Open-AudIT
http://www.open-audit.org/phpBB3/

Discovered Ports Script
http://www.open-audit.org/phpBB3/viewtopic.php?f=5&t=3831
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:
Code:
#!/bin/bash

NMAPDIR=.
OA=xxx.xxx.xxx.xxx

for nets in "$@"
do
  for a in {1..254}
  do
    echo "$nets.$a"
    nmap_file="nmap_file.txt"
    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"
  done
done


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

Code:
0       17      1       * *       /var/www/html/openaudit/scripts/nmap.sh 192.168.1 192.168.2


or call it from a shell:

Code:
/var/www/html/openaudit/scripts/nmap.sh 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!

Will

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

Attached is a new & improved nmap_linux.sh script. Used Wilnix and the enhanced nmap_linux.sh at http://www.open-audit.org/phpBB3/viewtopic.php?f=5&t=2520&start=0&hilit=portscan 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 :)

Attachment:
File comment: new & improved nmap_linux.sh
nmap-audit.txt [6.42 KiB]
Downloaded 193 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.

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

Page 1 of 1 All times are UTC + 10 hours
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/