Packet Timing Adjustments (`--scan-delay`) with Nmap

Learn how to use the --scan-delay option in Nmap to control the timing of packet transmission.

Introduction to Nmap and Packet Timing

Nmap (Network Mapper) is one of the most powerful and widely used network scanning tools. Security professionals, network administrators, and penetration testers use Nmap to discover hosts, identify open ports, detect services, and gather other valuable network information.

One of the critical aspects of network scanning is timing. The rate at which probes are sent to a target system affects the accuracy of results, the likelihood of detection, and the chances of triggering security mechanisms such as firewalls or intrusion detection systems (IDS). Packet timing adjustments, specifically using the --scan-delay option in Nmap, help control how fast Nmap sends probes, balancing efficiency with stealth.

Understanding --scan-delay

The --scan-delay option in Nmap allows users to introduce a fixed delay between probes sent to a target. This delay can be helpful in several situations, including avoiding rate limiting, reducing detection likelihood, and improving scan accuracy on unstable networks.

Syntax

The basic syntax for using --scan-delay in Nmap is:

nmap --scan-delay <time> <target>

Where <time> is the delay interval between probes (e.g., 500ms, 1s, 5s), and <target> is the IP address or hostname of the system being scanned.

Example Usage

To introduce a 1-second delay between probes while scanning a specific target:

nmap --scan-delay 1s 192.168.1.1

This forces Nmap to wait one second between sending packets, which can help avoid triggering IDS/IPS mechanisms or firewall rate limits.

Why Use --scan-delay?

1. Bypassing Intrusion Detection and Prevention Systems (IDS/IPS)

Many IDS/IPS solutions detect port scans based on the number of packets sent within a given time frame. If too many packets arrive too quickly, the scan may be blocked or flagged as an attack. Using --scan-delay can help avoid detection by slowing down the scan to mimic normal network traffic behavior.

2. Avoiding Firewall Rate Limiting

Some firewalls enforce rate limits that temporarily block IP addresses if they generate excessive requests within a short period. Adding a delay between packets ensures the scan does not exceed rate limits, preventing unnecessary blocks.

3. Improving Scan Accuracy on Unstable Networks

Networks with high latency or packet loss can result in inaccurate scan results if packets are sent too quickly. Delaying probes ensures each request has sufficient time to reach its destination and return a response.

4. Stealth Scanning for Evasion

Penetration testers and ethical hackers often use slow scans to evade detection. A slower scan with --scan-delay can blend in with legitimate traffic patterns, reducing the chances of being noticed by security teams.

Choosing the Right Delay Interval

The appropriate --scan-delay value depends on the network environment, security mechanisms, and desired scan speed. Here are some guidelines for choosing a suitable delay:

Use CaseRecommended --scan-delay
Fast scanning (low detection risk)100-500ms
Avoiding IDS/IPS detection1-5s
Unstable or high-latency networks500ms - 2s
Extremely stealthy scanning5-10s

Measuring Response Time with --max-rtt-timeout

To choose an optimal delay value, you can measure the network’s response time using:

nmap --max-rtt-timeout 1s 192.168.1.1

This adjusts the timeout based on the Round-Trip Time (RTT), helping determine an efficient scan delay.

Combining --scan-delay with Other Nmap Timing Options

1. Using -T Timing Templates

Nmap offers five built-in timing templates (-T0 to -T5), which can also affect scan delays. These templates adjust scanning speed automatically:

  • -T0 (Paranoid) – Maximum stealth, slowest speed
  • -T1 (Sneaky) – Slightly faster but still stealthy
  • -T2 (Polite) – Slows down scan to avoid detection
  • -T3 (Normal) – Default scanning speed
  • -T4 (Aggressive) – Fast scanning, risks detection
  • -T5 (Insane) – Very fast, likely to trigger security alerts

For example, combining a polite scan with a fixed delay:

nmap -T2 --scan-delay 500ms 192.168.1.1

2. Using --max-rate to Control Packet Rate

Instead of a fixed delay, --max-rate sets an upper limit on probe rate per second:

nmap --max-rate 10 192.168.1.1

This ensures no more than 10 packets per second are sent, useful for controlled scanning without a strict delay.

3. Combining with --host-timeout to Avoid Long Scans

When using long delays, scans can take a long time. To prevent Nmap from scanning a single host indefinitely, use:

nmap --scan-delay 2s --host-timeout 30m 192.168.1.1

This will stop scanning the host if it takes longer than 30 minutes.

Practical Scenarios for --scan-delay

Scenario 1: Stealthy Penetration Testing

A penetration tester wants to scan a network without triggering IDS alerts. They use:

nmap --scan-delay 5s -T1 192.168.1.1

This ensures slow, low-profile scanning.

Scenario 2: Scanning a Remote Host Behind a Firewall

A researcher wants to scan a remote host but notices packets are being blocked after rapid scans. To reduce detection, they use:

nmap --scan-delay 2s --max-retries 3 203.0.113.5

This sends packets slowly while limiting retries.

Scenario 3: Network Troubleshooting

An admin troubleshooting connectivity issues needs accurate results despite high packet loss. They use:

nmap --scan-delay 500ms --max-rtt-timeout 3s 192.168.1.1

This accounts for delays in packet transmission.

Conclusion

The --scan-delay option in Nmap is a powerful tool for controlling probe timing, balancing stealth, accuracy, and efficiency. Whether you’re a penetration tester evading IDS, a network administrator troubleshooting connectivity, or a security researcher avoiding firewall rate limits, fine-tuning packet timing is crucial.

By understanding how and when to use --scan-delay, along with other Nmap timing options, users can conduct more effective, reliable, and undetectable network scans.