Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- DATE=`/bin/date +%Y%m%d`
- NCMD=/opt/nessus/bin/nessus
- NHOST=localhost
- NPORT=1241
- NUSER=nessus
- NPASS=xxxxxxxxxxx
- NCONFIG1=/opt/autoscan/configs/admin_vlans.cfg
- NCONFIG2=/opt/autoscan/configs/other_vlans.cfg
- NCONFIG3=/opt/autoscan/configs/resnet_vlans.cfg
- NCONFIG4=/opt/autoscan/configs/student_vlans.cfg
- NCONFIG5=/opt/autoscan/configs/test_vlans.cfg
- NTARGET1=/opt/autoscan/targets/targets_admin.txt
- NTARGET2=/opt/autoscan/targets/targets_other.txt
- NTARGET3=/opt/autoscan/targets/targets_resnet.txt
- NTARGET4=/opt/autoscan/targets/targets_student.txt
- NTARGET5=/opt/autoscan/targets/targets_test.txt
- NRESULT1=/opt/autoscan/results/$DATE-admin_vlans.nbe
- NRESULT2=/opt/autoscan/results/$DATE-other_vlans.nbe
- NRESULT3=/opt/autoscan/results/$DATE-resnet_vlans.nbe
- NRESULT4=/opt/autoscan/results/$DATE-student_vlans.nbe
- NRESULT5=/opt/autoscan/results/$DATE-test_vlans.nbe
- NREPORT1=/opt/autoscan/reports/$DATE-admin_vlans.html
- NREPORT2=/opt/autoscan/reports/$DATE-other_vlans.html
- NREPORT3=/opt/autoscan/reports/$DATE-resnet_vlans.html
- NREPORT4=/opt/autoscan/reports/$DATE-student_vlans.html
- NREPORT5=/opt/autoscan/resports/$DATE-test_vlans.html
- VLANINPUT=$1
- RCTOOL=/opt/autoscan/script/update-nessusrc
- RCINPUT=$2
- HTMLOUT=/opt/autoscan/results/
- echo "\n\nNessus AutoScan script v0.1 - (c) Adam Obringer, Robert Morris University\n"
- if [ $VLANINPUT = admin ] ; then
- echo "\n\n x Configuring for admin VLAN scan.\n"
- NCONFIG=$NCONFIG1
- NTARGET=$NTARGET1
- NRESULT=$NRESULT1
- NREPORT=$NREPORT1
- elif [ $VLANINPUT = other ] ; then
- echo "\n\n x Configuring for other VLAN scan.\n"
- NCONFIG=$NCONFIG2
- NTARGET=$NTARGET2
- NRESULT=$NRESULT2
- NREPORT=$NREPORT2
- elif [ $VLANINPUT = resnet ] ; then
- echo "\n\n x Configuring for resnet VLAN scan.\n"
- NCONFIG=$NCONFIG3
- NTARGET=$NTARGET3
- NRESULT=$NRESULT3
- NREPORT=$NREPORT3
- elif [ $VLANINPUT = student ] ; then
- echo "\n\n x Configuring for student VLAN scan.\n"
- NCONFIG=$NCONFIG4
- NTARGET=$NTARGET4
- NRESULT=$NRESULT4
- NREPORT=$NREPORT4
- elif [ $VLANINPUT = test ] ; then
- echo "\n\n x Configuring for test VLAN scan.\n"
- NCONFIG=$NCONFIG5
- NTARGET=$NTARGET5
- NRESULT=$NRESULT5
- NREPORT=$NREPORT5
- else
- echo "\n*** Syntax error: Please properly specify zone to scan!\n $0 admin|other|student|test default|debug"
- fi
- if [ $RCINPUT = default ] ; then
- echo "\n x Configuring for default Nessus plugins via nessusrc.\n"
- # $RCTOOL -s $NCONFIG
- elif [ $RCINPUT = debug ] ; then
- echo "\n x Configuring for default Nessus plugins with debugging via nessusrc.\n"
- # $RCTOOL -d $NCONFIG
- else
- echo "\n*** Syntax error: Please specify plugin type(s).\n $0 admin|other|student|test default|debug\n"
- fi
- echo $NCONFIG
- echo $NTARGET
- echo $NRESULT
- echo $NREPORT
- echo $RCINPUT
- echo "\n x Scanning hosts within $VLANINPUT via Nessus commandline...\n"
- #$NCMD -c $NCONFIG -T nbe -xq $NHOST $NPORT $NUSER $NPASS $NTARGET $NRESULT
- echo "\n x Scan completed.\n"
- echo "\n x Generating reporting html...\n"
- #$NCMD -i $NRESULT -o $NREPORT
- echo "\n x Report generation completed. File(s) output to $HTMLOUT \n"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement