This repository collects CTF kernel-pwn challenges and writeups. Also, it introduces how to start learning kernel-pwn for beginners including me. All the challs here are solved by me, though the writeup may be based on the author's one or others's ones. I'm planning to include not onl...
kernel中文件的读写操作可以使用vfs_read()和vfs_write,在使用这两个函数前需要说明一下get_fs()和 set_fs()这两个函数。 vfs_read() vfs_write()两函数的原形如下: ssize_t vfs_read(struct file* filp, char __user* buffer, size_t len, loff_t* pos); ssize_t vfs_write(struct file* filp,...
int down_write_trylock(struct rw_semaphore *sem);类似down_read_trylock void up_write(struct rw_semaphore *sem);类似up_read void downgrade_write(struct rw_semaphore *sem);当一个写保护后,跟着一个耗费时间长的读保护,我们可以在使用能够downgrade_write,它允许其他读操作在你结束写后,马上获得读写型号...
c = sel_pos(i); if (use_unicode) bp += store_utf8(c, bp); else *bp++ = c; Generic slab allocations are rounded up to the closest cache size (32, 64, 128, etc.); if we ask for 55 bytes, we will actually get 64. Since we are definitely able to write two bytes past bp...
fdput_pos(f); } return ret; } 该函数获取struct fd引用计数和pos锁定,获取pos并主要通过调用vfs_write()实现数据写入。 vfs_write() vfs_write()函数定义如下: ssize_t vfs_write(struct file *file, const char __user *buf, size_t count, loff_t *pos) ...
内核注册字符设备驱动设备时会用到file_operations结构体,file_operations 结构体中的成员函数是字符设备驱动程序设计的主体内容,结构体中的一些指针比如open()、write()、read()、close() 等系统调用时最终会被内核调用,我们可以通过指定指针指向的内容修改其默认值为我们自定义的函数,这样我们在类似read(dev_fd, buf...
CONFIG_BLK_DEV_WRITE_MOUNTED |kconfig| is not set |a13xp0p0v |cut_attack_surface| OK: is not found CONFIG_FAULT_INJECTION |kconfig| is not set |a13xp0p0v |cut_attack_surface| OK CONFIG_ARM_PTDUMP_DEBUGFS |kconfig| is not set |a13xp0p0v |cut_attack_surface| OK: is not found ...
其中常用的就是read,write等函数。 之后也是正常的调用函数,套路编写。 // 读设备ssize_txxx_read(struct file *filp,char__user *buf,size_tcount,loff_t*f_pos){...copy_to_user(buf, ..., ...);// 内核空间到用户空间缓冲区的复制...}// 写设备ssize_txxx_write(s...
dm-log-writes デバイスマッパー・ログがターゲットを書き込む dm-log デバイス・マッパー・ダーティ・リージョン・ログ dm-mirror デバイスマッパー・ミラー・ターゲット dm-mod デバイス・マッパー・ドライバ dm-multipath デバイスマッパー...
在用户态设置缓冲区,然后使用0x6002的泄露功能,write出来 ioctl(fd,0x6002,buf);write(1,buf,0x200); 效果如下: 因为此时没有开启KASLR,所以我们可以寻找0xffffffff80000000附近的内核地址进行基址的泄露。 比如偏移为0x48的0xffffffff8129b078。 这里还要泄露canary(见上图v6变量),一般来说,canary会在rbp-8的位...