Skip to main content
XsiSec.com
HomeReposBlogProjectsPortfolio
© 2026 XsiSec.com
Security rules |security.txt
Updated 2026-08-15 · v1.0.0+2026-08-14.82f92cb · 82f92cb
← Back to overview
Security article

HTB Academy nmap network performance

HTB Academy nmap network performance: Nmap Scanning Performance Optimization • HTB Academy • nmap

2022-10-261 tag
Tags

Nmap Scanning Performance Optimization

Scanning performance plays a critical role when scanning large networks or working with low bandwidth. Nmap provides various options to tune scanning behavior:

  • Timing template: -T <0-5>
  • Parallelism: --min-parallelism <number>
  • Timeouts: --initial-rtt-timeout <time>, --max-rtt-timeout <time>
  • Rate control: --min-rate <number>
  • Retries: --max-retries <number>

🧭 Quick Reference (What each knob does)

KnobWhat it controlsTypical effectTradeoff
-T0..5Global timing templateBig swing in speedHigher templates risk misses / detection
--min-parallelism NConcurrent probesFaster on healthy linksCan overwhelm fragile links/hosts
--initial-rtt-timeout, --max-rtt-timeoutWait time for repliesLower = fasterToo low drops slow hosts
--min-rate NPackets/sec floorMuch fasterTrigger IPS / packet loss
--max-retries NRetransmits on silenceLower = fasterMiss slow/filtered ports

⏱️ Timeouts

When Nmap sends a packet, it waits for a Round-Trip-Time (RTT) response. By default, it starts with --min-rtt-timeout 100ms and adapts.

Default Scan

bash
sudo nmap 10.129.2.0/24 -F
# Nmap done: 256 IP addresses (10 hosts up) scanned in 39.44 seconds

Optimized RTT

bash
sudo nmap 10.129.2.0/24 -F   --initial-rtt-timeout 50ms --max-rtt-timeout 100ms
# Nmap done: 256 IP addresses (8 hosts up) scanned in 12.29 seconds

Tradeoff: Faster, but fewer hosts detected due to shorter timeout.

Tip: On lossy/WAN links, raise --max-rtt-timeout instead; on LANs, you can lower it more aggressively.


🔄 Max Retries

By default, Nmap retries up to 10 times if a port doesn’t respond. We can reduce this with --max-retries.

Default Scan

bash
sudo nmap 10.129.2.0/24 -F | grep "/tcp" | wc -l
# 23

Reduced Retries

bash
sudo nmap 10.129.2.0/24 -F --max-retries 0 | grep "/tcp" | wc -l
# 21

Tradeoff: Faster, but may miss open ports.

Hint: Try small values like --max-retries 2 before going to 0 to keep some resiliency.


🚀 Rates

If whitelisted in a penetration test, we can speed up scans using packet rates.

Default Scan

bash
sudo nmap 10.129.2.0/24 -F -oN tnet.default
# Nmap done: 256 IP addresses (10 hosts up) scanned in 29.83 seconds

Optimized Scan

bash
sudo nmap 10.129.2.0/24 -F --min-rate 300 -oN tnet.minrate300
# Nmap done: 256 IP addresses (10 hosts up) scanned in 8.67 seconds

Comparison – Open Ports Found

bash
cat tnet.default     | grep "/tcp" | wc -l   # 23
cat tnet.minrate300  | grep "/tcp" | wc -l   # 23

✅ Faster, same results.

Add --min-parallelism 50 on clean networks; reduce if you see packet loss.


⏳ Timing Templates

Nmap provides predefined timing templates:

  • -T0 → paranoid
  • -T1 → sneaky
  • -T2 → polite
  • -T3 → normal (default)
  • -T4 → aggressive
  • -T5 → insane

Too aggressive scans can trigger security systems.

Example – Insane Scan

bash
sudo nmap 10.129.2.0/24 -F -T5 -oN tnet.T5
# Nmap done: 256 IP addresses (10 hosts up) scanned in 18.07 seconds

Comparison – Open Ports Found

bash
cat tnet.default | grep "/tcp" | wc -l  # 23
cat tnet.T5      | grep "/tcp" | wc -l  # 23

✅ Same results, faster execution.


🧪 Suggested Profiles (copy/paste)

Conservative WAN

bash
sudo nmap -Pn -F   --max-retries 2   --initial-rtt-timeout 150ms --max-rtt-timeout 800ms   --min-parallelism 5   10.129.2.0/24

Balanced LAN

bash
sudo nmap -F -T4   --max-retries 2   --initial-rtt-timeout 50ms --max-rtt-timeout 200ms   --min-rate 200 --min-parallelism 25   10.129.2.0/24

Speed run (whitelisted)

bash
sudo nmap -F -T5   --max-retries 0   --initial-rtt-timeout 25ms --max-rtt-timeout 100ms   --min-rate 500 --min-parallelism 50   10.129.2.0/24

📌 Key Takeaways

  • Lower RTT timeouts speed up scans but risk missing hosts.
  • Fewer retries increase speed but may miss ports.
  • Higher packet rate (--min-rate) accelerates scans if bandwidth allows.
  • Timing templates (-T0 to -T5) provide easy tuning.
  • Tune parallelism to the stability of the network; watch for packet loss and retransmits.

Ethics & safety: coordinate rates/templates with your client’s SOC; aggressive settings can flood links or trip IDS/IPS.

Navigate

In this post

  1. 01Nmap Scanning Performance Optimization
  2. 02🧭 Quick Reference (What each knob does)
  3. 03⏱️ Timeouts
  4. 04Default Scan
  5. 05Optimized RTT
  6. 06🔄 Max Retries
  7. 07Default Scan
  8. 08Reduced Retries
  9. 09🚀 Rates
  10. 10Default Scan
  11. 11Optimized Scan
  12. 12Comparison – Open Ports Found
  13. 13⏳ Timing Templates
  14. 14Example – Insane Scan
  15. 15Comparison – Open Ports Found
  16. 16🧪 Suggested Profiles (copy/paste)
  17. 17📌 Key Takeaways
Search
Explore

Popular tags

Browse all 30 tags

Comments

0 comments

No comments yet — be the first to comment.