What a Process Is Made Of
A process is a running program's container. When Notepad starts, Windows reads notepad.exe from disk and builds a process around it. The process holds workers to run its code, shared code it borrows, space for its data, tickets to what it opens and a badge saying who it works for. The Basics below sets these parts side by side, and each has its own page in this section. An investigator reads them because code hiding in a process shows in one of its parts, even when its name in the list looks right.
The Basics
A process holds six parts, set side by side below with Notepad as the example. Each tile says what the part is, why Windows needs it and where to read more.
The cards under the picture explain the other words these pages use, such as PID, session and kernel.
notepad.exePID 4312Parent explorer.exeSession 1Runs as alice
DLLs
The shared code it borrows from Windows.
Every program opens files and draws windows, so Windows ships that code once for all of them.
In Notepadkernel32.dll for files, user32.dll for its window
Loaded DLLsHandles
Its numbered tickets to things Windows owns.
A program cannot touch a file or another process directly, so Windows hands it a ticket.
In NotepadTicket 0x1A4 for notes.txt
Handles, Pipes and MutexesMemory Regions
The space where its code and data sit.
Each program gets a space of its own, so one cannot overwrite another by mistake.
In NotepadThe text alice types sits in its heap
Memory RegionsThreads
The workers that run its code.
A program has several jobs at once, such as drawing its window while it saves.
In NotepadOne thread answers alice's typing
ThreadsToken
The ID badge that says who it works for.
Windows reads the badge before every file, key or process the program opens.
In Notepadalice, at medium integrity
Token and PrivilegesCommand Line
What it was told to do when it started.
One program can do many jobs, so it is told which one.
In Notepadnotepad.exe C:\
Command Line and EnvironmentUsers\ alice\ notes.txt
Its network connections sit outside it, in Windows' network stack, which notes the process that owns each one.Network Connections
PID and Parent PID
- What It Is
- The process ID (PID) is the number Windows gives each running process. The parent PID is the number of the process that started it.
- Why an Investigator Cares
- The parent says how a process came to run. Once a process exits, Windows is free to give its number to a new one. So read the parent from the record written when the process started, such as event 4688 in the Security log.
- Read More
- Process Trees and Call Chains
Session
- What It Is
- A session holds one person's sign-in, with its own desktop. Windows keeps its services in session 0 and runs the programs people use in their own sessions.
- Why an Investigator Cares
- A program a person opened that sits in session 0, where only Windows and its services run, is out of place.
Service
- What It Is
- A program the Service Control Manager, services.exe, starts and runs in the background, often at boot, under the account set for it.
- Why an Investigator Cares
- Services start with no one signed in and often run as SYSTEM, so a new one deserves a close look. Event 7045 in the System log records each service installed.
- Read More
- services.exe
Kernel
- What It Is
- The protected core of Windows. Ordinary programs cannot write to its memory, and it keeps the main record of every process.
- Why an Investigator Cares
- Its record of a process is hard to fake, so when it disagrees with the process's own copy, believe the kernel.
Integrity
- What It Is
- A level in the token, low, medium, high or system, that limits what a process may change. Standard users get medium, elevated users high and system services system.
- Why an Investigator Cares
- A program a person runs at system integrity, or at high integrity with no elevation they approved, needs a reason.
- Read More
- Token and Privileges
What It Is
Windows keeps two records of every process. One sits in the kernel, the protected core of Windows, and the other, the process environment block (PEB), sits in the process's own memory.
- Why Windows Needs It
- Windows needs a record it can trust, so it keeps one in memory that ordinary programs cannot reach. A program also needs its own details at hand, such as its command line and loaded DLLs. So Windows puts a copy of those in the program's own memory.
- An Everyday Example
- Notepad's PID, parent and token sit in the kernel's record. Its command line, notepad.exe C:\
Users\ alice\ notes. txt, sits in its PEB, where Notepad's own code can read it and could change it.
The Kernel's Record
Ordinary programs cannot change it
- PID and parent PID
- The program file it started from
- Its threads
- Its handles
- Its memory map
- Its token
The Process's Own Copy (PEB)
Code running in the process can rewrite it
- Its command line
- A copy of the program's path
- The lists of DLLs it loaded
- Kept by the Kernel
- Ordinary programs cannot write to the kernel's record, so it is the better witness of what the process really is.
- In the Process's Own Memory
- The PEB is ordinary memory in the process, so code running there can rewrite it and fool any tool that reads only the PEB.
The Map
The process window on the topic page shows a process as a row with seven tabs. Each card below names a tab, who keeps what it reads and the page that explains it.
Overview
- Kept By
- The kernel, and the PEB for the command line
- Explained In
- This page
DLLs
- Kept By
- The process's memory (lists) and the kernel (mapped files)
- Explained In
- Loaded DLLs
Handles
- Kept By
- The kernel
- Explained In
- Handles, Pipes and Mutexes
Memory
- Kept By
- The kernel
- Explained In
- Memory Regions
Threads
- Kept By
- The kernel
- Explained In
- Threads
Network
- Kept By
- The kernel's network stack
- Explained In
- Network Connections
Token
- Kept By
- The kernel
- Explained In
- Token and Privileges
Kept by the kernelIn the process's own memory, which code in it can change
Read a Process in Order
The pages in this section follow a learner's order. An investigation runs in another order, the one in which a disguise usually gives itself away.
Start with the process list, and check its name, parent, account, path and command line against the process's own page. Then read its threads and memory, then its DLLs and handles, then its connections and token.
A process whose list columns are right but whose threads start in memory no file backs is the case the inside view exists for.
The Kernel and the Process Disagree
When the two records disagree, believe the kernel. Code in the process can write to the PEB, and Microsoft calls the PEB an internal structure whose layout may change.
The kernel writes a path in its own form, starting \Device\HarddiskVolume3 where the PEB writes C:, so set that part aside before comparing. Here the kernel's record shows a copy in C:\Users\Public, while the PEB claims the Windows copy.
The Kernel's Record
- Image name
svchost.exe- Image path
\Device\ Harddisk Volume3\ Users\ Public\ svchost.exe
The Process's Own Copy
- Image name
svchost.exe- Image path
C:\Windows\ System32\ svchost.exe
- Image nameAgrees
- Image pathDisagrees: the PEB names the Windows copy
What Normal Looks Like
On a healthy machine this part looks like this.
- The kernel's record and the PEB name the same program file.
- The command line in the PEB matches the one recorded when the process started.
- Its code runs from the program and DLL files it loaded, and every thread starts there.
- It runs as the account its job needs, at the integrity level that account gets.
Why It Matters
A process can pass every column of a process list and still hold code that is not its own. Knowing which part each tool reads, and who can change it, tells you where to look next.
Normal and Suspicious
A clean machine sits beside a suspicious one, and the pointer marks where to look.
Normal
A clean Windows 11 install
| Name | PID | Parent | Path |
|---|---|---|---|
spoolsv.exe | PID 808 | services.exe | C:\ |
Suspicious
ws-042,
| Name | PID | Parent | Path |
|---|---|---|---|
spoolsv.exe | PID 3268 | services.exe | C:\ |
| PathThe genuine path, as on the clean side: the list cannot show this, so open its Threads and Memory tabs. Remote Thread Injection | |||
What a Malicious Example Shows
Each card is what malicious use of this part looks like, and where it shows.
- The kernel's record names one program file and the PEB another.Where it shows: windows.
malware. pebmasquerade sets the two paths side by side in a memory image. - The command line in the PEB differs from the one recorded when the process started.Where it shows: windows.cmdline in a memory image, set against Sysmon event 1 or event 4688 in the Security log.
Live and in Memory
A live tool asks Windows about a process while it runs. Volatility 3 reads the same records from a memory image, a saved copy of the machine's memory, where code that hides from a live tool often still shows.
On a Running Machine
- The process, still running
- Windows answers
- A live tool shows it
A live tool such as Process Explorer asks Windows about the process while it runs. It is quick, but code that is still running can hide from it.
In a Memory Image
- The machine's memory
- Saved to a file
- Read later by Volatility 3
A memory image is a copy of the machine's memory saved at one moment. Nothing on the machine can change the copy, so code that hides from live tools often still shows, but it shows one moment only.
Which processes are running, and do the kernel's own lists agree?
On a Running Machine
- Process Explorer (documentation, opens in a new tab)Live Machine A free Microsoft tool that works like a detailed Task Manager. It shows each process under the one that started it, with its DLLs and handles. Each process with its parent, owning account, path and command line.
Windows.(documentation, opens in a new tab)Live Machine A Velociraptor artifact. It is a ready-made question Velociraptor asks of running machines, named from general to specific. Pslist means process list. The same across many machines, with path, command line, user and start time.System. Pslist
In a Memory Image
windows.pslist(documentation, opens in a new tab)Memory Image A Volatility 3 plugin. It is one check run on a saved copy of a Windows machine's memory. pslist means process list. The processes in the kernel's active process list.windows.(documentation, opens in a new tab)Memory Image A Volatility 3 plugin from its malware group. It checks a memory image for code that hides, or code put into a process. psxview means process cross view. Which of several views of memory see each process, to find one a single list misses.malware. psxview
Does the process's own copy agree with the kernel's record?
On a Running Machine
Windows.(documentation, opens in a new tab)Live Machine A Velociraptor artifact. It is a ready-made question Velociraptor asks of running machines, named from general to specific. The PEB's image path, command line and environment for each live process.Memory. Process Info
In a Memory Image
windows.(documentation, opens in a new tab)Memory Image A Volatility 3 plugin from its malware group. It checks a memory image for code that hides, or code put into a process. The kernel's program name and path beside the PEB's path.malware. pebmasquerade
What does it hold open, and who does it run as?
On a Running Machine
- Handle (documentation, opens in a new tab)Live Machine A free Microsoft tool that lists the handles each process holds open. The handles a process holds open, with the access each one grants.
- AccessChk (documentation, opens in a new tab)Live Machine A free Microsoft tool that shows what access an account has to a file, key or process.
accesschk -p -f -v <process>The groups, privileges and integrity level in a process's token.
In a Memory Image
windows.handles(documentation, opens in a new tab)Memory Image A Volatility 3 plugin. It is one check run on a saved copy of a Windows machine's memory. Every handle each process held at capture.windows.getsids(documentation, opens in a new tab)Memory Image A Volatility 3 plugin. It is one check run on a saved copy of a Windows machine's memory. getsids means get SIDs, the security IDs of accounts and groups. The account and groups in each process's token.
What It Misses
Every way of looking has gaps, so cover these from another source.
- A live tool sees only what the running system reports now. For anything that ended before you looked, read creation records or a memory image.
- A memory image holds only the pages that were in RAM, so a part you cannot read is not proof it was empty.
False Positives
These look odd but are normal, so rule them out before you act.
- Paths differ in form between tools. The kernel writes device paths without a drive letter, so normalise both before calling two paths different.
- Some programs change their own command line after starting, so a PEB copy that differs from the creation record is a lead to explain, not a verdict.
Checks That Use It
These checks read this part as one of their steps.
Sources
- Microsoft Learn: about processes and threads (opens in a new tab)
- Microsoft Learn: user mode and kernel mode (opens in a new tab)
- Microsoft Learn: PEB structure (opens in a new tab)
- Microsoft Learn: PEB_LDR_DATA structure (opens in a new tab)
- Microsoft Learn: RTL_USER_PROCESS_PARAMETERS structure (opens in a new tab)
- Microsoft Learn: advantages of dynamic linking (opens in a new tab)
- Microsoft Learn: handles and objects (opens in a new tab)
- Microsoft Learn: access tokens (opens in a new tab)
- Microsoft Learn: Mandatory Integrity Control (opens in a new tab)
- Microsoft Learn: thread handles and identifiers (opens in a new tab)
- Microsoft Learn: session 0 isolation for services (opens in a new tab)
- Microsoft Learn: the service control manager (opens in a new tab)
- Volatility 3: windows.malware.psxview (opens in a new tab)
- Volatility 3: windows.malware.pebmasquerade (opens in a new tab)
- Velociraptor: Windows.Memory.ProcessInfo (opens in a new tab)
- Microsoft Sysinternals: Process Explorer (opens in a new tab)
- MITRE ATT&CK T1543.003: Create or Modify System Process: Windows Service (opens in a new tab)
MITRE ATT&CK is a free public catalogue of the techniques attackers use. Each technique has an ID, such as T1055 for Process Injection, so defenders can name the same behaviour the same way. Reading this part helps find these techniques.
- T1036 (opens in a new tab) Masquerading
- T1564.010 (opens in a new tab) Hide Artifacts: Process Argument Spoofing