# List all running servicesGet-Service|?{$_.Status-eq"Running"}|select -First2|fl
tasklist/svc# Handle specific servicesc qcSERVICE_NAME# Query servicesc start SERVICE_NAMEsc stopSERVICE_NAMEsc configSERVICE_NAMEKEY=VALUE# ex) sc config wuauserv binPATH=C:\Windows\pwn.exesc sdshowSERVICE_NAME# List running application under currently logged in userregqueryHKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run# Query specific service with the registry (returns more info than sc)Get-ACL-PathHKLM:\PATH\TO\SERVICE# Check Windows Defender StatusGet-MpComputerStatus# List AppLocker RulesGet-AppLockerPolicy-Effective|select -ExpandPropertyRuleCollections# Test AppLocker PolicyGet-AppLockerPolicy-Local|Test-AppLockerPolicy-pathPATH_TO_FILE-UserUSER
Scripts
1
2
3
4
5
6
.\SCRIPT.ps1# Execute script.\SCRIPT.ps1;MODULE# Excute particular module from the scriptImport-Module.\SCRIPT.ps1# Import modules from the scriptGet-Module# List all loaded modulesGet-ExecutionPolicy-ListSet-ExecutionPolicyPOLICY-ScopeSCOPE# Can set policy if proper rights given. Limited to user session
Windows Management Instrumentation (WMI)
1
2
3
4
5
# The command "wmic" is suited for CMD where as Powershell utilizes "Get-WmiObject" and "Invoke-WmiMethodwmic# Used in CMDGet-WmiObject# Get instances or information of WMI classesGet-WmiObjectwin32_useraccount# List user accounts with sidInvoke-WmiMethod# Get methods of WMI objects
MISC
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# Environmentset systeminfo# Check quick fixwmicqfeGet-HotFix|ft -AutoSize# pwsh# List installed programswmicproductgetnameGet-WmiObject-ClassWin32_Product|select Name,Version# pwsh# User & Groupqueryuser# w in linuxnetuser# list usersnetlocalgroup# list groupsnetlocalgroupGROUP # list members of the group