摘要: 看 glibc 2.32 源码: /* Safe-Linking: Use randomness from ASLR (mmap_base) to protect single-linked lists of Fast-Bins and TCache. That is, mask the "next 阅读全文
posted @ 2022-02-20 15:11 狒猩橙 阅读(152) 评论(0) 推荐(2) 编辑
摘要: 2.27 之前的 off by null 的利用手法总体来说比较简单伪造一个 presize 即可,但是在 glibc 2.29的更新当中,unlink 里加入的 presize check 使得之前的利用手法不再有效,并且 off by null 的难度提高不少。 /* consolidate b 阅读全文
posted @ 2022-02-18 13:22 狒猩橙 阅读(250) 评论(0) 推荐(1) 编辑
摘要: tcache stashing unlink atttack 主要利用的是 calloc 函数会绕过 tcache 从smallbin 里取出 chunk 的特性。并且 smallbin 分配后,同大小的空闲块挂进会 tcache。这个攻击可实现两个效果: 1、任意地址上写一个较大的数(和unsor 阅读全文
posted @ 2022-02-16 10:38 狒猩橙 阅读(263) 评论(0) 推荐(1) 编辑
摘要: 推迟了好久的复现,那就在情人节这个特殊的日子复现一波吧。这题除了 ora 之外特别的地方就是用到了 retf 来进行 32 位和 64 位的切换。参考了 winmt 师傅的博客复现了一下。 import time from pwn import * context.arch = 'amd64' #c 阅读全文
posted @ 2022-02-14 12:37 狒猩橙 阅读(76) 评论(0) 推荐(1) 编辑
摘要: 最近打 ctf 的时候感觉有点遇到瓶颈,就来 fuzz 这块看看。 AFL 全称为 American huzzy loop,是 Fuzzing 最高级的测试工具之一。这个工具对有源码和无源码的二进制程序均可以进行 fuzz 测试。 alf 各位自行安装即可,值得注意的是,在我本机 glibc2.31 阅读全文
posted @ 2022-02-13 21:55 狒猩橙 阅读(898) 评论(1) 推荐(1) 编辑
摘要: 在 glibc 2.29 当中 tcache 增加了 key 字段,让原本的 tcache-dup 不像原来那么简单了。一般来说我们需要破坏 key 字段,才能继续进行 double free。而 house of botcake 采用的思想是避免出现 key 字段那么就无需覆盖。他是在填满 tca 阅读全文
posted @ 2022-02-08 22:37 狒猩橙 阅读(316) 评论(1) 推荐(1) 编辑
摘要: off-by-null + unlink from pwn import * context.arch = 'amd64' context.log_level = 'debug' s = process('./ciscn_2019_es_4') #s = remote('node4.buuoj.cn 阅读全文
posted @ 2022-01-29 17:03 狒猩橙 阅读(101) 评论(1) 推荐(1) 编辑
摘要: setcontext+orw 大致可以把2.27,2.29做为两个分界点。 我们先来讨论 2.27 及以下的 setcontext + orw 的写法。 首先 setcontext 是什么?了解过 SROP 的师傅应该知道 pwntools 自带了一款可以控制寄存器值的工具。模板如下: frame 阅读全文
posted @ 2022-01-26 19:39 狒猩橙 阅读(1843) 评论(1) 推荐(2) 编辑
摘要: FSOP 是 File Stream Oriented Programming 的缩写。所有的 _IO_FILE 结构会由 _chain 字段连接形成一个链表,由 _IO_list_all 来维护。而 FSOP 的核心思想就是劫持通过 _IO_list_all 的值来伪造链表和其中的 _IO_FIL 阅读全文
posted @ 2022-01-19 20:24 狒猩橙 阅读(382) 评论(1) 推荐(1) 编辑
摘要: _fileno 是 stdin 文件里的一个字段,在 x64 系统里,偏移为 0x70。 以下是 IO_FILE 结构体: struct _IO_FILE { int _flags; /* High-order word is _IO_MAGIC; rest is flags. */ #define 阅读全文
posted @ 2022-01-14 10:09 狒猩橙 阅读(239) 评论(1) 推荐(1) 编辑