Discovered Ports Script
Page 1 of 1

Author:  wilnix [ Wed Oct 20, 2010 2:53 am ]
Post subject:  Discovered Ports Script

After working on getting discovered ports working for me, I wanted to contribute what I did to schedule nmap to run. This may or may not help others. I rewrote the original script with this:


for nets in "$@"
  for a in {1..254}
    echo "$nets.$a"
    nmap_input=`nmap -v -O -oN $nmap_file $nets.$a`
    nmap_output=`cat $nmap_file`
    wget -q --post-data="submit=submit&add=$nmap_output" http://$OA/openaudit/admin_nmap_input.php
    rm "$nmap_file"

You can place this script within the scripts directory (or wherever you want) and call it through crontab with a line similar to this:

0       17      1       * *       /var/www/html/openaudit/scripts/ 192.168.1 192.168.2

or call it from a shell:

/var/www/html/openaudit/scripts/ 10.1.1 172.31.16 192.168.100

You just need to put in the OA server name or IP.

Hope it helps someone else!


Author:  gpanula [ Wed Nov 10, 2010 4:11 am ]
Post subject:  Re: Discovered Ports Script

Attached is a new & improved script. Used Wilnix and the enhanced at for inspiration.

Run it with the --debug switch to do a dry-run. Debug mode just does a ping scan and then dry-runs thru the rest of it.

--maxscanners controls how many concurrent nmap processes to run
--multiples allows one to run multiple instances of the script

It should be mostly bug-free.

enjoy :)

File comment: new & improved
nmap-audit.txt [6.42 KiB]
Downloaded 197 times

Author:  gpanula [ Thu Nov 11, 2010 4:41 am ]
Post subject:  Re: Discovered Ports Script

attached is bug-fixed script for running nmap on a *nix host and reporting results to the OAServer.

File comment: script for running nmap from a *nix box
nmap-audit.txt [6.65 KiB]
Downloaded 225 times

Page 1 of 1 All times are UTC + 10 hours
Powered by phpBB® Forum Software © phpBB Group