If Nmap scan results are being written to file in either Normal or Grepable format (see Saving Nmap Output), the scan can be resumed after interruption by using the —resume
option. When resuming from a file, no command-line options are supported other than the file from which to resume (the original scan options are saved in the output file and are reused when the scan is resumed).
Only scans that span multiple hosts can be resumed, and the scan picks up after the last fully scanned host. Here's an example of a scan being interrupted after finishing one host and resuming to complete the scan on a second host:
bryan@firemaw:˜$sudo nmap -oG grepable_output -n 10.150.9.15,143
Interesting ports on 10.150.9.15: (The 1671 ports scanned but not shown below are in state: closed) PORT STATE SERVICE 22/tcp open ssh 111/tcp open rpcbind 955/tcp open unknown^C
caught SIGINT signal, cleaning up bryan@firemaw:˜$sudo nmap —resume grepable_output
Interesting ports on 10.150.9.143: (The 1672 ports scanned but not shown below are in state: filtered) PORT STATE SERVICE 139/tcp open netbios-ssn 445/tcp open microsoft-ds