Registrations to Open-AudIT forums are now closed. To ask any new questions please visit Opmantek Community Questions.

Open-AudIT

What's on your network?
It is currently Fri Mar 29, 2024 12:54 am

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
[/code]

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
[/code]

or call it from a shell:

[code]
/var/www/html/openaudit/scripts/nmap.sh 10.1.1 172.31.16 192.168.100
[/code]

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 [url]http://www.open-audit.org/phpBB3/viewtopic.php?f=5&t=2520&start=0&hilit=portscan[/url] 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=0] File comment: new & improved nmap_linux.sh
nmap-audit.txt [6.42 KiB]
Downloaded 476 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=0] File comment: script for running nmap from a *nix box
nmap-audit.txt [6.65 KiB]
Downloaded 531 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 2 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:  
cron
Powered by phpBB® Forum Software © phpBB Group