Open-AudIT

What's on your network?
It is currently Wed Jan 24, 2018 7:28 pm

All times are UTC + 10 hours




Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: Discovered Ports Script
PostPosted: Wed Oct 20, 2010 2:53 am 
Offline
Newbie

Joined: Wed Oct 20, 2010 1:55 am
Posts: 5
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

_________________
Open-AudIT Version 09.03.17
CentOS release 5.5 (Final)


Top
 Profile  
Reply with quote  
PostPosted: Wed Nov 10, 2010 4:11 am 
Offline
Newbie

Joined: Wed Nov 10, 2010 3:43 am
Posts: 2
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


Top
 Profile  
Reply with quote  
PostPosted: Thu Nov 11, 2010 4:41 am 
Offline
Newbie

Joined: Wed Nov 10, 2010 3:43 am
Posts: 2
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


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC + 10 hours


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group