Memory-Resident Malware Detection
What you'll learn: How to identify stealthy threats like fileless malware, code injection, rootkits, and malicious DLLs that hide entirely in RAM, leaving no traditional disk footprint.
The Challenge of Memory-Only Threats
Traditional malware leaves files on disk that antivirus can scan. Memory-resident malware is far more elusive—it exists only in RAM, often injecting itself into legitimate processes or loading malicious libraries dynamically. Think of it like a burglar who never leaves fingerprints because they never touch anything solid—they only manipulate what's already in motion.
What to Look For
When analyzing memory images (from the techniques you learned in lessons 2389-2392), you're hunting for anomalies that betray hidden threats:
Fileless Malware: Malicious PowerShell scripts, reflective DLL injection, or shellcode living in process memory without touching disk. Look for unusual script execution patterns or processes with strange memory allocations.
Code Injection: Legitimate processes like svchost.exe or explorer.exe with injected malicious code. Check for suspicious memory regions marked executable, threads pointing to unexpected addresses, or DLLs loaded from non-standard paths.
Rootkits: Kernel-level malware that hides processes, files, or network connections. Examine kernel memory for hooked system calls, hidden drivers, or Direct Kernel Object Manipulation (DKOM) techniques that unlink structures from system lists.
Malicious DLLs: Libraries loaded without corresponding disk files, or legitimate DLL names loaded from wrong locations. Cross-reference loaded modules against known-good baselines and verify digital signatures in memory.
Detection Approach
Compare running processes/threads against what should be there. Look for memory regions with unusual permissions (writable + executable), orphaned threads, hollowed processes, or APIs commonly abused for injection (VirtualAllocEx, WriteProcessMemory, CreateRemoteThread).
Key Takeaway: Memory-resident malware detection requires comparing memory artifacts against known-good baselines, hunting for injection indicators, examining unusual memory permissions, and identifying code executing from unexpected locations—all skills that depend on thorough process and thread analysis.