
Reproducible SOC lab for CVE-2024-4577 detection and response
HTSOC is a self-built Security Operations Center system in a lab environment. The system combines log collection, detection with Splunk, alert/case management with TheHive, Observable analysis with Cortex, IOC lookup with MISP or VirusTotal, and orchestrates notifications via n8n and Telegram.
CVE-2024-4577 is just a use case used to validate multi-layer detection capability; the entire project is not limited to a single CVE.
The system simulates a complete SOC workflow:
flowchart LR
K[Kali or test source] --> W[Windows/XAMPP + Apache/PHP-CGI]
L[Linux endpoint] --> F[Universal Forwarder]
W --> A[Apache access/error log]
W --> S[Windows Security + Sysmon]
A --> F
S --> F
F --> SP[Splunk]
L --> F
SP -->|Alert webhook| TH[TheHive]
TH -->|Alert + Observable| N[n8n]
N --> T[Telegram]
N -->|Analyzer selected by analyst| C[Cortex]
C --> M[MISP]
C --> V[VirusTotal]
M --> N
V --> N
N --> TThe addresses above are for lab use only. When redeploying, replace them with environment variables and do not expose services to the Internet.
Splunk is the detection hub of the system. The searches cover brute force login, suspicious NTLM network logon, high-privilege group changes, lateral movement via SMB, new Windows service creation, encoded PowerShell, and PHP-CGI argument injection.
TheHive receives alerts from Splunk, displays severity/source/title, stores Observables, and allows analysts to convert alerts into cases. Cortex receives Observables from TheHive to run analyzers. MISP and VirusTotal are two parallel analysis options, not required to run sequentially.
n8n receives webhooks from TheHive and sends the initial SOC alert to Telegram. When an analyst clicks an Observable, n8n then processes the callback, determines the analyzer, creates a Cortex job, waits for the report, and sends the result to Telegram. The update_id, callback_query_id, suppression, and job ID mechanisms help avoid duplicate runs.
Log generated
→ Universal Forwarder
→ Splunk search/correlation
→ TheHive alert
→ n8n webhook
→ Telegram SOC Alert
Analyst clicks Observable on Telegram
→ Telegram callback
→ n8n replies to callback immediately
→ retrieves Observable from TheHive
→ checks Observable type and analyzer
→ Cortex creates job
→ n8n waits and retrieves report
→ Telegram sends result
n8n does not automatically run all Observables as soon as an alert arrives. Analyzers are only run when selected by the analyst, thereby reducing cost, reducing duplicate notifications, and maintaining control over the investigation.
Baseline detections are located in config/splunk/core-savedsearches.conf, with exclusion lookups for legitimate activity:
This use case has two layers:
Sigma-format rule metadata is located at detections/sigma/cve-2024-4577-php-cgi-argument-injection.yml. The search executed in Splunk is located at config/splunk/install-cve-detections.ps1.
config/
├── forwarder/ Windows and Linux input/output configuration
├── misp/ simulated IOCs for internal lookup
├── n8n/ TheHive–Telegram–Cortex workflow templates
├── splunk/ saved searches, lookups, and correlation scripts
└── sysmon/ Windows telemetry configuration
deploy/ Docker Compose template with secrets removed
detections/
└── sigma/ vendor-independent rule metadata
scripts/
├── splunk/ update searches via API
├── validation/ readiness checks
└── windows/ install telemetry on lab target machine
docs/ operations documentation and Telegram callback
The mapping between source and live system is in the system inventory. The real n8n workflow manifest with secrets removed is at config/n8n/live-workflow-manifest.json; the small import template file is kept separately for safely building a new lab.
cp deploy/docker-compose.soc.example.yml deploy/docker-compose.yml
cp .env.example .env
# Fill in secrets using a secret manager or a local .env file.
docker compose -f deploy/docker-compose.yml config
docker compose -f deploy/docker-compose.yml up -d
docker compose -f deploy/docker-compose.yml ps
The Compose template deploys TheHive, Cortex, MISP, Cassandra, Elasticsearch, MinIO, Redis, and MISP modules. n8n is currently operated as a host service with workflow configuration at config/n8n/.
# PowerShell Administrator on Windows lab
.\scripts\windows\install-lab-telemetry.ps1
# On the Splunk machine, do not write passwords into source code
$env:SPLUNK_PASSWORD = '<local-secret>'
.\config\splunk\install-cve-detections.ps1
python .\scripts\splunk\update-correlation-searches.py
# Check readiness
.\scripts\validation\check-system-readiness.ps1
Callback details are in docs/telegram-callback-setup.md.
Testing is performed bottom-up:
Metrics used in the lab: MTTD from event to Splunk detection, MTTN from alert to Telegram notification, MTTR from alert receipt to triage/case closure, False Positive Rate, and Duplicate rate.
| Component | Role | Reference Address |
|---|
| Kali | authorized test traffic source | 192.168.10.132 |
| Windows/XAMPP | Apache/PHP-CGI and Sysmon target machine | 192.168.10.130:8080 |
| Splunk | collection, search, correlation, and alerting | 192.168.10.128 |
| TheHive | alert, case, and Observable management | 192.168.10.133:9000 |
| Cortex | runs analyzers | 192.168.10.133:9001 |
| MISP | internal IOC repository | 192.168.10.133:443 |
| n8n | webhook/callback automation | 192.168.10.133:5678 |
| Detection | Primary Data | Objective |
|---|
| Brute Force Login | Windows Event ID 4625 | multiple failed logins within a time window |
| Suspicious NTLM Logon | Windows Event ID 4624 | abnormal network logon type 3 using NTLM |
| Privileged Group Change | Event ID 4732/4728/4756 | account added to high-privilege group |
| Lateral Movement SMB | Event ID 4624 | one source accessing multiple hosts abnormally |
| New Windows Service | Event ID 7045 | new service created outside allowlist |
| Encoded PowerShell | Event ID 4688 | PowerShell using -enc or -EncodedCommand |