I've noticed that nmap only scans a bunch of known ports, and the only way i've managed to check 'em all is to put a "-p 0-65535" in.
Why is that? am I wrong? is there a more popular way to scan all ports aside from what I've done?
Server Fault is a question and answer site for system and network administrators. It only takes a minute to sign up.Sign up to join this community
By default, Nmap scans the top 1000 most popular ports, according to the statistics generated from Internet-wide scans and large internal network scans from the summer of 2008. There are a few options that change this:
-F reduces the number to 100,
-p allows you to specify which ports to scan, and
--top-ports lets you specify how many of the most popular ports to scan. This means that the default scan is equivalent to
--top-ports 1000, and
-F is the same as
These numbers were set in version 4.75, and were a change from the roughly 1700 (TCP) ports that were the default in version 4.68. The purpose was to decrease scanning times while still giving reasonable results. The flexibility of Nmap's command-line options guarantees that you can still scan just about any combination of ports that you want, regardless of the defaults.
Scanning all 65536 TCP ports is still possible with
-p0-, but it will take a very long time. Scanning all UDP ports with
-sU -p0- will take even longer, because of the way that open ports are detected.
What you have noticed is the normal nmap behavior to scan top 1000 ports, if you don't specify anything.
If you want to scan all, TCP and UDP, ports you can do
to scan select TCP and UDP ports you can do
or you scan some TCP OR UDP by
-pT 21,22,23 -pU 53, 88, 119