Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Oct 26th, 2010  |  syntax: Bash  |  size: 22.94 KB  |  views: 242  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. #!/bin/bash
  2.  
  3. #  Back|Track 4 Update Utility
  4.  
  5. #  (C)opyright 2010 Scamentology
  6. vs="1.82"
  7. clear
  8. #---License------------------------------------------------------------------------------------#
  9. #  This program is free software: you can redistribute it and/or modify it under the terms     #
  10. #  of the GNU General Public License as published by the Free Software Foundation, either      #
  11. #  version 3 of the License, or (at your option) any later version.                            #
  12. #                                                                                              #
  13. #  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;   #
  14. #  without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.   #
  15. #  See the GNU General Public License for more details.                                        #
  16. #                                                                                              #
  17. #  You should have received a copy of the GNU General Public License along with this program.  #
  18. #  If not, see <http://www.gnu.org/licenses/>.                                                 #
  19. #----------------------------------------------------------------------------------------------#
  20. ################################################################################################
  21. #                                                                                              #
  22. #    ~ btupdate.sh ( options ) ~                                                               #
  23. #    Updates the following...                                                                  #
  24. #    ( -d ) Run apt-get (Change variable under OS update below to disable any features)        #
  25. #    ( -m ) Metasploit                                                                         #
  26. #    ( -a ) aircrack-ng and airgraph-ng                                                        #
  27. #    ( -e ) exploitdb                                                                          #
  28. #    ( -s ) Social Engineering Toolkit                                                         #
  29. #    ( -f ) Fasttrack                                                                          #
  30. #    ( -S ) SQLMap                                                                             #
  31. #    ( -n ) Nikto                                                                              #
  32. #    ( -N ) Nessus                                                                             #
  33. #    ( -w ) w3af                                                                               #
  34. #    ( -z ) Update everything except apt-get                                                   #
  35. #                                                                                              #
  36. #    ~Known Issues~                                                                            #
  37. #    Let me know                                                                               #
  38. #                                                                                              #
  39. #    SQLMaps SVN asks for passwords - Just keep hitting enter if you did this update           #
  40. #    !!!This program runs apt-get clean - so if you want to keep downloaded updates then       #
  41. #    change -clean="yes"- to -clean="no"-                                                      #
  42. #                                                                                              #
  43. ################################################################################################
  44.  
  45. #                 Variables
  46.  
  47. # Check for Internet Access
  48.             netcheck="yes"        # (yes/no) no = don't check for internet access
  49.  
  50. # OS Update and Upgrade Variables
  51.               update="yes"        # (yes/no) yes for Update
  52.              upgrade="yes"        # (yes/no) yes for Upgrade
  53.                  dup="yes"        # (yes/no) yes for Distribution Update
  54.              cleanup="yes"        # (yes/no) Cleanup Downloaded Packages
  55.  
  56. # Default Install Paths (Change these if your install path is different)
  57.      framework3_path="/pentest/exploits/framework3"         # Metasploit framework 3
  58.      framework2_path="/pentest/exploits/framework2"         # Metasploit framework 2
  59.        aircrack_path="/pentest/wireless/aircrack-ng"        # Aircrack-ng
  60.        airgraph_path="/pentest/wireless/airgraph-ng"        # Airgraph-ng
  61.       exploitdb_path="/pentest/exploits/exploitdb"          # Exploitdb
  62.             set_path="/pentest/exploits/SET"                # Social Engineering Toolkit
  63.       fasttrack_path="/pentest/exploits/fasttrack"          # Fasttrack
  64.          sqlmap_path="/pentest/database/sqlmap"             # SQLMap
  65.           nikto_path="/pentest/scanners/nikto"              # Nikto
  66.          nessus_path="/opt/nessus/sbin"                     # Nessus
  67.            w3af_path="/pentest/web/w3af"                    # w3af
  68.  
  69. # Online SVN Checks (Change these if the SVN link changes)
  70.       framework3_svn="https://www.metasploit.com/svn/framework3/trunk"
  71.       framework2_svn="https://www.metasploit.com/svn/framework2/trunk"
  72.         aircrack_svn="http://trac.aircrack-ng.org/svn/trunk"
  73.         airgraph_svn="http://trac.aircrack-ng.org/svn/trunk/scripts/airgraph-ng"
  74.        exploitdb_svn="svn://devel.offensive-security.com/exploitdb"
  75.              set_svn="http://svn.thepentest.com/social_engineering_toolkit"
  76.        fasttrack_svn="http://svn.secmaniac.com/fasttrack"
  77.           sqlmap_svn="http://svn.sqlmap.org/sqlmap/trunk/sqlmap"
  78.             w3af_svn="https://w3af.svn.sourceforge.net/svnroot/w3af/trunk"
  79.  
  80. # Update Commands (Change these if the build design changes - or they are wrong)
  81.   framework3_command="svn update"
  82.   framework2_command="svn update"
  83.     aircrack_command="svn update"
  84.     airgraph_command="svn update"
  85.    exploitdb_command="svn co svn://devel.offensive-security.com/exploitdb"
  86.          set_command="./set-update"
  87.    fasttrack_command="svn update"
  88.       sqlmap_command="svn update"
  89.        nikto_command="perl nikto.pl -update"
  90.       nessus_command="./nessus-update-plugins"
  91.         w3af_command="svn update"
  92.  
  93. #-- Nothing to change below this line --------------------------------------------------
  94.  
  95. # Temporary log location
  96.                  log="/tmp/btupdate.log"
  97. # Borders
  98.              border1="echo "############################""
  99.              border2="echo "################################################################""
  100.  
  101. # Help Section
  102. function help() {
  103.    echo "(C)opyright 2010 Scamentology ~
  104. ######################################
  105. #           btupdate $vs             #
  106. # A script for updating Back|Track 4 #
  107. ######################################
  108.  
  109. Usage: update.sh [options]
  110.  
  111. Options:
  112.   -d [Dist-up]            ---  apt-get everything
  113.   -m [Metasploit]         ---  Update Metasploit 2 and 3 (svn update)
  114.   -a [aircrack-ng]        ---  Update aircrack-ng, airdrop-ng and airgraph-ng
  115.   -e [exploitdb]          ---  Update exploitdb
  116.   -s [SET]                ---  Update Social Engineering Toolkit
  117.   -S [SQLMap]             ---  Update SQLMap
  118.   -f [Fasttrack]          ---  Update Fasttrack
  119.   -n [Nikto]              ---  Update Nikto
  120.   -N [Nessus]             ---  Update Nessus Plugins
  121.   -w [w3af]               ---  Update w3af
  122.   -x [Everything]         ---  Do all actions in script
  123.   -z [Everything Except]  ---  Do all actions in script except apt-get
  124.   -h [Help]               ---  Help menu
  125.  
  126. Example:
  127.   ./btupdate.sh -x              (updates everything including apt-get
  128.   ./btupdate.sh -d              (apt-get update, upgrade and dist-upgrade)
  129.   ./btupdate.sh -m -a -s -f     (updates Metasploit Aircrack-ng SET and Fasttrack)
  130.  
  131. "
  132.    exit 1
  133. }
  134. while getopts "dmaesSfnNwxzh" OPTIONS; do
  135.    case ${OPTIONS} in
  136.       d ) distup="true" ;;                      # apt-get everything
  137.       m ) metasploit="true" ;;                  # Update Metasploit 2 and 3 (svn co)
  138.       a ) aircrack="true" ;;                    # Update aircrack-ng and airgraph-ng
  139.       e ) exploitdb="true" ;;                   # Update exploitdb
  140.       s ) SET="true" ;;                         # Update Social Engineering Toolkit
  141.       S ) SQLMap="true" ;;                      # Update SQLMap
  142.       n ) nikto="true" ;;                       # Update Nikto plugins
  143.       N ) nessus="true" ;;                      # Update Nessus plugins
  144.       f ) fasttrack="true" ;;                   # Update Fasttrack
  145.       w ) w3af="true" ;;                        # Update w3af
  146.       x ) all="true" ;;                         # Do all actions in script
  147.       z ) allbut="true" ;;                      # Do all actions in script except apt-get
  148.       h ) help ;;                               # Help menu
  149.       * ) help ;;                               # Default
  150.    esac
  151. done
  152.  
  153. #__ If the -x switch is chosen______________________________________________
  154. if [ "$all" == "true" ] ; then
  155.    metasploit="true"
  156.      aircrack="true"
  157.        distup="true"
  158.           SET="true"
  159.     exploitdb="true"
  160.     fasttrack="true"
  161.        SQLMap="true"
  162.         nikto="true"
  163.        nessus="true"
  164.          w3af="true"
  165. fi
  166. #__ If the -z switch is chosen______________________________________________
  167. if [ "$allbut" == "true" ] ; then
  168.    metasploit="true"
  169.      aircrack="true"
  170.        distup="false"
  171.           SET="true"
  172.     exploitdb="true"
  173.     fasttrack="true"
  174.        SQLMap="true"
  175.         nikto="true"
  176.        nessus="true"
  177.          w3af="true"
  178. fi
  179.  
  180. echo "   (C)opyright 2010 Scamentology ~"
  181. echo "######################################"
  182. echo "#           btupdate $vs             #"
  183. echo "# A script for updating Back|Track 4 #"
  184. echo "######################################"
  185.  
  186. #__ Check if Root __________________________________________________________
  187. if [ "$(id -u)" != "0" ] ; then echo "You must be root to use Back|Track Update Utility" ; exit 1 ; fi
  188.  
  189. #__ If no choices are made _________________________________________________
  190. if [ "$all" == "" ] && [ "$metasploit" == "" ] && [ "$aircrack" == "" ] && [ "$distup" == "" ] && [ "$SET" == "" ] && [ "$SQLMap" == "" ] && [ "$exploitdb" == "" ] && [ "$fasttrack" == "" ] && [ "$nikto" == "" ] && [ "$nessus" == "" ] && [ "$w3af" == "" ] ; then echo "Please choose an option" ; exit 1 ; fi
  191.  
  192. #__ OS Update and Upgrade Variables ________________________________________
  193. if [ "$update" == "yes" ] ; then updatea="apt-get -y update" ; fi
  194. if [ "$upgrade" == "yes" ] ; then upgradea="apt-get -y upgrade" ; fi
  195. if [ "$dup" == "yes" ] ; then distupa="apt-get -y dist-upgrade" ; fi
  196. if [ "$cleanup" == "true" ] ; then cleana="apt-get clean" ; fi
  197.  
  198. #__  Check if Programs are Installed _______________________________________
  199. if [ -e "$framework3_path/msfconsole" ] ; then framework3_install="true" ; fi
  200. if [ -e "$framework2_path/msfconsole" ] ; then framework2_install="true" ; fi
  201. if [ -d "$aircrack_path" ] ; then aircrack_install="true" ; fi
  202. if [ -e "$airgraph_path/airgraph-ng" ] ; then airgraph_install="true" ; fi
  203. if [ -d "$exploitdb_path" ] ; then exploitdb_install="true" ; fi
  204. if [ -e "$set_path/set" ] ; then set_install="true" ; fi
  205. if [ -e "$fasttrack_path/fast-track.py" ] ; then fasttrack_install="true" ; fi
  206. if [ -e "$sqlmap_path/sqlmap.py" ] ; then sqlmap_install="true" ; fi
  207. if [ -e "$nikto_path/nikto.pl" ] ; then nikto_install="true" ; fi
  208. if [ -e "$nessus_path/nessusd" ] ; then nessus_install="true" ; fi
  209.  
  210. #__ Checking for Internet __________________________________________________
  211. if [ "$netcheck" == "yes" ] ; then
  212.    clear
  213.    $border1
  214.    echo "#[i] Checking for internet"
  215.    $border1
  216.    for (( ; ; ))
  217.    do
  218.       ping -c 2 www.google.com >/dev/null
  219.       return_val=$?
  220.       if [ $return_val != "0" ] ; then
  221.          clear
  222.          $border2
  223.          echo "[!] Internet access: Failed..."
  224.          $border2
  225.          echo "[i] Click yes to start networking then close wicd to continue"
  226.          $border2
  227.          read -p "[?] Would you like to open WICD now? [Y/n]: "
  228.             if [[ "$REPLY" =~ ^[Yy]$ ]] ; then
  229.             wicd-gtk --no-tray
  230.          else
  231.             clear
  232.             $border1
  233.             echo "[!] No internet access available"
  234.             $border1
  235.             exit 1
  236.             fi
  237.       else
  238.          clear
  239.          $border1
  240.          echo "[i] Internet access: Success" ;
  241.          $border1
  242.          break;
  243.       fi
  244. done
  245. fi
  246. #__ Distribution and apt-get _______________________________________________
  247. if [ "$distup" == "true" ] ; then
  248.    clear
  249.    echo " -- Updating Distribution --------------------" >> $log
  250.    $border1
  251.    echo "[i] Updating Distribution..."
  252.    $border1
  253.    $updatea && $upgradea && $distupa | grep "newly installed" >> $log
  254.    $cleana
  255. fi
  256. #__ MSF Framework 3 ________________________________________________________
  257. if [ "$metasploit" == "true" ] ; then
  258.    if [ "$framework3_install" == "true" ] ; then
  259.       clear
  260.       echo " -- Framework 3 ------------------------------" >> $log
  261.       $border1
  262.       echo "[i] Updating Framework 3..."
  263.       $border1
  264.       cd $framework3_path
  265.       oldsvn=$(svn info | grep "Revision" | cut -c11-)
  266.       newsvn=$(svn info $framework3_svn | grep "Revision" | cut -c11-)
  267.       if [ "$newsvn" == "$oldsvn" ] ; then  
  268.          echo "You are up to date already (SVN $newsvn)" >> $log
  269.       else
  270.          $framework3_command
  271.          upsvn=$(svn info | grep "Revision" | cut -c11-)
  272.          if [ "$newsvn" == "$upsvn" ] ; then echo "Updated Successfully to    (SVN $upsvn)" >> $log ; fi
  273.          if [ "$newsvn" != "$upsvn" ] ; then echo "Server might be down or slow - Try again" >> $log ; fi
  274.       fi
  275.    else
  276.       echo " -- Framework 3 ------------------------------" >> $log
  277.       echo "[!] MSF 3 Not Installed" >> $log
  278.    fi
  279. fi
  280. #__ MSF Framework 2 ________________________________________________________
  281. if [ "$metasploit" == "true" ] ; then
  282.    if [ "$framework2_install" == "true" ] ; then
  283.       clear
  284.       echo " -- Framework 2 ------------------------------" >> $log
  285.       $border1
  286.       echo "[i] Updating Framework 2..."
  287.       $border1
  288.       cd $framework2_path
  289.       oldsvn=$(svn info | grep "Revision" | cut -c11-)
  290.       newsvn=$(svn info $framework2_svn | grep "Revision" | cut -c11-)
  291.       if [ "$newsvn" == "$oldsvn" ] ; then  
  292.          echo "You are up to date already (SVN $newsvn)" >> $log
  293.       else
  294.          $framework2_command
  295.          upsvn=$(svn info | grep "Revision" | cut -c11-)
  296.          if [ "$newsvn" == "$upsvn" ] ; then echo "Updated Successfully to    (SVN $upsvn)" >> $log ; fi
  297.          if [ "$newsvn" != "$upsvn" ] ; then echo "Server might be down or slow - Try again" >> $log ; fi
  298.       fi
  299.    else
  300.       echo " -- Framework 2 ------------------------------" >> $log
  301.       echo "[!] MSF 2 Not Installed" >> $log
  302.    fi
  303. fi
  304. #__ Aircrack-ng ____________________________________________________________
  305. if [ "$aircrack" == "true" ] ; then
  306.    if [ "$aircrack_install" == "true" ] ; then
  307.       clear
  308.       echo " -- Aircrack-ng ------------------------------" >> $log
  309.       $border1
  310.       echo "[i] Updating aircrack-ng..."
  311.       $border1
  312.       cd $aircrack_path
  313.       oldsvn=$(svn info | grep "Revision" | cut -c11-)
  314.       newsvn=$(svn info $aircrack_svn | grep "Revision" | cut -c11-) >> $log
  315.       if [ "$newsvn" == "$oldsvn" ] ; then  
  316.          echo "You are up to date already (SVN $newsvn)" >> $log
  317.       else
  318.          $aircrack_command
  319.          upsvn=$(svn info | grep "Revision" | cut -c11-)
  320.          if [ "$newsvn" == "$upsvn" ] ; then echo "Updated Successfully to    (SVN $upsvn)" >> $log ; fi
  321.          if [ "$newsvn" != "$upsvn" ] ; then echo "Server might be down or slow - Try again" >> $log ; fi
  322.       fi
  323.    else
  324.       echo " -- Aircrack-ng ------------------------------" >> $log
  325.       echo "[!] Aircrack-ng Not Installed in $aircrack_path" >> $log
  326.       echo "[i] If it is installed then change default path in script" >> $log
  327.    fi
  328. fi
  329. #__ Airgraph-ng _____________________________________________________________
  330. if [ "$aircrack" == "true" ] ; then
  331.    if [ "$airgraph_install" == "true" ] ; then
  332.       clear
  333.       echo " -- Airgraph-ng ------------------------------" >> $log
  334.       $border1
  335.       echo "[i] Updating Airgraph-ng..."
  336.       $border1
  337.       cd $airgraph_path
  338.       oldsvn=$(svn info | grep "Revision" | cut -c11-)
  339.       newsvn=$(svn info $airgraph_svn | grep "Revision" | cut -c11-) >> $log
  340.       if [ "$newsvn" == "$oldsvn" ] ; then  
  341.          echo "You are up to date already (SVN $newsvn)" >> $log
  342.       else
  343.          $airgraph_command
  344.          upsvn=$(svn info | grep "Revision" | cut -c11-)
  345.          if [ "$newsvn" == "$upsvn" ] ; then echo "Updated Successfully to    (SVN $upsvn)" >> $log ; fi
  346.          if [ "$newsvn" != "$upsvn" ] ; then echo "Server might be down or slow - Try again" >> $log ; fi
  347.       fi
  348.    else
  349.       echo " -- Airgraph-ng ------------------------------" >> $log
  350.       echo "[!] Airgraph-ng Not Installed in $airgraph_path" >> $log
  351.       echo "[i] If it is installed then change default path in script" >> $log
  352.    fi
  353. fi
  354. #__ Exploitdb ______________________________________________________________
  355. if [ "$exploitdb" == "true" ] ; then
  356.    if [ "$exploitdb_install" == "true" ] ; then
  357.       clear
  358.       echo " -- Exploitdb --------------------------------" >> $log
  359.       $border1
  360.       echo "[i] Updating Exploitdb..."
  361.       $border1
  362.       cd $exploitdb_path
  363.       oldsvn=$(svn info | grep "Revision" | cut -c11-)
  364.       newsvn=$(svn info $exploitdb_svn | grep "Revision" | cut -c11-)
  365.       if [ "$newsvn" == "$oldsvn" ] ; then  
  366.          echo "You are up to date already (SVN $newsvn)" >> $log
  367.       else
  368.          rm -rf exploitdb/
  369.          $exploitdb_command
  370.          upsvn=$(svn info | grep "Revision" | cut -c11-)
  371.          if [ "$newsvn" == "$upsvn" ] ; then echo "Updated Successfully to    (SVN $upsvn)" >> $log ; fi
  372.          if [ "$newsvn" != "$upsvn" ] ; then echo "Server might be down or slow - Try again" >> $log ; fi
  373.       fi
  374.    else
  375.       echo " -- Exploitdb --------------------------------" >> $log
  376.       echo "[!] Exploitdb Not Installed in $exploitdb_path" >> $log
  377.       echo "[i] If it is installed then change default path in script" >> $log
  378.    fi
  379. fi
  380. #__ Social Engineering Toolkit _____________________________________________
  381. if [ "$SET" == "true" ] ; then
  382.    if [ "$set_install" == "true" ] ; then
  383.       clear
  384.       echo " -- SET --------------------------------------" >> $log
  385.       $border1
  386.       echo "[i] Updating SET..."
  387.       $border1
  388.       cd $set_path
  389.       oldsvn=$(svn info | grep "Revision" | cut -c11-)
  390.       newsvn=$(svn info $set_svn | grep "Revision" | cut -c11-)
  391.       if [ "$newsvn" == "$oldsvn" ] ; then  
  392.          echo "You are up to date already (SVN $newsvn)" >> $log
  393.       else
  394.          $set_command
  395.          upsvn=$(svn info | grep "Revision" | cut -c11-)
  396.          if [ "$newsvn" == "$upsvn" ] ; then echo "Updated Successfully to    (SVN $upsvn)" >> $log ; fi
  397.          if [ "$newsvn" != "$upsvn" ] ; then echo "Server might be down or slow - Try again" >> $log ; fi
  398.       fi
  399.    else
  400.       echo " -- SET --------------------------------------" >> $log
  401.       echo "[!] SET Not Installed in $set_path" >> $log
  402.       echo "[i] If it is installed then change default path in script" >> $log
  403.    fi
  404. fi
  405. #__ Fast-track _____________________________________________________________
  406. if [ "$fasttrack" == "true" ] ; then
  407.    if [ "$fasttrack_install" == "true" ] ; then
  408.       clear
  409.       echo " -- Fasttrack --------------------------------" >> $log
  410.       $border1
  411.       echo "[i] Updating Fasttrack...  "
  412.       $border1
  413.       cd $fasttrack_path
  414.       oldsvn=$(svn info | grep "Revision" | cut -c11-)
  415.       newsvn=$(svn info $fasttrack_svn | grep "Revision" | cut -c11-)
  416.       if [ "$newsvn" == "$oldsvn" ] ; then  
  417.          echo "You are up to date already (SVN $newsvn)" >> $log
  418.       else
  419.          $fasttrack_command
  420.          upsvn=$(svn info | grep "Revision" | cut -c11-)
  421.          if [ "$newsvn" == "$upsvn" ] ; then echo "Updated Successfully to    (SVN $upsvn)" >> $log ; fi
  422.          if [ "$newsvn" != "$upsvn" ] ; then echo "Server might be down or slow - Try again" >> $log ; fi
  423.       fi
  424.    else
  425.       echo " -- Fasttrack --------------------------------" >> $log
  426.       echo "[!] Fasttrack Not Installed in $fasttrack_path" >> $log
  427.       echo "[i] If it is installed then change default path in script" >> $log
  428.    fi
  429. fi
  430. #__ SQLMap _________________________________________________________________
  431. if [ "$SQLMap" == "true" ] ; then
  432.    if [ "$sqlmap_install" == "true" ] ; then
  433.       clear
  434.       echo " -- SQLMap -----------------------------------" >> $log
  435.       $border1
  436.       echo "[i] Updating SQLMap...      "
  437.       $border1
  438.       cd $sqlmap_path
  439.       oldsvn=$(svn info | grep "Revision" | cut -c11-)
  440.       newsvn=$(svn info $sqlmap_svn | grep "Revision" | cut -c11-)
  441.       if [ "$newsvn" == "$oldsvn" ] ; then  
  442.          echo "You are up to date already (SVN $newsvn)" >> $log
  443.       else
  444.          $sqlmap_command
  445.          upsvn=$(svn info | grep "Revision" | cut -c11-)
  446.          if [ "$newsvn" == "$upsvn" ] ; then echo "Updated Successfully to    (SVN $upsvn)" >> $log ; fi
  447.          if [ "$newsvn" != "$upsvn" ] ; then echo "Server might be down or slow - Try again" >> $log ; fi
  448.       fi
  449.    else
  450.       echo " -- SQLMap -----------------------------------" >> $log
  451.       echo "[!] SQLMap Not Installed in $sqlmap_path" >> $log
  452.       echo "[i] If it is installed then change default path in script" >> $log
  453.    fi
  454. fi
  455. #__ Nikto __________________________________________________________________
  456. if [ "$nikto" == "true" ] ; then
  457.    if [ "$nikto_install" == "true" ] ; then
  458.       clear
  459.       echo " -- Nikto ------------------------------------" >> $log
  460.       $border1
  461.       echo "[i] Updating Nikto...  "
  462.       $border1
  463.       cd $nikto_path
  464.       $nikto_command | awk -v line=1 'NR == line { print $0 }'  >> $log
  465.    else
  466.       echo " -- Nikto -----------------------------------" >> $log
  467.       echo "[!] Nikto Not Installed in $nikto_path" >> $log
  468.       echo "[i] If it is installed then change default path in script" >> $log
  469.    fi
  470. fi
  471. #__ Nessus _________________________________________________________________
  472. if [ "$nessus" == "true" ] ; then
  473.    if [ "$nessus_install" == "true" ] ; then
  474.       clear
  475.       echo " -- Nessus -----------------------------------" >> $log
  476.       $border1
  477.       echo "[i] Updating Nessus...  "
  478.       $border1
  479.       cd $nessus_path
  480.       $nessus_command | awk -v line=2 'NR == line { print $0 }'  >> $log
  481.    else
  482.       echo " -- Nessus -----------------------------------" >> $log
  483.       echo "[!] Nessus Not Installed in $nessus_path" >> $log
  484.       echo "[i] If it is installed then change default path in script" >> $log
  485.    fi
  486. fi
  487. #__ w3af ___________________________________________________________________
  488. if [ "$w3af" == "true" ] ; then
  489.    clear
  490.    echo " -- w3af -------------------------------------" >> $log
  491.    $border1
  492.    echo "[i] Updating w3af..."
  493.    $border1
  494.    cd $w3af_path
  495.    oldsvn=$(svn info | grep "Revision" | cut -c11-)
  496.    newsvn=$(svn info $w3af_svn | grep "Revision" | cut -c11-)
  497.    if [ "$newsvn" == "$oldsvn" ] ; then  
  498.       echo "You are up to date already (SVN $newsvn)" >> $log
  499.    else
  500.       $w3af_command
  501.       upsvn=$(svn info | grep "Revision" | cut -c11-)
  502.       if [ "$newsvn" == "$upsvn" ] ; then echo "Updated Successfully to    (SVN $upsvn)" >> $log ; fi
  503.       if [ "$newsvn" != "$upsvn" ] ; then echo "Server might be down or slow - Try again" >> $log ; fi
  504.    fi
  505. fi
  506.  
  507. clear
  508. $border2
  509. echo " Update report for $(date)"
  510. $border2
  511. cat $log
  512. $border2
  513. sleep 1
  514. rm -f $log
  515. exit 1