kernel-pwn and writeup collection
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 only kernel-pwn, but also general non-userland pwn including QEMU, V8, multi-arch...
IMPORTANT: If you know some good kernel(non-userland) pwn challs, please tell me and I'll solve it. Then I'll add it on this repo if I feel it good to solve. And if you notice some wrong points in my writeups or blog posts, feel free to contact me.
corjail from CoRCTF2022
poll_list/ user_key_payload/ kROP on tty_structFire of Salvation from CoRCTF2021
msg_msg/ uffdnightclub from pbctf 2021
kone_gadget from SECCON CTF 2021
jmp &flag, which leaks secret content in CODE secition of panic message. It means that if the kernel uses initramfs and KASLR is disabled (or we have full knowlege of memory layout), just getting RIP means success of exploit, SMEP/SMAP is useless.klibrary from 3kCTF 2021
tty_struct/ modprobe_overwrite via vtable in tty_structshared knote from Bsides Ahmedabad 2021
fpos use/ zero-addr mappingcheck /proc/sys/vm/mmap_min/addr in my first procedures list.pprofile from LINE CTF 2021
nutty from Union CTF 2021
tty_struct. Then, bypass SMAP by kROP in kheap(on tty_strut).Day One from AIS3 EOF CTF 2021 Final
bpf_map.btf, is cool.kernel-rop from hxp CTF 2020
SharedHouse from ASIS 2020 Quals
Spark from HITCON 2020
hashbrown from DiceCTF 2021
gnote from TokyoWesterns CTF 2019
eebpf from TokyoWesterns CTF 2020
Krazynote from BalsnCTF 2019
Frequently Updated now...
I don't know these challs are difficult or not and good or soso. But at least I feel these challs are worth solving.
hwdbg from CakeCTF 2021
/dev/mem/, so all the protection is useless. However, CONFIG_DEVMEM_STRICT is enabled and you would be confused if you don't know this config.Stonks Socket from Hack.lu CTF 2021
Frequently Updated now...
If you don't know how to prepare for solving kernel-pwn, please refer to start-kernel-pwning.
Frequently Updated now...
I want to know some techniques to pwn in kernelland. If you know something I should know, please tell me. For the techniques I used to solve the challs listed above is listed HERE(under construction).
Frequently Updated now...
Kernel is distributed in the form of bzImage and no information about build configuration is not provided in 99% cases. However, you have to change the way of exploit depending on the configuration.
Some config might hide important information. Some config might randomize the memory layout. Some config might make variables only readable...
important_config directory collects the important configurations and tries to summarize how to check if it is enabled and how to bypass it.
My blog posts contain not only kernel-writeup, but normal userland-pwn and technique frequently used in pwning and so on... Please check it out. NOTE: The most parts of my blog is written when I'm solving the chall as a memo in HackMD and is converted to blog entry with md2html converter . I received some DMs which ask me to write my blog posts in Englinsh and I'm willing to, cuz writing in English is not a so heavy task for me (regardless of the quality of my English). I know that my blog is ill-translated by Google translater :( I'm planning to write them in English someday in the near future.
List of usefull resources are listed under reference directory.
If you have any suggestions, feel free to contact me on Twitter.
This repository is licensed under MIT.
Note that this license is applied only to WHAT I WROTE.
Binary of kernel challenges themselves would be in many cases licensed under other licenses.
Please follow these in that case.
If you think this or related repositories violate your rights, please contact me.
No open issues yet, or sync has not completed.