Satz-N-Sentry/wazuh-nmap-detection

GitHub: Satz-N-Sentry/wazuh-nmap-detection

基于Wazuh SIEM自定义规则的实时Nmap端口扫描检测方案,专为蓝队家庭实验室设计。

Stars: 0 | Forks: 0

# Wazuh SIEM - Nmap 端口扫描检测 ![Wazuh](https://img.shields.io/badge/Wazuh-v4.14.3-blue) ![License](https://img.shields.io/badge/license-MIT-green) ![Platform](https://img.shields.io/badge/platform-Linux-lightgrey) ![Author](https://img.shields.io/badge/author-Satheesh-orange) 使用自定义 Wazuh SIEM 规则和 iptables 日志记录进行实时 Nmap 端口扫描检测。 ## 作者 **Satheesh Nithiananthan** satheeshnithiananthan@gmail.com ## 实验环境配置 | 机器 | 操作系统 | IP | 角色 | |---------|----|----|------| | 攻击者 | BlackArch | 192.168.8.185 | Nmap 扫描 | | Agent | Debian/Ubuntu | 192.168.8.186 | 目标 | | Manager | Kali Linux | - | Wazuh Manager | ## 工作原理 ``` Nmap scan → iptables logs it → journald captures it → Wazuh agent forwards it → Custom rules fire at level 15 → Alert appears in dashboard ``` ## 规则 | 规则 ID | 级别 | 描述 | |---------|-------|-------------| | 100099 | 3 | 桥接规则 - 捕获 PORTSCAN 事件 | | 100100 | 15 | 检测到 TCP SYN 扫描 | | 100101 | 15 | 检测到 UDP 扫描 | | 100102 | 15 | 检测到 ICMP 扫描 | ## 快速开始 ``` # 复制 rules 到你的 Wazuh manager cp rules/local_rules.xml /var/ossec/etc/rules/local_rules.xml # 在你的 agent 上添加 iptables rule iptables -A INPUT -m state --state NEW -j LOG --log-prefix "PORTSCAN: " --log-level 4 # 重启 Wazuh manager systemctl restart wazuh-manager ``` ## 截图 ### iptables PORTSCAN 规则已激活 ![iptables](https://raw.githubusercontent.com/Satz-N-Sentry/wazuh-nmap-detection/main/screenshots/01_iptables_rule.png) ### Wazuh Agent 状态 ![agent](https://raw.githubusercontent.com/Satz-N-Sentry/wazuh-nmap-detection/main/screenshots/02_Agent_status.png) ### Wazuh Logtest - 规则 100100 在级别 15 触发 ![logtest](https://raw.githubusercontent.com/Satz-N-Sentry/wazuh-nmap-detection/main/screenshots/03_logtest_output.png) ### 来自 BlackArch 的 Nmap 扫描 ![nmap](https://raw.githubusercontent.com/Satz-N-Sentry/wazuh-nmap-detection/main/screenshots/04_nmap_scan.png) ### 在 alerts.log 中捕获的实时告警 ![alert](https://raw.githubusercontent.com/Satz-N-Sentry/wazuh-nmap-detection/main/screenshots/05_Live_alert.png) ### Wazuh Dashboard - 安全事件 ![dashboard](https://raw.githubusercontent.com/Satz-N-Sentry/wazuh-nmap-detection/main/screenshots/06_dashboard.png) ``` ## 完整案例研究 Read the complete step-by-step guide on Medium. ## Tags `Wazuh` `SIEM` `Nmap` `BlueTeam` `SOC` `iptables` `Linux` `CyberSecurity` ```
标签:SIEM, Wazuh, 入侵检测, 密码管理, 插件系统, 日志分析, 端口扫描检测, 蓝队