Fileless malware

On this page 7

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.

StageAbused mechanismWhat the attacker gains
Initial accessMacro, exploit or malicious linkFirst code execution on the host
StagingPowerShell or mshta with encoded commandsPayload fetched straight into memory
ExecutionReflective DLL loading, process injectionCode running inside a trusted process
PersistenceRegistry Run keys, WMI event subscriptionsSurvival across reboots without a binary
Lateral movementWMI, PsExec-style remote execution, RDPAccess to further hosts with stolen credentials
Typical stages of a fileless attack chain

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.

VariantWhere the payload livesPersistence
Memory-onlyProcess memory of a trusted programLost on reboot unless reinstalled
Registry-residentEncoded script stored in a registry valueRestarted by a Run key at logon
WMI-basedWMI repository event consumerTriggered by system events or timers
Script-basedInterpreter command line or remote scriptOften paired with a scheduled task
Firmware or low-levelBoot code or device firmwareSurvives reinstallation of the system
Main variants of fileless malware

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 typeTypical on-disk footprintPrimary detection method
Fileless malwareMinimal or noneBehavioral and memory analysis
TrojanExecutable disguised as useful softwareSignatures, reputation, sandboxing
RootkitKernel drivers or modified system filesIntegrity checks, offline scanning
Computer wormSelf-replicating binaryNetwork signatures, file scanning
RansomwareEncryptor binary plus ransom notesBehavioral rules on mass file changes
Comparison with related malware types

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.

ControlAttack stage disruptedPractical note
Macro blockingInitial accessBlock macros in files from the internet
AMSI and script loggingStaging and executionSend logs to a central SIEM
Application controlExecutionWDAC or AppLocker restrict LOLBins
Constrained language modeExecutionLimits dangerous PowerShell features
Attack surface reduction rulesExecution and persistenceBlock child processes from Office apps
Least privilegeLateral movementRemoves local administrator rights
Defensive controls against fileless techniques

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.