What Is Fileless Malware and How to Detect It Effectively
Fileless malware runs mainly in memory and abuses trusted tools already on a system, such as PowerShell, WMI and signed Windows binaries, instead of dropping a traditional executable. That makes file-scanning antivirus less effective.
Topic: Cyber Threats, Scams & Online Safety in Cybersecurity & Ethical Hacking · Tutorial
Quick answer: Fileless malware runs mainly in memory and abuses trusted tools already on a system, such as PowerShell, WMI and signed Windows binaries, instead of dropping a traditional executable. That makes file-scanning antivirus less effective. You detect it by watching behaviour: enable PowerShell script block logging (event ID 4104), keep the Antimalware Scan Interface (AMSI) active so scripts are scanned after deobfuscation, collect process and command-line data with Sysmon or an EDR tool, and alert on unusual parent and child processes. Reduce risk with attack surface reduction rules, application control and least privilege.
Key takeaways
- Fileless attacks live off the land, using built-in tools like PowerShell.
- MITRE ATT&CK tracks PowerShell abuse as T1059.001.
- AMSI lets security tools inspect scripts at run time.
- Script block logging and command-line auditing provide key evidence.
- Behaviour-based EDR is more effective than file scanning alone.
Table of Contents
- What Is Fileless Malware?
- Which Techniques Do Fileless Attacks Use?
- Why Is Fileless Malware Hard to Detect?
- Which Logs Should You Turn On?
- What Detection Signals Should You Watch?
- How Can You Prevent Fileless Attacks?
- How Should You Respond to a Suspected Case?
- References
What Is Fileless Malware?
Fileless malware is a style of attack, not a single malware family. The attacker avoids writing a malicious program to disk. Code may run directly in memory, be stored in the registry or WMI, or be loaded by trusted system tools. Security agencies call this living off the land. The joint CISA and partner guidance on living off the land explains why these techniques blend in with normal administration.
Which Techniques Do Fileless Attacks Use?
| Technique | ATT&CK ID | What defenders see |
|---|---|---|
| PowerShell execution | T1059.001 | Encoded commands, downloads into memory |
| Windows Management Instrumentation | T1047 | Remote process creation, WMI event subscriptions |
| Signed binary proxy execution | T1218 | mshta, rundll32 or regsvr32 running scripts |
| Registry run keys for persistence | T1547.001 | Scripts stored in registry values |
| Process injection | T1055 | Code running inside a legitimate process |
Attacks often begin with phishing or social engineering. The Kimsuky ClickFix campaign is one example where victims were tricked into running PowerShell themselves.
Why Is Fileless Malware Hard to Detect?
- There may be no file to hash or scan.
- PowerShell and WMI are used daily by administrators.
- Commands are often obfuscated or base64 encoded.
- Evidence in memory disappears after a reboot.
Which Logs Should You Turn On?
| Control | What it records | Where |
|---|---|---|
| PowerShell script block logging | Script content after deobfuscation, event ID 4104 | Microsoft-Windows-PowerShell/Operational |
| Process creation with command line | Every new process and its arguments, event ID 4688 | Security log |
| Sysmon | Process, network, registry and WMI events | Microsoft-Windows-Sysmon/Operational |
| AMSI | Runtime script content passed to antimalware | Defender or EDR alerts |
Microsoft's PowerShell logging documentation explains script block logging, usually enabled by Group Policy. AMSI lets antimalware inspect PowerShell, VBScript, JScript and Office macros at run time. Sysmon adds detailed telemetry. To review recent script block events on a test machine:
Get-WinEvent -LogName 'Microsoft-Windows-PowerShell/Operational' -MaxEvents 50 |
Where-Object { $_.Id -eq 4104 } |
Select-Object TimeCreated, Message
Under CERT-In directions, Indian organisations must keep ICT system logs for 180 days, so forward these logs to a SIEM.
What Detection Signals Should You Watch?
- Office apps or browsers launching PowerShell, cmd, mshta or wscript.
- PowerShell with encoded command or hidden window flags.
- Attempts to disable AMSI, Defender or logging.
- New WMI event subscriptions or unusual registry run keys.
- Scripting engines making outbound network connections.
How Can You Prevent Fileless Attacks?
- Enable Microsoft Defender attack surface reduction rules, such as blocking Office apps from creating child processes.
- Use application control (WDAC or AppLocker) so PowerShell runs in Constrained Language Mode for normal users.
- Remove PowerShell version 2, which lacks modern logging.
- Limit local admin rights and patch browsers and Office.
- Train staff to refuse instructions to paste commands into Run or terminal windows.
How Should You Respond to a Suspected Case?
Isolate the host but avoid rebooting until memory is captured, since evidence lives in RAM. Collect logs, check for persistence and reset exposed credentials. Report qualifying incidents to CERT-In within 6 hours. AI-assisted attackers are making scripts harder to spot, as covered in our piece on dark AI attacks. For hands-on detection practice, ask about our SOC analyst and threat hunting training.
References
Frequently Asked Questions
What's Your Reaction?
Like
0
Dislike
0
Love
0
Funny
0
Wow
0
Sad
0
Angry
0