allsmog/mlw-lab
GitHub: allsmog/mlw-lab
以 Stuxnet 为研究对象的可复现恶意软件分析实验室,提供静态(Docker)和动态(Vagrant VM)双分析面及配套检测规则与安全文档。
Stars: 0 | Forks: 0
# mlw-lab — Stuxnet 分析(学校项目)
一个可复现的实验室,用于从四个维度研究 Stuxnet:
1. **传播** — LNK 0-day (CVE-2010-2568), Print Spooler (CVE-2010-2729), MS08-067, USB & SMB 共享。
2. **持久化 / 隐蔽** — 签名的内核驱动程序(Realtek/JMicron 失窃证书),rootkit hooks。
3. **Payload** — Step7/WinCC DLL 劫持 (`s7otbxdx.dll`),Siemens S7-315/417 上的 PLC 代码注入,转子频率破坏逻辑。
4. **规避** — 反 AV 检查,环境密钥。
## 两个分析面
| 分析面 | 运行位置 | 用途 |
| -------- | ---------------------------------------- | ----------------------------------------------------------------------------- |
| 静态 | `static-lab/` Docker 容器 | 在不执行样本的情况下进行检查:YARA, capa, FLOSS, radare2, Volatility 等。 |
| 动态 | `dynamic-lab/` Vagrant VM (Win7 x86) | 在具有快照和 host-only 网络的隔离 VM 中引爆。 |
**容器*不是*执行恶意软件的沙箱。** 容器与宿主机共享内核;Stuxnet 的内核驱动程序(`mrxnet.sys`, `mrxcls.sys`)无法以这种方式被安全地隔离。仅使用该容器对静态样本运行分析工具。参见 [`docs/01-lab-architecture.md`](docs/01-lab-architecture.md)。
## 目录结构
```
.
├── README.md
├── SAFETY.md
├── Makefile # convenience: make build / make shell / make triage SAMPLE=...
├── docs/
│ ├── 01-lab-architecture.md
│ ├── 02-static-analysis-setup.md
│ ├── 03-dynamic-analysis-setup.md
│ ├── 04-network-isolation.md
│ ├── 05-sample-acquisition.md
│ ├── 06-first-session.md # 60-minute session-1 walkthrough
│ ├── instructor-approval-template.md
│ ├── propagation.md
│ ├── persistence.md
│ ├── payload.md
│ └── evasion.md
├── static-lab/
│ ├── Dockerfile # REMnux-style static analysis image
│ ├── docker-compose.yml # mounts samples/ read-only, no network
│ ├── extra-ca.crt # placeholder for proxy CA (PEM)
│ └── tools/install-extra.sh
├── dynamic-lab/
│ ├── Vagrantfile # detonator + target VMs (host-only)
│ ├── fakenet/fakenet.ini # FakeNet-NG config tuned for Stuxnet
│ └── README.md
├── yara/
│ └── stuxnet.yar # starter detection rules
├── sigma/ # behavioral detection rules (Sysmon-based)
│ └── *.yml
├── scripts/
│ ├── verify-hashes.sh # SHA-256 check against an allowlist
│ ├── triage.sh # PE triage + capa + YARA + FLOSS
│ ├── carve-resources.py # carve embedded blobs from the PE resource section
│ ├── mb-lookup.sh # MalwareBazaar metadata lookup by SHA-256
│ └── ghidra/ # Ghidra headless scripts (export analysis, ...)
├── samples/ # gitignored; drop authorized sample(s) here
├── analysis/ # raw outputs and rough notes, per axis
│ ├── propagation/
│ ├── persistence/
│ ├── payload/
│ └── evasion/
├── report/ # markdown source for the academic write-up
│ ├── 00-abstract.md ... 08-conclusion.md
│ └── references.md
├── slides/ # Marp slide deck for the project talk
│ └── deck.md
├── cloud/ # one-shot cloud-init for a disposable analysis VM
│ ├── stuxnet-lab.cloud-init.yml
│ └── README.md
└── .githooks/ # git pre-commit hook (blocks binary commits)
└── pre-commit
```
## 不想让活动的恶意软件留在你的笔记本电脑上?
那是正确的直觉。查看 [`cloud/`](cloud/) 获取一个一次性的
`cloud-init.yml`,它能在约 5 分钟内将任何全新的 Ubuntu 24.04 droplet (Hetzner /
DigitalOcean / Linode / Vultr / Oracle Free) 变成完整的实验室。恶意软件留在 droplet 上;你的笔记本电脑永远只运行
ssh。项目完成后销毁该 droplet。
## 快速开始(仅限静态分析)
```
# 0. 启用 pre-commit hook,以防意外提交样本。
make hooks
# 1. 构建分析容器。
make build
# 2. 将一个已授权的样本放入 samples/(参见 docs/05-sample-acquisition.md)。
# 请勿提交它。验证 hash:
make verify
# 3. 运行自动化分类(PE 信息 + capa + YARA + FLOSS)。
make triage SAMPLE=samples/stuxnet.bin
# 4. 进入包含所有可用工具的 shell。
make shell
```
## 快速开始(动态引爆)
```
cd dynamic-lab
# 请先阅读 README.md —— 您必须:
# - 确认 host-only networking
# - 进行快照
# - 获得指导者批准
vagrant up
```
## 范围说明
此项目的某些部分你可以完全复现;某些部分则不能:
- **LNK exploit** — 可以,可以通过 USB 镜像在未打补丁的 Win7 VM 上复现触发器。
- **Print Spooler / MS08-067** — 可以,可以在 host-only 网络上的未打补丁 VM 上实现。
- **已签名驱动程序加载** — 可以,但失窃的证书已被吊销;你会看到签名验证失败,这本身也是一个发现。
- **Rootkit hooks** — 可以,可通过 WinDbg / Volatility 观察。
- **Step7 DLL 劫持** — 部分;你可以静态观察劫持机制,但完整执行需要 Siemens Step7(商业软件)。
- **PLC 代码注入 / 转子破坏** — **仅限静态。** 这需要真实的 S7-315 或 S7-417 PLC,或 PLCSim。从二进制文件中记录逻辑;不要尝试执行它。
- **失窃证书验证** — 仅限静态。
## 参考文献入门
- Falliere, Murchu, Chien — *W32.Stuxnet Dossier* (Symantec, 2011)。
- Langner — *To Kill a Centrifuge* (2013)。
- Matrosov, Rodionov, Harley, Malcho — *Stuxnet Under the Microscope* (ESET)。
- Kaspersky — *Stuxnet/Duqu: The Evolution of Drivers*。
- Zetter — *Countdown to Zero Day* (2014)。
标签:Cutter, DAST, PE 加载器, Web报告查看器, YARA, 云安全监控, 云资产可视化, 云资产清单, 恶意软件分析, 知识库安全, 请求拦截, 逆向工具, 逆向工程, 配置错误, 静态分析, 靶场环境