Explore Windows internals using PowerShell — essential knowledge for malware analysis and incident response.
Understanding Windows internals is crucial for security analysts. These four components form the foundation of how Windows operates:
A running program with its own memory space, security token, and resources.
A unit of execution within a process. Processes can have multiple threads.
A reference to a system resource (file, registry key, mutex, etc.).
Hierarchical database storing system and application configuration.
List all processes with their ID, name, memory usage, and path:
Get-Process | Select-Object Id, ProcessName, WorkingSet64, Path | Format-Table
Search for processes by name pattern:
Get-Process -Name *svc* | Select-Object Id, ProcessName, StartTime
Identify which user account is running each process:
Get-WmiObject Win32_Process | Select-Object ProcessId, Name, @{N='Owner';E={$_.GetOwner().User}}
See which processes have the most threads (potential indicator of complexity or malicious activity):
Get-Process | Select-Object ProcessName, Id, @{N='Threads';E={$_.Threads.Count}} | Sort-Object Threads -Descending | Select-Object -First 10
High handle counts may indicate resource leaks or suspicious activity:
Get-Process | Select-Object ProcessName, Id, HandleCount | Sort-Object HandleCount -Descending | Select-Object -First 10
The registry stores critical configuration. Attackers often use it for persistence.
Malware often adds entries here to survive reboots:
Get-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Run'
Get-ItemProperty -Path 'HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Run'
Services are another persistence mechanism:
Get-Service | Where-Object {$_.StartType -eq 'Automatic'} | Select-Object Name, DisplayName, Status
1. Which registry key is commonly used by malware for persistence?
2. What is a "handle" in Windows?
3. Why might a security analyst be suspicious of a process with an unusually high thread count?
4. Which PowerShell command retrieves the owner of a running process?
Answer all questions to complete the lab.
You now understand Windows internals at a level useful for security analysis. These skills are essential for malware analysis and incident response.