-
-
[原创]house of cat详细原理分析+2022强网杯对应题目分析
-
-
[原创]house of cat详细原理分析+2022强网杯对应题目分析
适用版本:glibc2.34+
利用条件:能触发 __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
传播安全知识、拓宽行业人脉——看雪讲师团队等你加入!