Last active
October 12, 2016 02:30
-
-
Save quandqn/9da59fd2590cea533c07aea145898b3d to your computer and use it in GitHub Desktop.
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
import socket | |
import sys | |
HOST = '52.198.217.117' | |
PORT = 6666 | |
p = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
p.connect((HOST, PORT)) | |
evil = [] | |
for i in xrange(2**21): | |
if list(bin(i)).count("1") % 2 == 0: | |
evil.append(i) | |
p.connect((HOST, PORT)) | |
data = "" | |
while "hitcon" not in data: | |
try: | |
data = p.recv(1024) | |
data = data.replace("\n", "") | |
k, n = int(data.split(" ")[0]), int(data.split(" ")[0]) | |
k, n = min(k, n), max(k, n) | |
a = [] | |
for i in range(- (2**n), (2**n)): | |
a.append(i) | |
s = "" | |
for i in range(len(a)/2): | |
s+= str(a[evil[i]]) + " " | |
p.send(s + "\n") | |
except: | |
print data | |
sys.exit(0) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment