Windows Process Information

Process information

(pslist requires sysinternals pslist.exe):

tasklist -v
wmic process list full /format:csv
wmic process get name,parentprocessid,processid /format:csv
wmic process get ExecutablePath,processid /format:csv
wmic process get name,ExecutablePath,processid,parentprocessid /format:csv | findstr /I "appdata"
wmic process where processid=[PID] get parentprocessid
wmic process where processid=[PID] get commandline
wmic process where "commandline is not null and commandline!=''" get name,commandline /format:csv
gwmi win32_process -Filter "name like 'powershell.exe'" | select name,processId,commandline|FL
gwmi win32_process | select name,processId,path,commandline|FL
gwmi win32_process |FL ProcessID,ParentProcessID,CommandLine,@{e={$_.GetOwner().User}}
gwmi win32_process | Sort-Object -Property ProcessID | FL ProcessID,Path,CommandLine,ParentProcessID,@{n="User";e={$_.GetOwner().User}},@{n="ParentProcessPath";e={gps -Id $_.ParentProcessID|Select -exp Path}}
pslist

PowerShell Module to show Process Tree

import-module .\Get-ProcessTree.ps1
Get-ProcessTree -Verbose | FT Id, Level, IndentedName, ParentId,Path,CommandLine

Checking for running processes

Baseline processes and services

(Used to compare new process/services)

Current Process execution or module loads from temporary directories

Note: This will likely have some false positives as it’s just a wildcard. So in this case using ‘temp’ can come up in words such as ‘ItemProvider’.

Current Process execution or module loads from temporary directories + hash

Process Handles

Locate process handles (e.g. files open by process)

Note: Requires handles/handles64.exe from sysinternals

Close process handles (e.g. files open by process)

Note: Requires handles/handles64.exe from sysinternals

Hashes of Processes and Artifacts

Obtain hash for all running executables

Issues with spaces in names but supports CMD.exe

Powershell (Special thanks Lee Holmes)

My less efficient powershell

Obtain hash of DLLs currently loaded by processes

Obtain processes where binaries file version doesn’t match OS Release

Obtain process binary file external names

Obtain processes running which are running a DLL

Obtain hash of unsigned or invalid DLLs currently loaded by processes

Obtain list of unsigned DLLs currently loaded by processes

Process Scanning

Scan process creation logs for ‘appdata’