How To Scan All TCP and UDP Ports with Nmap? – POFTUT

How To Scan All TCP and UDP Ports with Nmap?

Nmap is very useful and popular tool used to scan ports. Nmap by default scans most popular 1000 ports. We may need to change the port range and protocol type to all while scanning with nmap.

Scan All TCP Ports with Range

We can specify the port range with the -p option. As we know TCP port numbers are between  and 65535  . We will use -p0-65535 as option in order to scan all TCP ports. We do not specify the TCP protocol because default protocol for nmap port scan is TCP.

Faster Scan For All Ports

If we are scanning all ports this will take a lot of time. If the situation is not critical we can use faster scan with -T5 parameter. This is the fastest  scan level for nmap. This option can be used for UDP scans too.

Faster Scan For All Ports

Faster Scan For All Ports

Scan All TCP Ports

Another way to specify all TCP ports is dash. We can use -p- which is more practical then port range specification.

Scan All UDP Ports with Range

Nmap uses TCP as default protocol for port scan. We should explicitly specify the UDP protocol for UDP port scan. We will use same port range specification used in TCP. We will use -sU for UDP protocol specification.

Scan All UDP Ports

We will use -p- to specify all ports easily.

LEARN MORE  Arping Command Tutorial With Examples For Linux

Scan All TCP UDP Ports

We can scan all UDP and TCP ports in a single command. We will use -sU for UDP and sT for TCP protocol.

echo '

7 Responses

  1. rodrigo says:


  2. John Doe says:

    Could you possibly add more AD’s to the page ?
    It’s barely loading….

  3. Daniel Pérez says:

    Thanks for the info, very useful


    How do we scan all ports which includes showing the un-popular ports aswell?

  5. John Doe's brother says:

    It definitely needs more ads

  1. 25/10/2019

    […] The protocol is the transport layer protocol like TCP or UDP […]

Leave a Reply

Your email address will not be published. Required fields are marked *