Soar in Soc
Soar in Soc
By
Asif Khan
Sr. Cyber/Digital Forensics Expert
https://www.linkedin.com/in/asif-
khan-b5379a126/
Index
1. Suspicious IP Playbook
1. Suspicious IP Playbook
Purpose:
The Suspicious IP Playbook is designed to identify, analyze, and respond to malicious or
suspicious IP activity in a corporate environment. This playbook focuses on automating initial
investigation tasks while providing actionable intelligence for L2 Threat Hunters to further
explore and respond to threats.
1. Trigger Event
The playbook begins when a suspicious IP is flagged by:
• SIEM Alerts (e.g., unusual outbound traffic to a known malicious IP or high-frequency
DNS queries to an unknown domain).
• EDR Solutions detecting abnormal connections.
• Threat Intelligence Platforms (TIPs) reporting new indicators of compromise (IOCs).
Example: The SIEM generates an alert for traffic originating from an endpoint to an IP address
flagged by a TIP as a known C2 (Command and Control) server.
2. Automation Steps
The playbook automates the following tasks:
Step 1: IOC Enrichment
• Query the flagged IP address in Threat Intelligence Platforms like VirusTotal,
AlienVault OTX, or Recorded Future.
• Retrieve contextual data such as:
o Reputation score
o Geolocation information (country, ISP, etc.)
o History of malicious activities (e.g., spam, malware hosting, C2 server usage).
• Lookup the IP in internal Threat Intelligence Databases for any previous sightings in
the environment.
Technical Workflow:
Step 2: Network Contextualization
• Query the Firewall Logs and NetFlow Data:
o Identify traffic patterns involving the flagged IP.
o Determine whether the IP is receiving or sending abnormal volumes of traffic.
• Query DNS Logs for any domain resolutions linked to the IP.
• Query Proxy Logs to check for web traffic involving the IP.
Technical Workflow Example:
Run an API query to the firewall (e.g., Palo Alto or Cisco):
Step 3: Endpoint Query
• Query EDR Tools (e.g., CrowdStrike, Carbon Black) to identify endpoints
communicating with the IP:
o Collect details like process name, file path, user account, and execution time.
o Check whether any binaries were downloaded from the IP.
• Check Host-based Indicators such as:
o Newly created files.
o Registry changes.
o Persistence mechanisms like scheduled tasks or startup programs.
Technical Workflow Example:
Step 4: Threat Score Calculation
Aggregate the data collected and calculate a threat score:
• IP reputation (high-risk IP = +50).
• Frequency of connections (e.g., >100 per hour = +30).
• Processes associated with the IP (e.g., PowerShell = +20).
• Data exfiltration potential (e.g., large outbound transfers = +50).
Automated Decision-Making:
If the threat score exceeds a predefined threshold (e.g., 70):
• Proceed to the containment phase (isolation, blocklist, etc.). If the score is below the
threshold:
• Escalate the investigation to an L2 analyst.
4. Response Actions
If malicious activity is confirmed, the following actions can be automated or manually executed:
Automated Actions via SOAR:
1. Block the IP:
o Add the IP to the firewall blocklist.
o Update web proxies to block future connections.
2. Isolate the Endpoint:
o Use EDR to quarantine affected devices.
3. IOC Sharing:
o Share the IP and associated IOCs with internal threat intelligence platforms and
partner organizations.
Manual Actions for L2 Hunter:
• Conduct detailed forensics on isolated endpoints (e.g., memory dumps, log extraction).
• Identify the root cause of the compromise (e.g., phishing email, exploited vulnerability).
• Create detailed incident reports for management and regulatory compliance.
5. Metrics and Reporting
Use SOAR to track and visualize:
• Time to detect and respond to suspicious IP activity.
• Number of IPs flagged, investigated, and blocked.
• Frequency of malicious IP activity by geography or category.
Dashboard Example:
• KPIs:
o Average time to resolve (TTR) for IP alerts.
o Percentage of IP alerts escalating to confirmed incidents.
o Distribution of IP categories (malware, phishing, C2).
6. Continuous Improvement
• Feedback Loop: Regularly update playbooks based on lessons learned.
• Threat Intelligence Updates: Keep IOC databases and TIPs updated with the latest
threats.
• Training: Conduct periodic training for L2 hunters to improve manual investigation
skills.
Key Objectives
1. Detect privilege escalation events using various data sources (SIEM, EDR, AD logs,
etc.).
2. Automate data enrichment and correlation for suspicious events.
3. Reduce the time to respond (TTR) by automating remediation steps like isolating
endpoints or disabling accounts.
4. Enable hunters to uncover patterns, such as potential lateral movement or exploitation of
vulnerabilities.
1. Trigger Event
The playbook is triggered when a suspicious privilege escalation event is detected. Triggers can
include:
• Active Directory Logs:
o Event ID 4670: Permissions on an object were changed.
o Event ID 4672: Special privileges assigned to a new logon session.
• Endpoint Detection and Response (EDR):
o Detection of tools like Mimikatz, SharpUp, or custom scripts attempting to
escalate privileges.
• SIEM Alerts:
o Correlation of anomalous user activity logs (e.g., standard user suddenly
accessing high-privilege resources).
Example Trigger:
• A user account (jdoe) is granted domain admin privileges without a corresponding
helpdesk ticket or request.
>>logoff /id:<session_id>
Playbook Metrics
Measure the playbook's effectiveness with:
1. Mean Time to Detect (MTTD):
o Average time between escalation and detection.
2. Mean Time to Respond (MTTR):
o Average time taken to contain the escalation.
3. False Positive Rate:
o Percentage of non-malicious escalations flagged.
3.Suspicious File Activity Playbook
The Suspicious File Activity Playbook is designed to help threat hunters investigate and
respond to suspicious file activity. This could involve unusual file access, file modifications,
encryption (indicative of ransomware), or unauthorized file downloads and uploads. Here’s a
detailed step-by-step technical guide tailored for L2 Threat Hunters in a corporate SOC
environment.
>>hash = "d41d8cd98f00b204e9800998ecf8427e"
response = requests.get(f"https://www.virustotal.com/api/v3/files/{hash}", headers={"x-apikey":
"YOUR_API_KEY"})
print(response.json())
2. User Context:
o Identify the user account that accessed or modified the file.
o Correlate with Active Directory (AD) logs:
▪ Look for anomalous login times or privilege escalations.
o Example: Query SIEM for Event ID 4624 (Successful Logon).
3. Process Analysis:
o Check processes interacting with the file using EDR.
o Example:
▪ Was the file accessed by a suspicious PowerShell script or cmd.exe?
o Command for live systems:
>> lsof | grep <file_name>
4. Network Correlation:
o Cross-reference with network traffic logs:
▪ Was the file uploaded to a remote server?
▪ Is there evidence of data exfiltration via FTP, HTTP, or cloud storage?
Real-World Scenarios
Scenario 1: Ransomware Alert
• Trigger: SIEM flags multiple files being encrypted in rapid succession.
• Workflow:
1. SOAR collects file metadata and matches the encryption tool with a known
ransomware strain.
2. Endpoint is isolated.
3. IOC (file hash, domain, IP) is added to blocklists.
Scenario 2: Unauthorized File Exfiltration
• Trigger: DLP alerts on sensitive files being uploaded to an unknown domain.
• Workflow:
1. SOAR pulls logs to identify the user and file details.
2. Traffic is analyzed for further exfiltration attempts.
3. Host is quarantined, and files are flagged for investigation.
Conclusion
The Suspicious File Activity Playbook is a vital tool for L2 Threat Hunters. By automating
repetitive tasks like log collection and IOC enrichment, SOAR allows hunters to focus on deeper
investigation and analysis. Using techniques like anomaly detection, file sandboxing, and
endpoint forensics, this playbook empowers hunters to identify and respond to suspicious file
activities swiftly and effectively.
def analyze_periodicity(timestamps):
# Convert timestamps to datetime
intervals = [timestamps[i] - timestamps[i - 1] for i in range(1, len(timestamps))]
# Check for consistent intervals
if np.std(intervals) < threshold:
return "Beaconing Pattern Detected"
return "No Consistent Pattern"
5. Detecting Domain Generation Algorithms (DGA)
• Malware using DGAs generates domain names algorithmically, often creating hundreds
of domains daily.
• Use SOAR to:
o Analyze DNS logs for high query rates to unique domains.
o Cross-reference domains against known DGA patterns using ML-based tools like
PyDG or FluXOR.
• Example: DGA Detection Logic:
o Identify domains with:
▪ High entropy (random-looking names).
▪ Few or no WHOIS records.
▪ Short lifetimes or frequent changes in IP resolution.
Real-World Example
Case Study: Detecting Beaconing in a Corporate Environment
1. A finance department endpoint starts making periodic HTTPS connections to
xy1yz.payrollcheck.net.
2. SOAR Playbook is triggered:
o Enriches xy1yz.payrollcheck.net with Threat Intelligence (classified as a low-
reputation domain).
o Retrieves PCAPs for traffic to the domain.
o Identifies periodic HTTPS requests with no user interaction.
3. Actions Taken:
o EDR isolates the endpoint.
o DNS logs reveal another endpoint querying the same domain.
o A malware sample is retrieved from the endpoint and analyzed.
Conclusion
Detecting beaconing is a complex but critical part of threat hunting. SOAR simplifies the process
by automating:
• Data collection (logs, threat intelligence).
• Periodicity analysis.
5.Lateral Movement Hunting in Threat Hunting
Lateral movement refers to the techniques attackers use after gaining access to an initial system,
allowing them to move across the network to achieve their ultimate objectives—whether that’s
data theft, privilege escalation, persistence, or sabotage.
For L2 Threat Hunters, lateral movement detection is a critical skill, and SOAR platforms
amplify their capabilities by automating and orchestrating complex detection and investigation
processes.
Conclusion
Lateral movement hunting is one of the most complex but rewarding aspects of threat hunting.
By leveraging SOAR, L2 Threat Hunters can automate routine tasks, focus on analyzing
advanced threats, and detect lateral movement efficiently. Always enrich alerts with context from
EDR, SIEM, and threat intelligence to make informed decisions.
6.Real-World Scenario: Detecting and Mitigating Lateral
Movement via PsExec
Scenario Overview:
An attacker has gained access to a corporate environment by exploiting a vulnerable endpoint.
They use PsExec to move laterally across the network, targeting a database server containing
sensitive financial data.
1. Initial Detection
• Trigger:
o A SIEM alert flags multiple login attempts from an endpoint (e.g., HR-Laptop01)
to a file server (Finance-Srv01) during non-working hours.
o Event ID 4624 (Logon Success) is detected, followed by Event ID 7045 (Service
Installed).
• Log Details:
o Source IP: 192.168.1.101 (HR-Laptop01)
o Destination IP: 192.168.1.102 (Finance-Srv01)
o Service Name: PsExecSvc
o Process Name: powershell.exe
Immediate Response with SOAR:
• SOAR Action:
1. Query Active Directory (AD) for the source user credentials associated with HR-
Laptop01.
2. Enrich the flagged IPs and services with threat intelligence.
3. Run an automated script to query endpoint activity using EDR tools (e.g.,
CrowdStrike, Carbon Black).
2. Data Enrichment and Contextual Analysis
• SOAR Playbook Workflow:
1. EDR Query:
▪ Logs reveal that PsExec was executed by powershell.exe.
▪ Parent-child relationship:
▪ Parent: explorer.exe
▪ Child: powershell.exe -> PsExec.exe
2. Threat Intelligence Check:
▪ The IP (192.168.1.101) is clean, but the service PsExecSvc matches
known indicators of compromise (IoCs) from a recent malware campaign.
3. Network Analysis:
▪ SOAR collects NetFlow logs:
▪ Large SMB traffic from HR-Laptop01 to Finance-Srv01 is
detected.
▪ Network packet captures (PCAPs) show a suspicious file
stealer.exe being transferred via SMB.
6. Forensic Analysis
• Memory Dump Analysis:
o Collect memory dumps from HR-Laptop01 and Finance-Srv01 for analysis.
▪ Command:
>>volatility -f memdump.img --profile=Win10x64 pstree
▪ Output:
>>Process: powershell.exe -> PsExec.exe -> stealer.exe
o Analyze stealer.exe with sandbox tools like Cuckoo Sandbox or Any.Run.
• Registry Analysis:
o Check for persistence mechanisms:
▪ Command:
>>Get-ItemProperty -Path 'HKLM:\Software\Microsoft\Windows\CurrentVersion\Run'
• Network Forensics:
o Inspect DNS logs for malicious domain lookups related to stealer.exe.