Created
April 18, 2022 19:23
-
-
Save ygorcb/cdd06d75fab332acd9ecce23348162c3 to your computer and use it in GitHub Desktop.
Utility to send binary data represented in hexadecimal over TCP connection
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import socket | |
import sys | |
host, port = sys.argv[1].split(':') | |
s = socket.socket() | |
s.connect((host, int(port))) | |
while True: | |
print('---') | |
s.send(bytes.fromhex(input('>>> '))) | |
print('<<<', bytes.hex(s.recv(1024))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment