Fileless malware is malicious code that executes in memory and relies on legitimate, preinstalled system tools instead of dropping a traditional executable file on disk. In cybersecurity, and specifically in the study of malware and attacks, the term describes a technique rather than a malware family: the attacker lives off the land, abusing interpreters such as PowerShell, Windows Management Instrumentation (WMI) or the .NET runtime to carry out each stage of an intrusion.
The approach matters because classic antivirus products were built to scan files for known signatures. When nothing suspicious is written to disk, that model loses much of its visibility, and defenders must instead watch process behavior, command lines and memory.
How fileless malware executes without a dropped binary
Fileless malware works by chaining trusted components so that every step looks like ordinary administration. A typical intrusion begins with a phishing document, a malicious link or an exploited browser vulnerability, which launches a script interpreter with an encoded command. That command downloads further code directly into memory, where it is reflectively loaded into a running process without ever touching the file system.
The term is somewhat misleading, because few attacks are completely fileless. Most leave a small artifact somewhere, such as a shortcut, a registry value or a scheduled task. The defining property is that the main malicious payload never exists as a standalone executable that a file scanner could inspect.
The following table shows the common stages of a fileless intrusion and the system mechanism each stage abuses.
| Stage | Abused mechanism | What the attacker gains |
|---|---|---|
| Initial access | Macro, exploit or malicious link | First code execution on the host |
| Staging | PowerShell or mshta with encoded commands | Payload fetched straight into memory |
| Execution | Reflective DLL loading, process injection | Code running inside a trusted process |
| Persistence | Registry Run keys, WMI event subscriptions | Survival across reboots without a binary |
| Lateral movement | WMI, PsExec-style remote execution, RDP | Access to further hosts with stolen credentials |
Variants and living-off-the-land techniques
Fileless techniques fall into several distinct categories depending on where the malicious logic resides. Security researchers often distinguish between purely memory-resident code, code hidden in system configuration stores, and attacks that only use dual-use binaries, sometimes called LOLBins, which are signed operating system programs that can also serve an attacker.
| Variant | Where the payload lives | Persistence |
|---|---|---|
| Memory-only | Process memory of a trusted program | Lost on reboot unless reinstalled |
| Registry-resident | Encoded script stored in a registry value | Restarted by a Run key at logon |
| WMI-based | WMI repository event consumer | Triggered by system events or timers |
| Script-based | Interpreter command line or remote script | Often paired with a scheduled task |
| Firmware or low-level | Boot code or device firmware | Survives reinstallation of the system |
Common abused tools on Windows include PowerShell, WMI, mshta, rundll32, regsvr32 and certutil. On Linux, attackers use bash, Python, curl and memory-backed file descriptors created with memfd_create to run code that has no path on disk. The MITRE ATT&CK framework catalogs these behaviors under techniques such as command and scripting interpreter, process injection and system binary proxy execution.
Fileless malware compared with traditional threats
Fileless malware differs from conventional malware mainly in where its code lives and how it is detected, not in its goals. It frequently serves as the delivery mechanism for familiar threats: a fileless loader may install ransomware, an infostealer or a backdoor once the attacker has secured access.
The comparison below contrasts the approach with neighboring threat types in the same topic.
| Threat type | Typical on-disk footprint | Primary detection method |
|---|---|---|
| Fileless malware | Minimal or none | Behavioral and memory analysis |
| Trojan | Executable disguised as useful software | Signatures, reputation, sandboxing |
| Rootkit | Kernel drivers or modified system files | Integrity checks, offline scanning |
| Computer worm | Self-replicating binary | Network signatures, file scanning |
| Ransomware | Encryptor binary plus ransom notes | Behavioral rules on mass file changes |
A rootkit also aims for stealth, but it typically hides by modifying the operating system, whereas fileless malware hides by blending into normal activity. Both may appear together in advanced campaigns run by organized criminal groups and state-sponsored actors.
Detecting and preventing fileless attacks
Effective defense against fileless malware depends on visibility into runtime behavior rather than static file inspection. Endpoint detection and response (EDR) tools record process trees, command lines, network connections and memory events, which allows analysts to spot a word processor launching PowerShell with a Base64-encoded command, a classic warning sign.
Microsoft provides several built-in controls that directly target these techniques. The Antimalware Scan Interface (AMSI) lets security products inspect script content after it has been decoded, and PowerShell script block logging records the code that actually runs. The table maps common controls to the stage they disrupt.
| Control | Attack stage disrupted | Practical note |
|---|---|---|
| Macro blocking | Initial access | Block macros in files from the internet |
| AMSI and script logging | Staging and execution | Send logs to a central SIEM |
| Application control | Execution | WDAC or AppLocker restrict LOLBins |
| Constrained language mode | Execution | Limits dangerous PowerShell features |
| Attack surface reduction rules | Execution and persistence | Block child processes from Office apps |
| Least privilege | Lateral movement | Removes local administrator rights |
Memory forensics completes the picture during incident response. Tools such as Volatility can analyze a captured memory image to reveal injected code, hidden threads and decrypted payloads, so responders should capture memory before rebooting a suspected host.
Limitations, misconceptions and common mistakes
The most common misconception is that fileless malware is undetectable. It is harder to catch with signature scanning, but its reliance on unusual parent-child process relationships and obfuscated command lines makes it highly visible to well-tuned behavioral monitoring.
- Rebooting is not a cure: registry and WMI persistence reinstall the payload at the next logon.
- Disabling PowerShell entirely is rarely practical and attackers simply switch to other interpreters.
- Alert fatigue is a real risk, because administrators use the same tools legitimately every day.
- Older PowerShell version 2 lacks AMSI and logging, so it should be removed where possible.
Defenders also make the mistake of treating fileless activity as a separate problem. In practice it is one stage of a broader intrusion, so detection rules should be correlated with identity events, email telemetry and network data to reconstruct the whole attack.
Stripped to the essentials
Most harmful programs arrive as a file that a security scanner can examine, much like a parcel that customs can open. Fileless malware avoids sending the parcel. Instead, it gives instructions to tools that already live on the computer and that the system trusts.
Because the dangerous code mostly stays in the computer’s short-term memory, it leaves few traces behind. The key takeaway is that catching it requires watching what programs do, not only checking which files are present.
Where it is applied
An accounts payable clerk at a mid-sized manufacturer opens an invoice attachment and enables editing. The document silently launches PowerShell with a long encoded command, which downloads a loader into memory and injects it into a legitimate system process. A WMI event subscription is created so the loader returns after every restart, and no new executable appears in the file system.
The company’s EDR platform flags the unusual chain of a spreadsheet application spawning PowerShell, and AMSI captures the decoded script. The security team isolates the workstation, captures a memory image, and removes the WMI subscription and registry entries. Investigation shows the loader was preparing to deploy ransomware. The attack was contained within about two hours, before any file servers were encrypted, and the company then blocked internet macros and enabled attack surface reduction rules across all endpoints.