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.     wr=raw_input("\033[1;31m [>]\033[1;m Wireshark takes time to compile do you wish to wait [y/N]:")
  305.     if(wr=="y"):
  306.  
  307.       print("\033[1;31m [>]\033[1;m Updating Wireshark, please wait.")
  308.       time.sleep(tsleep)
  309.    
  310.       os.system("apt-get install autoconf libgtk2.0-dev libglib2.0-dev libgeoip-dev libpcre3-dev libpcap0.8-dev libtool byacc flex -y")
  311.      
  312.       if (os.system("cd /tmp && svn co http://anonsvn.wireshark.org/wireshark/trunk/ wireshark")==0):
  313.     print("\033[1;31m [>]\033[1;m Files downloaded successfully! Now the painful part... Be patient")
  314.     time.sleep(tsleep)
  315.      
  316.     os.system("cd /tmp/wireshark && ./autogen.sh")
  317.     os.system("cd /tmp/wireshark && ./configure")
  318.     os.system("cd /tmp/wireshark && make")
  319.     if (os.system("cd /tmp/wireshark && make install")==0):
  320.         os.system("ldconfig")
  321.         os.system("rm -Rf /tmp/wireshark")
  322.         if (os.path.isfile('/usr/local/share/wireshark/init.lua')):
  323.           print("\033[1;31m [>]\033[1;m Changeging init.lua file..")
  324.           time.sleep(tsleep)
  325.        
  326.           for lines in fileinput.FileInput("/usr/local/share/wireshark/init.lua", inplace=1):
  327.             lines = lines.replace("disable_lua = false","disable_lua = true")
  328.      
  329.         print("\033[1;31m [>]\033[1;m Wireshark installed successfully!")
  330.         time.sleep(tsleep)
  331.       else:
  332.         print("\033[1;31m [>]\033[1;m Wireshark failed to install!")
  333.         time.sleep(tsleep)
  334.  
  335. def update():
  336.     print("\033[1;31m [>]\033[1;m Updating bt5update script.")
  337.    
  338.     os.system("cd /tmp && wget http://bl4ck5w4n.tk/wp-content/uploads/2011/07/bt5up.tar -c -q")
  339.    
  340.     if os.path.isfile("/tmp/bt5up.tar"):
  341.         os.system("tar -xvf /tmp/bt5up.tar -C /tmp/ > /dev/null")
  342.        
  343.     curfile = inspect.getfile(inspect.currentframe())
  344.    
  345.     pwd = os.getcwd() + str(curfile)
  346.    
  347.     os.system("rm -Rf " + pwd)
  348.     os.system("mv /tmp/bt5up.py " + str(curfile))
  349.     os.system("chmod +x " + str(curfile))
  350.    
  351.    
  352.     print("\033[1;31m [>]\033[1;m Update successfully! bt5up will restart, please wait...")
  353.     time.sleep(tsleep)
  354.     python = sys.executable
  355.     os.execl(python, python, * sys.argv)
  356.  
  357.  
  358.  
  359. def bugs_fixs():  
  360.     header()
  361.     print("         Section: Fix BT5 Bugs/Customize BT5")
  362.    
  363.         print("\033[1;31m [>]\033[1;m 1. Startx after login.")
  364.         print("\033[1;31m [>]\033[1;m 2. Change Login message.")
  365.         print("\033[1;31m [>]\033[1;m 3. Install Flash Player 64Bits.")
  366.         print("\033[1;31m [>]\033[1;m 4. Back.")
  367.         bugs = raw_input("\033[1;31m [>]\033[1;m Enter your choice: ")
  368.        
  369.         if(bugs=="1"):
  370.         startx()
  371.         bugs_fixs()
  372.     if(bugs=="2"):
  373.         login_msg()
  374.         bugs_fixs()
  375.     if(bugs=="3"):
  376.         flashplayer()
  377.         bugs_fixs()    
  378.     if(bugs=="4"):
  379.         main()
  380.  
  381.  
  382.  
  383. def startx():
  384.     print("\033[1;31m [>]\033[1;m Make startx as default...")
  385.     os.system('echo \'if [ -z "$DISPLAY" ] && [ $(tty) == /dev/tty1 ];\n then \nstartx \nfi\' >> /root/.bash_profile')
  386.     print("\033[1;31m [>]\033[1;m Done. Next time you reboot startx will start...")
  387.     time.sleep(tsleep)
  388.    
  389. def login_msg():
  390.     print("\033[1;31m [>]\033[1;m Edit the login message using nano")
  391.     time.sleep(tsleep)
  392.     os.system("nano /etc/update-motd.d/10-help-text")
  393.     os.system("sh /etc/update-motd.d/10-help-text")
  394.     print("\033[1;31m [>]\033[1;m Next time you boot your message will be like that")
  395.     time.sleep(tsleep)
  396.     os.system("nano /etc/update-motd.d/10-help-text")
  397.     os.system("sh /etc/update-motd.d/10-help-text")
  398.     print("\033[1;31m [>]\033[1;m Next time you boot your message will be like that")
  399.     time.sleep(tsleep)
  400.    
  401. def flashplayer():
  402.     print("\n\033[1;31m [>]\033[1;m Installing FlashPlayer 64Bits")
  403.     print("\033[1;31m [>]\033[1;m This will close your FireFox...")
  404.     time.sleep(tsleep)
  405.     os.system("killall -9 firefox-bin")
  406.     if(os.system("cd / && wget -c http://fpdownload.macromedia.com/get/flashplayer/current/install_flash_player_10_linux.tar.gz")==0):
  407.     os.system("cd / && tar -xvf  install_flash_player_10_linux.tar.gz")
  408.     os.system("mkdir -p ~/.mozilla/plugins")
  409.     os.system("cd / && mv libflashplayer.so ~/.mozilla/plugins/")
  410.     os.system("cd / && rm -Rf install_flash_player_10_linux.tar.gz")
  411.     print("\033[1;31m [>]\033[1;m FlashPlayer 64Bits installed successfully!")
  412.     time.sleep(tsleep)
  413.     else:  
  414.     print("\033[1;31m [>]\033[1;m Failed to install FlashPlayer 64Bits")
  415.     time.sleep(tsleep)
  416.  
  417.  
  418. def latest_version():
  419.     i=0
  420.     lversion = 0
  421.     os.system("cd /tmp && wget http://bl4ck5w4n.tk/wp-content/uploads/2011/07/version.txt -c -q")
  422.     if os.path.isfile("/tmp/version.txt"):
  423.         ofile=open("/tmp/version.txt","r")
  424.         lversion=ofile.readline()
  425.  
  426.     return lversion;
  427.  
  428. def clean_exit():
  429.       print("\033[1;31m [>]\033[1;m Cleaning temporary files and leaving...")
  430.       if os.path.isfile("/tmp/version.txt"):
  431.     os.system("rm /tmp/version.txt")
  432.       if os.path.isfile("/tmp/bt5up.tar"):
  433.     os.system("rm /tmp/bt5up.tar")
  434.       if os.path.isfile("/tmp/bt5up.py"):
  435.     os.system("rm /tmp/bt5up.py")
  436.       print("\033[1;31m [>]\033[1;m Thanks for using bt5up dont forget to visit: http://bl4ck5w4n.tk")
  437.       print("\033[1;31m [>]\033[1;m For automated updates you can use bt5up -u\n")
  438.      
  439. def header():
  440.     os.system("clear")
  441.     print('\033[1;31m                                        ,   ,')
  442.     print('                                        $,  $,     ,')
  443.     print('                                        "ss.$ss. .s')
  444.     print('                                ,     .ss$$$$$$$$$$s,')
  445.     print('                                $. s$$$$$$$$$$$$$$`$$Ss')
  446.     print('                                "$$$$$$$$$$$$$$$$$$o$$$       ,')
  447.     print('                               s$$$$$$$$$$$$$$$$$$$$$$$$s,  ,s')
  448.     print('                              s$$$$$$$$$"$$$$$$""""$$$$$$"$$$$$,')
  449.     print('                              s$$$$$$$$$$s""$$$$ssssss"$$$$$$$$"')
  450.     print('                             s$$$$$$$$$$         `"""ss"$"$s""')
  451.     print('                             s$$$$$$$$$$,              `"""""$  ')
  452.     print('                             s$$$$$$$$$$$$s,... ')
  453.  
  454.         print("------------------------------------------------------------------------------\033[1;m")
  455.     print("\033[1;37m                    [Back||Track 5 R1 Update]\033[1;m")
  456.         print("     Author: Bl4ck5w4n")
  457.         print("     Feedback/Bugs : bl4ck5w4n5@gmail.com || http://bl4ck5w4n.tk")
  458.         if (float(get_version()) < float(latest_version())):
  459.       print("   Installed Version: \033[1;31m" + str(get_version()) + "\033[1;m Latest Version:\033[1;37m" + str(latest_version()) +"\033[1;m")
  460.     else:
  461.       print("   Installed Version: \033[1;32m" + str(get_version()) + "\033[1;m Latest Version:\033[1;37m" + str(latest_version()) +"\033[1;m")
  462.    
  463.     print("\033[1;31m------------------------------------------------------------------------------\033[1;m")
  464.    
  465. def changelog():
  466.     os.system("cd /tmp && wget http://bl4ck5w4n.tk/wp-content/uploads/2011/07/changelog.txt -o /dev/null")
  467.     os.system("less /tmp/changelog.txt")
  468.     os.remove("/tmp/changelog.txt")
  469.  
  470.    
  471. def gmail():
  472.  
  473.     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")
  474.     gmailLogin = raw_input('\033[1;31m [>]\033[1;m Your GMail login (eg. someone@gmail.com): ')
  475.     gmailPass = raw_input('\033[1;31m [>]\033[1;m Your GMail Password: ')
  476.  
  477.     if (gmailLogin!="" or gmailPass != ""):
  478.       msg = raw_input('\033[1;31m [>]\033[1;m Your Message: ')
  479.       msg = MIMEText(msg)
  480.       msg['Subject'] = "BT5UP " +str(get_version()) +" FeedBack"
  481.       msg['From'] = gmailLogin
  482.       msg['To'] = "bl4ck5w4n5@gmail.com"
  483.  
  484.       server = smtplib.SMTP('smtp.gmail.com',587)
  485.       server.ehlo()
  486.       server.starttls()
  487.       server.ehlo()
  488.       server.login(gmailLogin,gmailPass)
  489.       server.sendmail(gmailLogin, "bl4ck5w4n5@gmail.com", msg.as_string())
  490.       server.close()
  491.       print("\033[1;31m [>]\033[1;m Thank you for your time...")
  492.       time.sleep(tsleep)
  493.  
  494.  
  495. def menu_exploit():
  496.  
  497.     header()
  498.     print("         Section: EXPLOIT TOOLS")
  499.    
  500.         print("\033[1;31m [>]\033[1;m 1. Metasploit Framework.")
  501.         print("\033[1;31m [>]\033[1;m 2. Exploit-db.")
  502.         print("\033[1;31m [>]\033[1;m 3. SET - Social Engineering Toolkit.")
  503.     print("\033[1;31m [>]\033[1;m 4. Update all.")
  504.         print("\033[1;31m [>]\033[1;m 5. Back.")
  505.        
  506.        
  507.     ex_var = raw_input("\033[1;31m [>]\033[1;m Enter your choice: ")
  508.  
  509.  
  510.     if(ex_var=="1"):
  511.          msf()
  512.          
  513.          menu_exploit()
  514.     if(ex_var=="2"):
  515.          exploit_db()
  516.          
  517.          menu_exploit()
  518.     if(ex_var=="3"):
  519.          Set()
  520.          
  521.          menu_exploit()
  522.     if(ex_var=="4"):
  523.           msf()
  524.           exploit_db()
  525.           Set()
  526.          
  527.           menu_exploit()
  528.     if(ex_var=="1"):
  529.           main()
  530.    
  531.    
  532.  
  533.  
  534. def menu_wireless():
  535.  
  536.     header()
  537.  
  538.         print("                        Section: WIRELESS & TELEPHONY")
  539.        
  540.         print("\033[1;31m [>]\033[1;m 1. Aircrack-ng and Airdrop.")
  541.         print("\033[1;31m [>]\033[1;m 2. WarVox.")
  542.         print("\033[1;31m [>]\033[1;m 3. Giskismet.")
  543.         print("\033[1;31m [>]\033[1;m 4. Update all.")
  544.         print("\033[1;31m [>]\033[1;m 5. Back.")
  545.        
  546.         w_var = raw_input("\033[1;31m [>]\033[1;m Enter your choice: ")
  547.    
  548.     if(w_var=="1"):
  549.          aircrack()
  550.          
  551.          menu_wireless()
  552.     if(w_var=="2"):  
  553.          warvox()
  554.          
  555.          menu_wireless()
  556.     if(w_var=="3"):
  557.         giskismet()
  558.        
  559.         menu_wireless()
  560.  
  561.     if(w_var=="4"):
  562.         aircrack()
  563.         warvox()
  564.         giskismet()
  565.        
  566.         menu_wireless()
  567.     if(w_var=="5"):
  568.         main()
  569.          
  570.    
  571.  
  572. def menu_web_db():
  573.         header()
  574.         print("                        Section: WEB & DATABASE")
  575.        
  576.         print("\033[1;31m [>]\033[1;m 1. W3AF.")
  577.         print("\033[1;31m [>]\033[1;m 2. Nikto.")
  578.         print("\033[1;31m [>]\033[1;m 3. Sqlmap.")
  579.     print("\033[1;31m [>]\033[1;m 4. Fimap.")
  580.         print("\033[1;31m [>]\033[1;m 5. Update all.")
  581.         print("\033[1;31m [>]\033[1;m 6. Back.")
  582.        
  583.        
  584.         wd_war=raw_input("\033[1;31m [>]\033[1;m Enter your choice: ")
  585.        
  586.         if(wd_war=="1"):
  587.       w3af()
  588.      
  589.       menu_web_db()
  590.     if(wd_war=="2"):
  591.           nikto()
  592.          
  593.           menu_web_db()
  594.     if(wd_war=="3"):
  595.           sqlmap()
  596.                 wr=raw_input("\033[1;31m [>]\033[1;m Wireshark takes time to compile do you wish to wait [y/N]:")
  597.         if(wr=="y"):
  598.           menu_web_db()
  599.     if(wd_war=="4"):
  600.           fimap()
  601.          
  602.           menu_web_db()
  603.     if(wd_war=="5"):
  604.           w3af()
  605.           nikto()
  606.           sqlmap()
  607.           fimap()
  608.          
  609.           menu_web_db()
  610.     if(wd_war=="6"):
  611.          
  612.           main()
  613.          
  614.          
  615.  
  616. def update_aptfast():
  617.     print("\033[1;31m [>]\033[1;m Updating apt-fast, please wait.")
  618.     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):
  619.     os.system("mv apt-fast.sh /usr/bin/apt-fast")
  620.     os.system("chmod +x /usr/bin/apt-fast")
  621.     print("\033[1;31m [>]\033[1;m Updating apt-fast successfully")
  622.     else:
  623.     print("\033[1;31m [>]\033[1;m Failed to update apt-fast")
  624.    
  625. def aptfast():
  626.     print("\033[1;31m [>]\033[1;m Checking to see if Axel is installed.")
  627.     time.sleep(tsleep)
  628.    
  629.     if(os.system("axel > /dev/null") == 0):
  630.         print("\033[1;31m [>]\033[1;m Axel is installed!")
  631.         time.sleep(tsleep)
  632.    
  633.     else:
  634.         print("\033[1;31m [>]\033[1;m Installing Axel, please wait.")
  635.         os.system("apt-get install axel")
  636.        
  637.     print("\033[1;31m [>]\033[1;m Checking to see if apt-fast is installed.")
  638.     time.sleep(tsleep)
  639.    
  640.     if(os.system("apt-fast > /dev/null") == 0):
  641.         print("\033[1;31m [>]\033[1;m apt-fast is installed!")
  642.         time.sleep(tsleep)
  643.    
  644.     else:
  645.         print("\033[1;31m [>]\033[1;m Installing apt-fast, please wait.")
  646.         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")
  647.         os.system("mv apt-fast.sh /usr/bin/apt-fast")
  648.         os.system("chmod +x /usr/bin/apt-fast")
  649.         choice=raw_input("Would you like to use apt-fast instead of apt-get?[y/n]")
  650.         if (choice =="y"):
  651.           os.system("echo  alias apt-get='apt-fast' >> /root/.bashrc")
  652.    
  653.  
  654.  
  655. def menu_other():
  656.     header()
  657.         print("                        Section: OTHER")
  658.     print("\033[1;31m [>]\033[1;m 1. Nessus.")
  659.     print("\033[1;31m [>]\033[1;m 2. Pyrit.")
  660.     print("\033[1;31m [>]\033[1;m 3. Wireshark.")
  661.     print("\033[1;31m [>]\033[1;m 4. OpenVAS.")
  662.     print("\033[1;31m [>]\033[1;m 5. SSLStrip.")
  663.     print("\033[1;31m [>]\033[1;m 6. Update all.")
  664.     print("\033[1;31m [>]\033[1;m 7. Back.")
  665.    
  666.     c_var = raw_input("\033[1;31m [>]\033[1;m Enter your choice: ")
  667.  
  668.    
  669.     if(c_var=="1"):
  670.          nessus()
  671.          menu_other()
  672.  
  673.     if(c_var=="2"):
  674.         pyrit()
  675.         menu_other()
  676.    
  677.     if(c_var=="3"):
  678.         wireshark()
  679.         menu_other()
  680.     if(c_var=="4"):
  681.         openvas()
  682.         menu_other()
  683.     if(c_var=="5"):
  684.         sslstrip()
  685.         menu_other()
  686.     if(c_var=="6"):
  687.         wireshark()
  688.         nessus()
  689.         pyrit()
  690.         update_aptfast()
  691.         openvas()
  692.         sslstrip()
  693.         menu_other()
  694.     if(c_var=="7"):
  695.         main() 
  696.    
  697. def additional_tools():
  698.     header()
  699.     print("                        Section: Additional Tools")
  700.     print("\033[1;31m [>]\033[1;m 1. Axel & apt-fast.")
  701.     print("\033[1;31m [>]\033[1;m 2. Nessus.")
  702.     print("\033[1;31m [>]\033[1;m 3. FeedingBottle.")
  703.     print("\033[1;31m [>]\033[1;m 4. HexorBase.")
  704.     print("\033[1;31m [>]\033[1;m 5. Install All.")
  705.     print("\033[1;31m [>]\033[1;m 6. Back.")
  706.     choice_var=raw_input("\033[1;31m [>]\033[1;m Enter your choice: ")
  707.     if(choice_var=="1"):
  708.         aptfast()
  709.         additional_tools()()
  710.     if(choice_var=="2"):
  711.         install_nessus()
  712.         additional_tools()
  713.     if(choice_var=="3"):
  714.         feedingbottle()
  715.         additional_tools()  
  716.     if(choice_var=="4"):
  717.         hexorbase()
  718.         additional_tools()
  719.     if(choice_var=="5"):
  720.         aptfast()
  721.         install_nessus()
  722.         feedingbottle()
  723.         hexorbase()
  724.         additional_tools()
  725.     if(choice_var=="6"):
  726.         main()
  727.        
  728.      
  729.    
  730. def main():
  731.     header()
  732.     print("                        Section: MAIN")
  733.     print("\033[1;31m [>]\033[1;m 1. Update and clean Backtrack.")
  734.     print("\033[1;31m [>]\033[1;m 2. Exploit tools.")
  735.     print("\033[1;31m [>]\033[1;m 3. Wireless & Telephony.")
  736.     print("\033[1;31m [>]\033[1;m 4. Web & Database.")
  737.     print("\033[1;31m [>]\033[1;m 5. Others.")
  738.     print("\033[1;31m [>]\033[1;m 6. Update all.")
  739.     print("\033[1;31m [>]\033[1;m 7. Update script.")
  740.     print("\033[1;31m [>]\033[1;m 8. Changelog.")
  741.     print("\033[1;31m [>]\033[1;m 9. Feedback (GMail).")
  742.     print("\033[1;31m [>]\033[1;m 10. Fix BT5 Bugs/Customize BT5.")
  743.     print("\033[1;31m [>]\033[1;m 11. Additional Tools")
  744.         print("\033[1;31m [>]\033[1;m 12. Exit.")
  745.    
  746.    
  747.     choice_var=raw_input("\033[1;31m [>]\033[1;m Enter your choice: ")
  748.    
  749.     if(choice_var=="1"):
  750.          backtrack_update()
  751.          
  752.          main()
  753.     if(choice_var=="2"):
  754.          menu_exploit()
  755.          
  756.          main()
  757.     if(choice_var=="3"):
  758.          menu_wireless()
  759.          
  760.          main()
  761.     if(choice_var=="4"):
  762.          menu_web_db()  
  763.          
  764.          main()
  765.     if(choice_var=="5"):
  766.          menu_other()
  767.          
  768.          main()
  769.     if(choice_var=="6"):
  770.         wireshark()
  771.         backtrack_update()
  772.         exploit_db()
  773.         Set()
  774.         warvox()
  775.         aircrack()
  776.         giskismet()
  777.         msf()
  778.         sslstrip()
  779.         nessus()
  780.         w3af()
  781.         nikto()
  782.         sqlmap()
  783.         fimap()
  784.         pyrit()
  785.         update_aptfast()
  786.         openvas()
  787.         main()
  788.     if(choice_var=="7"):   
  789.          update()
  790.     if(choice_var=="8"):
  791.          changelog()
  792.          
  793.          main()
  794.     if(choice_var=="9"):
  795.          gmail()
  796.          main()
  797.     if(choice_var=="10"):
  798.           bugs_fixs()
  799.           main()
  800.     if(choice_var=="11"):
  801.           additional_tools()
  802.           main()
  803.     if(choice_var=="12"):
  804.           clean_exit()
  805.           exit(0)
  806.          
  807.          
  808. def automated():
  809.     try:
  810.         opts, args = getopt.getopt(sys.argv[1:], "hvu", ["help", "version","update"])
  811.     except getopt.GetoptError, err:
  812.        
  813.         print str(err)
  814.         sys.exit(2)
  815.  
  816.     for o, a in opts:
  817.    
  818.         if o in("-v","--version"):
  819.         print(" \nBT5UP  Version: " +  str(get_version()) + "\n Author: Bl4ck5w4n (coded in Python)")
  820.         print(" Feedback/Bugs: bl4ck5w4n5@gmail.com || http://bl4ck5w4n.tk\n")
  821.         elif o in ("-h", "--help"):
  822.             print("\n ================OPTIONS================")
  823.             print(" -v --version        VERSION")
  824.             print(" -u --update         Update All\n")
  825.             sys.exit()
  826.         elif o in ("-u", "--update"):
  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()