Userland Hooking
Also called Inline hooking, API hooking.
Redirecting an API by patching its code or pointer in user space.
What it is
The practice of intercepting calls to a user-mode function by overwriting its first instructions with a jump, or by rewriting a table entry such as the import address table, so control diverts to attacker or monitor code. It is used both to spy and to defend.
Why it matters
Security tools rely on these hooks for visibility, and malware both installs hooks to tamper and detects or removes them to evade. Comparing in-memory API prologues against a clean copy reveals tampering.
In practice
Finding the first bytes of a logging API overwritten with a jump, neutralizing the agent that was supposed to record the activity.
What to look for
- Jumps at the start of API functions in memory.
- Modified import table entries.
- Differences between in-memory DLLs and their files on disk.
Common mistake
Assuming every hook is malicious. Security products hook APIs too, so check who owns the code.
Practice it nearby
CyberKit has no tool for this term itself. These are the closest places to practice it.
- File Triage
Drop any file. It names the format from its first bytes, hashes it, and opens the parser that reads it: PE, ELF, Mach-O, Office, PDF, plist, or entropy and strings.
- Rule Range
Write a regex, a Sigma rule, a YARA rule and a query pipeline, each graded live against samples, some of which you never see.
In the field
Well-known tools where this shows up on the job. They are listed to show the landscape, not as a recommendation.
-
Volatility 3 Open source
A widely used open source framework for analyzing memory images with plugins. Our notes.
-
Velociraptor Open source
Can collect memory and query live process memory across many hosts. Our notes.
-
CrowdStrike Falcon Commercial
EDR agents watch memory activity on the host, such as injection and unbacked code.
Read next
- Import Address Table: The table the loader fills with addresses of imported functions.
- Direct System Calls: Invoking the kernel directly to skip monitored user-mode APIs.
- Rootkit Concept: Subverting the OS to hide processes, files, or network activity.