4.1 KiB
Pointer Redirecting
Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)!
Other ways to support HackTricks:
- If you want to see your company advertised in HackTricks or download HackTricks in PDF Check the SUBSCRIPTION PLANS!
- Get the official PEASS & HackTricks swag
- Discover The PEASS Family, our collection of exclusive NFTs
- Join the 💬 Discord group or the telegram group or follow us on Twitter 🐦 @hacktricks_live.
- Share your hacking tricks by submitting PRs to the HackTricks and HackTricks Cloud github repos.
String pointers
If a function call is going to use an address of a string that is located in the stack, it's possible to abuse the buffer overflow to overwrite this address and put an address to a different string inside the binary.
If for example a system
function call is going to use the address of a string to execute a command, an attacker could place the address of a different string in the stack, export PATH=.:$PATH
and create in the current directory an script with the name of the first letter of the new string as this will be executed by the binary.
You can find an example of this in:
- https://github.com/florianhofhammer/stack-buffer-overflow-internship/blob/master/ASLR%20Smack%20and%20Laugh%20reference%20-%20Tilo%20Mueller/strptr.c
- https://guyinatuxedo.github.io/04-bof_variable/tw17_justdoit/index.html
- 32bit, change address to flags string in the stack so it's printed by
puts
- 32bit, change address to flags string in the stack so it's printed by
Function pointers
Same as string pointer but applying to functions, if the stack contains the address of a function that will be called, it's possible to change it (e.g. to call system
).
You can find an example in:
References
Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)!
Other ways to support HackTricks:
- If you want to see your company advertised in HackTricks or download HackTricks in PDF Check the SUBSCRIPTION PLANS!
- Get the official PEASS & HackTricks swag
- Discover The PEASS Family, our collection of exclusive NFTs
- Join the 💬 Discord group or the telegram group or follow us on Twitter 🐦 @hacktricks_live.
- Share your hacking tricks by submitting PRs to the HackTricks and HackTricks Cloud github repos.