Powershell Enumeration
Get-LocalUser : Enumerate local users
Get-LocalGroup : Enumerate groups
Get-LocalUser -SID "S-1-5-21-1394777289-3961777894-1791813945-501" : Find the user to which the defined SID belongs
Get-LocalUser | Where-Object -Property PasswordRequired -Match false : to find users that have their password required values set to False
Get-NetIPAddress : Find IP address info
Get-NetTCPConnection : Command to find about current TCP connections
Get-NetTCPConnection | Where-Object -Property State -Match Listen : Currently listening ports
Get-Hotfix : Patch update information
Get-ChildItem -Path C:\ -Include *.bak* -File -Recurse -ErrorAction SilentlyContinue : Finding files (here, backup file)
Get-ChildItem C:* -Recurse | Select-String -pattern APIKEY : Find files containing the string "API_KEY" (Similar to Grep)
Get-Process : List all processes
Get-ScheduleTask : Find scheduled task
Get-Acl <path> : Find ownership info
Get-Content -Path 'C:\Users\dark\AppData\Roaming\Microsoft\Windows\PowerShell\PSReadline\ConsoleHost_history.txt' : Just like Linux bash, Windows powershell saves all previous commands into a file called ConsoleHost_history. This is located at %userprofile%\AppData\Roaming\Microsoft\Windows\PowerShell\PSReadline\ConsoleHost_history.txt
Last updated