首页
社区
课程
招聘
[原创]house of cat详细原理分析+2022强网杯对应题目分析
发表于: 2026-3-18 15:25 3926

[原创]house of cat详细原理分析+2022强网杯对应题目分析

2026-3-18 15:25
3926

适用版本:glibc2.34+

利用条件:能触发 __malloc_assert + 有一个任意地址写原语

特攻题目:无 exit 函数

所以最终需要我们手动触发__malloc_assert进入该调用链

__malloc_assert -> __fxprintf -> __vfxprintf -> __locked_vfxprintf -> __vfwprintf_internal -> _IO_wfile_seekoff -> _IO_switch_to_wget_mode

fake_IO_addr 偏移

payload 偏移

写入值

FILE 视角

fake _wide_data视角

作用

0x00

不可直接写

不可写入

固定为该chunk prev_size

_flags

-

-

0x08

不可直接写

不可写入

固定为该chunk size

_IO_read_ptr

-

-

0x10

0x00

0

_IO_read_end

-

-

0x18

0x08

0

_IO_read_base

-

-

0x20

0x10

0

_IO_write_base

-

-

0x28

0x18

0

_IO_write_ptr

-

-

0x30

0x20

0

_IO_write_end

_wide_data->_IO_read_ptr

fake _wide_data起点

0x38

0x28

0

_IO_buf_base

_wide_data->_IO_read_end

次重要[1]

0x40

0x30

1

_IO_buf_end

_wide_data->_IO_read_base

次重要[1]

0x48

0x38

0

_IO_save_base

_wide_data->_IO_write_base

重要[2]

0x50

0x40

fp + 0xb0

_IO_bakcup_base

_wide_data->_IO_write_ptr

重要[2][3]

0x58

0x48

setcontext+61

_IO_save_end

_wide_data->_IO_write_end

重要[4]

0x60

0x50

0

_markers

_wide_data->_IO_buf_base

-

0x68

0x58

0

_chain

_wide_data->_IO_buf_end

-

0x70

0x60

0 + 0

_fileno + _flags2

_wide_data->_IO_save_base

两个都是 int

0x78

0x68

0

_old_offset

_wide_data->_IO_backup_base

_old_offset底层类型__off_t,占8字节

0x80

0x70

0

_cur_column

_vtable_offset

_shortbuf

_wide_data->_IO_save_end

_cur_column unsigned short

_vtable_offset signed char

_shortbuf char[1]

还有 4 字节的padding

0x88

0x78

heap_base + 0x200

_lock

wide+0x58

重要[5]

0x90

0x80

0

_offset

wide+0x60

-

0x98

0x88

0

_codecvt

wide+0x68

-

0xa0

0x90

fp + 0x30

_wide_data

wide+0x70

重要[6]

0xa8

0x98

0


传播安全知识、拓宽行业人脉——看雪讲师团队等你加入!

最后于 2026-3-20 00:34 被zemu137编辑 ,原因: 做了几道相应的题之后完善了本文,修复部分错误,补充未完善的地方
收藏
免费 5
支持
分享
最新回复 (1)
雪    币: 733
活跃值: (463)
能力值: ( LV3,RANK:30 )
在线值:
发帖
回帖
粉丝
2
猴哥好耶
2026-3-18 19:18
2
游客
登录 | 注册 方可回帖
返回