Skip to content

Instantly share code, notes, and snippets.

@yohanes
Created October 26, 2014 11:50
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/d756d49397583a3043cd to your computer and use it in GitHub Desktop.
Save yohanes/d756d49397583a3043cd to your computer and use it in GitHub Desktop.
Daemon 4 .so HITB2014
import socket
import sys
import time
def recv_until(st):
ret = ""
while st not in ret:
ret += s.recv(8192)
return ret
s = socket.create_connection(("localhost", 56789))
print recv_until("access:")
s.send("12345678901")
print "recv"
time.sleep(0.1)
f = s.recv(8192)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment