Search K
Appearance
Appearance
Other ways to support HackTricks:
A binary compiled as PIE, or Position Independent Executable, means the program can load at different memory locations each time it's executed, preventing hardcoded addresses.
The trick to exploit these binaries lies in exploiting the relative addressesโthe offsets between parts of the program remain the same even if the absolute locations change. To bypass PIE, you only need to leak one address, typically from the stack using vulnerabilities like format string attacks. Once you have an address, you can calculate others by their fixed offsets.
A helpful hint in exploiting PIE binaries is that their base address typically ends in 000 due to memory pages being the units of randomization, sized at 0x1000 bytes. This alignment can be a critical check if an exploit isn't working as expected, indicating whether the correct base address has been identified.
Or you can use this for your exploit, if you leak that an address is located at 0x649e1024
you know that the base address is 0x649e1000
and from the you can just calculate offsets of functions and locations.
In order to bypass PIE it's needed to leak some address of the loaded binary, there are some options for this:
Other ways to support HackTricks: