SHARE
TWEET

Untitled

a guest Apr 26th, 2019 70 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import socket
  2. import base64
  3.  
  4. prefix = "cccccccc"
  5. pad    = "c" * 15
  6. result = ""
  7. b      = 0
  8.  
  9. while True:
  10.     for by in range(16):
  11.         char = 0
  12.  
  13.         for ch in range(0x20, 0x7f):
  14.             s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
  15.             s.connect(("34.74.132.34", 1337))
  16.  
  17.             payload = prefix + pad + chr(ch) + ("c" * (15 - by))
  18.             print(payload)
  19.             payload = base64.b64encode(bytes(payload, encoding="ascii"))
  20.  
  21.             data = s.recv(2048)
  22.             s.sendall(payload + b"\n")
  23.             data = s.recv(2048)
  24.  
  25.             data = data[20:] # strip off prompts
  26.             data = base64.b64decode(data)
  27.  
  28.             blk0 = data[16:32]
  29.             blk1_off = 16 * (b + 2)
  30.             blk1 = data[blk1_off : blk1_off + 16]
  31.  
  32.             if blk0 == blk1:
  33.                 char = ch
  34.                 break
  35.  
  36.         if char == 0:
  37.             raise "BAD"
  38.  
  39.         pad = pad[1:] + chr(char)
  40.         print(pad)
  41.  
  42.     b += 1
  43.     result += pad
  44.     print(f"  {result}")
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top