kamalanathankaviprasath-cyber/Project-2-SIEM-log-analysis-wazuh
GitHub: kamalanathankaviprasath-cyber/Project-2-SIEM-log-analysis-wazuh
在 Ubuntu Server 上部署 Wazuh SIEM 并接入 Windows agent,通过模拟真实攻击验证自定义检测规则与 MITRE ATT&CK 映射的安全实验室项目。
Stars: 0 | Forks: 0
# 🔍 项目 2 — 使用 Wazuh 进行 SIEM 部署与日志分析




## 📋 概述
在 Ubuntu Server 22.04 上部署了完整的 Wazuh SIEM 技术栈,
将一台 Windows 10 终端作为 live agent 连接,模拟
真实世界的攻击,并在
Dashboard 中捕获映射了 MITRE ATT&CK 的告警。
编写了用于端口扫描和暴力破解攻击的自定义检测规则。
本项目演示了:
- SIEM 部署与配置
- Endpoint agent 管理
- 攻击模拟与检测
- 自定义检测规则编写
- MITRE ATT&CK 框架映射
- 告警分类与调查
## 🏗️ 实验室架构
Internet (VirtualBox NAT)
│
▼
┌─────────────────────────┐
│ pfSense Firewall VM │
│ 192.168.1.1 │
└─────────┬───────────────┘
│ LabNet (192.168.1.0/24)
│
┌─────┴──────────────┐
▼ ▼
┌──────────────┐ ┌─────────────┐
│ Ubuntu Server│ │ Windows 10 │
│ 192.168.1.50 │ │ 192.168.1.101│
│ Wazuh Manager│ │ Wazuh Agent │
│ + Dashboard │ │ Windows10-Lab│
└──────────────┘ └─────────────┘
## 🛠️ 使用的工具
| Tool | Version | Purpose |
|---|---|---|
| Wazuh Manager | 4.7.5 | SIEM engine — receives and analyses logs |
| Wazuh Dashboard | 4.7.5 | Web UI — visualizes alerts and events |
| Wazuh Indexer | 4.7.5 | OpenSearch — stores all log data |
| Wazuh Agent | 4.7.5 | Windows 10 endpoint log collection |
| Ubuntu Server | 22.04.5 LTS | Wazuh Manager host |
| Windows 10 Pro | 10.0.19041 | Monitored endpoint |
| pfSense | 2.6.0 | Network firewall/gateway |
| VirtualBox | 7.x | Hypervisor |
## ⚙️ Wazuh 组件说明
| Component | Role | Port |
|---|---|---|
| Wazuh Manager | Receives logs, runs rules, fires alerts | 1514/1515 |
| Wazuh Indexer | Stores and indexes all log data | 9200 |
| Wazuh Dashboard | Web interface for analysts | 443 |
| Wazuh Agent | Installed on endpoints, sends logs | 1514 |
## 🔍 执行的攻击模拟
### 攻击 1:SSH 暴力破解
**目标:** Ubuntu Server (192.168.1.50)
**方法:** 从 Ubuntu Desktop 重复使用
错误凭据尝试 SSH 登录
**Wazuh 检测:**
| Rule ID | Level | Description | MITRE |
|---|---|---|---|
| 5710 | 5 | SSH login attempt with non-existent user | T1110.001 |
| 5503 | 5 | PAM authentication failure | T1110.001 |
| 2502 | 10 | Multiple password failures | T1110 |
**检测到的战术:** Credential Access、Lateral Movement
### 攻击 2:Windows 暴力破解
**目标:** Windows 10 VM (192.168.1.101)
**方法:** 在 Windows 锁定屏幕上
多次失败的登录尝试
**Wazuh 检测:**
| Rule ID | Level | Description | MITRE |
|---|---|---|---|
| 60122 | 5 | Windows authentication failure | T1110 |
| 60106 | 3 | Windows logon success | T1078 |
| 60137 | 3 | Windows user logoff | T1078 |
**检测到的战术:** Credential Access、
Defense Evasion、Persistence
### 攻击 3:Nmap 端口扫描
**目标:** Windows 10 VM (192.168.1.101)
**方法:** 从 Ubuntu Desktop 进行
Nmap 服务版本扫描
**使用的命令:**
```
sudo nmap -sV -p 1-1000 192.168.1.101
```
## 📝 编写的自定义检测规则
参见 [rules/custom_detection_rules.md](./rules/custom_detection_rules.md)
和 [configs/local_rules.xml](./configs/local_rules.xml)
| Rule ID | Level | Trigger | MITRE | Tactic |
|---|---|---|---|---|
| 100001 | 10 | Port scan detected | T1046 | Discovery |
| 100002 | 12 | Multiple auth failures (3 in 2 min) | T1110 | Credential Access |
| 100003 | 12 | Multiple SSH failures same IP | T1110 | Credential Access |
## 🎯 MITRE ATT&CK 覆盖范围
| Technique | ID | Tactic | Detected By |
|---|---|---|---|
| Brute Force | T1110 | Credential Access | Rules 2502, 100002 |
| Valid Accounts | T1078 | Defense Evasion | Rule 60106 |
| SSH | T1021.004 | Lateral Movement | Rule 5710 |
| Network Service Discovery | T1046 | Discovery | Rule 100001 |
| Brute Force: Password Guessing | T1110.001 | Credential Access | Rule 5710 |
## 📸 证据
| Evidence | Description |
|---|---|
| [Dashboard 概览](./screenshots/wazuh_dashboard_overview.png) | 显示告警统计信息的主 Dashboard |
| [Agents 页面](./screenshots/wazuh_agents_active.png) | Windows10-Lab agent 活跃 |
| [SSH 暴力破解告警](./screenshots/ssh_brute_force_detection.png) | 真实的 SSH 攻击检测 |
| [告警详情](./screenshots/alert_detail_rule5710.png) | 展开包含完整详情的告警 |
| [Windows 告警](./screenshots/windows_brute_force_alerts.png) | Windows 暴力破解检测 |
## 📚 关键经验教训
参见完整文档:[lessons_learned.md](./lessons_learned.md)
**亮点:**
- Wazuh 服务启动顺序至关重要
- 检测规则的针对性与覆盖范围之间的权衡
- if_matched_sid 与 if_matched_group 的区别
- SSH 是最受攻击的 Linux 服务
- MITRE ATT&CK 映射为原始告警增加了上下文
- 虚拟机资源分配会影响 SIEM 性能
## 🎯 展示的技能
SIEM Deployment ████████████████░░░░ Intermediate
Log Analysis ████████████████░░░░ Intermediate
Detection Engineering ████████████░░░░░░░░ Foundational
MITRE ATT&CK ████████████████░░░░ Intermediate
Linux Administration ████████████████░░░░ Intermediate
Attack Simulation ████████████░░░░░░░░ Foundational
Incident Triage ████████████░░░░░░░░ Foundational
## 🔜 下一步计划
这是我网络安全作品集中的**项目 2(共 11 个)**。
**项目 3:** Python Security Automation Toolkit
- 日志解析器和 IP 信誉检查器
- 端口扫描器和密码审计器
- AbuseIPDB API 集成
**完整路线图:**
[github.com/kamalanathankaviprasath-cyber](https://github.com/kamalanathankaviprasath-cyber)
*作者:Kamalanathan Kaviprasath*
*IT Support Professional → Cybersecurity Engineer*
*📍 斯里兰卡科伦坡*
标签:PB级数据处理, Wazuh, 安全运维, 插件系统, 红队行动, 靶场环境