<< All versions

Skill v1.0.0

currentLLM-judged scan90/100
mizazhaider-ceh/agentarsenal/kernel-exploit-basics
──Details
PublishedOctober 24, 2026 at 10:26 AM
Content Hashsha256:20c716687c9484bb...
Git SHA27d8b27ec300
──Files
Files (1 file, 3.8 KB)
SKILL.md3.8 KBactive
SKILL.md · 115 lines · 3.8 KB

name: kernel-exploit-basics description: Use when learning kernel exploitation fundamentals in a lab with your own vulnerable VMs. Covers kernel attack surface, common bug classes, SMEP/SMAP/KASLR bypass concepts, and safe lab practices. Also use when triaging whether a kernel bug is exploitable. version: 1.0.0 domain: binary lifecycle: stable last_verified: 2026-10-23 requires: [] extends: [] relates: [pwn-fundamentals, heap-exploitation, rop-chains] tools:

  • name: Python

version: 3.12

  • name: Ghidra

version: 11.3


Kernel exploitation turns a kernel bug into ring 0 code execution: the stakes and the mitigations are both higher than userspace. This skill covers the fundamentals for lab learning on your own VMs: attack surface, bug classes, mitigation concepts, and the safe lab setup. Learning only; never test kernels you do not own.

Quick Workflow

  1. Build the lab: a vulnerable kernel VM with snapshots, and a

matching debug setup.

  1. Learn the attack surface: syscalls, ioctls, and drivers reachable

from unprivileged users.

  1. Study the bug class: UAF, overflow, or race in kernel context.
  2. Understand the mitigations: SMEP, SMAP, KASLR, KPTI, and what

each stops.

  1. Plan the primitive: what the bug gives you (read, write, where).
  2. Plan the escalation: from primitive to credential overwrite or

modprobe_path.

  1. Develop against snapshots: snapshot before each attempt.
  2. Document the full chain for learning, with the mitigations

noted.

1. Lab setup and recon

bash
# Lab VM: vulnerable kernel, snapshot before you start
# Check the mitigations on your lab kernel
cat /proc/cmdline
dmesg | grep -i -E "smep|smap|kaslr" | head -5
# Find reachable attack surface: world accessible device nodes
find /dev -type c 2>/dev/null | head -20
ls -l /dev/vuln* 2>/dev/null
bash
# Identify the bug: dmesg after a crash tells you the class
dmesg | tail -30
# KASAN builds give precise reports; use a KASAN kernel for learning

2. Classic escalation primitives (lab)

bash
# Concept: overwrite creds (uid=0) or modprobe_path, then trigger
# Modern path: ROP in kernel, bypassing SMEP with ret2usr alternatives
# or SMAP bypass via controlled kernel memory writes
echo "learn each mitigation bypass separately before chaining"
python
#!/usr/bin/env python3
"""Lab notes template for a kernel bug."""
bug = {
"location": "driver ioctl 0x1337",
"class": "heap UAF",
"primitive": "write-what-where (limited)",
"mitigations": "SMEP on, SMAP on, KASLR on",
"plan": "1. defeat KASLR via info leak 2. ROP to commit_creds(prepare_kernel_cred(0))",
}
for k, v in bug.items():
print(f"{k}: {v}")

Edge cases

  • The bug is not reachable unprivileged. Then it is a lower

severity local issue; adjust the learning goal.

  • KASLR defeats your hardcoded addresses. Learn info leaks first;

guessing is not a method.

  • The VM keeps crashing. That is the process; snapshots make it

cheap, and each crash teaches the constraint.

Escalation

  • Stuck on a mitigation: study that mitigation's known bypasses

in isolation before returning to the chain.

  • Need a real target assessment: kernel exploitation against

production is specialized work; scope it separately.

Detection and defender view

Defenders detect kernel exploitation with kernel integrity monitoring, audit of privileged operations, and crash analysis. They defend with the mitigations (keep them on), timely patching, and reducing attack surface (unneeded drivers, unprivileged namespaces). The durable lesson: patch quickly, because public kernel exploits follow disclosure fast.

Key references

  • MITRE ATT&CK T1068 (Exploitation for Privilege Escalation).
  • Linux kernel self protection documentation.
  • Kernel exploitation learning resources (lab focused).
All versions