De Bruijn Sequences
"Calculating" offset
Last updated
Invalid $SP address: 0x61616166
[------------------------------------------------------------------------------]
Legend: code, data, rodata, value
Stopped reason: SIGSEGV
0x56556302 in main ()
gdb-peda$$ pwn cyclic -l aaam
45gdb-peda$ pattern search $eip
Registers contain pattern buffer:
EBX+0 found at offset: 20
ESI+0 found at offset: 24
EIP+0 found at offset: 28
Registers point to pattern buffer:
[EDX] --> offset 0 - size ~70
[ESP] --> offset 32 - size ~38
[EBP] --> offset 40 - size ~30from pwn import *
# Connect to the target program
p = process("./chall")
# Send the payload containing cyclic data
payload = cyclic(1024)
p.sendline(payload)
# Print the crash message
print(p.recvall())
# Get the offset to the saved EIP
offset = cyclic_find(p.corefile.fault_addr)
log.success("Offset to saved EIP: {}".format(offset))