DEV Community

Clive Da
Clive Da

Posted on

nmap - i never knew that

nmap - i never knew that for large port range scans it only list OPEN ports but for short range scans it lists EVERY port ! i must have used nmap for over 15 years without noticing this behaviour

LONG RANGE

$ nmap localhost -p10000-20000

Starting Nmap 6.40 ( http://nmap.org ) at 2020-02-18 23:32 GMT
Nmap scan report for localhost (127.0.0.1)
Host is up (0.00074s latency).
Other addresses for localhost (not scanned): 127.0.0.1
Not shown: 10000 closed ports
PORT      STATE SERVICE
19999/tcp open  unknown

Nmap done: 1 IP address (1 host up) scanned in 0.49 seconds

SHORT RANGE

$ nmap localhost -p19990-20000

Starting Nmap 6.40 ( http://nmap.org ) at 2020-02-18 23:32 GMT
Nmap scan report for localhost (127.0.0.1)
Host is up (0.0010s latency).
Other addresses for localhost (not scanned): 127.0.0.1
PORT      STATE  SERVICE
19990/tcp closed unknown
19991/tcp closed unknown
19992/tcp closed unknown
19993/tcp closed unknown
19994/tcp closed unknown
19995/tcp closed unknown
19996/tcp closed unknown
19997/tcp closed unknown
19998/tcp closed unknown
19999/tcp open   unknown
20000/tcp closed dnp

Nmap done: 1 IP address (1 host up) scanned in 0.04 seconds

Top comments (0)