Leaking Address
Leaking addresses can be helpful when trying to identify the canary, figuring out the base of pie
The ability to leak addresses comes from vulnerablities like overwriting null bytes at the end of strings, and mainly format string vulnerabilities
Overwriting null bytes example:
In this example, since read
is taking in 0x20
bytes and the char it is being read to is also 0x20
bytes, then the null byte \x00
at the end of buf1 will be overwritten and print the contents of flag
This vulnerability could potentially lead to leaks of other important variables and memory addresses, leading to compromise of the entire binary or even system by spawning a shell
Format string example:
In this example, the input taken in can be printed out in any format specified by the user, which the user can use to leak memory address of important parts of memory, like the stack canary, other address.
Receiving the address nicely in pwntools
If the base of PIE was leaked then we can set the binary's base address so offsets to functions and variables in memory can be used instead of recalculating every time
Last updated