Skip to content

Instantly share code, notes, and snippets.

@andreif
Last active September 6, 2022 12:31
Show Gist options
  • Select an option

  • Save andreif/02e0778e7a6d9775f8e175ba16feb309 to your computer and use it in GitHub Desktop.

Select an option

Save andreif/02e0778e7a6d9775f8e175ba16feb309 to your computer and use it in GitHub Desktop.
"""
0000 | 00 00 00 00 00 00 00 00 4A 96 70 27 C4 7A E5 51
0010 | 14 00 00 00 78 97 46 60 3E 05 49 82 8C CA 27 E9
0020 | 66 B3 01 A4 8F EC E2 FC
"""
import re
msg = re.sub('\d{4} \| ', '', __doc__)
msg = re.sub('\s+', '', msg)
msg = bytes.fromhex(msg)
import struct
import zlib
counter = 0
msg = struct.pack('<ii', len(msg) + 12, counter) + msg
msg += struct.pack('<I', zlib.crc32(msg))
import socket
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(('149.154.167.40', 443))
s.send(msg)
print(s.recv(1024))
s.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment