root@thehacksparrow:~/writeups$ SYSTEM ONLINE
root@sparrow:~/writeups$ cat sneaky-patch.md
// Offensive

Sneaky Patch

24 Jul 2023 · 9 min read · user access
Executive summary — Sneaky Patch is an Easy kernel-forensics room on TryHackMe: we start from a Linux system already compromised by a kernel-level rootkit shipped as a loadable module (LKM). Unlike a userspace backdoor, this module lives inside the kernel and evades conventional detection tooling. The journey is pure analysis: we enumerate loaded modules, single out the suspicious spatch, inspect its metadata with modinfo, pull strings from the .ko binary and decode the hex-encoded flag. A lsmod → modinfo → strings → hex decode journey.
PlatformTryHackMe
Operating systemLinux
DifficultyEasy
RoomSneaky Patch
Target IPMACHINE_IP

Attack map

[ACCESS]  session on the compromised host
   |  sudo su -> root for system-level analysis
   v
[dmesg]  kernel logs -> module loading events
   |
   v
[lsmod]  suspicious module: spatch (not in standard docs)
   |  modinfo spatch -> author "Cipher", "Cipher is always root"
   v
[strings]  spatch.ko -> [CIPHER BACKDOOR] secret in hex
   |  xxd -r -p
   v
[FLAG]  THM{sup3r_sn34ky_d00r}
   .  (alt) echo get_flag > /proc/cipher_bd -> dmesg

1. Context: why a kernel rootkit is so dangerous

Before touching the keyboard it helps to understand the terrain. A classic userspace backdoor leaves visible traces: added SSH keys, bind/reverse shells, malicious cron jobs. A kernel rootkit plays in a different league: it is implemented as a Loadable Kernel Module (LKM) and runs in ring 0, with direct access to system structures. From there it can hide processes, files and connections from conventional tools, because it is the kernel itself that lies.

The key idea: when the attacker controls the kernel, you cannot trust the answers the system gives you. Forensics focuses on what the module cannot fully hide: its own presence in the module list, its metadata and the contents of its on-disk binary.
🔒 Free account required

This is USER ACCESS content — free to unlock, no payment. The rest of the write-up (and everything else at this level) opens up once you're signed in.

Create a free account