Skip to content

Instantly share code, notes, and snippets.

@ssadler
Created June 21, 2020 04:20
Show Gist options
  • Save ssadler/aef35f0cbe79a38e08b59e8aa8443cc8 to your computer and use it in GitHub Desktop.
Save ssadler/aef35f0cbe79a38e08b59e8aa8443cc8 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python3
import binascii
import gevent
import struct
from gevent import socket
def init_peer(peer, port):
sends = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sends.connect(peer)
sends.sendall(b'\0' + struct.pack('>H', port))
while True:
sends.sendall(binascii.unhexlify(b'000000000000000000000000000000000000000000'))
PEER = ('127.0.0.1', 40440)
if __name__ == '__main__':
threads = []
threads.append(gevent.spawn(init_peer, PEER, 8888))
gevent.joinall(threads)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment