how2heap专题

how2heap-2.23-12-house_of_spirit

house_of_spirit 注意事项 house_of_spirit:将一个地址伪造成符合fast bin大小的chunk,将其释放进fastbin中,同时伪造其中的fd指针,达到任意地址分配 伪造的chunk的大小,为什么是fast bin大小范围内的chunk? 如果伪造的地址是在堆中,伪造成任何大小都没有关系;但是对于大于get_max_fast的chunk,在_int_free函

how2heap-2.23-15-house_of_einherjar

在学习完 how2heap-2.23-07-unsafe_unlink 再学习 how2heap-2.23-11-poison_null_byte时,想着在被poison_null_byte的chunk上方进行布局利用,当时想到的利用方式原来就是这个house_of_einherjar 在how2heap 的例子中,是将要合并的伪造chunk布置到栈上,并布局chunk,使合并后的伪造chunk

how2heap-2.23-11-poison_null_byte

什么是poison_null_byte 当然不止这一种,下面最简单的形式 #include <malloc.h>int main(){char * a = malloc(0x200);char * b = malloc(0x200);size_t real_size = malloc_usable_size(a);a[real_size] = 0;return 0;} 影响: ch

how2heap-2.23-06-unsorted_bin_into_stack

#include <stdio.h>#include <stdlib.h>#include <stdint.h>#include <string.h>// 从 unsorted bin 的 bk 去找合适的void jackpot(){ fprintf(stderr, "Nice jump d00d\n"); exit(0); }int main() {intptr_t stack_buf

how2heap-2.23-03-fastbin_dup_consolidate

#include <stdio.h>#include <stdint.h>#include <stdlib.h>#include <string.h>int main() {void* p1 = malloc(0x10);strcpy(p1, "AAAAAAAA");void* p2 = malloc(0x10);strcpy(p2, "BBBBBBBB");fprintf(stderr,