Malware & ransomware

What Is Fileless Malware? How It Hides in Memory and How to Stop It

Fileless malware never writes an executable to disk. It hides in memory and borrows your own system tools, which is why signature-based antivirus misses it.

Cysoro Security TeamPublished · 9 min read
>_ PowerShellWMIRegistrymemory MALWARE & RANSOMWARE Filelessmalware No file. No trace. Still dangerous.
Quick answer

Fileless malware is malicious code that runs in a computer's memory without writing an executable file to disk. It abuses legitimate built-in tools such as PowerShell, WMI and Office macros to carry out its goals, which lets it evade signature-based antivirus. It can still steal data, install ransomware or open remote access, so defense depends on behavior monitoring, script logging and least privilege.

Key takeaways

  • Fileless malware executes in memory and abuses trusted tools such as PowerShell and WMI, so there is no file for traditional antivirus to scan.
  • The best-known cases are Poweliks and Kovter, which hid payloads in the Windows Registry, and Duqu 2.0, which lived only in memory.
  • The defenses that work are PowerShell logging, application control, patching, phishing-resistant MFA and endpoint detection that watches behavior.

Most malware leaves a trail: a downloaded file, a new program, a changed setting your antivirus can spot. Fileless malware skips that step. It runs in memory, borrows tools your system already trusts, and can vanish when the machine restarts — which is why it still catches teams that think their antivirus has them covered.

What is fileless malware?

Fileless malware is malicious code that executes in a computer's memory without writing an executable file to disk. Instead of dropping a payload that antivirus can scan, it abuses legitimate built-in tools such as PowerShell, Windows Management Instrumentation (WMI) and Office macros to carry out the attacker's goals.

The name is slightly misleading. Some fileless attacks do store small encoded payloads in the Windows Registry or in WMI, and the Registry itself lives on disk. The point is that no ordinary executable file is ever created, so file-scanning defenses have nothing to match against a signature.

Fileless malware can do anything traditional malware can do: steal credentials, install a remote access tool, mine cryptocurrency or encrypt files for ransom. The difference is delivery and execution, not the final goal. That is why it is best understood as a technique, not a separate species of malware.

How does fileless malware work?

A typical fileless attack starts the same way most attacks start: a phishing email with a malicious document or link, or an exploited vulnerability in a public-facing application. The difference begins at execution, when the payload runs in memory instead of being saved as a file.

One common chain looks like this: a user opens a Word document and enables macros. The macro launches PowerShell, which downloads and executes a payload directly in memory. That payload injects itself into a legitimate process such as Explorer, then sets up persistence through a Registry Run key or a WMI event subscription, so it reloads at the next login without ever creating an executable.

Because every step uses signed, trusted tools, the attack blends into normal administrator activity. PowerShell is expected to run on every Windows machine. WMI is a normal management interface. That trust is the whole trick: the defenses that look for foreign files see only familiar programs doing familiar-looking things.

Anatomy of a fileless attack 1 Phishing lure malicious doc or link 2 Macro runs PowerShell in memory 3 Inject process hide inside a trusted program 4 Steal or encrypt credentials, data or ransomware 5 Persist Registry or WMI reloads at login No executable is ever written to disk — the whole chain runs in memory.
The five stages of a fileless attack. The payload lives in memory and trusted tools do the work. Illustration by Cysoro.

Fileless malware vs traditional malware: what's the difference?

The difference is where the malicious code lives and what your defenses can see. Traditional malware writes an executable to disk, which gives antivirus a file to scan, a hash to match and a quarantine target. Fileless malware removes that evidence.

Traditional malwareFileless malware
Where code livesExecutable file on diskMemory, Registry or WMI
What runs itIts own programTrusted tools: PowerShell, WMI, macros
Signature detectionWorks if the file is knownUsually fails: no file to scan
Survives reboot?Yes, via installed filesOnly with Registry or WMI persistence
Forensic evidenceFiles, hashes, install pathsLogs, memory dumps, Registry keys
Typical entryDownloaded executablePhishing document or exploited app
Final goalsTheft, ransomware, remote accessExactly the same

That last row matters most. Fileless malware is not less dangerous because it leaves no file. It is more dangerous because the same goals are reached with less evidence, which means it is often found later — after credentials are stolen or data is already gone.

What techniques does fileless malware use?

Fileless attacks are a family of techniques, not one trick. The four below cover most real cases, and attackers often combine them in a single chain.

Living off the land (LotL)

Living off the land means using legitimate system tools for malicious purposes. PowerShell can download, decode and execute code entirely in memory. WMI event subscriptions can run commands on system triggers without creating scheduled tasks. Office macros can launch all of it from a document the user chose to open. Check Point's guide to fileless malware explains how these trusted tools become the attack surface.

Registry-resident payloads

Some fileless malware stores its payload inside Windows Registry keys rather than the file system. A small loader in a Run key or a file-association handler tells a legitimate program such as mshta.exe or regsvr32.exe to read the Registry value, decode it and execute it in memory at startup or login. This is how Poweliks and Kovter achieved persistence without a file.

Process injection and hollowing

Process injection loads malicious code into the memory of a legitimate process, so the attack runs under a trusted name such as svchost.exe. Process hollowing goes further: it starts a legitimate process, empties its memory, and replaces it with malicious code. MITRE ATT&CK lists process injection as technique T1055, and Picus found it the single most prevalent technique across more than 1.1 million malware samples in its Red Report 2026.

Malicious documents and scripts

A Microsoft Office document with macros remains the most common starting point. The macro uses PowerShell to execute commands, which can include downloading and running additional malware without writing it to disk. Attackers also use HTML files, shortcut files and script interpreters already on the system to start the chain. The document is the only file involved, and it often looks like a routine invoice or CV.

What are real examples of fileless malware?

Fileless malware has a documented history going back more than a decade, and the early cases still explain how modern attacks work.

Poweliks (2014)

Poweliks was the first fileless malware to demonstrate persistence. It entered through a Microsoft Word vulnerability, then used PowerShell and JavaScript to load itself into memory. Its persistence trick was elegant: instead of pointing a Registry Run key at a malicious executable, it pointed the key at rundll32.exe, a legitimate Windows program, with parameters containing JavaScript that reloaded Poweliks into memory at every login.

Kovter (2015 onwards)

Kovter, a click-fraud family, borrowed Poweliks' approach and refined it. Malwarebytes' analysis showed Kovter hiding malicious modules in PowerShell scripts and Registry keys, using mshta.exe to run JavaScript that decrypted the payload in memory. No executable needed to be dropped on disk, which is why Kovter became known as a fileless family even though it started life as an ordinary executable.

Duqu 2.0 (2014–2015)

Duqu 2.0, documented by Kaspersky Lab in 2015, was a sophisticated espionage platform that remained solely in memory on infected hosts. It implemented no persistence mechanism at all. Instead, the attackers targeted servers with high uptime and simply re-infected systems that were disinfected by reboots. It showed that for a well-resourced attacker, memory-only operation is a viable strategy on its own.

Astaroth (2019)

Astaroth, analyzed by Microsoft in 2019, ran a textbook living-off-the-land chain: a phishing shortcut file launched a batch script, which invoked WMIC, then BITSAdmin fetched encoded payloads, Certutil decoded them, and Regsvr32 loaded the final info-stealing DLL. Every tool in the chain was a legitimate Windows component. Microsoft's researchers spotted the campaign after noticing an unusual spike in WMIC usage — behavior monitoring, not file scanning, caught it.

How do you detect fileless malware?

Detecting fileless malware means watching what programs do, not what files exist. The signals are behavioral, and they show up in logs that many organizations never turn on.

  • PowerShell logging. Enable script block logging and module logging so encoded commands, downloads and remote execution are recorded. Look for PowerShell launched by Office applications, or with encoded command arguments.
  • Unusual parent processes. A Word document should not launch PowerShell. PowerShell should not launch rundll32.exe. These parent-child relationships are the strongest single signal in most fileless attacks.
  • WMI and Registry monitoring. Watch for new WMI event subscriptions, new Registry Run keys, and file-association changes that point at scripting hosts such as mshta.exe or wscript.exe.
  • Memory inspection. Endpoint detection tools can scan process memory for injected code and suspicious allocations, which is the only way to see a purely memory-resident payload.
  • Network behavior. A process that normally never talks to the internet suddenly downloading code or beaconing to an unknown server is worth investigating, even if no file was created.

Picus's Blue Report 2025 found that while 54% of attacker activity gets logged, only 14% generates an actual alert. Turning on logging is not enough: someone, or something, has to watch the logs and act on them.

How do you prevent fileless malware?

No single control stops fileless malware. The goal is to break the chain at several points, so that when one defense fails, the next one catches the attack.

Five layers that stop fileless malware 1 Block risky macrosmacros from the internet disabled; Office files from email cannot run code 2 Constrain and log PowerShellConstrained Language Mode + script block logging on every endpoint 3 Least privilegeno local admin for daily work; admin accounts need phishing-resistant MFA 4 Patch fastclose the Office and browser flaws that start the chain 5 Behavior-based endpoint detectionwatch processes and memory, not just files
Defense in depth against fileless malware — each layer catches what the one above misses. Illustration by Cysoro.

Block macros from the internet. Microsoft now blocks macros in Office files downloaded from the internet by default, and you should keep that setting. Most fileless chains start with a user enabling macros, so removing that option removes the most common entry point.

Constrain PowerShell. Run PowerShell in Constrained Language Mode for standard users, enable script block logging, and alert on encoded commands. You do not need to remove PowerShell — you need to make its abuse visible and limited.

Enforce least privilege and MFA. Fileless malware running as a standard user can do far less damage than the same code running as an administrator. Remove local admin rights from daily accounts, and protect admin accounts with phishing-resistant MFA.

Patch Office, browsers and the operating system. Poweliks entered through a Word vulnerability. Many fileless attacks still start with a known flaw in a document reader or browser, and patching closes that door cheaply.

Use behavior-based endpoint detection. Signature antivirus is still worth having for file-based threats, but it cannot be your only endpoint control. Add detection that monitors process behavior, memory and parent-child relationships. For a wider starting point, our small business cybersecurity checklist covers endpoint controls alongside backups and updates.

Most fileless attacks begin with phishing, so training matters too. Our guide to what spear phishing is explains the targeted emails that deliver these payloads, and the verification habits that stop them.

What should you do if fileless malware infects a machine?

Act quickly and assume credentials are compromised. Fileless malware's whole advantage is stealth, so by the time you find it, it may have been running for days.

  1. Disconnect the machine from the network, but do not switch it off yet: memory evidence disappears on shutdown, and your incident responder may need a memory dump first.
  2. Run a full endpoint scan with a tool that inspects memory and checks Registry and WMI persistence, not just files.
  3. Change passwords used on that machine, revoke sessions, and check for new mail-forwarding rules, scheduled tasks and Registry Run keys.
  4. Check neighboring machines for the same indicators, especially the same PowerShell commands or WMI subscriptions.
  5. Rebuild the machine from a known-good image if you cannot confirm the infection is fully removed. Cleaning memory-resident malware without a rebuild is risky, because persistence can hide in places a scan never looks.
Do not reboot firstRebooting a machine infected with purely memory-resident malware will remove the payload — but it also destroys the evidence you need to know what was stolen. Capture logs and a memory image first, or let your IT team decide.

The bottom line

Fileless malware works because it uses your own tools against you. PowerShell, WMI and Office macros are legitimate, signed and expected to run, so file-scanning antivirus has nothing to catch. The defense is to watch behavior instead: log scripts, block risky macros, limit admin rights and monitor what processes actually do.

If you take one step today, turn on PowerShell script block logging and check that macros from the internet are blocked. Those two settings close the most common fileless entry points, and they cost nothing. You can also check whether any password used on the machine has appeared in a known breach with our free pwned password checker.

Frequently asked questions

What is fileless malware in simple terms?

Fileless malware is an attack that runs in your computer's memory instead of installing a program on your hard drive. It borrows tools already built into Windows, such as PowerShell, to do its work, so traditional antivirus that scans files has nothing to find.

Can antivirus detect fileless malware?

Traditional signature-based antivirus usually cannot, because there is no malicious file to match against a signature. Modern endpoint detection tools can catch it by watching behavior, such as PowerShell downloading code from the internet or injecting code into another process.

Does fileless malware disappear when you restart?

Purely memory-resident malware does disappear on reboot, which is why some early attacks targeted servers with high uptime. Many fileless families persist anyway by storing encoded payloads in the Windows Registry or WMI, so they reload at the next login.

What is the difference between fileless malware and a malware-free attack?

Fileless malware still involves malicious code, but it executes in memory or from the registry instead of a file on disk. A malware-free attack may involve no malicious code at all: the attacker simply uses stolen credentials and legitimate admin tools to do the damage.

Is PowerShell dangerous?

PowerShell itself is a legitimate administration tool, and blocking it outright would break normal IT work. The risk is PowerShell running encoded commands, downloading code from the internet or launching from Office documents, which is why logging and constraining it matter more than removing it.

How do you remove fileless malware?

Start by disconnecting the machine from the network, then run a full scan with an endpoint detection tool that inspects memory and checks registry and WMI persistence. Because fileless malware often steals credentials, change passwords, revoke sessions and check for new scheduled tasks, registry Run keys and mail rules before the machine goes back online.

Can fileless malware deliver ransomware?

Yes. Fileless techniques are a delivery method, not a separate kind of payload, so the same in-memory chain can end in data theft, a remote access tool, a cryptominer or ransomware encryption.

How can I protect my business from fileless malware?

Enable PowerShell script block logging, block macros in Office files from the internet, keep systems patched, enforce least privilege and MFA, and use endpoint detection that monitors process behavior and memory rather than relying on file signatures alone.

Sources

  1. Check Point — What is Fileless Malware?
  2. Picus Security — What Is Fileless Malware?
  3. Malwarebytes Labs — Untangling Kovter's persistence methods
  4. Lenny Zeltser — The History of Fileless Malware
  5. MITRE ATT&CK — Technique T1055: Process Injection
  6. ManageEngine — Fileless Malware: How It Works, Detection Methods, and Prevention
Written & fact-checked byCysoro Security Team

The engineers and analysts who build Cysoro's domain scanner, email-authentication checks and free security tools. We test what we write about every day — SPF, DKIM, DMARC, certificates, look-alike domains and phishing — and check each guide against the relevant standards, government guidance and vendor documentation.

  • Email authentication
  • Phishing & BEC
  • Domain & DNS security
  • Small-business security

Checked against Check Point, Picus Security and Malwarebytes Labs analyses, the history documented by Lenny Zeltser, and MITRE ATT&CK T1055.

How we write and fact-check →

See where your domain stands

Free for up to 3 domains. No card, no installs.

Start free