return fake
The House of Einherjar
The House of Einherjar
2017.08.16The House of Einherjarhttps://github.com/umbum/pwn/blob/master/how2heap/house_of_einherjar.c off-by-one(null) + Force 응용( huge consolidate ) + unlink check 회피.fake chunk까지 consolidate 하고 다시 ``c malloc()``하면 fake chunk가 반환되는 식. off-by-one(null)```cvictim->size's LSB = 0x00```Poison null byte와 같은 off-by-one overflow를 이용해 size LSB를 ``c 0x00``으로 만들지만, 차이가 있다.Poision null byte``c free(victim)`` 이후 of..
The House of Lore
The House of Lore
2017.08.15The House of Lorefree'd small/fast chunk의 bk를 `` fake_chunk`` addr로 overwrite. https://github.com/umbum/pwn/blob/master/how2heap/house_of_lore_fast.chttps://github.com/umbum/pwn/blob/master/how2heap/house_of_lore_small.c fastbin도 결국 large request가 들어오면 smallbin으로 옮겨지기 때문에 이 경우 small과 똑같이 동작한다.``c mov_to_small=malloc(large)``를 호출하지 않으면 차이가 발생한다. ( limitation #2 ) smallbins bk check & unlink```c e..
fastbin attack / fastbin_dup
fastbin attack / fastbin_dup
2017.08.15fastbin attackfree'd fast chunk의 fd를 `` fake_chunk`` addr로 overwrite.다음 ``c malloc(fast)`` 때 overwrited fast chunk가 반환되면서 fastbin에 `` fake_chunk`` addr이 추가되므로, 그 다음 반환 chunk는 `` fake_chunk``. ```cfake_chunk[1] = FAST; // bypass check hptr = malloc(FAST);victim = malloc(FAST);free(victim);strcpy(hptr, argv[1]); // vulnerability ( overflow, uaf, overlap, fastbin_dup... ) victim = malloc(FAST); // ..
The House of Spirit
The House of Spirit
2017.08.15The House of Spiritstack overflow로 stack에 있는 포인터 변수 hptr을 `` fake_chunk`` addr로 overwrite.이후 ``c free(hptr)``하면 fastbin에는 ``c fake_chunk`` addr이 추가되므로, 그 다음 반환 chunk는 `` fake_chunk`` ```c/* set fake_chunk */fake_chunk[1] = arbitrary_size;/* set next chunk size */... void *hptr = malloc(SIZE);char buf[4];strcpy(buf, argv[1]); // stack overflow free(hptr) // fake chunk is added in fastbinfake = ma..