Ethical Hacking

Learn to find vulnerabilities before the bad guys do! Gain real world hands on hacking experience in our state of the art hacking lab. Course designed and taught by expert instructors with years of penetration testing experience. 12 student maximum in every class. Certification attempt included in every package.
Computer Forensics Training at InfoSec Institute

Gain the in-demand skills of a certified computer examiner, learn to recover trace data left behind by fraud, theft, and cybercrime perpetrators. Discover the source of computer crime and abuse at your organization so that it never happens again. All of our class sizes are guaranteed to be 12 students or less to facilitate one-on-one interaction with one of our expert instructors.




Network Security Nessus-Users
[Top] [All Lists]

Re: Scripting Nessus Scan and emailing of output

Subject: Re: Scripting Nessus Scan and emailing of output
Date: Thu, 28 Jun 2007 13:50:50 -0400
I'll bite.

Your requirements were a little vague, but this should work fine. Note that the target IPs you want to scan should go in /tmp/targets (assuming you aren't purging stale /tmp files regularly -- in that case, put it somewhere else and fix the TARGETS variable). Obviously you'll also need to set all these variables accordingly.

All - if I'm doing something incorrectly please don't hesitate to point it out.
-rw


--snip--

#!/bin/bash

PATH=/bin:/usr/bin:/opt/nessus/bin/nessus
LD_LIBRARY_PATH=/opt/nessus/lib:${LD_LIBRARY_PATH}

# configure as needed
RECIPIENTS="admin@domain.com,dave@blah.com"
SERVER=localhost
PORT=1241
USERNAME=nessus
PASSWORD=nessus
TARGETS=/tmp/targets
REPORT=/tmp/nessus.html.$$

# run the scan - reading targets from $TARGETS and outputting to $REPORT
nessus -q $SERVER $PORT $USERNAME $PASSWORD $TARGETS $REPORT -T html

# punt off the report to recipients
mail -s 'Nessus scan results' $RECIPIENTS < $REPORT

# clean up
rm -f $REPORT




John J. Culkin wrote:
Hello

Can anyone help me create a script which does a Nessus Scan and then emails the results.

I am hoping to run this script via cron on RHEL 4 and/or RHEL 5

-- John C.


_______________________________________________ Nessus mailing list Nessus@list.nessus.org http://mail.nessus.org/mailman/listinfo/nessus

<Prev in Thread] Current Thread [Next in Thread>