Pastebin launched a little side project called HostCabi.net, check it out ;-)Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

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