Advertisement
Guest User

Untitled

a guest
Jun 24th, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 3.08 KB | None | 0 0
  1. #!/bin/sh
  2.  
  3. DATE=`/bin/date +%Y%m%d`
  4. NCMD=/opt/nessus/bin/nessus
  5. NHOST=localhost
  6. NPORT=1241
  7. NUSER=nessus
  8. NPASS=xxxxxxxxxxx
  9. NCONFIG1=/opt/autoscan/configs/admin_vlans.cfg
  10. NCONFIG2=/opt/autoscan/configs/other_vlans.cfg
  11. NCONFIG3=/opt/autoscan/configs/resnet_vlans.cfg
  12. NCONFIG4=/opt/autoscan/configs/student_vlans.cfg
  13. NCONFIG5=/opt/autoscan/configs/test_vlans.cfg
  14. NTARGET1=/opt/autoscan/targets/targets_admin.txt
  15. NTARGET2=/opt/autoscan/targets/targets_other.txt
  16. NTARGET3=/opt/autoscan/targets/targets_resnet.txt
  17. NTARGET4=/opt/autoscan/targets/targets_student.txt
  18. NTARGET5=/opt/autoscan/targets/targets_test.txt
  19. NRESULT1=/opt/autoscan/results/$DATE-admin_vlans.nbe
  20. NRESULT2=/opt/autoscan/results/$DATE-other_vlans.nbe
  21. NRESULT3=/opt/autoscan/results/$DATE-resnet_vlans.nbe
  22. NRESULT4=/opt/autoscan/results/$DATE-student_vlans.nbe
  23. NRESULT5=/opt/autoscan/results/$DATE-test_vlans.nbe
  24. NREPORT1=/opt/autoscan/reports/$DATE-admin_vlans.html
  25. NREPORT2=/opt/autoscan/reports/$DATE-other_vlans.html
  26. NREPORT3=/opt/autoscan/reports/$DATE-resnet_vlans.html
  27. NREPORT4=/opt/autoscan/reports/$DATE-student_vlans.html
  28. NREPORT5=/opt/autoscan/resports/$DATE-test_vlans.html
  29. VLANINPUT=$1
  30. RCTOOL=/opt/autoscan/script/update-nessusrc
  31. RCINPUT=$2
  32. HTMLOUT=/opt/autoscan/results/
  33.  
  34. echo "\n\nNessus AutoScan script v0.1 - (c) Adam Obringer, Robert Morris University\n"
  35.  
  36. if [ $VLANINPUT = admin ] ; then
  37.   echo "\n\n x Configuring for admin VLAN scan.\n"
  38.   NCONFIG=$NCONFIG1
  39.   NTARGET=$NTARGET1
  40.   NRESULT=$NRESULT1
  41.   NREPORT=$NREPORT1
  42. elif [ $VLANINPUT = other ] ; then
  43.   echo "\n\n x Configuring for other VLAN scan.\n"
  44.   NCONFIG=$NCONFIG2
  45.   NTARGET=$NTARGET2
  46.   NRESULT=$NRESULT2
  47.   NREPORT=$NREPORT2
  48. elif [ $VLANINPUT = resnet ] ; then
  49.   echo "\n\n x Configuring for resnet VLAN scan.\n"
  50.   NCONFIG=$NCONFIG3
  51.   NTARGET=$NTARGET3
  52.   NRESULT=$NRESULT3
  53.   NREPORT=$NREPORT3
  54. elif [ $VLANINPUT = student ] ; then
  55.   echo "\n\n x Configuring for student VLAN scan.\n"
  56.   NCONFIG=$NCONFIG4
  57.   NTARGET=$NTARGET4
  58.   NRESULT=$NRESULT4
  59.   NREPORT=$NREPORT4
  60. elif [ $VLANINPUT = test ] ; then
  61.   echo "\n\n x Configuring for test VLAN scan.\n"
  62.   NCONFIG=$NCONFIG5
  63.   NTARGET=$NTARGET5
  64.   NRESULT=$NRESULT5
  65.   NREPORT=$NREPORT5
  66. else
  67.  echo "\n*** Syntax error: Please properly specify zone to scan!\n $0 admin|other|student|test default|debug"
  68. fi
  69.  
  70. if [ $RCINPUT = default ] ; then
  71.   echo "\n x Configuring for default Nessus plugins via nessusrc.\n"
  72. #  $RCTOOL -s $NCONFIG
  73. elif [ $RCINPUT = debug ] ; then
  74.   echo "\n x Configuring for default Nessus plugins with debugging via nessusrc.\n"
  75. #  $RCTOOL -d $NCONFIG
  76. else
  77.   echo "\n*** Syntax error: Please specify plugin type(s).\n $0 admin|other|student|test default|debug\n"
  78. fi
  79.  
  80. echo $NCONFIG
  81. echo $NTARGET
  82. echo $NRESULT
  83. echo $NREPORT
  84. echo $RCINPUT
  85.  
  86. echo "\n x Scanning hosts within $VLANINPUT via Nessus commandline...\n"
  87. #$NCMD -c $NCONFIG -T nbe -xq $NHOST $NPORT $NUSER $NPASS $NTARGET $NRESULT
  88. echo "\n x Scan completed.\n"
  89. echo "\n x Generating reporting html...\n"
  90. #$NCMD -i $NRESULT -o $NREPORT
  91. echo "\n x Report generation completed. File(s) output to $HTMLOUT \n"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement