221 words
1 minutes
Performance
2025-08-03

Introduction#

Scanning performance plays a significant role when scanning extensive networks or dealing with low bandwidth. Nmap provides various options to control scan speed and accuracy.

Timeout Optimization#

Default Scan Example#

sudo nmap 10.129.2.0/24 -F`

- **Results**: 256 IPs scanned, 10 hosts up in 39.44 seconds

### Optimized RTT Scan
sudo nmap 10.129.2.0/24 -F --initial-rtt-timeout 50ms --max-rtt-timeout 100ms
  • Results: 256 IPs scanned, 8 hosts up in 12.29 seconds
  • Tradeoff: Found 2 fewer hosts but 4x faster

Timeout Options#

OptionDescription
--initial-rtt-timeoutSets initial Round-Trip-Time timeout
--max-rtt-timeoutSets maximum RTT timeout

Retry Optimization#

Default Scan#

sudo nmap 10.129.2.0/24 -F | grep "/tcp" | wc -l
  • Results: 23 open ports found

Reduced Retries Scan#

sudo nmap 10.129.2.0/24 -F --max-retries 0 | grep "/tcp" | wc -l
  • Results: 21 open ports found
  • Tradeoff: Faster but may miss some ports

Packet Rate Control#

Default Scan#

sudo nmap 10.129.2.0/24 -F -oN tnet.default
  • Results: 29.83 seconds

Optimized Rate Scan#

sudo nmap 10.129.2.0/24 -F -oN tnet.minrate300 --min-rate 300
  • Results: 8.67 seconds (same host/port count)

Timing Templates#

Nmap provides six timing templates:

TemplateNameDescription
-T0ParanoidVery slow, stealthy
-T1SneakySlow, less conspicuous
-T2PoliteSlower than normal
-T3NormalDefault balanced speed
-T4AggressiveFaster, may trigger defenses
-T5InsaneVery fast, likely detected

Default Timing (-T3)#

sudo nmap 10.129.2.0/24 -F -oN tnet.default
  • Results: 32.44 seconds

Insane Timing (-T5)#

sudo nmap 10.129.2.0/24 -F -oN tnet.T5 -T5
  • Results: 18.07 seconds

Performance Comparison#

Optimization MethodDefault TimeOptimized TimeHosts FoundPorts Found
RTT Timeouts39.44s12.29s10 → 8N/A
Max RetriesN/AN/ASame23 → 21
Min Rate 30029.83s8.67sSameSame
-T5 Template32.44s18.07sSameSame

Best Practices#

  1. Test Environment: Always test settings in a controlled environment first
  2. Balance Speed/Accuracy: Faster scans may miss important information
  3. Whitebox Advantage: Use aggressive settings only when whitelisted
  4. Documentation: Refer to Nmap timing docs
Performance
https://fuwari.vercel.app/posts/performance/
Author
Ranjung Yeshi Norbu
Published at
2025-08-03