3.6 KiB
Overwriting a freed chunk
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.
Several of the proposed heap exploitation techniques need to be able to overwrite pointers inside freed chunks. The goal of this page is to summarise the potential vulnerabilities that could grant this access:
Simple Use After Free
If it's possible for the attacker to write info in a free chunk, he could abuse this to overwrite the needed pointers.
Double Free
If the attacker can free
two times the same chunk (free other chunks in between potentially) and make it be 2 times in the same bin, it would be possible for the user to allocate the chunk later, write the needed pointers and then allocate it again triggering the actions of the chunk being allocated (e.g. fast bin attack, tcache attack...)
Heap Overflow
It might be possible to overflow an allocated chunk having next a freed chunk and modify some headers/pointers of it.
Off by 1 Overflow
In this case it would be possible to modify the size of the following chunk in memory. An attacker could abuse this to make an allocated chunk have a bigger size, then free
it, making the chunk been added to a bin of a different size (bigger), then allocate the fake size, and the attack will have access to a chunk with a size which is bigger than it really is, granting therefore a heap overflow (check previous section).
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.