1. #!/usr/bin/python
  2. # This is a update script for Backtrack 5.
  3. # Rewritten by: bl4ck5w4n aka MaXFX in BT Forum
  4. # Mail: bl4ck5w4n5@gmail.com
  5. # Blog: http://bl4ck5w4n.tk
  6. # Original autor Sickness http://sickness.tor.hu
  7.  
  8. import  os, time, inspect,sys,fileinput
  9. import smtplib, getopt
  10. from email.MIMEText import MIMEText
  11.  
  12. global tsleep
  13. tsleep = 2
  14.  
  15. def get_version():
  16.       curversion = 1.1
  17.       return curversion
  18.  
  19.  
  20. def backtrack_update():
  21.     print("\033[1;31m [>]\033[1;m Updating and cleaning Backtrack, please wait.")
  22.     time.sleep(tsleep)
  23.  
  24.     if(os.system("apt-get update && apt-get -y dist-upgrade && apt-get autoremove -y && apt-get -y autoclean") == 0):
  25.         print("\033[1;31m [>]\033[1;m Backtrack updated and cleaned successfully!")
  26.         time.sleep(tsleep)
  27.    
  28.     else:
  29.         print("\033[1;31m [>]\033[1;m Failed to update Backtrack.")
  30.         time.sleep(tsleep)
  31.    
  32.  
  33.  
  34. def exploit_db():
  35.         print("\033[1;31m [>]\033[1;m Updating Exploit-db, please wait.")
  36.         time.sleep(tsleep)
  37.         if(os.system("cd /pentest/exploits/exploitdb/platforms/ && svn up") == 0):
  38.                 print("\033[1;31m [>]\033[1;m Exploit-db updated successfully!")
  39.         time.sleep(tsleep)
  40.    
  41.     else:
  42.         print("\033[1;31m [>]\033[1;m Failed to update Exploit-db.")
  43.         time.sleep(tsleep)
  44.    
  45.  
  46.  
  47.  
  48. def Set():
  49.         print("\033[1;31m [>]\033[1;m Updating SET, please wait.")
  50.         time.sleep(tsleep)
  51.        
  52.         if(os.system("cd /pentest/exploits/set/ && svn up") == 0):
  53.    
  54.       print("\033[1;31m [>]\033[1;m SET updated successfully!")
  55.       time.sleep(tsleep)
  56.    
  57.     else:
  58.       print("\033[1;31m [>]\033[1;m Failed to update SET.")
  59.       time.sleep(tsleep)
  60.    
  61.  
  62.  
  63. def warvox():
  64.     print("\033[1;31m [>]\033[1;m Updating Warvox, please wait.")
  65.     time.sleep(tsleep)
  66.    
  67.     if(os.system("cd /pentest/telephony/warvox/ && svn up") == 0):
  68.      
  69.           print("\033[1;31m [>]\033[1;m Warvox updated successfully!")
  70.           time.sleep(tsleep)
  71.    
  72.     else:
  73.         print("\033[1;31m [>]\033[1;m Failed to update Warvox")
  74.         time.sleep(tsleep)
  75.    
  76.  
  77.  
  78. def aircrack():
  79.     print("\033[1;31m [>]\033[1;m Updating Aircrack-NG and Airodump, please wait.")
  80.     time.sleep(tsleep)
  81.    
  82.     if(os.system("cd /pentest/wireless/aircrack-ng/ && svn up") == 0):
  83.       os.system("cd /pentest/wireless/aircrack-ng/scripts/ && chmod a+x airodump-ng-oui-update && ./airodump-ng-oui-update")
  84.      
  85.       print("\033[1;31m [>]\033[1;m Aircrack-NG and Airodump updated successfully!")
  86.       time.sleep(tsleep)
  87.    
  88.     else:
  89.         print("\033[1;31m [>]\033[1;m Failed to update Aircrack-ng.")
  90.         time.sleep(tsleep)
  91.    
  92.  
  93. def feedingbottle():
  94.   print("\033[1;31m [>]\033[1;m Checking to see if FeedingBottle is installed.")
  95.   time.sleep(tsleep)
  96.   if os.path.exists("/bin/feedingbottle"):
  97.     print("\033[1;31m [>]\033[1;m FeedingBottle installed!")
  98.     time.sleep(tsleep)
  99.   else:
  100.     print("\033[1;31m [>]\033[1;m Installing FeddingBottle, please wait.")
  101.     os.system("wget http://www.ibeini.com/beini_system/others/feedingbottle/feedingbottle3.2-backtrack5-gnome.zip")
  102.     os.system("unzip feedingbottle3.2-backtrack5-gnome.zip")
  103.     if (os.system("dpkg -i feedingbottle3.2-backtrack5-gnome.deb")==0):
  104.           print("\033[1;31m [>]\033[1;m FeddingBottle installed successfully!")
  105.       time.sleep(tsleep)
  106.    
  107.     else:
  108.       print("\033[1;31m [>]\033[1;m Failed to install FeddingBottle.")
  109.       time.sleep(tsleep)
  110.    
  111.     os.system("rm feedingbottle3.2*")
  112.    
  113.      
  114. def giskismet():
  115.     print("\033[1;31m [>]\033[1;m Updating Giskismet, please wait.")
  116.     time.sleep(tsleep)
  117.    
  118.     if(os.system("cd /pentest/wireless/giskismet/ && svn up") == 0):
  119.      
  120.       print("\033[1;31m [>]\033[1;m Giskismet updated successfully!")
  121.       time.sleep(tsleep)
  122.    
  123.     else:
  124.         print("\033[1;31m [>]\033[1;m Failed to update Giskismet.")
  125.         time.sleep(tsleep)
  126.    
  127.  
  128.  
  129. def msf():
  130.     print("\033[1;31m [>]\033[1;m Updating Metasploit, please wait.")
  131.     time.sleep(tsleep)
  132.    
  133.     if(os.system("cd /pentest/exploits/framework/ && svn up") == 0):
  134.      
  135.       print("\033[1;31m [>]\033[1;m Metasploit updated successfully!")
  136.       time.sleep(tsleep)
  137.    
  138.     else:
  139.         print("\033[1;31m [>]\033[1;m Failed to update Metasploit.")
  140.         time.sleep(tsleep)
  141.    
  142. def openvas():
  143.  
  144.     print("\033[1;31m [>]\033[1;m Updating OpenVAS, please wait.")
  145.    
  146.         if (os.system("openvas-nvt-sync")== 0):
  147.         print("\033[1;31m [>]\033[1;m OpenVAS updated successfully!")
  148.         time.sleep(tsleep)
  149.         else:
  150.             print("\033[1;31m [>]\033[1;m Failed to update OpenVAS!")
  151.             time.sleep(tsleep)
  152.  
  153. def sslstrip():
  154.     print("\033[1;31m [>]\033[1;m Updating SSLStrip, please wait.")
  155.        
  156.         if (os.system("cd /tmp && wget http://www.thoughtcrime.org/software/sslstrip/sslstrip-0.9.tar.gz") == 0):
  157.         os.system("apt-get purge sslstrip -y")
  158.         os.system("rm -Rf /pentest/web/sslstrip")
  159.         os.system("tar -C /pentest/web/ -xvf  /tmp/sslstrip-0.9.tar.gz")
  160.         os.system("mv  /pentest/web/sslstrip-0.9 /pentest/web/sslstrip")
  161.         os.system("cd /pentest/web/sslstrip && python ./setup.py install")
  162.         os.system("chmod +x /pentest/web/sslstrip/sslstrip.py")
  163.         print("\033[1;31m [>]\033[1;m SSLStrip updated successfully!")
  164.         time.sleep(tsleep)
  165.        
  166.         else:
  167.         print("\033[1;31m [>]\033[1;m Failed to update SSLStrip!")
  168.         time.sleep(tsleep)
  169.  
  170. def nessus():
  171.   if(os.system("which nessus > /dev/null") == 0):
  172.     print("\033[1;31m [>]\033[1;m Updating Nessus plugins, please wait.")
  173.     time.sleep(tsleep)
  174.    
  175.     if(os.system("cd /opt/nessus/sbin/ && ./nessus-update-plugins") == 0):
  176.      
  177.       print("\033[1;31m [>]\033[1;m Nessus plugins updated successfully!")
  178.       time.sleep(tsleep)
  179.    
  180.     else:
  181.         print("\033[1;31m [>]\033[1;m Failed to update Nessus.")
  182.         time.sleep(tsleep)
  183.   else:
  184.       print("\033[1;31m [>]\033[1;m Nessus is not installed.")
  185.       time.sleep(tsleep)
  186.  
  187. def install_nessus():
  188.     if(os.system("which nessus > /dev/null") == 0):
  189.         print("\033[1;31m [>]\033[1;m Nessus is already installed!")
  190.         time.sleep(tsleep)
  191.        
  192.     else:
  193.       print("\033[1;31m [>]\033[1;m Installing Nessus!")
  194.       os.system("apt-get install nessus")
  195.       print("\033[1;31m [>]\033[1;m You need to register nessus to get the activation code:")
  196.       browser_nessus = raw_input("\033[1;31m [>]\033[1;m Would you like me to open Firefox for you? [n/Y] : ")
  197.       if(browser_nessus.upper()=="Y"):
  198.     os.system("firefox http://tenable.com/products/nessus/nessus-homefeed&")
  199.      
  200.       auth_key=""
  201.       while(auth_key == ""):
  202.           auth_key = raw_input("\033[1;31m [>]\033[1;m Enter Activation Code that was sent to your Email: ")
  203.           os.system("/opt/nessus/bin/nessus-fetch --register " + auth_key)
  204.           print("\033[1;31m [>]\033[1;m Adding user")
  205.           os.system("/opt/nessus/sbin/nessus-adduser")
  206.           print("\033[1;31m [>]\033[1;m Staring Nessus service")
  207.           os.system("/etc/init.d/nessusd start")
  208.           print("\033[1;31m [>]\033[1;m To access Nessus Web Interface: https://127.0.0.1:8834")
  209.  
  210. def hexorbase():
  211.   if (os.path.isfile('/opt/HexorBase/execute.py')):
  212.     print("\033[1;31m [>]\033[1;m HexorBase already installed!")
  213.     time.sleep(tsleep)
  214.   else:
  215.     if (os.system("apt-get install python-mysqldb python-psycopg2 python-pymssql python-qscintilla2 python-qt4 -y")==0):
  216.       if (os.system("cd /tmp && wget http://hexorbase.googlecode.com/files/hexorbase_1.0_all.deb")==0):
  217.         os.system("cd /tmp && dpkg -i hexorbase_1.0_all.deb")
  218.         os.system("sed -i.bak 's/Categories.*/Categories = bt-web-assessment-vulnerability-scanner;bt-web-exploitation-scanners;bt-db-mysql-assessment;bt-db-mssql-assessment;bt-db-oracle-assessment;bt-db-mysql-analysis;bt-db-mssql-analysis;bt-db-oracle-analysis;bt-db-mysql-exploit;bt-db-mssql-exploit;bt-db-oracle-exploit;/g' /usr/share/applications/hexorbase.desktop")
  219.         print("\033[1;31m [>]\033[1;m To install Oracle API please read: /opt/HexorBase/Oracle-API-installation.txt")
  220.         print("\033[1;31m [>]\033[1;m HexorBase installed successfully!")
  221.         time.sleep(tsleep)
  222.     else:
  223.       print("\033[1;31m [>]\033[1;m Failed to install HexorBase!")
  224.      
  225. def w3af():
  226.         print("\033[1;31m [>]\033[1;m Updating W3AF, please wait.")
  227.         time.sleep(tsleep)
  228.        
  229.         if(os.system("cd /pentest/web/w3af/ && svn up") == 0):
  230.      
  231.       print("\033[1;31m [>]\033[1;m W3AF updated successfully!")
  232.       time.sleep(tsleep)
  233.    
  234.     else:
  235.         print("\033[1;31m [>]\033[1;m Failed to update W3AF.")
  236.         time.sleep(tsleep)
  237.    
  238.  
  239. def nikto():
  240.         print("\033[1;31m [>]\033[1;m Updating Nikto, please wait.")
  241.         time.sleep(tsleep)
  242.        
  243.         if(os.system("cd /pentest/web/nikto/ && ./nikto.pl -update") == 0):
  244.      
  245.       print("\033[1;31m [>]\033[1;m Nikto updated successfully!")
  246.       time.sleep(tsleep)
  247.    
  248.     else:
  249.         print("\033[1;31m [>]\033[1;m Failed to update Nikto.")
  250.         time.sleep(tsleep)
  251.    
  252.  
  253.  
  254. def sqlmap():
  255.         print("\033[1;31m [>]\033[1;m Updating Sqlmap, please wait.")
  256.         time.sleep(tsleep)
  257.        
  258.         if(os.system("svn checkout https://svn.sqlmap.org/sqlmap/trunk/sqlmap /pentest/database/sqlmap") == 0):
  259.       print("\033[1;31m [>]\033[1;m Sqlmap updated successfully!")
  260.       time.sleep(tsleep)
  261.    
  262.     else:
  263.         print("\033[1;31m [>]\033[1;m Failed to update SQLmap.")
  264.         time.sleep(tsleep)
  265.    
  266.  
  267.  
  268.  
  269. def pyrit():
  270.     print("\033[1;31m [>]\033[1;m Checking to see if pyrit is installed.")
  271.     time.sleep(tsleep)
  272.    
  273.     if(os.system("pyrit > /dev/null") == 0):
  274.         print("\033[1;31m [>]\033[1;m Pyrit installed!")
  275.         time.sleep(tsleep)
  276.    
  277.     else:
  278.         print("\033[1;31m [>]\033[1;m Installing Pyrit, please wait.")
  279.         time.sleep(tsleep)
  280.         os.system("apt-get -y install libssl-dev scapy python-dev")
  281.         os.system("svn checkout http://pyrit.googlecode.com/svn/trunk/ pyrit_svn")
  282.         os.system("cd pyrit_svn/pyrit && python setup.py build && python setup.py install")
  283.         os.system("rm -Rf pyrit_svn")
  284.         print("\033[1;31m [>]\033[1;m Pyrit installed successfully!")
  285.    
  286.  
  287.  
  288. def fimap():
  289.     print("\033[1;31m [>]\033[1;m Updating Fimap and installing MSF plugin, please wait.")
  290.         time.sleep(tsleep)
  291.    
  292.         os.system("rm -Rf /pentest/web/fimap")
  293.     if(os.system("svn checkout http://fimap.googlecode.com/svn/trunk/src/ /pentest/web/fimap")==0):    
  294.        
  295.             print("\033[1;31m [>]\033[1;m Fimap updated successfully!")
  296.            
  297.             time.sleep(tsleep)
  298.        
  299.         else:
  300.             print("\033[1;31m [>]\033[1;m Failed to update Fimap!")
  301.             time.sleep(tsleep)
  302.        
  303. def wireshark():
  304.     print("\033[1;31m [>]\033[1;m Updating Wireshark, please wait.")
  305.     time.sleep(tsleep)
  306.    
  307.     os.system("apt-get install autoconf libgtk2.0-dev libglib2.0-dev libgeoip-dev libpcre3-dev libpcap0.8-dev libtool byacc flex -y")
  308.    
  309.     if (os.system("cd /tmp && svn co http://anonsvn.wireshark.org/wireshark/trunk/ wireshark")==0):
  310.       print("\033[1;31m [>]\033[1;m Files downloaded successfully! Now the painful part... Be patient")
  311.       time.sleep(tsleep)
  312.      
  313.       os.system("cd /tmp/wireshark && ./autogen.sh")
  314.       os.system("cd /tmp/wireshark && ./configure")
  315.       os.system("cd /tmp/wireshark && make")
  316.       if (os.system("cd /tmp/wireshark && make install")==0):
  317.       os.system("ldconfig")
  318.       os.system("rm -Rf /tmp/wireshark")
  319.       if (os.path.isfile('/usr/local/share/wireshark/init.lua')):
  320.         print("\033[1;31m [>]\033[1;m Changeging init.lua file..")
  321.         time.sleep(tsleep)
  322.        
  323.         for lines in fileinput.FileInput("/usr/local/share/wireshark/init.lua", inplace=1):
  324.           lines = lines.replace("disable_lua = false","disable_lua = true")
  325.      
  326.       print("\033[1;31m [>]\033[1;m Wireshark installed successfully!")
  327.       time.sleep(tsleep)
  328.     else:
  329.       print("\033[1;31m [>]\033[1;m Wireshark failed installed!")
  330.       time.sleep(tsleep)
  331.  
  332. def update():
  333.     print("\033[1;31m [>]\033[1;m Updating bt5update script.")
  334.    
  335.     os.system("cd /tmp && wget http://bl4ck5w4n.tk/wp-content/uploads/2011/07/bt5up.tar -c -q")
  336.    
  337.     if os.path.isfile("/tmp/bt5up.tar"):
  338.         os.system("tar -xvf /tmp/bt5up.tar -C /tmp/ > /dev/null")
  339.        
  340.     curfile = inspect.getfile(inspect.currentframe())
  341.    
  342.     pwd = os.getcwd() + str(curfile)
  343.    
  344.     os.system("rm -Rf " + pwd)
  345.     os.system("mv /tmp/bt5up.py " + str(curfile))
  346.     os.system("chmod +x " + str(curfile))
  347.    
  348.    
  349.     print("\033[1;31m [>]\033[1;m Update successfully! bt5up will restart, please wait...")
  350.     time.sleep(tsleep)
  351.     python = sys.executable
  352.     os.execl(python, python, * sys.argv)
  353.  
  354.  
  355.  
  356. def bugs_fixs():  
  357.     header()
  358.     print("         Section: Fix BT5 Bugs/Customize BT5")
  359.    
  360.         print("\033[1;31m [>]\033[1;m 1. Startx after login.")
  361.         print("\033[1;31m [>]\033[1;m 2. Change Login message.")
  362.         print("\033[1;31m [>]\033[1;m 3. Install Flash Player 64Bits.")
  363.         print("\033[1;31m [>]\033[1;m 4. Back.")
  364.         bugs = raw_input("\033[1;31m [>]\033[1;m Enter your choice: ")
  365.        
  366.         if(bugs=="1"):
  367.         startx()
  368.         bugs_fixs()
  369.     if(bugs=="2"):
  370.         login_msg()
  371.         bugs_fixs()
  372.     if(bugs=="3"):
  373.         flashplayer()
  374.         bugs_fixs()    
  375.     if(bugs=="4"):
  376.         main()
  377.  
  378.  
  379.  
  380. def startx():
  381.     print("\033[1;31m [>]\033[1;m Make startx as default...")
  382.     os.system('echo \'if [ -z "$DISPLAY" ] && [ $(tty) == /dev/tty1 ];\n then \nstartx \nfi\' >> /root/.bash_profile')
  383.     print("\033[1;31m [>]\033[1;m Done. Next time you reboot startx will start...")
  384.     time.sleep(tsleep)
  385.    
  386. def login_msg():
  387.     print("\033[1;31m [>]\033[1;m Edit the login message using nano")
  388.     time.sleep(tsleep)
  389.     os.system("nano /etc/update-motd.d/10-help-text")
  390.     os.system("sh /etc/update-motd.d/10-help-text")
  391.     print("\033[1;31m [>]\033[1;m Next time you boot your message will be like that")
  392.     time.sleep(tsleep)
  393.     os.system("nano /etc/update-motd.d/10-help-text")
  394.     os.system("sh /etc/update-motd.d/10-help-text")
  395.     print("\033[1;31m [>]\033[1;m Next time you boot your message will be like that")
  396.     time.sleep(tsleep)
  397.    
  398. def flashplayer():
  399.     print("\n\033[1;31m [>]\033[1;m Installing FlashPlayer 64Bits")
  400.     print("\033[1;31m [>]\033[1;m This will close your FireFox...")
  401.     time.sleep(tsleep)
  402.     os.system("killall -9 firefox-bin")
  403.     if(os.system("cd / && wget -c http://fpdownload.macromedia.com/get/flashplayer/current/install_flash_player_10_linux.tar.gz")==0):
  404.     os.system("cd / && tar -xvf  install_flash_player_10_linux.tar.gz")
  405.     os.system("mkdir -p ~/.mozilla/plugins")
  406.     os.system("cd / && mv libflashplayer.so ~/.mozilla/plugins/")
  407.     os.system("cd / && rm -Rf install_flash_player_10_linux.tar.gz")
  408.     print("\033[1;31m [>]\033[1;m FlashPlayer 64Bits installed successfully!")
  409.     time.sleep(tsleep)
  410.     else:  
  411.     print("\033[1;31m [>]\033[1;m Failed to install FlashPlayer 64Bits")
  412.     time.sleep(tsleep)
  413.  
  414.  
  415. def latest_version():
  416.     i=0
  417.     lversion = 0
  418.     os.system("cd /tmp && wget http://bl4ck5w4n.tk/wp-content/uploads/2011/07/version.txt -c -q")
  419.     if os.path.isfile("/tmp/version.txt"):
  420.         ofile=open("/tmp/version.txt","r")
  421.         lversion=ofile.readline()
  422.  
  423.     return lversion;
  424.  
  425. def clean_exit():
  426.       print("\033[1;31m [>]\033[1;m Cleaning temporary files and leaving...")
  427.       if os.path.isfile("/tmp/version.txt"):
  428.     os.system("rm /tmp/version.txt")
  429.       if os.path.isfile("/tmp/bt5up.tar"):
  430.     os.system("rm /tmp/bt5up.tar")
  431.       if os.path.isfile("/tmp/bt5up.py"):
  432.     os.system("rm /tmp/bt5up.py")
  433.       print("\033[1;31m [>]\033[1;m Thanks for using bt5up dont forget to visit: http://bl4ck5w4n.tk")
  434.       print("\033[1;31m [>]\033[1;m For automated updates you can use bt5up -u\n")
  435.      
  436. def header():
  437.     os.system("clear")
  438.     print('\033[1;31m                                        ,   ,')
  439.     print('                                        $,  $,     ,')
  440.     print('                                        "ss.$ss. .s')
  441.     print('                                ,     .ss$$$$$$$$$$s,')
  442.     print('                                $. s$$$$$$$$$$$$$$`$$Ss')
  443.     print('                                "$$$$$$$$$$$$$$$$$$o$$$       ,')
  444.     print('                               s$$$$$$$$$$$$$$$$$$$$$$$$s,  ,s')
  445.     print('                              s$$$$$$$$$"$$$$$$""""$$$$$$"$$$$$,')
  446.     print('                              s$$$$$$$$$$s""$$$$ssssss"$$$$$$$$"')
  447.     print('                             s$$$$$$$$$$         `"""ss"$"$s""')
  448.     print('                             s$$$$$$$$$$,              `"""""$  ')
  449.     print('                             s$$$$$$$$$$$$s,... ')
  450.  
  451.         print("------------------------------------------------------------------------------\033[1;m")
  452.     print("\033[1;37m                    [Back||Track 5 R1 Update]\033[1;m")
  453.         print("     Author: Bl4ck5w4n")
  454.         print("     Feedback/Bugs : bl4ck5w4n5@gmail.com || http://bl4ck5w4n.tk")
  455.         if (float(get_version()) < float(latest_version())):
  456.       print("   Installed Version: \033[1;31m" + str(get_version()) + "\033[1;m Latest Version:\033[1;37m" + str(latest_version()) +"\033[1;m")
  457.     else:
  458.       print("   Installed Version: \033[1;32m" + str(get_version()) + "\033[1;m Latest Version:\033[1;37m" + str(latest_version()) +"\033[1;m")
  459.    
  460.     print("\033[1;31m------------------------------------------------------------------------------\033[1;m")
  461.    
  462. def changelog():
  463.     os.system("cd /tmp && wget http://bl4ck5w4n.tk/wp-content/uploads/2011/07/changelog.txt -o /dev/null")
  464.     os.system("less /tmp/changelog.txt")
  465.     os.remove("/tmp/changelog.txt")
  466.  
  467.    
  468. def gmail():
  469.  
  470.     print("\033[1;31m [>]\033[1;m Send me some feeback/bugs/requests (Please NO spam)...\n If you wanna go back just leave the email or pass in blank\n")
  471.     gmailLogin = raw_input('\033[1;31m [>]\033[1;m Your GMail login (eg. someone@gmail.com): ')
  472.     gmailPass = raw_input('\033[1;31m [>]\033[1;m Your GMail Password: ')
  473.  
  474.     if (gmailLogin!="" or gmailPass != ""):
  475.       msg = raw_input('\033[1;31m [>]\033[1;m Your Message: ')
  476.       msg = MIMEText(msg)
  477.       msg['Subject'] = "BT5UP " +str(get_version()) +" FeedBack"
  478.       msg['From'] = gmailLogin
  479.       msg['To'] = "bl4ck5w4n5@gmail.com"
  480.  
  481.       server = smtplib.SMTP('smtp.gmail.com',587)
  482.       server.ehlo()
  483.       server.starttls()
  484.       server.ehlo()
  485.       server.login(gmailLogin,gmailPass)
  486.       server.sendmail(gmailLogin, "bl4ck5w4n5@gmail.com", msg.as_string())
  487.       server.close()
  488.       print("\033[1;31m [>]\033[1;m Thank you for your time...")
  489.       time.sleep(tsleep)
  490.  
  491.  
  492. def menu_exploit():
  493.  
  494.     header()
  495.     print("         Section: EXPLOIT TOOLS")
  496.    
  497.         print("\033[1;31m [>]\033[1;m 1. Metasploit Framework.")
  498.         print("\033[1;31m [>]\033[1;m 2. Exploit-db.")
  499.         print("\033[1;31m [>]\033[1;m 3. SET - Social Engineering Toolkit.")
  500.     print("\033[1;31m [>]\033[1;m 4. Update all.")
  501.         print("\033[1;31m [>]\033[1;m 5. Back.")
  502.        
  503.        
  504.     ex_var = raw_input("\033[1;31m [>]\033[1;m Enter your choice: ")
  505.  
  506.  
  507.     if(ex_var=="1"):
  508.          msf()
  509.          
  510.          menu_exploit()
  511.     if(ex_var=="2"):
  512.          exploit_db()
  513.          
  514.          menu_exploit()
  515.     if(ex_var=="3"):
  516.          Set()
  517.          
  518.          menu_exploit()
  519.     if(ex_var=="4"):
  520.           msf()
  521.           exploit_db()
  522.           Set()
  523.          
  524.           menu_exploit()
  525.     if(ex_var=="1"):
  526.           main()
  527.    
  528.    
  529.  
  530.  
  531. def menu_wireless():
  532.  
  533.     header()
  534.  
  535.         print("                        Section: WIRELESS & TELEPHONY")
  536.        
  537.         print("\033[1;31m [>]\033[1;m 1. Aircrack-ng and Airdrop.")
  538.         print("\033[1;31m [>]\033[1;m 2. WarVox.")
  539.         print("\033[1;31m [>]\033[1;m 3. Giskismet.")
  540.         print("\033[1;31m [>]\033[1;m 4. Update all.")
  541.         print("\033[1;31m [>]\033[1;m 5. Back.")
  542.        
  543.         w_var = raw_input("\033[1;31m [>]\033[1;m Enter your choice: ")
  544.    
  545.     if(w_var=="1"):
  546.          aircrack()
  547.          
  548.          menu_wireless()
  549.     if(w_var=="2"):  
  550.          warvox()
  551.          
  552.          menu_wireless()
  553.     if(w_var=="3"):
  554.         giskismet()
  555.        
  556.         menu_wireless()
  557.  
  558.     if(w_var=="4"):
  559.         aircrack()
  560.         warvox()
  561.         giskismet()
  562.        
  563.         menu_wireless()
  564.     if(w_var=="5"):
  565.         main()
  566.          
  567.    
  568.  
  569. def menu_web_db():
  570.         header()
  571.         print("                        Section: WEB & DATABASE")
  572.        
  573.         print("\033[1;31m [>]\033[1;m 1. W3AF.")
  574.         print("\033[1;31m [>]\033[1;m 2. Nikto.")
  575.         print("\033[1;31m [>]\033[1;m 3. Sqlmap.")
  576.     print("\033[1;31m [>]\033[1;m 4. Fimap.")
  577.         print("\033[1;31m [>]\033[1;m 5. Update all.")
  578.         print("\033[1;31m [>]\033[1;m 6. Back.")
  579.        
  580.        
  581.         wd_war=raw_input("\033[1;31m [>]\033[1;m Enter your choice: ")
  582.        
  583.         if(wd_war=="1"):
  584.       w3af()
  585.      
  586.       menu_web_db()
  587.     if(wd_war=="2"):
  588.           nikto()
  589.          
  590.           menu_web_db()
  591.     if(wd_war=="3"):
  592.           sqlmap()
  593.          
  594.           menu_web_db()
  595.     if(wd_war=="4"):
  596.           fimap()
  597.          
  598.           menu_web_db()
  599.     if(wd_war=="5"):
  600.           w3af()
  601.           nikto()
  602.           sqlmap()
  603.          
  604.           menu_web_db()
  605.     if(wd_war=="6"):
  606.          
  607.           main()
  608.          
  609.          
  610.  
  611. def update_aptfast():
  612.     print("\033[1;31m [>]\033[1;m Updating apt-fast, please wait.")
  613.     if (os.system("wget -U 'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.6) Gecko/20070802 SeaMonkey/1.1.4' http://www.mattparnell.com/linux/apt-fast/apt-fast.sh -c")==0):
  614.     os.system("mv apt-fast.sh /usr/bin/apt-fast")
  615.     os.system("chmod +x /usr/bin/apt-fast")
  616.     print("\033[1;31m [>]\033[1;m Updating apt-fast successfully")
  617.     else:
  618.     print("\033[1;31m [>]\033[1;m Failed to update apt-fast")
  619.    
  620. def aptfast():
  621.     print("\033[1;31m [>]\033[1;m Checking to see if Axel is installed.")
  622.     time.sleep(tsleep)
  623.    
  624.     if(os.system("axel > /dev/null") == 0):
  625.         print("\033[1;31m [>]\033[1;m Axel is installed!")
  626.         time.sleep(tsleep)
  627.    
  628.     else:
  629.         print("\033[1;31m [>]\033[1;m Installing Axel, please wait.")
  630.         os.system("apt-get install axel")
  631.        
  632.     print("\033[1;31m [>]\033[1;m Checking to see if apt-fast is installed.")
  633.     time.sleep(tsleep)
  634.    
  635.     if(os.system("apt-fast > /dev/null") == 0):
  636.         print("\033[1;31m [>]\033[1;m apt-fast is installed!")
  637.         time.sleep(tsleep)
  638.    
  639.     else:
  640.         print("\033[1;31m [>]\033[1;m Installing apt-fast, please wait.")
  641.         os.system("wget -U 'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.6) Gecko/20070802 SeaMonkey/1.1.4' http://www.mattparnell.com/linux/apt-fast/apt-fast.sh -c")
  642.         os.system("mv apt-fast.sh /usr/bin/apt-fast")
  643.         os.system("chmod +x /usr/bin/apt-fast")
  644.         choice=raw_input("Would you like to use apt-fast instead of apt-get?[y/n]")
  645.         if (choice =="y"):
  646.           os.system("echo  alias apt-get='apt-fast' >> /root/.bashrc")
  647.    
  648.  
  649.  
  650. def menu_other():
  651.     header()
  652.         print("                        Section: OTHER")
  653.     print("\033[1;31m [>]\033[1;m 1. Nessus.")
  654.     print("\033[1;31m [>]\033[1;m 2. Pyrit.")
  655.     print("\033[1;31m [>]\033[1;m 3. Wireshark.")
  656.     print("\033[1;31m [>]\033[1;m 4. OpenVAS.")
  657.     print("\033[1;31m [>]\033[1;m 5. SSLStrip.")
  658.     print("\033[1;31m [>]\033[1;m 6. Update all.")
  659.     print("\033[1;31m [>]\033[1;m 7. Back.")
  660.    
  661.     c_var = raw_input("\033[1;31m [>]\033[1;m Enter your choice: ")
  662.  
  663.    
  664.     if(c_var=="1"):
  665.          nessus()
  666.          menu_other()
  667.  
  668.     if(c_var=="2"):
  669.         pyrit()
  670.         menu_other()
  671.    
  672.     if(c_var=="3"):
  673.         wireshark()
  674.         menu_other()
  675.     if(c_var=="4"):
  676.         openvas()
  677.         menu_other()
  678.     if(c_var=="5"):
  679.         sslstrip()
  680.         menu_other()
  681.     if(c_var=="6"):
  682.         wr=raw_input("\033[1;31m [>]\033[1;m Wireshark takes time to compile do you wish to wait [y/N]:")
  683.         if(wr=="y"):
  684.           wireshark()
  685.         nessus()
  686.         pyrit()
  687.         update_aptfast()
  688.         openvas()
  689.         menu_other()
  690.     if(c_var=="7"):
  691.         main() 
  692.    
  693. def additional_tools():
  694.     header()
  695.     print("                        Section: Additional Tools")
  696.     print("\033[1;31m [>]\033[1;m 1. Axel & apt-fast.")
  697.     print("\033[1;31m [>]\033[1;m 2. Nessus.")
  698.     print("\033[1;31m [>]\033[1;m 3. FeedingBottle.")
  699.     print("\033[1;31m [>]\033[1;m 4. HexorBase.")
  700.     print("\033[1;31m [>]\033[1;m 5. Install All.")
  701.     print("\033[1;31m [>]\033[1;m 6. Back.")
  702.     choice_var=raw_input("\033[1;31m [>]\033[1;m Enter your choice: ")
  703.     if(choice_var=="1"):
  704.         aptfast()
  705.         additional_tools()()
  706.     if(choice_var=="2"):
  707.         install_nessus()
  708.         additional_tools()
  709.     if(choice_var=="3"):
  710.         feedingbottle()
  711.         additional_tools()  
  712.     if(choice_var=="4"):
  713.         hexorbase()
  714.         additional_tools()
  715.     if(choice_var=="5"):
  716.         aptfast()
  717.         install_nessus()
  718.         feedingbottle()
  719.         hexorbase()
  720.         additional_tools()
  721.     if(choice_var=="6"):
  722.         main()
  723.        
  724.      
  725.    
  726. def main():
  727.     header()
  728.     print("                        Section: MAIN")
  729.     print("\033[1;31m [>]\033[1;m 1. Update and clean Backtrack.")
  730.     print("\033[1;31m [>]\033[1;m 2. Exploit tools.")
  731.     print("\033[1;31m [>]\033[1;m 3. Wireless & Telephony.")
  732.     print("\033[1;31m [>]\033[1;m 4. Web & Database.")
  733.     print("\033[1;31m [>]\033[1;m 5. Others.")
  734.     print("\033[1;31m [>]\033[1;m 6. Update all.")
  735.     print("\033[1;31m [>]\033[1;m 7. Update script.")
  736.     print("\033[1;31m [>]\033[1;m 8. Changelog.")
  737.     print("\033[1;31m [>]\033[1;m 9. Feedback (GMail).")
  738.     print("\033[1;31m [>]\033[1;m 10. Fix BT5 Bugs/Customize BT5.")
  739.     print("\033[1;31m [>]\033[1;m 11. Additional Tools")
  740.         print("\033[1;31m [>]\033[1;m 12. Exit.")
  741.    
  742.    
  743.     choice_var=raw_input("\033[1;31m [>]\033[1;m Enter your choice: ")
  744.    
  745.     if(choice_var=="1"):
  746.          backtrack_update()
  747.          
  748.          main()
  749.     if(choice_var=="2"):
  750.          menu_exploit()
  751.          
  752.          main()
  753.     if(choice_var=="3"):
  754.          menu_wireless()
  755.          
  756.          main()
  757.     if(choice_var=="4"):
  758.          menu_web_db()  
  759.          
  760.          main()
  761.     if(choice_var=="5"):
  762.          menu_other()
  763.          
  764.          main()
  765.     if(choice_var=="6"):
  766.         wr=raw_input("\033[1;31m [>]\033[1;m Wireshark takes time to compile do you wish to wait [y/N]:")
  767.         if(wr=="y"):
  768.           wireshark()
  769.         backtrack_update()
  770.         exploit_db()
  771.         Set()
  772.         warvox()
  773.         aircrack()
  774.         giskismet()
  775.         msf()
  776.         sslstrip()
  777.         nessus()
  778.         w3af()
  779.         nikto()
  780.         sqlmap()
  781.         fimap()
  782.         pyrit()
  783.         update_aptfast()
  784.         openvas()
  785.         main()
  786.     if(choice_var=="7"):   
  787.          update()
  788.     if(choice_var=="8"):
  789.          changelog()
  790.          
  791.          main()
  792.     if(choice_var=="9"):
  793.          gmail()
  794.          main()
  795.     if(choice_var=="10"):
  796.           bugs_fixs()
  797.           main()
  798.     if(choice_var=="11"):
  799.           additional_tools()
  800.           main()
  801.     if(choice_var=="12"):
  802.           clean_exit()
  803.           exit(0)
  804.          
  805.          
  806. def automated():
  807.     try:
  808.         opts, args = getopt.getopt(sys.argv[1:], "hvu", ["help", "version","update"])
  809.     except getopt.GetoptError, err:
  810.        
  811.         print str(err)
  812.         sys.exit(2)
  813.  
  814.     for o, a in opts:
  815.    
  816.         if o in("-v","--version"):
  817.         print(" \nBT5UP  Version: " +  str(get_version()) + "\n Author: Bl4ck5w4n (coded in Python)")
  818.         print(" Feedback/Bugs: bl4ck5w4n5@gmail.com || http://bl4ck5w4n.tk\n")
  819.         elif o in ("-h", "--help"):
  820.             print("\n ================OPTIONS================")
  821.             print(" -v --version        VERSION")
  822.             print(" -u --update         Update All\n")
  823.             sys.exit()
  824.         elif o in ("-u", "--update"):
  825.         wr=raw_input("\033[1;31m [>]\033[1;m Wireshark takes time to compile do you wish to wait [y/N]:")
  826.         if(wr=="y"):
  827.           wireshark()
  828.         backtrack_update()
  829.         exploit_db()
  830.         Set()
  831.         warvox()
  832.         aircrack()
  833.         giskismet()
  834.         msf()
  835.         sslstrip()
  836.         nessus()
  837.         w3af()
  838.         nikto()
  839.         sqlmap()
  840.         fimap()
  841.         pyrit()
  842.         openvas()
  843.         update_aptfast()
  844.         os.system("clear")
  845.         print("\033[1;31m [>]\033[1;m Thanks for using bt5up dont forget to visit: http://bl4ck5w4n.tk\n")
  846.  
  847.  
  848. if __name__=="__main__":
  849.  
  850.   if (len(sys.argv) > 1):
  851.     automated()
  852.   else:
  853.     main()