michael-borck/forensics-docker-lab
GitHub: michael-borck/forensics-docker-lab
一个基于 Docker 的数字取证与事件响应培训平台,通过调查数据泄露案件的五个实验教授完整 DFIR 工作流程。
Stars: 0 | Forks: 0
# 数字取证与事件响应实验室
[](https://github.com/topics/cybersecurity) [](https://github.com/topics/digital-forensics) [](https://github.com/topics/docker) [](https://github.com/topics/edtech) [](https://github.com/topics/incident-response) [](https://github.com/topics/memory-forensics) [](https://github.com/topics/network-analysis) [](https://github.com/topics/sleuth-kit) [](https://github.com/topics/volatility) [](https://github.com/topics/yara)
## 关于 Cloudcore 2009 事件的完整 5 实验课程
## 🎯 课程概述
这是一门全面且注重实践的数字取证课程,你将针对 Cloudcore Inc. 发生的一起数据泄露事件进行真实风格的调查。你将在容器化环境中使用专业取证工具完成 5 个进阶实验,分析证据、恢复被删除文件、执行内存分析,并生成专业的事件响应报告。
**案件:** CLOUDCORE-2009-INS-001 - 数据泄露调查
**环境:** 基于 Docker 的取证工作站
**工具:** Sleuth Kit, Volatility, Autopsy GUI, Plaso, YARA 等
**时长:** 5 个进阶实验(每周一个,每个约 8-10 小时)
## 📚 5 个实验
| 实验 | 标题 | 技能 | 关键工具 |
|-----|-------|--------|-----------|
| **1** | **USB_Imaging** | 证据处理、初步分类、删除文件恢复 | Sleuth Kit, foremost, exiftool |
| **2** | **Memory_Forensics** | 易失性内存分析、进程调查 | Volatility 2 (Windows XP) |
| **3** | **Email_Logs** | 邮件痕迹分析、日志检查 | Python 分析, grep/awk |
| **4** | **Network_Analysis** | 网络流量分析、C2 检测、数据渗出 | Wireshark, tshark, PCAP 分析 |
| **5** | **Final_Report** | 综合分析、时间线构建、专业报告 | 所有工具 + 报告技能 |
## 📦 此包中包含什么?
```
forensics-docker-lab/
├── README.md ← You are here (course overview)
├── docs/
│ ├── README.md ← Student documentation index (START HERE)
│ ├── scenario.md ← Complete case background and context
│ ├── setup.md ← Installation and Docker setup guide
│ ├── storyline.md ← Investigation timeline and narrative
│ ├── glossary.md ← Forensics terminology
│ ├── troubleshooting.md ← Common issues and solutions
│ └── instructor/ ← Instructor materials (on instructor branch)
│
├── cases/ ← YOUR WORKSPACE (5 lab folders)
│ ├── USB_Imaging/ ← Lab 1: Imaging, integrity & initial triage
│ ├── Memory_Forensics/ ← Lab 2: Memory analysis with Volatility
│ ├── Email_Logs/ ← Lab 3: Email artifact analysis
│ ├── Network_Analysis/ ← Lab 4: Network traffic and C2 detection
│ ├── Final_Report/ ← Lab 5: Synthesis and final reporting
│ └── Autopsy_GUI/ ← Optional: Graphical forensic examination
│
├── evidence/ ← READ-ONLY evidence files
│ ├── usb.img / usb.E01 ← USB device forensic image (~800MB)
│ ├── memory.raw ← Windows XP memory dump (~511MB)
│ └── network.cap ← Network traffic capture (~100MB)
│
├── templates/ ← Student report templates
│ ├── README.md ← Template documentation
│ ├── lab_report_template.md ← Individual lab report template
│ ├── final_report_template.md ← Final synthesis report template
│ ├── chain_of_custody.csv ← CoC log template
│ └── analysis_log.csv ← Analysis tracking template
│
├── guides/ ← Interactive guides (HTML)
│ ├── chain-custody-guide.html ← Chain of custody reference
│ └── forensic-image-primer.html ← E01 format overview
│
├── rules/ ← YARA malware detection rules
│ └── README.md ← How to use YARA rules
│
├── scripts/
│ ├── forensics-workstation ← Immersive login script (bash)
│ ├── forensics-workstation.ps1 ← Immersive login script (PowerShell)
│ ├── coc-log ← Chain of custody logging utility
│ ├── verify_setup.sh ← Setup verification (bash)
│ ├── verify_setup.ps1 ← Setup verification (PowerShell)
│ ├── legacy/ ← Old scripts (for reference)
│ └── instructor/ ← Instructor-only tools (on instructor branch)
│
├── images/
│ ├── dfir-cli/ ← Main forensic workstation container
│ └── volatility2/ ← Windows XP memory analysis (vol2)
│
├── docker-compose.yml ← Container orchestration
└── LICENSE
```
## 🚀 快速开始 (5 分钟)
### TL;DR - 只需运行这些命令
**首次设置(选择其一):**
**选项 A: 使用 Make(推荐 - 最简单)**
```
cd forensics-docker-lab
make setup
make verify
make start
```
**选项 B: 直接脚本**
```
cd forensics-docker-lab
docker compose build
./start.sh # or start.bat on Windows
```
**后续每次:**
```
make start # or ./start.sh / start.bat
```
### 详细设置
#### 步骤 1: 前置条件
**安装 Docker Desktop:**
- **Windows/Mac:** 从 https://www.docker.com/products/docker-desktop 下载
- **Linux (Ubuntu/Debian):**
sudo apt update
sudo apt install docker.io docker-compose
sudo usermod -aG docker $USER
# 注销并重新登录以使组更改生效
**验证安装:**
```
docker --version
docker compose version
```
**系统要求:**
- 最低 4GB 内存(推荐 8GB+ 用于 Autopsy GUI)
- 15GB 可用磁盘空间(用于所有证据文件)
- 互联网连接(仅在首次构建时)
#### 步骤 2: 构建取证环境
```
cd /path/to/forensics-docker-lab
make setup
```
或手动:
```
docker compose build
docker compose run --rm dfir echo "Environment ready!"
```
#### 步骤 3: 验证你的设置(推荐)
```
make verify
```
或手动:
- **Windows:** `scripts\verify_setup.bat`
- **macOS/Linux:** `./scripts/verify_setup.sh`
所有检查都应通过(绿色的 ✓)。
#### 步骤 4: 进入取证工作站
```
make start
```
或直接:
- **Mac/Linux:** `./start.sh` (或 `./scripts/forensics-workstation`)
- **Windows:** `start.bat` (或 `scripts\forensics-workstation.bat`)
系统将提示你输入分析师姓名,随后你将进入环境:
```
╔═════════════════════════════════════════════════════════════════╗
║ ║
║ DIGITAL FORENSICS & INCIDENT RESPONSE LABORATORY ║
║ ║
║ Cloudcore 2009 Data Exfiltration Investigation ║
║ ║
╚═════════════════════════════════════════════════════════════════╝
alice@forensics-lab:/cases$
```
**现在直接运行取证命令**(无需 `docker compose` 前缀!):
```
# Example: List evidence files
ls -la /evidence/
# Example: Verify USB image integrity
sha256sum /evidence/usb.E01
# Example: Start Lab 1 analysis
mkdir -p USB_Imaging/output
cd USB_Imaging
fls -r /evidence/usb.img > output/fls.txt
# When done
exit
```
## 📖 如何使用本实验室
### 第一次?从这里开始:
1. **阅读课程概述**(本页 - 10 分钟)
2. **查看 `docs/README.md`** - 学生文档索引(10 分钟)
3. **阅读 `docs/scenario.md`** - 完整案件背景(20 分钟)
4. **构建 Docker 环境** - 上面的步骤 2(5 分钟)
5. **验证设置** - 上面的步骤 3(5 分钟)
6. **进入工作站** - 上面的步骤 4(1 分钟)
### 对于每个实验:
1. **阅读实验 README** - 例如,`cases/USB_Imaging/README.md`
2. **查看演练** - 例如,`cases/USB_Imaging/WALKTHROUGH.md`
3. **进入工作站** - `make start` (或 `./start.sh` / `start.bat`)
4. **运行分析命令** - 遵循实验演练中的命令
5. **填写报告** - 将 `templates/lab_report_template.md` 复制到你的实验文件夹
6. **记录你的操作** - 使用 `coc-log` 进行监管链记录
### 快速参考:
- **实验卡住了?** → 查看该实验的 `WALKTHROUGH.md`
- **想了解案件?** → 查看 `docs/scenario.md`
- **需要时间线背景?** → 查看 `docs/storyline.md`
- **术语困惑?** → 查看 `docs/glossary.md`
- **设置问题?** → 查看 `docs/troubleshooting.md`
## 🔑 关键特性
### ✅ 沉浸式取证工作站
无需每次都输入 `docker compose run --rm dfir`,只需使用:
```
make start # Recommended: simplest option
# or
./start.sh # Direct on Linux/Mac
start.bat # Direct on Windows
./scripts/forensics-workstation # Full path (equivalent to start.sh)
```
**优势:**
- 🎯 感觉像连接到真实的 DFIR 工作站
- 📝 你的分析师姓名会被记录在监管链中
- ⚡ 更少的输入 = 更快的工作流
- 🏢 符合真实世界的事件响应实践
### ✅ 自动监管链日志记录
`coc-log` 工具会自动为所有命令添加时间戳和哈希值:
```
coc-log "fls -r /evidence/usb.img" "Initial filesystem analysis"
```
结果会记录到 `cases/analysis_log.csv`,包含:
- 时间戳 (UTC)
- 分析师姓名
- 执行的命令
- 退出代码
- 输出哈希 (SHA256)
- 文件大小
- 你的备注
### ✅ 完整的证据包
包含所有证据文件:
- **usb.img / usb.E01** - USB 设备取证镜像 (800MB)
- **memory.raw** - Windows XP 内存转储 (511MB)
- **network.cap** - 网络流量捕获 (100MB)
只读以防止意外修改。所有分析都在可写的 `./cases/` 文件夹中进行。
### ✅ 多平台支持
- **Windows:** 支持 Docker Desktop + WSL 2 的 PowerShell 脚本
- **macOS:** 支持 Intel 和 Apple Silicon (M1/M2/M3)
- **Linux:** Ubuntu, Debian, Fedora 等
## 🖥️ 平台特定说明
### Windows 用户
**终端:** 使用带命令提示符或 PowerShell 的 Windows 终端(两者均可)
**Docker Desktop 设置:**
- 启用 WSL 2 后端(默认)
- 在 Docker Desktop 设置中分配 4GB+ 内存
- 确保 Docker Desktop 正在运行
**命令:**
```
# Use batch scripts for Windows:
scripts\verify_setup.bat
scripts\forensics-workstation.bat
# Docker commands work the same:
docker compose build
docker compose run --rm dfir
```
**常见问题:**
- "Command not found":重启 Docker Desktop
- "Access denied":以管理员身份运行命令提示符
- 批处理文件无法运行:确保你在正确的目录中
- PowerShell 执行策略:改用批处理文件(无需 PowerShell)
### macOS 用户 (Intel 和 Apple Silicon)
**终端:** 使用内置终端或 iTerm2
**Apple Silicon (M1/M2/M3):**
- Docker 使用 Rosetta 2(自动转换)
- 性能极佳
- 首次构建可能需要 5-7 分钟
**命令:**
```
./scripts/verify_setup.sh
./scripts/forensics-workstation
```
### Linux 用户 (Ubuntu/Debian/Fedora)
**Docker 组设置(一次性):**
```
sudo usermod -aG docker $USER
# Log out and back in
groups | grep docker # verify
```
**命令:**
```
./scripts/verify_setup.sh
./scripts/forensics-workstation
```
## 💡 基本命令
### 启动你的取证会话
**Mac/Linux/WSL:**
```
# Enter the immersive workstation (RECOMMENDED)
./scripts/forensics-workstation
# Or use Docker directly (for advanced users)
docker compose run --rm -it dfir bash
```
**Windows:**
```
# Enter the immersive workstation (RECOMMENDED)
scripts\forensics-workstation.bat
# Or use Docker directly (for advanced users)
docker compose run --rm -it dfir bash
```
### 在工作站内
```
# Lab 1: Analyse the USB image
mkdir -p USB_Imaging/output
fls -r /evidence/usb.img > USB_Imaging/output/fls.txt
# Lab 2: Memory analysis (run on host, not inside workstation)
docker compose exec vol2 vol.py -f /evidence/memory.raw imageinfo
# Lab 5: Network analysis (run on host, not inside workstation)
tshark -r evidence/network.cap -Y "irc"
# Always exit when done
exit
```
### 监管链
**记录证据处理命令:**
```
# Inside workstation
coc-log "fls -r /evidence/usb.img" "Lab 1 filesystem listing"
# This creates: cases/analysis_log.csv with timestamp, hash, analyst name
```
**查看完整参考:** `docs/COMMANDS.md`
## 📁 工作区组织结构
### 证据目录 (`./evidence/`)
**只读** - 切勿修改:
- `usb.img` / `usb.E01` - USB 设备镜像
- `memory.raw` - 内存转储
- `network.cap` - 网络捕获
在容器内挂载为 `/evidence`
### 案件目录 (`./cases/`)
**可写** - 保存你所有的工作:
- 在容器内挂载为 `/cases`
- 你在 `/cases/` 中创建的所有内容都会出现在主机的 `./cases/` 中
- 每个实验一个文件夹(USB_Imaging, Memory_Forensics 等)
**示例结构:**
```
./cases/
├── USB_Imaging/
│ ├── README.md ← Lab 1 instructions
│ ├── WALKTHROUGH.md ← Step-by-step guide
│ ├── output/ ← Your analysis outputs
│ ├── recovered/ ← Recovered files
│ └── report.md ← Your report (copy from templates/WORKBOOK.md)
├── Memory_Forensics/
│ ├── README.md
│ ├── WALKTHROUGH.md
│ ├── vol_output/
│ └── report.md
└── [etc for other labs...]
```
## 🔧 故障排除
### "Docker command not found"
**修复:**
- 确保 Docker Desktop 正在运行 (Windows/Mac)
- 安装 Docker 后重启终端
- Linux: `sudo systemctl start docker`
### "Cannot connect to Docker daemon"
**修复:**
- **Windows/Mac:** 启动 Docker Desktop 应用程序
- **Linux:** `sudo systemctl start docker`
### /evidence 上的 "Permission denied"
**这是预期的!** 证据是只读的。
- ✅ 正确:`fls -r /evidence/usb.img > /cases/output.txt`
- ❌ 错误:`fls -r /evidence/usb.img > /evidence/output.txt`
### "Build failed" 或 "Container won't start"
**修复:**
```
docker compose down -v
docker compose build --no-cache
```
### "Port 8080 already in use"(如果使用 Autopsy)
**修复:** 编辑 `docker-compose.yml` 并将 `8080:8080` 更改为 `8081:8080`
### 获取更多帮助
- **实验课:** 询问讲师或助教
- **办公时间:** 查看课程大纲了解时间
- **LMS 论坛:** 发布技术问题
- **文档:** 查看 `docs/COMMANDS.md`, `docs/SCENARIO.md`, 实验室 WALKTHROUGH.md
查看 **`docs/TROUBLESHOOTING.md`** 获取更详细的故障排除指南。
## 🧠 学习目标
完成所有 5 个实验后,你将:
1. ✅ 理解正确的数字证据处理(监管链、哈希、完整性验证)
2. ✅ 掌握行业标准的取证工具(Sleuth Kit, Volatility, Autopsy, Wireshark)
3. ✅ 分析多种证据类型(磁盘镜像、内存转储、网络捕获、日志)
4. ✅ 执行删除文件恢复和雕刻
5. ✅ 对旧版 Windows 系统进行内存取证
6. ✅ 识别和分析命令与控制 (C2) 通信
7. ✅ 构建时间线并关联多个数据源的事件
8. ✅ 撰写专业的事件响应报告
9. ✅ 理解真实世界的事件响应工作流
10. ✅ 批判性地反思 AI 工具在取证调查中的使用
## 📝 后续步骤
### 今天:
1. ✅ 阅读此 README(你正在做!)
2. → 阅读 `docs/README.md` 获取文档索引
3. → 阅读 `docs/SCENARIO.md` 获取案件背景
4. → 构建 Docker 环境(上面的快速开始)
### 本周(实验 1):
1. → 阅读 `cases/USB_Imaging/README.md`
2. → 遵循 `cases/USB_Imaging/WALKTHROUGH.md`
3. → 使用 `docs/COMMANDS.md` 作为命令参考
4. → 完成实验 1 的分析和报告
### 即将到来:
- 第 2 周:Memory_Forensics (Volatility)
- 第 3 周:Email_Logs (日志分析)
- 第 4 周:Network_Analysis (PCAP 分析)
- 第 5 周:Final_Report (综合 + 报告)
## 🎓 课程资料
**对于学生(主分支 main):**
- `docs/README.md` - 文档索引
- `docs/scenario.md` - 案件背景
`docs/setup.md` - 安装指南
- `docs/storyline.md` - 调查时间线
- 实验室文件夹:`cases/USB_Imaging/`, `cases/Memory_Forensics/` 等
**对于讲师(讲师分支 instructor):**
```
git checkout instructor
```
- `docs/instructor/README.md` - 讲师材料概览
- `cases/*/instructor/INSTRUCTOR_NOTES.md` - 每个实验的教学提示
- `cases/*/instructor/answer_key.md` - 预期发现
- `cases/*/instructor/rubric.csv` - 评分标准
## ⚖️ 学术诚信提醒
- 这是一项**个人评估** - 可以在概念上合作,但代码不行
- **允许使用 AI 工具**,但必须在你的反思中记录
- **切勿在不理解的情况下复制粘贴** AI 输出
- 在执行前**验证所有命令**
- **你的工作应可重现** - 记录每一步
- **切勿修改证据文件** - 仅在副本上工作
## 🆘 需要帮助?
**技术问题:**
- 查看 `docs/troubleshooting.md`
- 仔细查看错误信息
- 在线搜索错误(加上 "docker" + 工具名称)
- 在 LMS 论坛发帖并附上:操作系统、错误信息、你正在尝试的操作、你已经尝试过的解决方法
**取证概念:**
- 查看 `docs/scenario.md` 和 `docs/storyline.md`
- 参加实验课和办公时间
- 查看工具文档(Sleuth Kit, Volatility 等)
- 在 LMS 论坛提问
**实验室特定帮助:**
- 查看该实验室的 `README.md`
- 遵循该实验室的 `WALKTHROUGH.md`
- 在实验课期间询问讲师
## 🔒 重要说明
- **切勿修改证据文件** - 仅在副本上工作
- **记录一切** - 可重现性是关键
- **客观报告** - 陈述事实,而非指控
- **测试你的提交** - 确保包含所有文件
- **尽早开始** - 不要等到最后一天
- **提出问题** - 问总比猜好
## 📚 取证工具与资源
### 核心工具(预装)
- **Sleuth Kit (fls, icat, tsk_recover, fsstat, istat):** https://sleuthkit.org/sleuthkit/docs.php
- **Volatility 2:** 用于 Windows XP 及更旧版本的内存分析 - https://volatility-labs.blogspot.com/
- **Volatility 3:** 现代内存取证框架 - https://volatility3.readthedocs.io/
- **tshark:** 命令行网络数据包分析器 - https://www.wireshark.org/docs/man-pages/tshark.html
- **YARA:** 恶意软件模式匹配与检测 - https://virustotal.github.io/yara/
- **Autopsy:** GUI 取证分析平台 - https://www.sleuthkit.org/autopsy/
### 其他资源
- **Wireshark:** 网络协议分析器(tshark 的 GUI 补充) - https://www.wireshark.org/docs/
- **YARA Rules Repository:** 社区恶意软件检测规则 - https://github.com/Yara-Rules/rules
**祝你的调查顺利!请记住:专业性、文档记录和客观性是优秀取证工作的标志。**
标签:Active Directory, AI合规, Autopsy, DAST, DNS 反向解析, DNS 解析, Docker实验室, HTTP工具, Plaso, SecList, Sleuth Kit, YARA, 事件响应报告, 云核心事件, 云资产可视化, 入侵调查, 内存取证, 动手实训, 后端开发, 子域名变形, 安全教育, 容器化环境, 库, 应急响应, 应用安全, 恶意软件分析, 搜索语句(dork), 数字取证, 数据渗漏, 数据窃取调查, 文件恢复, 系统分析, 网络分析, 网络安全, 自动化脚本, 蓝队训练, 请求拦截, 逆向工具, 隐私保护