CTF
SECUINSIDE 2017 - babyheap
Eyebrowmoon
2017. 7. 2. 21:37
team member를 음수로 넣을 수 있는데, 이를 이용하면 realloc(buf, 0)을 호출하여 버퍼를 free시킬 수 있다.
바이너리에서 이 경우를 따로 처리해주지 않기 때문에 이를 이용한 uaf를 통해 member pointer가 free_hook을 가리키도록 하여 수정할 수 있다.
libc leak은 그냥 unsorted bin - 0x10 leak 나는걸로 해결
https://github.com/Eyebrowmoon/ctf/blob/master/secuinside2017/babyheap/solver.py