100+ Windows CMD Commands


When it comes to penetration testing and ethical hacking, Windows Command Prompt (CMD) is still one of the most underrated yet powerful hacking tools. While PowerShell gets most of the attention, CMD remains a goldmine for red teamers, pentesters, and hackers who want quick, stealthy, and effective results.

In this ultimate guide, I’ll walk you through all the essential CMD commands you need to master — from system reconnaissance to domain enumeration, privilege escalation, persistence, and lateral movement.

This is your one-stop Windows CMD cheat sheet for hackers. Bookmark it, practice it, and use it in your next red team engagement.


🖥️ System Information (Recon)

Gathering system details is the first step in any pentest or exploit chain.

wmic os get osarchitecture || echo %PROCESSOR_ARCHITECTURE%   #Get architecture
systeminfo
systeminfo | findstr /B /C:"OS Name" /C:"OS Version"         #Get only OS info
wmic computersystem LIST full                                #PC info
wmic qfe get Caption,Description,HotFixID,InstalledOn        #Patches
wmic qfe list brief                                          #Updates
hostname                                                     #Get hostname
DRIVERQUERY                                                  #Drivers (potentially vulnerable)

🌍 Environment Variables

Environment variables can leak usernames, domains, and controllers useful for exploitation.

Important ones:

  • COMPUTERNAME → Computer name

  • USERNAME → Current user

  • USERDOMAIN / USERDNSDOMAIN → Domain info

  • LOGONSERVER → Domain controller

  • HOMEPATH / USERPROFILE → Home directory


💾 Mounted Disks


🛡️ Windows Defender & Recycle Bin


⚙️ Processes, Services & Installed Software


🏢 Active Directory & Domain Enumeration

Domain Info

Users

Groups

Computers & Trusts


📜 Logs & Event Queries


👤 Users & Groups

Persistence tricks:


🌐 Networking & Firewall

Firewall rules:

Enable Remote Desktop:


📡 Shares & WiFi


📥 File Download via LOLBAS


🔐 Credentials & Passwords


🧨 Misc Exploitation Tricks

  • Hide files:

  • Alternate Data Streams (ADS):

  • Obfuscation:

  • Manual DNS exfil:

General commands:


circle-check

Last updated

Was this helpful?