Advertisement
Guest User

ecb_solve

a guest
Jul 21st, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.77 KB | None | 0 0
  1. #!/usr/bin/env python2.7
  2. import socket
  3. import string
  4. import time
  5. host = "25d.ninja"
  6. port = 2004
  7. s =  socket.socket(socket.AF_INET, socket.SOCK_STREAM)
  8. s.connect((host, port))
  9. data = s.recv(4096)
  10. attempt = "}"
  11. charMAP = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJLKMNOPQRSTUVWXYZ0123456789!@#$%^&*()_+-=,./<>?|[];{}'
  12. padCHAR = "00000000000000000"
  13. print(data)
  14. response = ""
  15. found_chars = ""
  16. while "25D{" not in found_chars:
  17.     for x in charMAP:
  18.         print("trying " + str(x) + str(found_chars) + str(padCHAR))
  19.         s.sendall(str(x) + found_chars + str(padCHAR))
  20.         data = s.recv(2048)
  21.         response = data.strip().split(" ")[1]
  22.         if response[:32] == response[-32:]:
  23.             found_chars = str(x) + found_chars
  24.             break
  25. print(found_chars)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement