长亭PWN笔记03
发布日期:2021-05-14 08:36:27 浏览次数:19 分类:精选文章

本文共 3498 字,大约阅读时间需要 11 分钟。

glibc���������������

���������������������������������������������������������������������������Heap������GNU C������������glibc������������������������������������������������������������������������������������������������������������������������������������

���������������������

������������������������������������������������������������������������Stack���������������������������������������������������������������������������������������������������������malloc���������������������free���������������������������������������������������������������������������������������������

������������������

���glibc���������������������������������������������������

  • Arena���

    • Arena���������������������������������������������������������Arena������������������������
    • ������������Arena������sbrk������������������
    • ���������������Arena������mmap���������������
  • Malloc_state���

    • ������Arena������������������������������������������������������������������������bins���������
    • ������������malloc_state���������glibc������������������������������������������������Arena���������
  • Bins���

    • ���������������������������������������������������Bin������������������������������������������������
    • ������Fast bins���Small bins���Large bins���Unsorted bins������������������
  • Chunk���

    • ���������������������������������������������������������������������������
  • ptmalloc2������������������

    ptmalloc2���glibc���������������������������������������������������������������

  • ������������������������Arena���per thread arena������
  • ������������Arena������main arena��� Arena���������CPU���������������
  • ������������������

    ���������������������������������������������������������������������������������������������������������������������������

  • First Fit allocation���FF���������������������������������������������������������������
  • Best Fit allocation���BF������������������������������������������������
  • Worst Fit allocation���WF���������������������������������������
  • ** geography allocation**������������������������������������������������������
  • case Study������������������������

    ���������������������������������������������������������������

    #include 
    int main() {
    char *A, *B, *C, *D;
    A = malloc(0x100 - 8);
    B = malloc(0x100 - 8);
    C = malloc(0x100 - 8);
    D = malloc(0x100 - 8);
    free(A);
    free(C);
    A = malloc(0x100 - 8);
    free(A);
    A = malloc(0x80 - 8);
    free(B);
    return 0;
    }

    ���������������

  • MALLOC WORKFLOW���

    • ������������Fast bins���������������������������������
    • ���������������������max_fast������������������
    • ���������������unsorted bin������������������������������������������/���Bin������
  • FREE WORKFLOW���

    • ������������������������������������������������������������
    • ������top chunk���last_remainder���������������
  • ������������������������������������������������������������������������������������������������������������������

    Bins������������

    • Fast bins���������������������������������������������FILO���������������������������������
    • Small bins���������������������������������������������������������
    • Large bins������������������������������������������������������������������������������
    • Unsorted bins������������������������������������������������Bin���

    ������������

    ������������������������������������������������������������������������������������������������������glibc���������������������������������������������������������������������������������������������������������������������������������������������������������������������

    上一篇:长亭PWN笔记04
    下一篇:长亭PWN笔记02

    发表评论

    最新留言

    路过按个爪印,很不错,赞一个!
    [***.219.124.196]2025年04月16日 08时26分12秒