Nmap Scan from FreeBSD OS - Coding Question
jhary at unsane.co.uk
Tue Jan 9 12:59:56 UTC 2007
linux quest wrote:
> I am currently doing a simple penetration testing for my company in a LAN environment. Yes, I have already downloaded NMap by using the 'make install' command... and it did fetched the required files from insecure.org successfully.
> My question will be, how can I create a Network Program in .c that will invoke the
nmap capabilities to scan the network or computers? Example, lets say, I
want an automated nmap scan to run on FreeBSD to scan 192.168.1.10 and
192.168.1.11 , every morning at 10am - may I know how do I achieve that?
I hope someone can show me a simple coding to invoke nmap scan, thanks :)
you dont really need c for this, a simple shell script run from cron
would do fine.
RECEPIENTS="someone at somewhere.com"
SUBJECT="namp scan results"
$NMAP $NMAPOPTIONS $TARGETS | /usr/bin/mail -s "$SUBJECT" $RECEPIENTS
save that somewhere and remember to chmod it to be executable
add a line like
1 10 * * * /path/to/script
to the appropriate users crontab
(change /path/to/script to the location of the script)
and you should get the output emailed to you every morning.
> Thanks :)
> Linux Quest
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam protection around
> freebsd-questions at freebsd.org mailing list
> To unsubscribe, send any mail to "freebsd-questions-unsubscribe at freebsd.org"
More information about the freebsd-questions