What is fileless malware?

Malicious software that doesn't rely on files stored on disk is known as fileless malware. It operates in memory, taking control of OS-installed legitimate tools and processes. PowerShell, Office macros, and Windows Management Instrumentation (WMI) are a few examples. Instead of planting obvious payloads, it blends into everyday operations and then executes in memory and slips past signature-based defenses. It’s a ghost that moves like a system administrator, not a criminal, which is why conventional tools struggle to spot them.

How is fileless malware different from conventional malware?

Traditional malware usually leaves footprints in the form of new executable files, altered system data, or suspicious programs, that antivirus tools can detect and block. In the case of fileless malware, instead of dropping files onto a system, it exploits trusted, built-in tools like PowerShell, WMI, or system memory to carry out its attack (also known as LOTL, or Living off the land). Unlike conventional malware that installs something foreign, fileless malware weaponizes what’s already there, turning legitimate processes into attack vectors.

How does fileless malware work?

Rather than leaving behind files, fileless malware blends into everyday processes, making it far harder to spot. Here’s how attackers typically pull it off:

  • Initial access: The attack often begins with a phishing email, a malicious link, or a compromised website. Instead of dropping an obvious file, attackers rely on scripts or weaponized macros to kick things off.
  • Execution in memory: The malicious code executes directly in system memory (RAM), often abusing trusted tools like PowerShell, WMI, or registry scripts to do the heavy lifting. It is at this stage when a Next-gen Antivirus can be crucial to block such attempts.
  • Establishing persistence: Fileless malware burrows into the system via persistence, which is maintained through registry modifications or scheduled task creation. This enables the malware to survive reboots without leaving conventional file-based indicators.
  • Lateral movement: Once inside, attackers quietly move between systems, harvest credentials, and deploy additional payloads, while staying under the radar of traditional defenses.
  • Cleaning up: Since the majority of activity takes place in memory, a lot of the evidence disappears when the computer is rebooted, leaving investigators with no evidence of attack.

Typical fileless malware methods

Fileless malware thrives by weaponizing tools that are already trusted within the operating system. Instead of dropping files, attackers twist everyday utilities into attack vectors. Common techniques include:

  • PowerShell abuse: Once a tool for administrators, PowerShell is hijacked to pull down and execute scripts directly in memory. This way adversaries ensure their code keeps running or executes remotely, without creating a single suspicious file. Nothing touches the disk which leaves conventional antivirus blind to fileless attacks.
  • Windows Management Instrumentation (WMI): By creating WMI event subscriptions, adversaries achieve persistence or execute remote code without needing to store files locally.
  • Registry manipulation: In this case, attackers bury code in registry keys so it automatically triggers at startup, quietly maintaining persistence while avoiding file-based detection.
  • Office Macros: This method involves weaponizing Word or Excel files, which are delivered via phishing emails, tricking users into enabling macros that activate in-memory payloads. The moment they do, an in-memory payload is activated.
  • Living-off-the-Land Binaries (LoLBins): In this method, attackers camouflage their activity by abusing legitimate Windows tools. Tools like certutil.exe or mshta.exe, which are normally part of Windows, get repurposed to execute malicious actions, blending in with seemingly normal system operations.

How to detect fileless malware

The basic premise to detect fileless malware is to shift from “what ran” approach to asking “how it ran” and “why it ran.” It’s important to look for behaviors, relationships, and anomalies across processes, memory, logs, and users.

  • Process monitoring: Watch for suspicious parent-child chains: Office spawning PowerShell or cmd, script interpreters launching LOLBins (rundll32, regsvr32, wmic, mshta), or browser processes kicking off system tools. Flag encoded or obfuscated commands (e.g., powershell -enc, base64 blobs, excessive use of -nop -w hidden, or IEX with web requests). Monitor abnormal use of WMI (persistent event consumers, Win32_Process.Create) and Scheduled Tasks creation from unusual parents.
  • Memory forensics and in-memory telemetry: Look for code injection, reflective DLL loading, and suspicious memory regions in trusted processes like svchost.exe, lsass.exe, explorer.exe, or powershell.exe. Indicators include RWX (read-write-execute) sections, shellcode-like byte patterns, and threads starting in non-module memory.
  • Event logging and correlation: Turn on and forward detailed logs, then correlate across hosts and time windows: PowerShell Script Block, Module, and Transcription logging; AMSI scan logs. Windows Event IDs: 4688 (new process), 7045 (service install), 4698 (scheduled task), 4104 (PowerShell script block), 5861 (AMSI), 19–21 (WMI activity via Microsoft-Windows-WMI-Activity). Registry changes in Run/RunOnce keys, WMI persistence, or unusual LSA/WDigest settings. Stitch together unusual script executions, registry edits, and odd login times or sources.
  • Network and C2 behaviors: Spot beaconing patterns: small, periodic outbound connections, domain generation algorithm lookups, or DNS-over-HTTPS from endpoints that don’t usually use it. Block/monitor suspicious destinations, newly registered domains, and cloud storage abuse (Pastebin, GitHub raw, OneDrive).
  • User and entity behavior analytics (UEBA): Use ML/behavior baselines to catch context shifts. For example, a helpdesk user suddenly running remote PowerShell, or a kiosk system starting WMI tasks. Combine this with impossible travel, atypical admin tool usage, or privilege escalation attempts.
  • Baselines and MITRE ATT&CK mapping: Establish “normal” per role, device type, and time-of-day. Map detections to ATT&CK (e.g., T1059 Scripting, T1047 WMI, T1055 Injection, T1064 PowerShell) to close coverage gaps and guide hunts.

How to prevent fileless malware

So to recap, fileless attacks thrive by abusing tools you already trust (PowerShell, WMI, Office, browsers) and by executing primarily in memory. Prevention is about shrinking the places attackers can run code, limiting who can run it, and containing the blast radius in the event if something slips through. Think layered controls that make the easy path for attackers the impossible one for you.

  • Limit script execution and harden interpreters: Restrict who can use PowerShell and WMI. Regular users shouldn’t need them; admins should use them from controlled jump hosts. Enforce signed script policies and enable PowerShell Script Block and Transcription logging. Disable PowerShell v2; prefer PowerShell 5+ or 7 with AMSI enabled. Apply Constrained Language Mode. Lock down WinRM to specific admin groups and trusted hosts. Implement application allowlisting for approved binaries and scripts (PS1, VBS, JS).
  • Tighten macro and Office attack surface: Block macros from the internet, disable legacy XLM macros, and keep macro settings restrictive. Turn on Protected View. Use Attack Surface Reduction (ASR) to block Office from creating child processes. Audit add-ins/COM objects. Review OAuth/consent flows for add-ins.
  • Keep up with patching and configuration hygiene: Prioritize updates for browsers, Office, scripting engines, VPN/RDP gateways, and EDR/AV. Remove deprecated components (SMBv1, legacy IE, unused Java/Flash). Set patch SLAs (critical within 48h, high severity within 7d).
  • Deploy Next-gen Antivirus for behavioral and in-memory protection: Use NGAV/EDR that inspects scripts via AMSI, detects code injection, and blocks suspicious parent-child chains. Malware Protection Plus provides behavioral ML, in-memory scanning, exploit blocking, ASR-style controls, and tamper protection.
  • Reduce privileges and harden identity: Enforce least privilege and JIT admin access. Eliminate standing local admin rights. Enable Credential Guard; disable WDigest cleartext; prevent LSASS access from non-system processes. Rotate admin passwords with LAPS. Require MFA for admin/remote access. Segment admin accounts from daily accounts.
  • Segment the network and control egress: Separate workstations from servers. Limit lateral movement (RDP, SMB, WinRM). Require jump boxes. Apply egress filtering so endpoints only reach necessary destinations. Inspect DNS for C2 patterns. Use DNS sinkholes and filtering.
  • Strengthen email and web defenses: Filter/sandbox attachments. Rewrite/scan URLs on click. Sandbox suspicious docs before delivery. Enforce DMARC/DKIM/SPF. Train users regularly on phishing, malicious prompts, and macros.
  • Browser and endpoint hardening: Standardize on modern browsers with baselines. Limit risky extensions. Enable site isolation and SmartScreen. Enforce device control for USBs and trusted removable media.

Pro tip icon Pro tip: Explore our Malware Detection Guide to learn how to uncover hidden malware and stay protected.

icon-1Meet the author
Author Image

Manish Mandal

Manish is a cybersecurity and product marketing expert with ManageEngine's Unified Endpoint Management and Security solution. With over five years of experience, he leverages technical expertise and storytelling to create blogs, reports, and resources that empower IT leaders to build resilient defenses against modern cyber threats.