How hoefler02/cve-2025-21756 works
Project type and purpose
• This is a proof-of-concept exploit tool targeting Linux kernel CVE-2025-21756 (vulnerable kernel 6.6.75).
• Its purpose is to build a minimal initramfs environment, boot a vulnerable kernel (e.g., under QEMU), execute the exploit binary (x.c compiled), gain kernel privileges, and retrieve a flag.
File structure
• Top‐level files and scripts:
• run.sh → orchestrates build, packaging, and QEMU launch
• compress.sh → builds or compresses the initramfs image
• extract-image.sh → unpacks an existing initramfs
• x.c → C source for the exploit
• flag.txt → placeholder for captured flag
• initramfs/ directory → the guest root filesystem:
• initramfs/bin/{busybox, sh}
• initramfs/etc/{inittab, init.d/rcS, motd, resolv.conf}
• initramfs/init → primary init script that runs the exploit
README for additional insights
• Confirms it’s an exploit for CVE-2025-21756
• References a full write-up covering exploitation of vsock
Diagramming recommendations
• Host components (scripts, toolchain) in blue
• Virtualized runtime (QEMU + kernel) in green
• Initramfs guest components in orange
• Exploit/vsock channel in red
• Script invocations (run.sh → compress.sh)
• Packaging steps (scripts → initramfs.cpio.gz)
• Boot flow (kernel → initramfs → init)
• Exploit communication (x → vsock → host)
• Optionally, annotate notes on critical files (e.g., “rcS: sets up network for vsock”)
Detail without over-splitting
• Logical step as its own component
• Don’t omit simple utilities (busybox/sh) because they’re part of the minimal environment
• The goal is to see at a glance: how the exploit gets into initramfs, how it’s executed, and how control returns to the host