Arbitrary Read/Write: modprobe_path and Friends


Kernel Exploitation: A CTF Study Path.

Many bugs give you a read or write primitive rather than RIP control. With an arbitrary write you often do not need ROP at all: overwrite a piece of kernel data that the kernel later trusts. modprobe_path and core_pattern make the kernel run a program of your choice as root; overwriting your own struct cred makes you root directly.

What you will learn

  • Building AAR/AAW from simple bugs: unchecked pointers, OOB indices, signedness, format strings, linked-list corruption
  • Defeating KASLR with leaks (kernel pointers on the heap/stack, physmap, cpu_entry_area)
  • The modprobe_path trick (unknown binary format -> usermode helper) and its core_pattern cousin
  • Finding and overwriting your own cred (task list walks, uid fields, capabilities)
  • When these targets are blocked (STATIC_USERMODEHELPER, read-only data) and what to do instead

Prerequisites

Module 01. Module 02 helps but is not strictly needed: most challenges here are ROP-free.

References



Challenges

ASIS CTF Finals 2025 · difficulty ★☆☆☆☆ · module: Arbitrary Read/Write: modprobe_path and Friends

A kernel linked list whose edit forgets how long a node is; point the next node anywhere you like.

Mitigations: SMEP, SMAP, nokaslr, oops=panic

Running it

Run /challenge/run. It boots the original kernel and root filesystem in QEMU with the serial console on your terminal. Quit with Ctrl-A then X. Put a statically linked exploit at /home/hacker/exploit first; it appears in the VM as /exploit. The flag is the raw disk /dev/vda (root only). The original /init brings up a network that does not exist here and, under set -e, would stop there; init.dojo is the same script without those two lines.

The flag is put where the original challenge kept it, readable only by root in the VM (unless a note above says otherwise). Files in /challenge (kernel, initramfs, sources and the original launcher, where the CTF shipped them): bzImage, chall.ko, init.dojo, rootfs.cpio.gz, run.sh.

Original challenge

Description

Let's have a KList, shall we?

Points

117

Solves

37

Credits

  • Challenge author(s): not recorded (credit goes to the ASIS CTF Finals 2025 organizers)
  • Compiled by: mito753 in Kernel-Exploit-Dojo, which also has the original handout and writeups

SECCON Beginners CTF 2023 · difficulty ★☆☆☆☆ · module: Arbitrary Read/Write: modprobe_path and Friends

A beginner driver that trusts user pointers; the ideal first kernel challenge.

Mitigations: no SMEP, no SMAP, no KASLR (nokaslr), KPTI, oops=panic

Running it

Run /challenge/run. It boots the original kernel and root filesystem in QEMU with the serial console on your terminal. Quit with Ctrl-A then X. Put a statically linked exploit at /home/hacker/exploit first; it appears in the VM as /exploit. /challenge/run boots the release/ image; debug/ is the organizers' debug setup for local use.

The flag is put where the original challenge kept it, readable only by root in the VM (unless a note above says otherwise). Files in /challenge (kernel, initramfs, sources and the original launcher, where the CTF shipped them): README.txt, debug/Makefile, debug/bzImage, debug/debug.sh, debug/example.c, debug/rootfs.cpio, release/bzImage, release/rootfs.cpio, release/run.sh, src/config, src/ctf4b.c, src/ctf4b.h.

Original challenge

Description

release: The actual remote server runs with this configuration.
debug: The same driver is loaded but with debug configuration.
src: Source code of the driver.

Run `make debug` in `/debug` to compile a sample program.

Points

N/A

Solves

19

Credits

  • Challenge author(s): not recorded (credit goes to the SECCON Beginners CTF 2023 organizers)
  • Compiled by: mito753 in Kernel-Exploit-Dojo, which also has the original handout and writeups

TCP1P CTF 2023 · difficulty ★☆☆☆☆ · module: Arbitrary Read/Write: modprobe_path and Friends

An introductory driver with a generous read/write interface; learn the standard path from primitive to root.

Mitigations: SMEP, SMAP, KASLR (kaslr), KPTI (kernel default; depends on the host CPU)

Running it

Run /challenge/run. It boots the original kernel and root filesystem in QEMU with the serial console on your terminal. Quit with Ctrl-A then X. Put a statically linked exploit at /home/hacker/exploit first; it appears in the VM as /exploit. The original run.sh misses a backslash, so it never passes -append; /challenge/run uses the intended command line. The flag is /root/fake.

The flag is put where the original challenge kept it, readable only by root in the VM (unless a note above says otherwise). Files in /challenge (kernel, initramfs, sources and the original launcher, where the CTF shipped them): 226157a62b9da0ab025d71f35e5574e4.jpg, bzImage, initramfs.cpio.gz, run.sh.

Original challenge

Description

Let him cook

Points

484

Solves

5

Credits

  • Challenge author(s): hyffs, for TCP1P CTF 2023
  • Compiled by: mito753 in Kernel-Exploit-Dojo, which also has the original handout and writeups

SECCON Beginners CTF 2024 · difficulty ★☆☆☆☆ · module: Arbitrary Read/Write: modprobe_path and Friends

A buffer device with a careless seek and length check: a gentle first look at leaking and writing kernel memory.

Mitigations: SMEP, SMAP, KASLR, KPTI

Running it

Run /challenge/run. It boots the original kernel and root filesystem in QEMU with the serial console on your terminal. Quit with Ctrl-A then X. Put a statically linked exploit at /home/hacker/exploit first; it appears in the VM as /exploit. The flag is the raw disk /dev/sda (root only). There is no network card, so the boot waits a few seconds for eth0; that is expected.

The flag is put where the original challenge kept it, readable only by root in the VM (unless a note above says otherwise). Files in /challenge (kernel, initramfs, sources and the original launcher, where the CTF shipped them): bzImage, driver.c, rootfs.cpio, run.sh.

Original challenge

Description

Enjoy the kernel buffer!


Proof-of-work (hashcash) is enabled on the remote server.

Points

305

Solves

8

Credits

  • Challenge author(s): ptr-yudai, for SECCON Beginners CTF 2024
  • Compiled by: mito753 in Kernel-Exploit-Dojo, which also has the original handout and writeups

NexHunt CTF 2025 · difficulty ★☆☆☆☆ · module: Arbitrary Read/Write: modprobe_path and Friends

An index the driver never checks gives you reach below its buffer; a clean first OOB challenge.

Mitigations: SMEP, KASLR, KPTI disabled (nopti)

Running it

Run /challenge/run. It boots the original kernel and root filesystem in QEMU with the serial console on your terminal. Quit with Ctrl-A then X. Put a statically linked exploit at /home/hacker/exploit first; it appears in the VM as /exploit.

The flag is put where the original challenge kept it, readable only by root in the VM (unless a note above says otherwise). Files in /challenge (kernel, initramfs, sources and the original launcher, where the CTF shipped them): bzImage, initramfs.cpio, run.sh.

Original challenge

Description

obligatory kernel chall

connection info: 

Points

423

Solves

12

Credits

  • Challenge author(s): djaoued, for NexHunt CTF 2025
  • Compiled by: mito753 in Kernel-Exploit-Dojo, which also has the original handout and writeups

3kCTF-2021 · difficulty ★★☆☆☆ · module: Arbitrary Read/Write: modprobe_path and Friends

An unusual syscall gives you small reads and writes into kernel memory; find a data-only path to root.

Mitigations: SMEP, SMAP, KPTI, KASLR

Running it

Run /challenge/run. It boots the original kernel and root filesystem in QEMU with the serial console on your terminal. Quit with Ctrl-A then X. Put a statically linked exploit at /home/hacker/exploit first; it appears in the VM as /exploit.

The flag is put where the original challenge kept it, readable only by root in the VM (unless a note above says otherwise). Files in /challenge (kernel, initramfs, sources and the original launcher, where the CTF shipped them): bzImage, initramfs.cpio, src/echo.c, start.sh.

Original challenge

Description

Can you pwn this 1 line syscall?
You just receive what you send to the kernel.

Points

478

Solves

9

Credits

  • Challenge author(s): Maher, for 3kCTF-2021
  • Compiled by: mito753 in Kernel-Exploit-Dojo, which also has the original handout and writeups

BackdoorCTF 2021 · difficulty ★★☆☆☆ · module: Arbitrary Read/Write: modprobe_path and Friends

A linked-list driver with a sloppy length check; turn list pointer corruption into a kernel write.

Mitigations: SMEP, KPTI (kernel default; depends on the host CPU), KASLR

Running it

Run /challenge/run. It boots the original kernel and root filesystem in QEMU with the serial console on your terminal. Quit with Ctrl-A then X. Put a statically linked exploit at /home/hacker/exploit first; it appears in the VM as /exploit.

The flag is put where the original challenge kept it, readable only by root in the VM (unless a note above says otherwise). Files in /challenge (kernel, initramfs, sources and the original launcher, where the CTF shipped them): bzImage, initramfs.cpio.gz, run.sh.

Original challenge

Description

People have been pwning note taking challenges for years now. This is usually done by some heap exploitation magic. I believe the simplest solution to counter this is to just move the service from userland to kernel. The kernel will save me, right?... right?

Points

N/A

Solves

N/A

Credits

  • Challenge author(s): SHUBHANG TRIPATHI, for BackdoorCTF 2021
  • Compiled by: mito753 in Kernel-Exploit-Dojo, which also has the original handout and writeups

LINE CTF 2021 · difficulty ★★☆☆☆ · module: Arbitrary Read/Write: modprobe_path and Friends

A profiling driver writes results somewhere it should not; shape a constrained write into something useful.

Mitigations: SMEP, SMAP, KASLR

Running it

Run /challenge/run. It boots the original kernel and root filesystem in QEMU with the serial console on your terminal. Quit with Ctrl-A then X. Put a statically linked exploit at /home/hacker/exploit first; it appears in the VM as /exploit. The original launcher was named run; it is shipped as run.sh so it does not clash with /challenge/run.

The flag is put where the original challenge kept it, readable only by root in the VM (unless a note above says otherwise). Files in /challenge (kernel, initramfs, sources and the original launcher, where the CTF shipped them): bzImage, initramfs.cpio, pprofile.ko, run.sh.

Original challenge

Description

KKKKERNEL PPPPPROFILE

pw: pprofile

Points

460

Solves

7

Credits

  • Challenge author(s): Unkown, for LINE CTF 2021
  • Compiled by: mito753 in Kernel-Exploit-Dojo, which also has the original handout and writeups

GrabCON CTF 2021 · difficulty ★★☆☆☆ · module: Arbitrary Read/Write: modprobe_path and Friends

printf, but in the kernel: leak and write with a format string bug.

Mitigations: KPTI (kernel default; depends on the host CPU), KASLR, no SMEP/SMAP (default CPU; +smep/+smap in -append have no effect)

Running it

Run /challenge/run. It boots the original kernel and root filesystem in QEMU with the serial console on your terminal. Quit with Ctrl-A then X. Put a statically linked exploit at /home/hacker/exploit first; it appears in the VM as /exploit. The handout shipped the unpacked initramfs/ tree; here it is packed (owned by root) into initramfs.cpio.gz, the way its README builds it.

The flag is put where the original challenge kept it, readable only by root in the VM (unless a note above says otherwise). Files in /challenge (kernel, initramfs, sources and the original launcher, where the CTF shipped them): bzImage, initramfs.cpio.gz, printf.c, run.sh.

Original challenge

Description

I implemented a really cool feature in the kernel! Can you test it? Also, can you guess what paas means?

how to compress initramfs

#!/bin/sh

cd initramfs
find . | cpio -o -H newc > ../initramfs.cpio
cd ..
gzip < initramfs.cpio > initramfs.cpio.gz
rm -f initramfs.cpio
Note : exploit name should be exploit

Connection : ssh [email protected] -p 10000

password : wolfie

Backup Connection : ssh [email protected] -p 10000

Points

500

Solves

1

Credits

  • Challenge author(s): Bitfriends, for GrabCON CTF 2021
  • Compiled by: mito753 in Kernel-Exploit-Dojo, which also has the original handout and writeups

LINE CTF 2025 · difficulty ★★☆☆☆ · module: Arbitrary Read/Write: modprobe_path and Friends

A driver's fast path trusts a pointer it gets from userland a little too much.

Mitigations: SMEP, SMAP, KASLR, KPTI, page_alloc.shuffle, init_on_alloc

Running it

Run /challenge/run. It boots the original kernel and root filesystem in QEMU with the serial console on your terminal. Quit with Ctrl-A then X. Put a statically linked exploit at /home/hacker/exploit first; it appears in the VM as /exploit.

The flag is put where the original challenge kept it, readable only by root in the VM (unless a note above says otherwise). Files in /challenge (kernel, initramfs, sources and the original launcher, where the CTF shipped them): bzImage, rootfs_dist.cpio, run.sh, transmit.c.

Original challenge

Description

Transmit!

Alternate download link: https://storage.googleapis.com/linectf_2025/Transmit.zip

 136.110.67.174:10007

Points

555

Solves

10

Credits

  • Challenge author(s): not recorded (credit goes to the LINE CTF 2025 organizers)
  • Compiled by: mito753 in Kernel-Exploit-Dojo, which also has the original handout and writeups

M*CTF 2025 Quals · difficulty ★★☆☆☆ · module: Arbitrary Read/Write: modprobe_path and Friends

A to-do list driver with its own home-grown allocator; procrastinate on freeing things correctly and see what happens.

Mitigations: SMEP, SMAP, KASLR, KPTI (kernel default; depends on the host CPU)

Running it

Run /challenge/run. It boots the original kernel and root filesystem in QEMU with the serial console on your terminal. Quit with Ctrl-A then X. Put a statically linked exploit at /home/hacker/exploit first; it appears in the VM as /exploit.

The flag is put where the original challenge kept it, readable only by root in the VM (unless a note above says otherwise). Files in /challenge (kernel, initramfs, sources and the original launcher, where the CTF shipped them): bzImage, initramfs.cpio.gz, run.sh, src/procrastinator.c, src/procrastinator/heap.c, src/procrastinator/heap.h.

Original challenge

Description

RU:
Это точно не libc.

EN:
It’s definitely not libc.

Points

4986

Solves

4

Credits

  • Challenge author(s): phoen1xxx, for M*CTF 2025 Quals
  • Compiled by: mito753 in Kernel-Exploit-Dojo, which also has the original handout and writeups

TAMUctf 2022 · difficulty ★★☆☆☆ · module: Arbitrary Read/Write: modprobe_path and Friends

A shared vector driver multiplies sizes without worrying about overflow; bounds checks then mean little.

Mitigations: KASLR, KPTI (kernel default; depends on the host CPU)

Running it

Run /challenge/run. It boots the original kernel and root filesystem in QEMU with the serial console on your terminal. Quit with Ctrl-A then X. Put a statically linked exploit at /home/hacker/exploit first; it appears in the VM as /exploit. Log in on the console as pwn (no password). The flag is the raw disk /dev/sda (root only). The original attached it with -hdb flag.txt.

The flag is put where the original challenge kept it, readable only by root in the VM (unless a note above says otherwise). Files in /challenge (kernel, initramfs, sources and the original launcher, where the CTF shipped them): bzImage, kernel.diff, rootfs.cpio, start.sh.

Original challenge

Description

Shared memory vector in kernel space written in 15 minutes? What could go wrong!

log in with user "pwn" and no password

bzImage built by applying kernel.diff to https://github.com/torvalds/linux/commit/40037e4f8b2f7d33b8d266f139bf345962c48d46

rootfs is buildroot 2022.02 with glibc 2.34

Points

493

Solves

7

Credits

  • Challenge author(s): sky, for TAMUctf 2022
  • Compiled by: mito753 in Kernel-Exploit-Dojo, which also has the original handout and writeups

HKCERT CTF 2024 · difficulty ★★☆☆☆ · module: Arbitrary Read/Write: modprobe_path and Friends

A driver lets you flip bits in kernel memory; work out which bits are worth flipping.

Mitigations: SMEP, SMAP, KPTI, KASLR disabled (nokaslr)

Running it

Run /challenge/run. It boots the original kernel and root filesystem in QEMU with the serial console on your terminal. Quit with Ctrl-A then X. Put a statically linked exploit at /home/hacker/exploit first; it appears in the VM as /exploit.

The flag is put where the original challenge kept it, readable only by root in the VM (unless a note above says otherwise). Files in /challenge (kernel, initramfs, sources and the original launcher, where the CTF shipped them): bzImage, flipper_hero.ko, rootfs.cpio, run.sh.

Original challenge

Description

If you could flip the world, what would you change?

Points

250

Solves

10

Credits

  • Challenge author(s): botton, for HKCERT CTF 2024
  • Compiled by: mito753 in Kernel-Exploit-Dojo, which also has the original handout and writeups

DownUnderCTF 2025 · difficulty ★★★☆☆ · module: Arbitrary Read/Write: modprobe_path and Friends

Someone left a syscall in this kernel that really should not be there; find a leak and a write and pick the simplest target.

Mitigations: SMEP, SMAP, KASLR, KPTI, SMP 1

Running it

Run /challenge/run. It boots the original kernel and root filesystem in QEMU with the serial console on your terminal. Quit with Ctrl-A then X. Put a statically linked exploit at /home/hacker/exploit first; it appears in the VM as /exploit. Log in on the console as ctf with password ctf.

The flag is put where the original challenge kept it, readable only by root in the VM (unless a note above says otherwise). Files in /challenge (kernel, initramfs, sources and the original launcher, where the CTF shipped them): bzImage, kernel.diff, rootfs.cpio.gz, run.sh, vmlinux.gz.

Original challenge

Description

Can you escape the void in my backdoor? Creds are ctf:ctf

Regards,
toasterpwn

AU: 
US: 

Points

321

Solves

18

Credits

  • Challenge author(s): toasterpwn, for DownUnderCTF 2025
  • Compiled by: mito753 in Kernel-Exploit-Dojo, which also has the original handout and writeups

TastelessCTF 2020 · difficulty ★★★★☆ · module: Arbitrary Read/Write: modprobe_path and Friends

A note driver with a signedness slip in its index handling; turn type confusion into arbitrary read/write.

Mitigations: SMEP, SMAP, nokaslr

Running it

Run /challenge/run. It boots the original kernel and root filesystem in QEMU with the serial console on your terminal. Quit with Ctrl-A then X. Put a statically linked exploit at /home/hacker/exploit first; it appears in the VM as /exploit.

The flag is put where the original challenge kept it, readable only by root in the VM (unless a note above says otherwise). Files in /challenge (kernel, initramfs, sources and the original launcher, where the CTF shipped them): bzImage, initrd.gz, run.sh, src/Makefile.txt, src/yaknote.c, src/yaknote.h, yaknote.ko.

Original challenge

Description

yak shaving

Points

500

Solves

1

Credits

  • Challenge author(s): not recorded (credit goes to the TastelessCTF 2020 organizers)
  • Compiled by: mito753 in Kernel-Exploit-Dojo, which also has the original handout and writeups

corCTF 2023 · difficulty ★★★★☆ · module: Arbitrary Read/Write: modprobe_path and Friends

A kernel encryption service; to write what you want, you first have to think in ciphertext.

Mitigations: KASLR (kernel default), no -cpu given (qemu64 defaults, no SMEP/SMAP flags), oops=panic, launcher uses -enable-kvm

Running it

Run /challenge/run. It boots the original kernel and root filesystem in QEMU with the serial console on your terminal. Quit with Ctrl-A then X. Put a statically linked exploit at /home/hacker/exploit first; it appears in the VM as /exploit.

The flag is put where the original challenge kept it, readable only by root in the VM (unless a note above says otherwise). Files in /challenge (kernel, initramfs, sources and the original launcher, where the CTF shipped them): bzImage, initramfs.cpio.gz, run.sh.

Original challenge

Description

lightning fast super-secure and cryptographically safe(?) ciphering in kernel space

connect with ssh: ssh [email protected]

upload a file to /tmp/exploit: ssh -t [email protected] connect $(cat exploit | ssh i.be.ax upload)

Points

321

Solves

11

Credits

  • Challenge author(s): clubby789, for corCTF 2023
  • Compiled by: mito753 in Kernel-Exploit-Dojo, which also has the original handout and writeups

LINE CTF 2022 · difficulty ★★★★☆ · module: Arbitrary Read/Write: modprobe_path and Friends

A crypto driver with a broken mmap and a leaky interface; turn its own encryption into an oracle and a write primitive.

Mitigations: SMEP, SMAP, KASLR

Running it

Run /challenge/run. It boots the original kernel and root filesystem in QEMU with the serial console on your terminal. Quit with Ctrl-A then X. /home/hacker/exploit is not copied into this VM. The root filesystem is an ext4 disk, so there is no initramfs to add files to: transfer your exploit over the console (for example base64). Disk changes are discarded when the VM stops.

The flag is put where the original challenge kept it, readable only by root in the VM (unless a note above says otherwise). Files in /challenge (kernel, initramfs, sources and the original launcher, where the CTF shipped them): bzImage, rootfs.ext4, run.sh.

Original challenge

Description

New encryption service in Kernel!

Points

322

Solves

7

Credits

  • Challenge author(s): not recorded (credit goes to the LINE CTF 2022 organizers)
  • Compiled by: mito753 in Kernel-Exploit-Dojo, which also has the original handout and writeups

30-Day Scoreboard:

This scoreboard reflects solves for challenges in this module after the module launched in this dojo.

Rank Hacker Badges Score