Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

glibc 2.31 常见利用手法 #201

Open
wsxk opened this issue Jul 31, 2024 · 0 comments
Open

glibc 2.31 常见利用手法 #201

wsxk opened this issue Jul 31, 2024 · 0 comments

Comments

@wsxk
Copy link
Owner

wsxk commented Jul 31, 2024

https://wsxk.github.io/glic231/

前言

  1. glibc堆利用——共识篇

  2. tcache利用篇

    2.1 2.31 tcache新增机制
    2.2 fast bin double free+tcache stash进行绕过

references

前言
2年不做pwn,已经是个废物了
这回碰到glibc 2.31的堆风水题目做了半天才做出来,感觉对堆已经生疏了,重新总结一下堆的相关知识然后

  1. glibc堆利用——共识篇
    在做堆的题目之前,需要对一些基本的思路有一些了解:

  2. glibc的堆题目思路一般是:代码审计——发现漏洞(uaf,double free,oob, …)——利用漏洞泄露glibc地址/堆地址——堆风水(目的是获得任意地址的读写能力)——劫持free_hook为system,实现利用
    这个思路很重要,理解了才好继续深究。

  3. 正常的堆操作流程是无法泄露地址信息的,如果正常的堆操作流程可以泄露地址,说明堆实现有问题

  4. tcache利用篇
    自从glibc.2.26版本出现tcache之后,tcache马上就变成了堆利用的重灾区啊~原因无他,太好使了。刚出那会tcache根本没有保护,随便用
    2.1 2.31 tcache新增机制
    在2.31,tcache新增机制主要体现在free函数上。
    具体细节如下:
    // free函数关于tcache的2.31新增校验
    if (__glibc_unlikely(e->key == tcache))//剪枝
    {
    tcache_entry *tmp;
    LIBC_PROBE(memory_tcache_double_free, 2, e, tc_idx);
    for (tmp = tcache->entries[tc_idx]; tmp; tmp = tmp->next)
    if (tmp == e)
    malloc_printerr(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant