Zer0Byte

Geekiest Techno News

port scan the entire planet with masscan

Lee7s this is some epic piece of  port scanner I have seen in A while after Nmap. MASSCAN: Mass IP port scanner claims to be the fastest port scanner yet and is able to scan the enitre internet in under 6 minutes (0.0′). On top of that its a cross platform.

According the dev of this port scanner :

” It can scan the entire Internet in under 6 minutes, transmitting 10 million packets per second.

It produces results similar to nmap, the most famous port scanner. Internally, it operates more like scanrand,unicornscan, and ZMap, using asynchronous transmission. The major difference is that it’s faster than these other scanners. In addition, it’s more flexible, allowing arbitrary address ranges and port ranges.”

 How to Build on Debian / Ubuntu

On Debian/Ubuntu, it goes something like this:

$ git clone https://github.com/robertdavidgraham/masscan
$ cd masscan
$ sudo apt-get install libpcap-dev
$ make

This puts the program in the masscan/bin subdirectory. You’ll have to manually copy it to something like/usr/local/bin if you want to install it elsewhere on the system.

While Linux is the primary target platform, the code runs well on many other systems. Here’s some additional build info:

  • Windows w/ Visual Studio: use the VS10 project
  • Windows w/ MingGW: just type make
  • Windows w/ cygwin: won’t work
  • Mac OS X /w XCode: use the XCode4 project
  • Mac OS X /w cmdline: just type make
  • FreeBSD: type gmake
  • other: I don’t know, don’t care

How to scan the entire Internet

While useful for smaller, internal networks, the program is designed really with the entire Internet in mind. It might look something like this:

# masscan 0.0.0.0/0 -p0-65535

Scanning the entire Internet is bad. For one thing, parts of the Internet react badly to being scanned. For another thing, some sites track scans and add you to a ban list, which will get you firewalled from useful parts of the Internet. Therefore, you want to exlude a lot of ranges. To blacklist or exclude ranges, you want to use the following syntax:

# masscan 0.0.0.0/0 -p0-65535 --excludefile exclude.txt

This just prints the results to the command-line. You probably want them saved to a file instead. Therefore, you want something like:

# masscan 0.0.0.0/0 -p0-65535 -oX scan.xml

Download the Source Code

https://github.com/robertdavidgraham/masscan/releases

 

Useful links