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
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.
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,
--resumeonly 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:
In these situations, an interruption requires restarting the entire scan from the beginning, wasting considerable time.
Proposed Enhancement
Extend the option
--resumeso 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:
After an interruption,
nmap --resume <output file>could continue with only the remaining ports instead of restarting the entire scan.Benefits
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
-pparameter.Thank you for considering this enhancement.