How To Scan Top Ports with Masscan?


masscan is an alternative tool to the popular nmap . Actually masscan provides very less of the nmap but provides some huge adventages. masscan is designed to be fast and performative. nmap have popular feautre named top ports which option is --top-ports to scan specified number of most popular ports. masscan also provides this options too.

Nmap Top Ports

We will start with scanning top ports in nmap . As stated previously we will use ---top-ports option the count of most popular ports. In this example we will scan most popular 10 ports.

$ nmap --top-ports 10 scanme.nmap.org
Nmap Top Ports
Nmap Top Ports

Masscan Top Ports

Now we will do same thing with masscan. masscan actually uses the nmap top port list which we will learn in the next step. For masscan we will use same option --top-ports in order to specify the top ports. In this example we will scan top 5 ports of the scanme.nmap.org  which is a open, free test target provided by nmap.

$ masscan  --top-ports 5 45.33.32.156

But keep in mind that the masscan version 1.0.5 and newer supports --top-ports option.

Check Masscan Version

So in order to check wether our masscan version supports the --top-ports we will use -V option.

$ masscan -V
Check Masscan Version
Check Masscan Version

List Top Port List

Top port list of nmap is stored in  /usr/share/nmap/nmap-services file. We can view and investigate it with less command like below.

$ less /usr/share/nmap/nmap-services
List Top Port List
List Top Port List

LEARN MORE  SNMP Port Number Tutorial with Examples

Leave a Comment