Skip to main content

The Mindset

On Windows you’ll work through one of several interfaces depending on how you got your shell. Each has strengths:
  • CMD — the classic command prompt. Limited, but present everywhere and great for quick enumeration
  • PowerShell — the powerful one. Full access to .NET, WMI, and the entire system. This is where serious work happens
  • WMI — not a shell but an interface into nearly every aspect of the system, queryable from both CMD (wmic) and PowerShell

CMD — The Command Prompt

The traditional interpreter. You’ll often get a CMD shell first from an exploit, then upgrade to PowerShell.

Core Commands

findstr — The Windows grep


PowerShell — The Real Tool

PowerShell is object-oriented (commands return objects, not just text) and gives you full access to the system. This is where you do credential hunting, enumeration scripts, and most offensive tooling.

Cmdlet Naming — Verb-Noun

PowerShell commands follow a Verb-Noun pattern, which makes them discoverable:

Common Aliases

PowerShell aliases many cmdlets to familiar CMD and Linux commands, so muscle memory carries over:

Discovery — Finding What You Need

Get-Member is your best friend in PowerShell. Pipe any object into it to see every property and method available — that’s how you discover what data you can extract from a command’s output.

Pipeline & Filtering

Because PowerShell passes objects, you filter on properties, not text:

Execution Policy

PowerShell’s execution policy restricts which scripts can run. It’s not a security boundary — it’s trivial to bypass, and you’ll need to when running enumeration scripts.
Bypassing it (several ways, none require admin):
IEX (New-Object Net.WebClient).DownloadString(...) is the classic “download cradle” — it pulls a script from your machine and runs it directly in memory, leaving nothing on disk for AV to scan. The modern equivalent uses Invoke-RestMethod (irm).

WMI — Windows Management Instrumentation

WMI is an interface to almost every part of the system — hardware, OS, processes, services, installed software. You query it when you need detailed system info, and it’s available from both CMD and PowerShell.

From CMD — wmic

wmic process get ...,commandline is a credential-hunting goldmine — just like ps aux on Linux, processes often have passwords passed as command-line arguments, and this shows them.

From PowerShell — Get-WmiObject / Get-CimInstance

Get-WmiObject is deprecated in favor of Get-CimInstance (same syntax, swap the cmdlet name). Use Get-CimInstance on modern systems, but know Get-WmiObject for older boxes where the newer cmdlet may behave differently.

Quick Reference

CMD

PowerShell

WMI


Next: Processes & Services — finding running processes, abusing service misconfigurations, and dumping credentials from memory.