Resuming Interrupted Scan Only With Remaining Ports
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- c
- Domain
- networking
Research direction
No source files, tests, or entry points are identified in the issue. Start by tracing Nmap's existing --resume implementation and its XML/GNMAP output handling; define how per-host port state would be persisted and restored. Done means an interrupted scan resumes only unscanned ports, including single-target and partial-port cases.
Written by the indexing model from the issue text.
Description
TL;DR
Please add support for continuing to scan the remaining ports of interrupted scans (e.g. of a single target host) after an unexpected interruption (e.g. network loss, system reboot, or manual interruption).
Problem
Currently, --resume only works when Nmap has completely finished scanning at least one target in a multi-host scan. This only continues to scan the other IP addresses, but not remaining ports, if, for example, a full port scan was launched, but only 80% of these ports were successfully scanned. If a scan is interrupted while scanning all ports, it cannot be resumed, even though a significant portion of the port scan may already have completed.
This is especially inconvenient for long-running scans, such as:
- Full TCP port scans (-p-)
- UDP scans
- Scans over slow or unreliable network connections
In these situations, an interruption requires restarting the entire scan from the beginning, wasting considerable time.
Proposed Enhancement
Extend the option --resume so it can continue an interrupted scan and scan only the remaining ports of an IP address.
For example, Nmap could periodically save its port scan progress to the XML or GNMAP files including:
Target host:
- List of ports already scanned
- Scan state for each port
After an interruption, nmap --resume <output file> could continue with only the remaining ports instead of restarting the entire scan.
Benefits
- Saves significant time for long-running scans.
- Makes Nmap more resilient to temporary network failures.
- Reduces unnecessary network traffic caused by repeating completed work.
- Improves usability for remote scans over unstable connections.
- Provides more consistent behavior between single-target and multi-target scans.
Thoughts
Since Nmap already supports resuming scans across multiple targets after a completed host, much of the underlying resume infrastructure already exists. Extending this capability to preserve per-host progress would make the feature more generally useful without changing existing workflows. This shouldn't be too difficult technically, as just adding each successfully scanned port along with the status to a list would do the job. When resuming, read the least and calculate the remaining ports specificed in the -p parameter.
Thank you for considering this enhancement.
- Dominant language
- C
- Stars
- 14k
- Forks
- 3k
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from nmap/nmap
-
Scan progress and ETC undercount retransmissions since 7.99x (stuck at 99.99% with --max-retries 0)Open
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 1 day
-
make check-zenmap reports success regardless of test resultsPossibly taken @gargamel778 claimed this 67 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
Maintainers usually reply within 1 day
-
BSD Nmap question
Difficulty 4/5 3-5 days Newbie friendliness 45/100
Maintainers usually reply within 1 day
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
area/build-framework kind/enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
yugabyte/yugabyte-db#39342 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Document the isv:HDFGroup Linux package repositories and signing keyPossibly taken @brtnfld claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
kind:silent-wrong needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
InauguralSystems/EigenScript#2567 · 1 comment ·
Maintainers usually reply within 1 day