SIEM in Threat Hunting - Part-I
SIEM in Threat Hunting - Part-I
Part - I
B Y,
Asif Khan
Sr. Cyber Forensics Expert
HTTPS://WWW.LINKEDIN.COM/IN/ASIF-KHAN-B5379A126/
SIEM in Threat Hunting
Security Information and Event Management (SIEM) systems are foundational tools in modern
threat hunting. They aggregate logs, correlate events, and provide contextual insights into
security incidents across an organization's IT infrastructure. Below is an in-depth explanation of
SIEM's key functions in threat hunting with detailed examples.
Index:
Scenario:
An attacker compromises a user's credentials via phishing, escalates privileges, and moves
laterally within the network to access sensitive resources.
1. Initial Event (Compromise Detection):
o Log Source: Email Security Gateway
o Event: A phishing email containing a malicious link clicked by "user1."
o Example Log Entry:
2. Credential Theft:
o Log Source: Windows Event Logs (Domain Controller)
o Event: Multiple failed login attempts (Event ID 4625), followed by a successful
login (Event ID 4624).
o Example Log Entries:
o
3. Privilege Escalation:
o Log Source: Windows Security Logs
o Event: Sensitive privilege escalation attempt (Event ID 4673).
o Example Log Entry:
4. Lateral Movement:
o Log Source: Network Logs (Firewalls or IDS)
o Event: SMB (Server Message Block) traffic spikes originating from the
compromised user’s workstation, targeting other hosts.
o Example Log Entry:
o
SIEM Correlation Rule:
A rule in Splunk or QRadar to detect this behavior might look like:
Alert Workflow:
• Trigger: SIEM detects multiple login failures followed by privilege escalation and
unusual network activity.
• Action: Generate an alert with details of affected hosts and initiate automated playbook:
1. Isolate the compromised endpoint.
2. Notify the SOC team.
3. Collect forensic data for deeper analysis.
Technical Benefits:
• Detects multi-stage attacks that individual systems might miss.
• Provides a timeline of the attack for forensic investigation.
• Automates the response to reduce mean time to detect (MTTD) and respond (MTTR).
2. Event Correlation
SIEM correlates logs and events from various systems to detect patterns of malicious behavior that
individual logs might not reveal. Correlation rules can help identify multi-stage attacks.
Examples:
• Correlation Rule: Multiple failed login attempts followed by a successful login and unusual data
transfer volumes.
Detection: Indicates a possible brute-force attack followed by data exfiltration.
Example: A SIEM correlates logs from an Active Directory (AD) server and a file server. If a
user logs in at midnight and uploads 10 GB of sensitive files, it could signal an insider threat or
compromised credentials.
• Phishing Campaign Detection:
Email gateway logs indicate several emails with suspicious attachments, while endpoint logs
detect PowerShell activity post-click. Correlating these events can highlight a targeted phishing
campaign.
Real-Life Scenario:
A SIEM like ArcSight identifies a pattern: an external IP sends a phishing email, a user clicks the
attachment, and malicious PowerShell commands are executed on the endpoint. The correlation rule alerts
the security team.
▪ In Elastic SIEM:
▪ Use KQL to define the rule:
>> authentication.action: "failed" and event.count >= 5 and authentication.source_ip: *
followed_by authentication.action: "success"
3. Example Output:
o src_ip: 192.168.1.10
o user: admin
o Pattern: 5 failed logins followed by success.
4. Generated Alert:
o Description: "Potential brute-force attack detected. Successful login after multiple
failures."
o Severity: High.
▪ In Graylog:
▪ Define pipeline rules to match login and privilege escalation
events.
4. Example Output:
o Log 1:
▪ Timestamp: 2024-11-27 10:30:00
▪ Event: Login Success (ID 4624)
▪ User: Alice
o Log 2:
▪ Timestamp: 2024-11-27 10:33:00
▪ Event: Privilege Escalation (ID 4672)
▪ User: Alice
o Correlation: Alice logged in and elevated privileges within 3 minutes.
5. Alert:
o Description: "Unusual privilege escalation detected after login. User: Alice."
o Severity: Critical.
Technical Workflow
1. Threat Intelligence Feed Ingestion:
o Threat feeds are integrated into the SIEM system using APIs, data connectors, or
manual imports.
o Common Threat Intelligence Providers:
▪ Public Feeds: AlienVault OTX, AbuseIPDB, or Spamhaus.
▪ Premium Feeds: Recorded Future, CrowdStrike Falcon Intelligence,
FireEye iSight.
▪ Industry-Specific Feeds: FS-ISAC for financial services, InfraGard for
critical infrastructure.
o Example Feed Format:
4. Anomaly Detection
SIEM solutions use machine learning (ML) and baselining to identify anomalies in user and
system behavior. These anomalies often indicate potential threats.
Examples:
• User Behavior Analytics (UBA):
A user typically accesses files from a specific department but suddenly accesses files
from multiple departments.
Detection: Insider threat or credential misuse.
1. Failed Logins
• Query Syntax:
>> Query: source="auth.log" AND action="failed_login"
• Advanced Explanation:
o The auth.log file typically records authentication-related events (e.g., SSH logins,
sudo attempts).
o The action failed_login indicates unsuccessful login attempts, which could signify
potential brute force attempts or incorrect password entries.
• Enhancements:
o Add time-based filtering to refine searches:
>> Query: source="auth.log" AND action="failed_login" AND timestamp > "2024-11-
26T00:00:00"
o Include grouping to identify patterns:
>> Query: source="auth.log" AND action="failed_login" | stats count by user
▪ This query identifies which user accounts have the highest number of
failed login attempts.
• Use Case:
o Brute Force Detection: Focus on repeated attempts from the same IP or targeting
a single user account.
o Geolocation Analysis: Correlate the source IP with geographic data to identify
anomalous login locations.
Real-Life Scenario:
A SOC analyst uses Splunk to search logs for PowerShell commands like Invoke-Mimikatz, uncovering
an attacker attempting credential dumping.
Implementation Challenges
1. Data Overload: Dashboards need to filter relevant data to avoid overwhelming analysts.
2. Customization Complexity: Technical expertise is required to create meaningful and
actionable visualizations.
3. Real-Time Updates: Ensuring low latency for real-time dashboards can strain resources.
Real-Life Scenario:
A SOC team uses QRadar's dashboard to monitor alerts on suspicious SMB activity. They identify a
ransomware attack in progress and isolate the affected systems.
Summary
SIEM systems are indispensable for threat hunting, offering:
• Centralized visibility across diverse data sources.
• Advanced correlation to detect multi-stage attacks.
• Rich threat intelligence for proactive detection.
• Anomaly detection for uncovering unknown threats.
• Powerful search capabilities for forensic investigations.
By leveraging these features, threat hunters can uncover sophisticated attacks, contain incidents, and
strengthen an organization's security posture.