Security & Hacking

Heap exploit

zeroone-kr 2025. 3. 8. 16:01

 

익스플로잇 할때, 각 bin이 어떤 크기의 chunk를 관리하고 어떤 자료구조인지 등에 관해서 알아야한다.

본 글에서는 64비트 기준 bin들에 대한 특징들을 정리한다.

본 글에서는 다루지 않지만, 이외에도 arena, remainder chunk, unlinking, top chunk 등에 대해서도 알 필요가 있다.

 

tcachebin

  • single LL
  • 0x20 ~ 0x410 ( <=1040 )
  • LIFO
  • 최대 7개 까지 저장

fastbin

  • single LL
  • 0x20 ~ 0x80 (  <=128 )
  • LIFO

smallbin

  • double LL
  • 0x20 ~" 0x400 ( < 1024 )
  • FIFO

largebin

  • double LL
  • 0x400 ~ ( >=1024 )
  • FIFO
    => largebin은 다른 bin들과 다르게 각 인덱스에 연결되어 있는 청크 사이즈가 같지 않다

unsortedbin

  • double LL
  • any size
  • FIFO
    => 적당한 chunk를 찾을때까지 탐색한 chunk들은 small bin이나 large bin으로 들어감
    => unsorted bin은 한개만 존재한다.

'Security & Hacking' 카테고리의 다른 글

3 types of embedded systems  (0) 2025.03.03
Android Security - exported 편  (0) 2025.02.16
command injection  (0) 2025.02.11
CodeQL  (0) 2025.02.11
00_angr_find  (0) 2025.02.10