Skip to content

Instantly share code, notes, and snippets.

@inaz2
Last active September 30, 2016 05:01
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 inaz2/f397b63375ac58af6b47aa3479e6e574 to your computer and use it in GitHub Desktop.
Save inaz2/f397b63375ac58af6b47aa3479e6e574 to your computer and use it in GitHub Desktop.
# time python solve.py
'_\x96\x1es\xdd\xfc\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
real 0m4.301s
user 0m3.588s
sys 0m0.688s
# useradd -m crackme
# echo THIS_IS_FLAG > /home/crackme/key
# ./crackme &
# echo -e '_\x96\x1es\xdd\xfc\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' | nc localhost 54321
Enter registration code: Thank you, valued customer!
Your key is: THIS_IS_FLAG
import angr
p = angr.Project('./crackme', load_options={'auto_load_libs': False})
s = p.factory.blank_state(addr=0x8048ef6)
initial_path = p.factory.path(s)
pg = p.factory.path_group(initial_path)
e = pg.explore(find=0x8048f88, avoid=0x804900b)
if len(e.found) > 0:
s = e.found[0].state
print "%r" % s.se.any_str(s.memory.load(s.regs.bp-0x20c, 0x10))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment