/* Perform vtable pointer validation. If validation fails, terminate the process. */ staticinlineconststruct _IO_jump_t * IO_validate_vtable(conststruct _IO_jump_t *vtable) { /* Fast path: The vtable pointer is within the __libc_IO_vtables section. */ uintptr_t section_length = __stop___libc_IO_vtables - __start___libc_IO_vtables; uintptr_t ptr = (uintptr_t) vtable; uintptr_t offset = ptr - (uintptr_t) __start___libc_IO_vtables; if (__glibc_unlikely (offset >= section_length)) /* The vtable pointer is not in the expected section. Use the slow path, which will terminate the process if necessary. */ _IO_vtable_check (); return vtable; }
ciscn_2019_n_7
版本
glibc2.23
思路
1.利用FSOP,通过更改_IO_list_all结构体,来改变进行文件流操作时的函数调用。
2.伪造_IO_FILE_plus使其一些成员满足一些特定条件来调用假的虚表中的函数。
py
from pwn import * io = remote("node5.buuoj.cn",29483) from LibcSearcher import *