bsauce / blog-comment

0 stars 0 forks source link

kernel exploit 有用的结构体——spray&victim — bsauce #22

Open bsauce opened 3 years ago

bsauce commented 3 years ago

https://bsauce.github.io/2021/09/26/kernel-exploit-%E6%9C%89%E7%94%A8%E7%9A%84%E7%BB%93%E6%9E%84%E4%BD%93/

kernel exploit 有用的结构体——spray&victim一、可用于 Leak/AAR/AAW/RIP劫持的结构体说明目前缺少kmalloc-8、kmalloc-16、kmalloc-64、kmalloc-512结构体。1. shm_file_datasize: 0x20 kmalloc-32内核基址:可泄露。其ns、vm_ops指针可以泄露heap:可泄露。file指向堆区域stack:不能泄露劫持RIP:不能产生:调用shmat()映射共享内存释放:shmctl() ??备注:尝试过重写vm_ops,但是没发现调用fake_vtable函数指针的情况。struct shm_file_data { int id; struct ipc_namespace ns; struct file file; const struct vm_operations_struct vm_ops;};/ 测试输出(对一个含UAF漏洞的test.ko进行测试)0x0000:0x00000000000000000x0008:0xffffffff82292ae00x0010:0xffff88800ea097000x0018:0xffffffff81e15540[+] kbase = 0xffffffff81000000[+] kheap = 0xffff88800ea09700*/2. seq_operationssize: 0x20 kmalloc-32内核基址:4个指针都能泄露出内核基址heap:不能泄露stack:不能泄露劫持RIP:可劫持。修改start,并调用read,将劫持RIP产生:open(

seamaner commented 1 month ago

很不错的整理