← Writeups
SOC · Wazuh · Detection · MITRE ATT&CKDecember 4, 2025

Building a Home SOC Lab with Wazuh

Why I Built This

I had read about SIEMs, detection rules, and MITRE ATT&CK mapping. I understood the theory. But I had never actually watched an attack generate a log, watched that log get parsed by a rule I wrote, and watched an alert appear on a dashboard I configured. The gap between knowing how it works and having done it felt too wide to ignore.

So I built a SOC lab. Three virtual machines on a single host, fully isolated from the internet, running real attack traffic against real vulnerable services, with a Wazuh SIEM collecting and alerting on everything.

Architecture

The lab uses three VMs on VirtualBox connected through a host-only adapter:

  • Wazuh Manager — Ubuntu 22.04 running the full Wazuh stack (manager, indexer, dashboard). This machine receives all agent logs, processes them through my custom rules, and displays the resulting alerts.
  • Victim Server — Ubuntu Server running DVWA (Damn Vulnerable Web Application) and Honeytrap. This machine also runs the Wazuh agent and forwards all its logs to the manager.
  • Attacker — Kali Linux. This is where all attack traffic originates. Nothing else.

The network is fully isolated. No traffic leaves the host. This means I can run actual exploit tools without worrying about hitting real targets.

What I Attacked and What I Detected

SSH Brute Force with Hydra

I ran Hydra against the Honeytrap service listening on port 22 of the victim server. Honeytrap is a low-interaction honeypot that logs every connection attempt and every credential tried.

The Wazuh agent on the victim forwards Honeytrap's log to the manager. I wrote a custom rule in local_rules.xml that hooks into Wazuh's built-in rule 5710 (multiple failed SSH logins) and raises the severity. The rule specifically labels the attack as Hydra based on connection patterns.

MITRE ATT&CK mapping: T1110.001 — Brute Force: Password Spraying under the CREDENTIAL ACCESS tactic.

SOC interpretation: Block the source IP at the perimeter, disable root SSH login, implement fail2ban or equivalent rate-limiting.

SQL Injection with SQLMap

I ran SQLMap against DVWA's SQL injection module at /dvwa/vulnerabilities/sqli/ with the security level set to Low. SQLMap automatically found the injection point and dumped the database.

My custom Wazuh rule uses regex matching on the Apache access logs forwarded from the victim. It looks for patterns like UNION SELECT, SLEEP, information_schema, and ORDER BY in GET requests — all signatures of SQLMap's default behavior.

MITRE ATT&CK mapping: T1190 — Exploit Public-Facing Application under the INITIAL ACCESS tactic.

SOC interpretation: Check WAF logs for the same patterns, confirm whether the injection succeeded by correlating with database query logs, and look for data exfiltration indicators.

Command Injection

I used DVWA's command injection module through the web interface. Payloads included shell metacharacters like semicolons (;), pipes (|), and chained commands (&&).

Here's the problem: Apache does not log POST bodies by default. A command injection payload in a POST parameter never appears in the access log. I only discovered this after my initial Wazuh rules failed to fire.

The fix was installing ModSecurity on the victim server and setting it to audit mode. ModSecurity captures the full request including POST bodies and writes them to /var/log/apache2/modsec_audit.log. I configured the Wazuh agent to forward this log, then wrote a custom rule that matches shell metacharacters in the POST body field.

MITRE ATT&CK mapping: T1059 — Command and Scripting Interpreter under the EXECUTION tactic.

What I Learned

The biggest lesson was the gap between two VMs and three. My initial plan put the Wazuh manager and the vulnerable services on the same machine. It would have "worked" but it would have been architecturally wrong — in any real environment, the SIEM does not run on the same host as the services it monitors. The three-VM design forced me to configure networking, manage separate log forwarding paths, and think about which machine sees what traffic. That friction was the point.

The ModSecurity discovery was the other key moment. I spent hours trying to figure out why my command injection rule would not fire before I realized Apache simply does not log what I needed it to log. That single problem taught me more about web server logging than any documentation could have.

The third lesson was that reading raw logs during an active attack is nothing like reading about them. When you see 200 failed SSH attempts in thirty seconds scroll past in real time, the threat becomes tangible in a way that summary statistics never achieve.

Full Writeup

For complete configuration details, the exact rule XML, and screenshots of the alerts as they appeared in the Wazuh dashboard, the full writeup is on Medium:

Building a Home SOC Lab with Wazuh