Fileless malware operates entirely in memory without writing malicious files to disk, using legitimate system tools and processes to evade traditional file-based antivirus detection.
Fileless malware executes entirely in memory without writing traditional malicious executables to disk. It leverages legitimate system tools like PowerShell, WMI, and .NET to load and execute payloads in memory, inject into running processes, or persist through registry entries and scheduled tasks, evading file-based antivirus scanning.
Fileless malware typically arrives through phishing or exploitation, then uses legitimate scripting engines to download and execute payloads directly in memory. Common techniques include reflective DLL injection, process hollowing, PowerShell cradles that download and invoke code without touching disk, and abuse of .NET runtime for in-memory execution.
Traditional antivirus relies on scanning files on disk for malicious signatures. Fileless malware never creates detectable files, operates within trusted process memory spaces, uses signed system binaries, and disappears on reboot unless persistence mechanisms are employed. Detection requires memory analysis, behavioral monitoring, and process relationship tracking.
Common techniques include PowerShell download cradles, reflective PE injection into legitimate processes, process hollowing (replacing legitimate process memory), WMI event subscriptions for persistence, registry-resident payloads, .NET Assembly.Load for in-memory execution, and abuse of scripting hosts like mshta and wscript for initial execution.
Defenses include deploying EDR solutions with memory analysis capabilities, enabling PowerShell Script Block Logging, implementing AMSI (Antimalware Scan Interface) for script content inspection, restricting administrative tool access through application control, monitoring process injection behaviors, and implementing behavioral detection rules in SIEM.
The Antimalware Scan Interface (AMSI) is a Windows framework that allows security products to inspect script content at runtime before execution. AMSI intercepts PowerShell, VBScript, JScript, and .NET content, enabling antivirus to scan fileless payloads in memory. Attackers target AMSI bypass as a critical step in fileless attack chains.
EDR detects fileless malware through behavioral analysis including suspicious process creation chains, memory injection detection, command-line argument monitoring, script content analysis via AMSI integration, API call hooking for process manipulation, anomalous network connections from legitimate processes, and machine learning models trained on fileless attack patterns.
Penetration testers use fileless techniques like PowerShell Empire, Cobalt Strike's in-memory beacons, and custom .NET assemblies to simulate advanced threat actor behavior. Testing fileless attack chains evaluates EDR detection capabilities, AMSI effectiveness, script logging coverage, and SOC response to memory-resident threats.