michael-borck/cybersecurity-lab-lateral-movement

GitHub: michael-borck/cybersecurity-lab-lateral-movement

该项目为网络安全课程和渗透测试练习提供一个基于 Docker 的隔离横向移动实验环境,内置多个预配置靶机与攻击工具容器。

Stars: 2 | Forks: 0

# CYB204 横向移动实验室环境 [![cybersecurity](https://img.shields.io/badge/-cybersecurity-f44336?style=flat-square)](https://github.com/topics/cybersecurity) [![docker](https://img.shields.io/badge/-docker-2496ed?style=flat-square)](https://github.com/topics/docker) [![docker-compose](https://img.shields.io/badge/-docker--compose-blue?style=flat-square)](https://github.com/topics/docker-compose) [![edtech](https://img.shields.io/badge/-edtech-4caf50?style=flat-square)](https://github.com/topics/edtech) [![ethical-hacking](https://img.shields.io/badge/-ethical--hacking-blue?style=flat-square)](https://github.com/topics/ethical-hacking) [![html](https://img.shields.io/badge/-html-e34f26?style=flat-square)](https://github.com/topics/html) [![lateral-movement](https://img.shields.io/badge/-lateral--movement-blue?style=flat-square)](https://github.com/topics/lateral-movement) [![penetration-testing](https://img.shields.io/badge/-penetration--testing-blue?style=flat-square)](https://github.com/topics/penetration-testing) [![security-lab](https://img.shields.io/badge/-security--lab-blue?style=flat-square)](https://github.com/topics/security-lab) [![vulnerable-applications](https://img.shields.io/badge/-vulnerable--applications-blue?style=flat-square)](https://github.com/topics/vulnerable-applications) **▶ 从这里开始:https://michael-borck.github.io/cybersecurity-lab-lateral-movement/** — 或者运行 `./start.sh`。 这个基于 Docker 的实验室环境提供了一个安全、隔离的网络,用于作为 CYB204 道德黑客课程的一部分来练习横向移动技术。 ## 系统要求 该实验室设计为可在 Linux、Windows 和 Mac 平台的低配置笔记本电脑上运行。 ### 最低要求: - 4GB 内存(推荐 8GB) - 10GB 可用磁盘空间 - 已安装 Docker Desktop 或 Docker Engine - Docker Compose v2.0 或更高版本 ### 测试环境: - Windows 10/11 搭配 Docker Desktop - macOS(Intel 和 Apple Silicon) - Ubuntu Linux 20.04+ ## 安装说明 ### 1. 安装 Docker **Windows/Mac:** - 下载并安装 [Docker Desktop](https://www.docker.com/products/docker-desktop/) - 在继续之前确保 Docker Desktop 正在运行 **Linux:** ``` # 安装 Docker curl -fsSL https://get.docker.com -o get-docker.sh sudo sh get-docker.sh # 安装 Docker Compose sudo apt-get install docker-compose-plugin # 将你的用户添加到 docker 组 sudo usermod -aG docker $USER newgrp docker ``` ### 2. 获取 Compose 文件 实验室镜像已预构建并发布到 GitHub Container Registry (GHCR), 因此你不需要构建任何东西——你只需要 `docker-compose.yml` 文件。克隆仓库(或者只下载 `docker-compose.yml`): ``` git clone https://github.com/michael-borck/cybersecurity-lab-lateral-movement.git cd cybersecurity-lab-lateral-movement ``` ### 3. 启动实验室环境 ``` docker compose up -d ``` 首次运行会从 GHCR 拉取预构建的镜像(根据你的网络情况可能需要几分钟); 随后的启动几乎是瞬时的。这些镜像以多架构(multi-architecture)形式发布,因此在 Intel/AMD 机器和 Apple Silicon Mac 上都会自动拉取正确的构建版本。 ### 4. 验证所有容器是否正在运行 ``` docker-compose ps ``` 你应该看到 8 个正在运行的容器: - secutils - workstation - ubuntu-desktop - ldap - mysql - telnet - juice-shop - dvwa ## 实验室架构 ### 网络配置 - **子网:** 172.20.0.0/24 - **网络名称:** cyb204_net ### 容器 IP 和服务 | 容器 | IP 地址 | 服务 | 用途 | |-----------|------------|----------|---------| | secutils | 172.20.0.10 | 攻击工具 | 主要攻击客户端,包含 nmap, impacket 等 | | workstation | 172.20.0.20 | SSH (22), SMB (139/445) | 带有共享资源的 Linux 目标机 | | ubuntu-desktop | 172.20.0.30 | SSH (22) | 带有配置文件的 Ubuntu 目标机 | | ldap | 172.20.0.40 | LDAP (389) | 目录服务目标机 | | mysql | 172.20.0.50 | MySQL (3306) | 数据库目标机 | | telnet | 172.20.0.60 | Telnet (23) | Telnet 服务目标机 | | juice-shop | 172.20.0.70 | HTTP (3000) | 存在漏洞的 Web 应用 | | dvwa | 172.20.0.80 | HTTP (80) | Damn Vulnerable Web App | ### 默认凭据 **Workstation:** - labuser / Password123 - admin / Admin123! - root / RootPass123 **Ubuntu-Desktop:** - user1 / User123 - developer / Dev2023! **Telnet:** - telnetuser / Telnet123 - guest / guest **MySQL:** - root / root123 - dbuser / dbpass123 **LDAP:** - Admin DN: cn=admin,dc=cyb204,dc=local - Password: admin123 ## 快速入门指南 ### 访问攻击容器(secutils) ``` docker exec -it secutils /bin/bash ``` ### 基本命令 **扫描网络:** ``` nmap -sP 172.20.0.0/24 ``` **详细服务扫描:** ``` nmap -sV 172.20.0.20 ``` **检查容器 IP:** ``` docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' ``` **直接访问其他容器:** ``` docker exec -it workstation /bin/sh docker exec -it ubuntu-desktop /bin/bash ``` **查看 Web 应用程序:** - Juice Shop: http://localhost:3000 - DVWA: http://localhost:8080 ## 实验室练习 按照 `week09-worksheet-movement.docx` 中的练习进行: 1. 枚举网络 2. 从 Linux 系统中导出凭据 3. 利用 SSH 和 SMB 的信任关系 4. 练习远程代码执行 5. 理解横向移动技术 ## 故障排除 ### 容器无法启动 ``` # 停止所有 containers docker-compose down # 移除旧的 containers 和 networks docker-compose down -v # 重新构建并全新启动 docker-compose build --no-cache docker-compose up -d ``` ### 内存不足错误 ``` # 在 Docker Desktop 上:在 Settings > Resources 中增加内存分配 # 建议最低 4GB,理想情况下 6-8GB 以运行所有 containers # 停止不必要的 containers docker-compose stop juice-shop dvwa ``` ### 无法在容器之间连接 ``` # 验证 network 是否存在 docker network ls | grep cyb204 # 检查 container IP docker network inspect cyb204_net ``` ### 权限被拒绝错误 ``` # Linux 用户:确保你已加入 docker 组 sudo usermod -aG docker $USER newgrp docker ``` ## 停止实验室 ### 停止所有容器(保留数据): ``` docker-compose stop ``` ### 停止并删除容器: ``` docker-compose down ``` ### 完全清理(删除所有内容): ``` docker-compose down -v docker system prune -a ``` ## 安全说明 **重要提示:** 此实验室环境包含故意设置了漏洞的系统,只能在隔离环境中用于教育目的。 - 不要将这些容器暴露在互联网上 - 不要在生产环境中使用这些配置 - 所有密码为了教育目的都故意设置为弱密码 - 始终遵守道德黑客原则 ## 资源使用情况 所有容器运行时的典型资源使用情况: - **内存:** 2-4GB RAM - **CPU:** 在现代系统上占用 10-20% - **磁盘:** 镜像占用约 2GB 要减少资源使用,请停止未使用的容器: ``` docker-compose stop juice-shop dvwa ``` ## 支持 如果遇到问题: 1. 查看上面的故障排除部分 2. 查看 Docker 日志:`docker-compose logs ` 3. 确保 Docker Desktop 正在运行并分配了足够的资源 4. 附带错误消息和系统规格联系你的讲师 ## 许可证 该实验室环境专为 CYB204 道德黑客课程的教育目的而创建。
标签:Checkov, Docker, Modbus, PE 加载器, 后端开发, 多模态安全, 安全教育, 安全防御评估, 横向移动, 版权保护, 编程规范, 网络安全, 请求拦截, 隐私保护, 靶场环境