The SOC Analyst’s Arsenal: 25+ Essential Commands for Your Next Incident

Listen to this Post

Featured Image

Introduction:

The modern Security Operations Center (SOC) is the frontline defense against a relentless tide of cyber threats. While theoretical knowledge from certifications is crucial, practical, hands-on command of tools and techniques separates a proficient analyst from a novice. This article provides a verified toolkit of essential Linux, Windows, and security platform commands to empower SOC analysts in detection, investigation, and response.

Learning Objectives:

  • Master fundamental command-line utilities for log analysis and process investigation on Linux and Windows systems.
  • Understand key commands for leveraging essential SOC tools like Splunk for proactive hunting.
  • Develop a practical workflow for initial triage and evidence collection during a security incident.

You Should Know:

  1. Linux Log Interrogation with grep, awk, and `journalctl`
    The ability to quickly parse system logs is a core SOC skill. Linux provides powerful text processing utilities to filter and analyze log data for Indicators of Compromise (IoCs).

Verified Commands:

– `grep -i “failed password” /var/log/auth.log` – Searches for failed SSH login attempts, a key sign of brute-force attacks.
– `journalctl –since “1 hour ago” _SYSTEMD_UNIT=sshd.service | grep “Failed”` – Uses systemd’s journal to inspect SSH failures from the last hour.
– `awk ‘{print $1}’ /var/log/nginx/access.log | sort | uniq -c | sort -nr | head -10` – Uses `awk` to extract, sort, and count the top 10 IP addresses accessing an Nginx web server, useful for identifying scanning activity.

Step-by-step guide:

To investigate a potential web server compromise, an analyst might first check for unusual client IPs. Running the `awk` command above provides a sorted list of the most frequent visitors. A single IP with an abnormally high request count warrants further investigation. The analyst could then drill down with `grep “192.168.1.100” /var/log/nginx/access.log` to see every request from that specific suspicious IP.

  1. Windows Process and Network Analysis with `tasklist` and `netstat`
    When responding to an alert on a Windows endpoint, understanding running processes and their network connections is the first step in triage.

Verified Commands:

– `tasklist /svc` – Lists all running processes along with their associated services, helping to identify malicious services.
– `netstat -ano | findstr ESTABLISHED` – Displays all established network connections and the Process ID (PID) that owns them.
– `wmic process get name,processid,commandline` – Retrieves process information, including the full command line, which can reveal malicious arguments.

Step-by-step guide:

Upon receiving a beaconing alert, an analyst would run `netstat -ano | findstr ESTABLISHED` to see all active connections. Noting a suspicious connection on port 4444 owned by PID 1234, they would then cross-reference with `tasklist /svc | findstr 1234` to identify the process name. Finally, `wmic process where processid=1234 get name,commandline` would reveal the exact executable path and arguments used to launch the potentially malicious process.

3. Proactive Hunting with Splunk SPL

Splunk is a cornerstone of many SOCs. Using its Search Processing Language (SPL) effectively allows analysts to hunt for threats across massive datasets.

Verified Commands:

– `index=windows sourcetype=”WinEventLog:Security” EventCode=4625 | stats count by src_ip` – Searches for Windows logon failure events (Event ID 4625) and counts them by source IP address to find brute-force attacks.
– `index=main “powershell.exe” “-EncodedCommand” | table _time, host, user` – Hunts for PowerShell commands that use base64 encoding, a common technique for obfuscation.
– `index=bro sourcetype=”bro:http:json” | top limit=20 uri` – In a Zeek (Bro) environment, this lists the top 20 URIs being accessed, useful for identifying command-and-control callouts.

Step-by-step guide:

To investigate potential data exfiltration, an analyst could run a search like: index=bro sourcetype="bro:conn:json" | stats sum(bytes_out) as total_bytes by id.orig_h | sort - total_bytes | head 5. This query sums all outgoing bytes from internal hosts, ranking them to quickly identify any host transmitting an unusually large amount of data to the internet, which could indicate data theft.

4. Endpoint Evidence Collection and Forensics

Before containing a threat, it’s critical to collect volatile evidence from a compromised system that would be lost after a reboot.

Verified Commands (Linux):

– `ps auxef` – Displays a detailed, full-format listing of all running processes, showing the process tree.
– `lsof -i -P -n` – Lists all open files and network connections.
– `ss -tulnpe` – A modern replacement for netstat, showing listening ports and the associated processes.
– `history` – Shows the command history of the current user, which may reveal attacker commands.

Verified Commands (Windows via CMD/PowerShell):

– `powershell “Get-WinEvent -FilterHashtable @{LogName=’Security’; ID=4688} | Select-Object -First 10″` – Uses PowerShell to pull the most recent process creation events (Event ID 4688).
– `reg export “HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run” C:\temp\autoruns.reg` – Exports Run key entries for persistence analysis.

Step-by-step guide:

On a potentially compromised Linux server, an analyst should immediately capture the state of the system. Running ps auxef > /tmp/process_list.txt, lsof -i -P -n > /tmp/network_connections.txt, and `cp /home//.bash_history /tmp/` preserves a snapshot of running processes, network sockets, and user command history for later forensic analysis.

5. Network Traffic Interrogation with `tcpdump`

When packet-level analysis is required, `tcpdump` is an indispensable tool for capturing and filtering live network traffic.

Verified Commands:

– `tcpdump -i any -w initial_capture.pcap` – Captures all traffic on any interface and writes it to a file for later analysis in Wireshark.
– `tcpdump -n -i eth0 host 10.1.1.100` – Captures all traffic to or from the specific IP 10.1.1.100 without resolving hostnames.
– `tcpdump -i any port 53` – Captures all DNS traffic (port 53), useful for investigating DNS tunneling or suspicious domain queries.

Step-by-step guide:

If an Intrusion Detection System (IDS) alerts on suspicious traffic from host 10.1.1.100, an analyst can immediately start a targeted capture with tcpdump -n -i eth0 -w suspect_traffic.pcap host 10.1.1.100. This command avoids DNS lookups (-n) for performance, listens on the primary interface eth0, and saves the raw packets to suspect_traffic.pcap. This file can then be transferred to a security workstation for deep inspection in a tool like Wireshark.

6. Vulnerability Scanning and Service Enumeration with `nmap`

While often an offensive tool, `nmap` is critical for SOC analysts to verify exposures, understand the network attack surface, and confirm remediation efforts.

Verified Commands:

– `nmap -sV -sC 192.168.1.0/24` – Conducts a service version and default script scan against an entire subnet to inventory running services.
– `nmap -p 80,443,22,3389 –open 10.0.0.50` – Quickly scans a single host for only the most common administrative ports, reporting only those that are open.
– `nmap -sU -p 53,161 192.168.1.1` – Performs a UDP scan against a specific host for DNS (port 53) and SNMP (port 161) services.

Step-by-step guide:

After a patch is deployed for a critical vulnerability in an SSH service, the SOC may be tasked with verifying its application. An analyst can use `nmap -sV -p 22 10.2.2.0/24` to scan the relevant subnet. The `-sV` flag will probe the SSH port on each host and report the specific version of the service running, allowing the analyst to quickly identify any hosts that are still running the vulnerable version.

What Undercode Say:

  • Practical Proficiency Trumps Theory Alone. The gap between knowing what a SOC does and being able to perform its functions is bridged by hands-on command-line fluency. Certifications provide the map, but these commands are the vehicle.
  • Automation is Built on Foundational Commands. Before a playbook can be automated in a SOAR platform, the manual steps must be understood. Each command listed is a fundamental building block for a larger, automated security process.

The curated list of free SOC certifications from the source post is an excellent starting point for building foundational knowledge. However, the true value of an analyst is realized when they can translate that knowledge into immediate, effective action during an incident. The commands provided here are the practical implementation of that knowledge. Memorizing them is less important than understanding the logic behind their use—knowing when to grab a process list, why you would filter for a specific Event ID, and how to correlate network connections with running processes. This command-level competence transforms an analyst from a passive alert reviewer into an active cyber defender capable of hunting threats and mitigating breaches effectively.

Prediction:

The increasing automation of both attacks and defenses will elevate the value of the SOC analyst’s interpretive skills. While AI will handle routine alert triage and SOAR platforms will execute standardized containment playbooks, the human analyst’s ability to use these fundamental commands for deep-dive investigation, to ask unconventional questions of the data, and to recognize subtle anomalies that evade automated rules will become the most critical and sought-after skill in cybersecurity. The future SOC will not be fully automated, but will be a collaborative environment where human expertise, armed with practical command-line tools, directs and refines the power of automated systems.

🎯Let’s Practice For Free:

IT/Security Reporter URL:

Reported By: Ouardi Mohamed – Hackers Feeds
Extra Hub: Undercode MoN
Basic Verification: Pass ✅

🔐JOIN OUR CYBER WORLD [ CVE News • HackMonitor • UndercodeNews ]

💬 Whatsapp | 💬 Telegram

📢 Follow UndercodeTesting & Stay Tuned:

𝕏 formerly Twitter 🐦 | @ Threads | 🔗 Linkedin | 🦋BlueSky