PDA

View Full Version : Attempt to thread Nmap scans



Godwin Austin
12-05-2012, 12:29 PM
Hello Hackers;

How are you doing !
Well .. My office people were facing an issue with Nmap scans for a large number of hosts.
The issue was that, if an Nmap scan is ran for lets say a hundred hosts. Nmap will first linearly run all the scans and then will generate a single output file for it. In the process if one IP takes alot of time due to any reason, we are stuck with no actual output.

I was thinking about writing something which will thread Nmap and will give us better performance.
But then I thought, Why thread just Nmap ? There should be something to thread any linear bash process.
I got something named PPSS - [(Distributed) Parallel Processing Shell Script]. This script simply does what we want.

Here is a simple example.

Lets say there is a text file of all hundred IPs we wanna scan. Let the filename be IPs.txt
So simply we will just run following nmap command via PPSS script.

ppss -f IPs.txt -c 'nmap -n -P0 -A -oN "$ITEM" "$ITEM"' -p 10

The $ITEM will be the IP address from IPS.txt. The "-p" argument is the number of processes.
So the command will run 10 Nmap instances at a time and will save all results in separate files.

So it is recommended to install PPSS on your hacktop ! :)

Original source and coder of the project :

Scanning many hosts in parallel with Nmap using PPSS (http://louwrentius.com/blog/2010/02/scanning-many-hosts-in-parallel-with-nmap-using-ppss/)

Google code link for the Project: Downloads - ppss - (Distributed) Parallel Processing Shell Script - parallel processing made easy! - Google Project Hosting (http://code.google.com/p/ppss/downloads/list)

Ro(Ha)ck On !!


--

Godwin Austin

PS. Also check out the dnmap (Distributed Nmap Project)

41.w4r10r
12-05-2012, 01:37 PM
and welcome back Godwin_Austin...