|
| 1 | +--- |
| 2 | +sidebar_position: 1 |
| 3 | +--- |
| 4 | +# Automated Threat Hunting System |
| 5 | + |
| 6 | +:::info |
| 7 | +**Document Creation:** 17 May 2025. **Last Edited:** 23 May 2025. **Authors:** Syed Mahmood Aleem Huzaifa. |
| 8 | +**Effective Date:** 23 May 2025. **Expiry Date:** 23 May 2026. |
| 9 | +::: |
| 10 | + |
| 11 | +## Introduction |
| 12 | + |
| 13 | +The aim of this project was to build a fully integrated Automated Threat Hunting System using open-source security tools. The objective was to detect, enrich, and automatically triage security threats by leveraging real-time logs, behavioural analytics, threat intelligence, and SOAR capabilities. |
| 14 | + |
| 15 | +## Tools and Technologies Used |
| 16 | + |
| 17 | +- **Wazuh Manager** (Host-based SIEM and endpoint detection) |
| 18 | +- **Wazuh Agent** (Deployed on monitored machines) |
| 19 | +- **Suricata** (Network Intrusion Detection System) |
| 20 | +- **MISP** (Malware Information Sharing Platform for Threat Intelligence) |
| 21 | +- **The Hive** (Incident Response Platform for case management) |
| 22 | +- **Cortex** (Automated observable analysis engine) |
| 23 | +- **Docker & Docker Compose** (For containerised deployments) |
| 24 | +- **Python** (Custom scripting for Wazuh-MISP integration) |
| 25 | +- **Linux Systems** (Ubuntu, Debian, Kali VMs) |
| 26 | +- **VirtualBox Networking** (Bridged/NAT IP setups) |
| 27 | + |
| 28 | +## Project Phases and Milestones |
| 29 | + |
| 30 | +### Phase 1: Core Setup and Wazuh Deployment |
| 31 | + |
| 32 | +- Installed Wazuh Manager on an Ubuntu VM for centralised security monitoring. |
| 33 | +- Deployed Wazuh Agent on a Debian VM to collect logs (system, authentication, file monitoring). |
| 34 | +- Used the Wazuh built-in dashboard (not external ELK) to visualise agent events and alerts. |
| 35 | +- Verified agent registration, health monitoring, and event flow. |
| 36 | + |
| 37 | +### Phase 2: Network Threat Detection Integration |
| 38 | + |
| 39 | +- Installed Suricata IDS on the same Ubuntu VM hosting Wazuh Manager. |
| 40 | +- Configured Suricata to output EVE JSON logs for network-based event detection. |
| 41 | +- Integrated Suricata logs into Wazuh by configuring local log collection rules. |
| 42 | +- Verified detection of network events like port scans, brute-force attempts, and suspicious traffic. |
| 43 | + |
| 44 | +### Phase 3: Threat Intelligence Platform Deployment (MISP) |
| 45 | + |
| 46 | +- Deployed MISP on a Kali Linux VM using Docker for easier management. |
| 47 | +- Populated MISP with custom and public threat indicators (IP addresses, hashes, domains). |
| 48 | +- Developed a custom Python script (`custom-misp.py`) to enable Wazuh alerts to query MISP indicators in real-time. |
| 49 | +- Created a shell wrapper (`custom-misp`) to trigger MISP lookups from Wazuh based on alert rules. |
| 50 | + |
| 51 | +### Phase 4: Wazuh–MISP Integration and Automation |
| 52 | + |
| 53 | +- Configured custom Wazuh rules to trigger MISP lookups on specific alerts (e.g., new file detections, network connections). |
| 54 | +- Modified Wazuh decoders and ruleset to tag alerts enriched with MISP intelligence. |
| 55 | +- Monitored MISP-correlated events through Wazuh Dashboard (e.g., tagged with threat categories, risk scores). |
| 56 | + |
| 57 | +### Phase 5: Security Orchestration (SOAR) — TheHive and Cortex |
| 58 | + |
| 59 | +- Deployed TheHive (case management platform) and Cortex (observable analyser) via Docker Compose. |
| 60 | +- Installed and configured Cortex analyzers. |
| 61 | +- Validated the full pipeline: |
| 62 | + - Wazuh triggers alert |
| 63 | + - MISP enriches alert |
| 64 | + - Alert forwarded to TheHive (Future Work) |
| 65 | + - Cortex enriches observables (Future Work) |
| 66 | + - Analyst triages case (Future Work) |
| 67 | + |
| 68 | +### Phase 6: Behavioural Detection and Automated Threat Hunting |
| 69 | + |
| 70 | +- Designed and deployed custom Wazuh behavioural rules for detecting: |
| 71 | + - SSH brute-force attacks (multiple login failures from the same IP) |
| 72 | + - Suspicious PowerShell commands that may indicate lateral movement or privilege escalation |
| 73 | + - Communication with known malicious IPs using Suricata with enrichment from MISP |
| 74 | + |
| 75 | +- Simulated realistic attacks to validate detection accuracy, including: |
| 76 | + - Repeated failed login attempts over SSH |
| 77 | + - Execution of encoded PowerShell commands |
| 78 | + - Test network connections to blacklisted IPs |
| 79 | + |
| 80 | +- Created advanced Wazuh correlation rules that: |
| 81 | + - Link related suspicious events using shared indicators (e.g., IP address, file path) |
| 82 | + - Combine failed authentication attempts with malicious outbound traffic into a single high-priority alert |
| 83 | + |
| 84 | +- Developed an automated IOC hunting mechanism by scheduling MISP indicator lookups using a cron-based script. |
| 85 | +- Tuned rule thresholds and suppression criteria to reduce alert fatigue and eliminate low-fidelity noise. |
| 86 | + |
| 87 | +## Architecture Overview |
| 88 | + |
| 89 | +| **Component** | **Purpose** | |
| 90 | +|------------------|----------------------------------------------------------| |
| 91 | +| Wazuh Manager | Collects and analyses endpoint and Suricata network logs | |
| 92 | +| Wazuh Agent | Sends local system events to Wazuh Manager | |
| 93 | +| Suricata | Captures and analyses network traffic | |
| 94 | +| MISP | Provides real-time threat intelligence for enrichment | |
| 95 | +| TheHive | Manages incidents and alert triage | |
| 96 | +| Cortex | Performs automatic analysis of observables attached to incidents | |
| 97 | + |
| 98 | +## Key Outcomes |
| 99 | + |
| 100 | +- Real-time security event collection and monitoring using Wazuh and Suricata. |
| 101 | +- Automated IOC enrichment from MISP with Wazuh rule correlation. |
| 102 | +- End-to-end SOAR capabilities with TheHive and Cortex for automated case handling. |
| 103 | +- Custom behavioural detection rules tailored to common attack techniques. |
| 104 | +- Full automation of threat detection, enrichment, and triage. |
0 commit comments