mirror of
https://github.com/carlospolop/hacktricks
synced 2024-11-22 20:53:37 +00:00
3.2 KiB
3.2 KiB
AW2Exec - __malloc_hook
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.
Malloc Hook
As you can Official GNU site, the variable __malloc_hook
is a pointer pointing to the address of a function that will be called whenever malloc()
is called stored in the data section of the libc library. Therefore, if this address is overwritten with a One Gadget for example and malloc
is called, the One Gadget will be called.
To call malloc it's possible to wait for the program to call it or by calling printf("%10000$c")
which allocates too bytes many making libc
calling malloc to allocate them in the heap.
More info about One Gadget in:
{% content-ref url="../one-gadget.md" %} one-gadget.md {% endcontent-ref %}
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.