Skip to main content
Windows Architecture, Processes & Registry Basics
Lesson 6 of 10

Windows Architecture, Processes & Registry Basics

Understand how Windows separates user mode from kernel mode, trace normal parent-child process trees to spot anomalies, and navigate core Registry hives safely.

Beginner 22 min Linux & Windows
Authorised environments only — The techniques described here are used only in training labs and on systems you own or have written permission to test.

Learning objectives

  • Explain the boundary between user mode and kernel mode in modern Windows
  • Identify normal parent-child relationships for core Windows system processes
  • Inspect running processes, image paths and command lines using Process Explorer
  • Navigate the five root Registry hives and query autostart keys from the command line

Recommended first: Linux Processes, Signals & systemd Services

#Why this matters

Earlier in Stage 2 you saw how Linux separates user space from the kernel and stores configuration under /etc. Windows uses layered subsystem DLLs, a tight chain of boot processes, and a binary database called the Registry.

Knowing what normal looks like is the fastest way to spot trouble. Suspicious software often leaves clues in an unexpected parent process, an unsigned binary outside System32, or a new Registry autostart entry.

#User mode and kernel mode

Modern Windows splits execution into two privilege levels so that a bug in an everyday program cannot crash or corrupt the entire machine.

  1. User ApplicationsWord, browser, PowerShell, user tools
  2. Windows Subsystemkernel32.dll, advapi32.dll, ntdll.dll
  3. NT Kernel & Executiventoskrnl.exe, memory, scheduler, I/O manager
  4. Hardware Abstraction LayerHAL and kernel device drivers (.sys)
  • User mode runs applications and environment subsystems. Each process receives a private virtual address space and a security token describing its user and privileges. If a user-mode app crashes, Windows closes only that process.
  • Kernel mode runs ntoskrnl.exe, the Hardware Abstraction Layer (HAL), and kernel drivers (.sys). Every driver shares kernel memory, so an unhandled fault here triggers a Stop error (Blue Screen of Death) to protect data integrity.

Applications never touch hardware directly. A call to create a file moves from application code through Win32 APIs (kernel32.dll) into ntdll.dll, which transitions across the system call boundary into the kernel I/O manager.

#Core processes and parent-child trees

Every Windows process has a Process ID (PID) and records the PID of its parent (PPID). Just as systemd sits at the root of a Linux process tree, Windows builds a predictable startup hierarchy during boot:

Process Normal parent Role on Windows 10/11 and Server 2019/2022
System (PID 4) None Hosts kernel threads
smss.exe System Session Manager; initializes sessions
csrss.exe smss.exe Client/Server Runtime Subsystem
wininit.exe smss.exe Starts Session 0 core services
services.exe wininit.exe Service Control Manager (SCM)
lsass.exe wininit.exe Local Security Authority; handles logon and tokens
svchost.exe services.exe Host container for DLL-based Windows services
explorer.exe userinit.exe (exits) Interactive desktop shell for the signed-in user

Notice how strict those relationships are. On a healthy host, there is only one lsass.exe, running from C:\Windows\System32\lsass.exe as a child of wininit.exe. Every svchost.exe instance is launched by services.exe with a -k service-group argument. Because userinit.exe exits right after launching the desktop shell, explorer.exe normally shows no live parent in Sysinternals Process Explorer.

When inspecting a suspicious host, ask two questions first: Where is the binary located on disk? and Who spawned it? A Microsoft Office process (winword.exe) spawning cmd.exe or powershell.exe, or an svchost.exe running from C:\Users\Public\, is an immediate red flag.

#The Windows Registry

Where Linux reads /etc configuration files, Windows stores operating system, hardware, and software settings in the Windows Registry. You can browse it graphically with regedit.exe or query it from a terminal with reg.exe.

The Registry is organized like a directory tree made of keys (folders) and values (name, data type, and data). Common value types include REG_SZ (text string), REG_EXPAND_SZ (string with environment variables such as %SystemRoot%), and REG_DWORD (32-bit integer).

Five root keys (often called hives or root handles) appear at the top level:

Root key Abbreviation Scope
HKEY_LOCAL_MACHINE HKLM Machine-wide OS, driver, service, and software settings
HKEY_CURRENT_USER HKCU Settings for the currently signed-in user
HKEY_USERS HKU Profiles for all loaded user accounts (keyed by SID)
HKEY_CLASSES_ROOT HKCR Merged file-type associations and COM registrations
HKEY_CURRENT_CONFIG HKCC Active hardware profile linked from HKLM\SYSTEM

Two keys matter early in security work because programs listed there launch automatically at sign-in:

  • HKCU\Software\Microsoft\Windows\CurrentVersion\Run (runs for that user, writable without administrator rights)
  • HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run (runs for all users, requires administrator rights to modify)
Querying an autostart key on a lab workstation
$ reg query "HKCU\Software\Microsoft\Windows\CurrentVersion\Run"

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run
    OneDrive    REG_SZ    "C:\Users\labuser\AppData\Local\Microsoft\OneDrive\OneDrive.exe" /background
    UpdaterLab  REG_SZ    "C:\Users\labuser\AppData\Local\Temp\helper.exe"

Look closely at the second entry: UpdaterLab points to an executable inside Temp. Standard installers do not run persistent tools from a temporary folder.

#Defending and common mistakes

  • Trusting process names alone: Attackers frequently name malicious binaries svchost.exe or csrss.exe. Always check the full path, parent process, and digital signature.
  • Ignoring HKCU because HKLM looks clean: Non-admin users can write to HKCU\...\Run and AppData, making per-user persistence common.
  • Editing live Registry keys without backup: Mistakes in HKLM\SYSTEM or HKLM\SOFTWARE can break boot or applications. Export a .reg backup before modifying production keys, and prefer read-only queries (reg query) during triage.
  • Confusing HKCR with an independent hive: HKCR is a merged view of HKLM\SOFTWARE\Classes and HKCU\SOFTWARE\Classes, where per-user entries can override machine defaults.

#Summary

Windows isolates applications in user mode while reserving hardware and core memory management for kernel mode (ntoskrnl.exe and drivers). Core system processes follow a strict boot chain, making parent-child relationships, image paths, and signatures reliable health indicators in Process Explorer. Configuration lives in the hierarchical Windows Registry across five root keys, where HKLM and HKCU Run keys are essential stops for both administration and security triage.

Knowledge check

Sign in to take the test, complete lessons and save your progress. Log in