This project showcases an automated threat detection and response system using Wazuh, Shuffle, and TheHive.
- Data Collection: Wazuh agents on Windows collect telemetry.
- Rule Matching: Wazuh Manager matches data against rules.
- Enrichment: Adds threat intelligence data.
- Alert Creation: Alerts generated in Shuffle and sent to TheHive.
- SOC Analyst Review: Incidents are managed in TheHive.
- Download VMware Workstation.
- Install and activate.
- Download the Windows ISO from Microsoft.
- Install Windows 10 on a new VM.
-
Download Sysmon from Sysinternals.
-
Install using:
.\Sysmon64.exe -i sysmonconfig.xml
-
Create a new Ubuntu droplet.
-
Update and install Wazuh:
sudo apt update && sudo apt upgrade curl -sO https://packages.wazuh.com/4.7/wazuh-install.sh && sudo bash ./wazuh-install.sh -a
-
Create a new droplet and install dependencies:
- Java:
sudo apt install java-common java-11-amazon-corretto-jdk
- Cassandra:
sudo apt install cassandra
- Elasticsearch:
sudo apt install elasticsearch
- TheHive:
sudo apt-get install -y thehive
- Java:
-
Configure services and access TheHive at
http://<your_TheHive_IP_Address>:9000
.
To collect and analyze events from endpoints, install the Wazuh Agent:
- Add Agent: Navigate to the Wazuh dashboard and click "Add Agent".
- Server Address: Enter the Wazuh server IP address.
- Install Agent: Execute the command provided by Wazuh on the Windows 10 endpoint.
- Check Service: Ensure the Wazuh service is running on the endpoint.
- Agent Activation: Refresh the Wazuh dashboard to confirm the agent is active.
-
Open the
ossec.conf
file located at:C:\Program Files (x86)\ossec-agent\ossec.conf
-
As an Administrator, add the following to send Sysmon logs to Wazuh:
<localfile> <location>Microsoft-Windows-Sysmon/Operational</location> <log_format>eventchannel</log_format> </localfile>
-
Optionally, for PowerShell logs, replace the
location
value:<localfile> <location>Microsoft-Windows-PowerShell/Operational</location> <log_format>eventchannel</log_format> </localfile>
-
Save and restart the Wazuh service.
Mimikatz is used for credential dumping. Here's how to detect it:
- Download Mimikatz: Disable Windows Defender, then download
mimikatz_trunk.zip
. - Run Mimikatz: Extract the zip and execute
mimikatz.exe
using PowerShell as Administrator. - Check Logs: Open Wazuh and monitor Sysmon logs. If Mimikatz isn't detected, edit the Wazuh configuration:
- Set
<logall>
and<logall_json>
toyes
in/var/ossec/etc/ossec.conf
. - Restart Wazuh Manager with:
sudo systemctl restart wazuh-manager.service
- Set
-
Navigate to the Rules section in Wazuh.
-
Add a custom rule in
local_rules.xml
:<rule id="100002" level="15"> <if_group>sysmon_event1</if_group> <field name="win.eventdata.originalFileName" type="pcre2">(?i)mimikatz\.exe</field> <description>Malicious Activity : Mimikatz Detected!</description> <mitre> <id>T1003</id> </mitre> </rule>
-
Test the Rule: Run Mimikatz on the Windows machine again and check if the alert is triggered.
-
Test with Renamed File: Rename
mimikatz.exe
to another name (e.g.,svchost.exe
) and verify the rule still triggers based on theoriginalFileName
.
This configuration allows real-time monitoring and detection of Mimikatz on Windows systems using Wazuh, ensuring that even if an attacker renames the file, the detection will still work.
This guide walks through setting up Shuffle, an open-source Security Orchestration, Automation, and Response (SOAR) platform, with Wazuh, VirusTotal, and TheHive for automated threat detection and response workflows.
- Sign up for Shuffle and navigate to Workflows -> New Workflow.
- Provide a name and description for the project, then click Done.
- Drag Webhook into the workflow, rename it, and set the call section to
$exec
by selecting Execution Argument. - Connect Wazuh with Shuffle by adding the following to the
ossec.conf
:<integration> <name>Shuffle</name> <hook_url>YOUR_WEBHOOK_URL_HERE</hook_url> <alert_format>json</alert_format> <rule_id>100002</rule_id> </integration>
- Rule ID 100002 sends Mimikatz detections to Shuffle.
Restart Wazuh with:
systemctl restart wazuh-manager.service
systemctl status wazuh-manager.service
- Run Mimikatz on the Windows machine (
svchost.exe
if renamed). - Test Workflow: Click Test Workflow in Shuffle and review the output via the webhook icon.
- Regex Setup: Select Regex capture group in Shuffle.
- Input Data: Use
$exec.text.win.eventdata.hashes
with the following regex:MD5=([0–9A-Fa-f]{32})
- Sign up for VirusTotal and retrieve your API key.
- Add VirusTotal to the workflow in Shuffle and authenticate using the API key.
- Action: Set to Get a hash report and connect it to the MD5 extraction step.
- Add TheHive to the workflow and authenticate with your API key.
- Set the alert fields:
- Title:
$exec.title
- Tags:
["T1003"]
(OS credential dumping technique) - Severity: 2
- Source: Wazuh
- Description: "Mimikatz Detected"
- Host:
$exec.text.win.system.computer
- User:
$exec.text.win.eventdata.user
- Title:
-
Add Email to Workflow: Input your email in the recipient field.
-
Customize the body with details like:
$exec.text.win.eventdata.utcTime Host: $exec.text.win.system.computer User: $exec.text.win.eventdata.user CommandLine: $exec.text.win.eventdata.commandLine
Final Testing
Run Mimikatz: Execute the Mimikatz binary on the Windows machine. Verify: Check for alerts in TheHive and email notifications.