11 Windows Security Commands for SOC Analysts and What to Look For
SOC analysts use a small set of read-only Windows commands to triage a suspicious host quickly.
Topic: SOC & Blue Team in Cybersecurity & Ethical Hacking · Commands & reference
Learning path: SOC Analyst, lesson 5 of 16
Quick answer: SOC analysts use a small set of read-only Windows commands to triage a suspicious host quickly. The most useful are Get-WinEvent for security events (failed logons 4625, new processes 4688, new services 7045), netstat -ano and Get-NetTCPConnection for network connections, Get-Process for running programs, Get-MpComputerStatus and Get-MpThreatDetection for Microsoft Defender health, auditpol /get to confirm logging is enabled, Get-LocalGroupMember for admin accounts, schtasks /query and Win32_StartupCommand for persistence, and Get-HotFix for patches. Run them from an elevated prompt where needed, only on systems you are authorised to examine, and record what you run.
Key takeaways
- All commands here only read information; they do not change the system.
- Check audit policy first, because missing logs mean missing evidence.
- Focus on logons, processes, services, connections and persistence.
- Map findings to MITRE ATT&CK techniques for reporting.
- On live incidents, prefer EDR or forensic collection to avoid altering evidence.
Table of Contents
- What Should You Check Before Running Commands?
- Is Logging Turned On?
- How Do You Search Security Events?
- Which Commands Show Network Activity?
- How Do You Check Microsoft Defender Status?
- How Do You Look for Persistence and Privilege?
- Which Command Answers Which Question?
- References
What Should You Check Before Running Commands?
Confirm you are authorised, note the host name and time, and open PowerShell as administrator because the Security log needs elevation. If the host may be compromised, consider isolating it and collecting evidence with your EDR first. Know where logs live; our guide to Windows log file locations covers that.
Keep a simple triage log: the command, the time you ran it and a short note of what you saw. Save output to a case folder rather than retyping it, and compare results with a known good machine of the same build so normal entries are easier to rule out. Commands give a quick snapshot, not a full investigation, so escalate whenever results look unusual.
Is Logging Turned On?
1. auditpol /get shows the current audit policy.
auditpol /get /category:*
Look for Logon, Process Creation and Security Group Management set to Success and Failure. If Process Creation shows No Auditing, event 4688 will not exist.
How Do You Search Security Events?
2. Failed logons (4625). Get-WinEvent with a filter hashtable is fast:
Get-WinEvent -FilterHashtable @{LogName='Security'; Id=4625} -MaxEvents 50
Many 4625 events from one source suggest password guessing (ATT&CK T1110).
3. New processes (4688).
Get-WinEvent -FilterHashtable @{LogName='Security'; Id=4688} -MaxEvents 50 | Format-List TimeCreated, Message
Watch for Office apps launching PowerShell or cmd, or encoded command lines.
4. New services (7045).
Get-WinEvent -FilterHashtable @{LogName='System'; Id=7045} -MaxEvents 20
Unexpected services can indicate persistence or remote execution tools (T1543.003).
Which Commands Show Network Activity?
5. netstat lists connections with process IDs:
netstat -ano
6. Get-NetTCPConnection gives the same data as objects:
Get-NetTCPConnection -State Established | Sort-Object RemoteAddress
7. Get-Process links a PID to a program and path:
Get-Process -Id 1234 | Select-Object Name, Id, Path
Replace 1234 with the PID you found. Unknown programs in user folders talking to external addresses deserve attention. See Get-NetTCPConnection documentation for filters.
How Do You Check Microsoft Defender Status?
8. Get-MpComputerStatus shows whether protection is healthy:
Get-MpComputerStatus | Select-Object AMServiceEnabled, RealTimeProtectionEnabled, AntivirusSignatureLastUpdated
Real-time protection turned off on a user machine is a red flag (T1562.001). Then list recent detections:
Get-MpThreatDetection
How Do You Look for Persistence and Privilege?
9. Local administrators:
Get-LocalGroupMember -Group Administrators
10. Scheduled tasks and startup items (schtasks query):
schtasks /query /fo LIST /v
Get-CimInstance Win32_StartupCommand | Select-Object Name, Command, Location
11. Installed updates:
Get-HotFix | Sort-Object InstalledOn -Descending
Unknown admin accounts, tasks running scripts from temp folders and long gaps in patching all need follow-up.
Which Command Answers Which Question?
| Question | Command | ATT&CK link |
|---|---|---|
| Is logging enabled? | auditpol /get | Supports all detection |
| Password guessing? | Get-WinEvent 4625 | T1110 |
| Suspicious processes? | Get-WinEvent 4688, Get-Process | T1059 |
| New services? | Get-WinEvent 7045 | T1543.003 |
| Odd connections? | netstat -ano, Get-NetTCPConnection | T1071 |
| Defender tampered? | Get-MpComputerStatus | T1562.001 |
| Persistence? | schtasks /query, Win32_StartupCommand | T1053.005, T1547 |
| Extra admins? | Get-LocalGroupMember | T1098 |
Technique details are in MITRE ATT&CK. These commands are part of daily work described in our SOC analyst job description. Practise them in a lab through our SOC analyst training.
References
Frequently Asked Questions
What's Your Reaction?
Like
0
Dislike
0
Love
0
Funny
0
Wow
0
Sad
0
Angry
0