haltacademy/Lab

GitHub: haltacademy/Lab

基于 Docker 的企业级 Web 应用渗透测试靶场套件,通过统一门户管理 28+ 个覆盖主流漏洞类型的实战实验室,帮助安全学习者高效练习攻防技能。

Stars: 1 | Forks: 0

# Defender 实验室 ![Version](https://img.shields.io/badge/Version-1.0.0-00e676?style=for-the-badge) ![Docker](https://img.shields.io/badge/Docker-Required-2496ED?style=for-the-badge&logo=docker) ![Linux](https://img.shields.io/badge/Linux-Supported-FCC624?style=for-the-badge&logo=linux&logoColor=black) ![macOS](https://img.shields.io/badge/macOS-Supported-000000?style=for-the-badge&logo=apple) ![Windows](https://img.shields.io/badge/Windows-Supported-0078D6?style=for-the-badge&logo=windows) 一个专业的容器化 Web 安全培训平台,提供通过单一门户管理的 **28+ 个实战实验室**。专为渗透测试学生和安全研究人员打造。 ## 包含的实验室 | 类别 | 实验室 | |----------|------| | SQL 注入 | 联合查询、盲注、报错 | | 跨站脚本攻击 (XSS) | 反射型、存储型、DOM | | CSRF | Token 绕过、方法绕过 | | 本地文件包含 (LFI) | 路径遍历、编码、Null 字节 | | 远程文件包含 (RFI) | 基础 RFI | | 命令注入 | 简单、过滤器绕过、盲注 | | 服务端请求伪造 (SSRF) | 基础 SSRF | | Shell 上传 | 黑名单/白名单绕过、WAF、路径遍历 | | XXE 注入 | 基础 XXE | | PHP 过滤器 | 输入过滤器、源码泄露 | | Docker 安全 | Socket 逃逸、暴露的 API、特权逃逸 | ## 前置条件 | 平台 | 要求 | |----------|-------------| | **Linux** | Docker Engine + Docker Compose | | **macOS** | Docker Desktop | | **Windows** | Docker Desktop + WSL 2 | ## 安装说明 ### Linux (Debian / Ubuntu) ``` # 安装 Docker sudo apt install -y docker.io docker-compose sudo usermod -aG docker $USER && newgrp docker # 安装 lab sudo dpkg -i defender-lab_1.0.0_amd64.deb ``` 安装后门户会自动启动。 ### macOS 1. 安装 [Docker Desktop](https://www.docker.com/products/docker-desktop/) 并启动 2. 打开 `.dmg` 文件 3. 双击 **Install.command** 4. 在提示时输入您的密码 然后启动实验室: ``` defender-lab start ``` ### Windows 1. 使用 WSL 2 后端安装 [Docker Desktop](https://www.docker.com/products/docker-desktop/) 2. 双击 **defender-lab_1.0.0_windows.exe** 3. 按照安装向导操作 4. 从 **开始菜单 → Defender Lab → Start Lab** 启动 ## 快速开始(从源代码) **Linux / macOS:** ``` git clone https://github.com/haltacademy/Lab.git cd Lab chmod +x start.sh ./start.sh ``` **Windows PowerShell:** ``` git clone https://github.com/haltacademy/Lab.git cd Lab .\start.ps1 ``` **Windows CMD:** ``` git clone https://github.com/haltacademy/Lab.git cd Lab start.bat ``` 首次启动会构建 Docker 镜像,需要 **5–10 分钟**。后续启动将是瞬间完成。 预期输出: ``` ============================================ Defender Lab is running! Open: http://localhost:9000 Login: admin / admin ============================================ ``` ## 访问门户 打开您的浏览器:**http://localhost:9000** | 字段 | 值 | |-------|-------| | 用户名 | `admin` | | 密码 | `admin` | ## 使用实验室 1. 前往侧边栏的 **Web Application Pentesting** 2. 按类别浏览目录 3. 点击 **Launch** —— 实验室将自动部署并在新标签页中打开 4. 如果实验室已在运行,按钮将显示 **Open** —— 单击即可立即打开 5. 点击 **Destroy** 停止实验室并释放内存 6. 在仪表板上使用 **Nuke** 可一次性停止所有正在运行的实验室 ## 停止实验室 **Linux / macOS:** ``` ./stop.sh ``` **Windows PowerShell:** ``` .\stop.ps1 ``` **Windows CMD:** ``` stop.bat ``` **Linux(通过 .deb 安装):** ``` defender-lab stop ``` ## 仓库结构 ``` Lab/ ├── Nebula Security Suite/ ← Management portal (port 9000) ├── CSRF Lab/ ← 2 CSRF environments ├── Command Injection Lab/ ← 4 injection labs ├── SQL Injection Lab/ ← SQLi environments ├── XSS Lab/ ← Cross-site scripting labs ├── LFI Basic Bypasses/ ← 5 LFI bypass techniques ├── RFI Lab/ ← Remote file inclusion ├── Shell Uploading Lab/ ← 6 file upload bypass labs ├── SSRF Lab/ ← Server-side request forgery ├── XXE Injection Lab/ ← XML external entity ├── PHP Filters/ ← PHP filter exploitation ├── Docker Security Lab/ ← Container escape labs ├── start.sh / stop.sh ← Linux & macOS launcher ├── start.bat / stop.bat ← Windows CMD launcher ├── start.ps1 / stop.ps1 ← Windows PowerShell launcher ├── defender-lab_1.0.0_amd64.deb ← Linux installer ├── defender-lab_1.0.0_macos.dmg ← macOS installer └── defender-lab_1.0.0_windows.exe ← Windows installer ``` ## 从源代码构建安装程序 ``` # Linux .deb (需要:在 macOS 上运行 brew install dpkg) ./build-deb.sh # macOS .dmg (内置 hdiutil,无额外 deps) ./build-dmg.sh # Windows .exe (需要:在 macOS 上运行 brew install nsis) ./build-exe.sh ``` ## 故障排除 **Docker 未运行:** 启动 Docker Desktop 并等待图标停止动画后再运行启动脚本。 **端口 9000 已被占用:** ``` # Linux/macOS sudo lsof -i :9000 && sudo kill -9 # Windows PowerShell netstat -ano | findstr :9000 taskkill /PID /F ``` **权限被拒绝 (Linux):** ``` sudo usermod -aG docker $USER && newgrp docker ``` **Windows PowerShell 被阻止:** ``` Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSigned ``` ## 免责声明 *Defender Lab 仅用于教育和授权的安全研究。切勿在未获得明确书面许可的情况下测试系统。* **由 Defender Labs © 2026 构建**
标签:AI合规, CISA项目, CSRF, CTF训练, Cutter, Docker, Docker逃逸, Go语言工具, IP 地址批量处理, LFI, NIDS, OPA, PHP安全, RFI, SSRF, Web安全, XSS, XXE注入, 后端开发, 命令注入, 安全培训, 安全教育, 安全防御评估, 实战平台, 容器化, 开源安全项目, 文件上传, 漏洞情报, 漏洞演练, 版权保护, 网络安全, 网络安全审计, 蓝队分析, 请求拦截, 跨站脚本攻击, 隐私保护, 靶场