zula69/End-to-End-Cybersecurity-Lab-Network-Design-APT-Simulation-Digital-Forensics

GitHub: zula69/End-to-End-Cybersecurity-Lab-Network-Design-APT-Simulation-Digital-Forensics

一个端到端网络安全实验项目,涵盖校园网络设计、APT 攻击模拟和多层级的数字取证调查,完整展示了事件响应的全生命周期。

Stars: 0 | Forks: 0

# 🔍 APT 模拟与数字取证调查 — ICBT 校园网络 这是一个综合的网络安全项目,模拟针对完全配置好的校园网络的高级持续性威胁(APT)攻击,捕获取证证据,并在网络、内存和磁盘层进行完整的数字取证分析。 ## 🎯 目标 本项目基于在 Cisco Packet Tracer 中构建的 ICBT 大学校园拓扑结构,复制了真实的企业网络环境,随后在受控的 4 个虚拟机(VM)实验室中模拟了对运行中的易受攻击机器的 APT 攻击。展示了完整的事件响应生命周期: - 🏛️ **校园网络设计** — 具有非军事区 (DMZ)、ACL、NAT 和路由的多 VLAN 分层网络 - ⚔️ **APT 攻击模拟** — 侦察、漏洞利用、持久化和数据窃取 - 📡 **证据收集** — 被动网络捕获、内存获取和磁盘镜像 - 🔬 **数字取证** — 使用行业标准工具进行网络、内存和磁盘取证分析 - 📋 **事件响应** — 包含 IOC(妥协指标)、时间线和补救建议的完整 IR 报告 ## 🧠 展示的技能 - 设计和配置多层分层校园网络 - VLAN 分段、VLAN 间路由、Trunking 和 ACL 的实施 - APT 攻击链执行:侦察 → 漏洞利用 → 持久化 → 数据窃取 - 使用 tcpdump 进行被动证据收集而不惊动攻击者 - 使用 Wireshark 进行网络取证:协议分析、流重建、IOC 识别 - 使用 Volatility3 进行内存取证 - 使用 The Sleuth Kit (TSK) 进行磁盘取证:分区分析、文件系统检查、已删除文件恢复 - 使用 Plaso 生成超级时间线(提取了 62,631 个事件) - 使用 Foremost 进行文件雕刻 - 取证证据保管链 — 只读磁盘挂载、证据哈希 ## 🛠️ 使用的工具 | 工具 | 用途 | 阶段 | |------|---------|-------| | **Cisco Packet Tracer** | 校园网络设计和模拟 | 网络设计 | | **Nmap** | 网络侦察和端口扫描 | 侦察 | | **Metasploit Framework** | 利用 Samba usermap_script (CVE-2007-2447) 漏洞 | 漏洞利用 | | **Netcat** | 通过端口 5555 进行数据窃取 | 数据窃取 | | **tcpdump** | 在 Kali #2 上进行被动网络流量捕获 | 证据收集 | | **LiME** | 从受害机器获取实时内存 | 证据收集 | | **dd** | 取证磁盘镜像获取 | 证据收集 | | **Wireshark** | PCAP 分析、协议检查、流重建 | 网络取证 | | **Volatility3** | 内存转储分析 | 内存取证 | | **The Sleuth Kit (TSK)** | 磁盘取证 — mmls, fls, icat, fsstat, mactime | 磁盘取证 | | **Foremost** | 从磁盘镜像中雕刻文件 | 磁盘取证 | | **Plaso / log2timeline** | 生成超级时间线(62,631 个事件) | 时间线分析 | | **tcpflow** | TCP 流重建和数据提取 | 网络取证 | | **p0f** | 从 PCAP 进行被动 OS 指纹识别 | 网络取证 | ## 🔑 主要发现 | 发现 | 证据来源 | 详情 | |---------|----------------|--------| | Nmap 侦察已确认 | Wireshark SYN 过滤器 | 来自 192.168.56.10 针对多个端口的快速 SYN 数据包 | | 尝试 vsftpd 漏洞利用但失败 | Wireshark + Metasploit 日志 | CVE-2011-2523 未触发 | | Samba 漏洞利用成功 | Wireshark 端口 445 流 | 确认 CVE-2007-2447 payload | | 端口 6200 上的 Root shell | Wireshark TCP 流 | 攻击者命令以明文可见 | | 已创建后门用户 | 磁盘上的 /etc/passwd | aptbackdoor:x:1003:1003::/home/aptbackdoor:/bin/bash | | 数据窃取已确认 | Wireshark 端口 5555 流 | 员工数据以明文可见 | | 62,631 个文件系统事件 | Plaso 磁盘时间线 | 受害磁盘的完整活动日志 | ## ⚡ 挑战与缓解措施 | # | 挑战 | 发生了什么 | 如何修复的 | |---|-----------|---------------|-----------------| | 1 | **vsftpd 漏洞利用失败** | Metasploit vsftpd_234_backdoor 模块未触发 shell | 改用 Samba usermap_script 漏洞利用 (CVE-2007-2447),成功返回了 Root shell | | 2 | **LiME 内核头文件不匹配** | 由于 Kali 运行的是前沿内核且没有可用的头文件,导致 LiME 编译失败 | 安装了带有匹配头文件的稳定内核包,并在重新编译 LiME 之前重新启动 | | 3 | **内存证据丢失** | 在 Volatility3 分析开始时,易失性内存数据(进程、连接)已经消失 | 作为关键教训记录下来:内存取证必须在事件窗口期间实时执行 | | 4 | **Autopsy 2.x 镜像格式错误** | apt 安装的 Autopsy (v2.24) 返回“无法确定镜像格式类型” | 替换为 The Sleuth Kit CLI 工具 (mmls, fls, icat, mactime) — Autopsy 包装的底层引擎 | | 5 | **Autopsy 4.x Java 冲突** | 由于系统运行 Java 25,Autopsy 4.21 崩溃(Java 17+ 中移除了 Security Manager) | 通过编辑 etc/autopsy.conf 将 jdkhome 设置为 Java 17 路径进行修复,绕过了系统 Java | | 6 | **磁盘镜像使用了错误的分区偏移量** | 使用默认偏移量时 TSK 命令未返回任何结果 | 使用 mmls 识别正确的起始扇区(boot 为 63,LVM 在 482013)并应用 -o 标志 | | 7 | **通过 TSK 无法访问 LVM 分区** | Root 文件系统位于 LVM 内 — fls 未返回任何攻击工件 | 使用 vgscan/vgchange 激活 LVM,并以只读方式挂载 Root 卷以直接访问文件系统 | | 8 | **NetworkMiner 在 Parrot KDE 上渲染损坏** | Mono + KDE 导致所有启动尝试时出现黑屏/空白 GUI | 替换为用于流重建的 tcpflow 和用于 OS 指纹识别的 p0f — 原生 Linux 工具 | | 9 | **Plaso CSV 首次运行时为空** | psort 使用了 > 重定向,导致输出损坏 | 改用 -w 标志而不是 shell 重定向来正确写入 CSV 文件 | | 10 | **Snapd 在 Parrot OS 上损坏** | AppArmor 冲突导致 snapd 无法启动以安装 Autopsy 4 | 使用带有显式 jdkhome 配置的手动 Autopsy 4 安装代替了 snap | ## 🖧 第 1 部分 — 校园网络设计 一个参考校园网络是在 Cisco Packet Tracer 中设计和配置的,使用了三层分层模型,包含五个 VLAN、一个 DMZ、一个边缘路由器和一个 ISP 路由器。 ### 网络拓扑概述 ``` ┌─────────────────────────────────────────────────────────────┐ │ ICBT CAMPUS NETWORK │ ├─────────────────────────────────────────────────────────────┤ │ VLAN 10 → Students → 10.10.10.0/24 │ │ VLAN 20 → Staff → 10.20.20.0/24 │ │ VLAN 30 → Admin → 10.30.30.0/24 │ │ VLAN 40 → Library → 10.40.40.0/24 │ │ VLAN 50 → Guest WiFi → 10.50.50.0/24 │ │ DMZ → Servers → 172.16.1.0/24 │ └─────────────────────────────────────────────────────────────┘ ``` ### 🔌 设备设置与标签 在开始配置之前,对拓扑中的所有网络设备进行了配置和标签标记。每个设备都通过其角色和位置进行了清晰识别。 - 为网络设备和物理连接添加了标签 ![带有标签的设备](https://raw.githubusercontent.com/zula69/End-to-End-Cybersecurity-Lab-Network-Design-APT-Simulation-Digital-Forensics/main/screenshots/pt_labelled_devices.png) - 连接了拓扑中的所有设备 ![已连接的设备](https://raw.githubusercontent.com/zula69/End-to-End-Cybersecurity-Lab-Network-Design-APT-Simulation-Digital-Forensics/main/screenshots/pt_connected_devices.png) ### 🎓 学生实验室交换机 (VLAN 10) 配置了学生实验室的接入层交换机,分配了 VLAN 10,并设置了 Trunk 端口以连接到汇聚层。 - 更改学生实验室交换机的主机名 ![学生交换机主机名](https://raw.githubusercontent.com/zula69/End-to-End-Cybersecurity-Lab-Network-Design-APT-Simulation-Digital-Forensics/main/screenshots/pt_student_hostname.png) - 配置 VLAN 10(学生 — 10.10.10.0/24) ![VLAN 10 配置](https://raw.githubusercontent.com/zula69/End-to-End-Cybersecurity-Lab-Network-Design-APT-Simulation-Digital-Forensics/main/screenshots/pt_vlan10_config.png) - 在学生实验室交换机上创建 Trunk 端口 ![学生 Trunk 端口](https://raw.githubusercontent.com/zula69/End-to-End-Cybersecurity-Lab-Network-Design-APT-Simulation-Digital-Forensics/main/screenshots/pt_student_trunk.png) - 确认 VLAN 10 处于活动状态且正常工作 ![VLAN 10 确认](https://raw.githubusercontent.com/zula69/End-to-End-Cybersecurity-Lab-Network-Design-APT-Simulation-Digital-Forensics/main/screenshots/pt_vlan10_confirm.png) ### 👨‍💼 员工交换机 (VLAN 20) - 更改员工交换机的主机名 ![员工交换机主机名](https://raw.githubusercontent.com/zula69/End-to-End-Cybersecurity-Lab-Network-Design-APT-Simulation-Digital-Forensics/main/screenshots/pt_staff_hostname.png) - 创建 VLAN 20(员工 — 10.20.20.0/24) ![VLAN 20 配置](https://raw.githubusercontent.com/zula69/End-to-End-Cybersecurity-Lab-Network-Design-APT-Simulation-Digital-Forensics/main/screenshots/pt_vlan20_config.png) - 在员工交换机上创建 Trunk 端口 ![员工 Trunk 端口](https://raw.githubusercontent.com/zula69/End-to-End-Cybersecurity-Lab-Network-Design-APT-Simulation-Digital-Forensics/main/screenshots/pt_staff_trunk.png) - 确认 VLAN 20 处于活动状态 ![VLAN 20 确认](https://raw.githubusercontent.com/zula69/End-to-End-Cybersecurity-Lab-Network-Design-APT-Simulation-Digital-Forensics/main/screenshots/pt_vlan20_confirm.png) ### 🔐 管理员交换机 (VLAN 30) - 更改管理员交换机的主机名 ![管理员交换机主机名](https://raw.githubusercontent.com/zula69/End-to-End-Cybersecurity-Lab-Network-Design-APT-Simulation-Digital-Forensics/main/screenshots/pt_admin_hostname.png) - 创建 VLAN 30(管理员 — 10.30.30.0/24) ![VLAN 30 配置](https://raw.githubusercontent.com/zula69/End-to-End-Cybersecurity-Lab-Network-Design-APT-Simulation-Digital-Forensics/main/screenshots/pt_vlan30_config.png) - 在管理员交换机上创建 Trunk 端口 ![管理员 Trunk 端口](https://raw.githubusercontent.com/zula69/End-to-End-Cybersecurity-Lab-Network-Design-APT-Simulation-Digital-Forensics/main/screenshots/pt_admin_trunk.png) - 确认 VLAN 30 处于活动状态 ![VLAN 30 确认](https://raw.githubusercontent.com/zula69/End-to-End-Cybersecurity-Lab-Network-Design-APT-Simulation-Digital-Forensics/main/screenshots/pt_vlan30_confirm.png) ### 📚 图书馆交换机 (VLAN 40) - 更改图书馆交换机的主机名 ![图书馆交换机主机名](https://raw.githubusercontent.com/zula69/End-to-End-Cybersecurity-Lab-Network-Design-APT-Simulation-Digital-Forensics/main/screenshots/pt_library_hostname.png) - 创建 VLAN 40(图书馆 — 10.40.40.0/24) ![VLAN 40 配置](https://raw.githubusercontent.com/zula69/End-to-End-Cybersecurity-Lab-Network-Design-APT-Simulation-Digital-Forensics/main/screenshots/pt_vlan40_config.png) - 在图书馆交换机上进行 Trunk 端口设置 ![图书馆 Trunk 端口](https://raw.githubusercontent.com/zula69/End-to-End-Cybersecurity-Lab-Network-Design-APT-Simulation-Digital-Forensics/main/screenshots/pt_library_trunk.png) - 确认 VLAN 40 处于活动状态 ![VLAN 40 确认](https://raw.githubusercontent.com/zula69/End-to-End-Cybersecurity-Lab-Network-Design-APT-Simulation-Digital-Forensics/main/screenshots/pt_vlan40_confirm.png) ### 📶 访客 WiFi 交换机 (VLAN 50) - 更改访客 WiFi 交换机的主机名 ![访客 WiFi 主机名](https://raw.githubusercontent.com/zula69/End-to-End-Cybersecurity-Lab-Network-Design-APT-Simulation-Digital-Forensics/main/screenshots/pt_guest_hostname.png) - 创建 VLAN 50(访客 WiFi — 10.50.50.0/24) ![VLAN 50 配置](https://raw.githubusercontent.com/zula69/End-to-End-Cybersecurity-Lab-Network-Design-APT-Simulation-Digital-Forensics/main/screenshots/pt_vlan50_config.png) - 在访客 WiFi 交换机上进行 Trunk 端口设置 ![访客 Trunk 端口](https://raw.githubusercontent.com/zula69/End-to-End-Cybersecurity-Lab-Network-Design-APT-Simulation-Digital-Forensics/main/screenshots/pt_guest_trunk.png) - 确认 VLAN 50 处于活动状态 ![VLAN 50 确认](https://raw.githubusercontent.com/zula69/End-to-End-Cybersecurity-Lab-Network-Design-APT-Simulation-Digital-Forensics/main/screenshots/pt_vlan50_confirm.png) ### 🔀 汇聚交换机 1 第一台汇聚层交换机聚合来自学生实验室、员工和管理员接入交换机的流量,并通过 Trunk 向上连接到核心层。 - 更改汇聚交换机 1 的主机名 ![汇聚交换机 1 主机名](https://raw.githubusercontent.com/zula69/End-to-End-Cybersecurity-Lab-Network-Design-APT-Simulation-Digital-Forensics/main/screenshots/pt_dist1_hostname.png) - 在汇聚交换机 1 上创建 VLAN ![汇聚交换机 1 VLAN](https://raw.githubusercontent.com/zula69/End-to-End-Cybersecurity-Lab-Network-Design-APT-Simulation-Digital-Forensics/main/screenshots/pt_dist1_vlans.png) - 确认 VLAN 处于活动状态 ![汇聚交换机 1 VLAN 确认](https://raw.githubusercontent.com/zula69/End-to-End-Cybersecurity-Lab-Network-Design-APT-Simulation-Digital-Forensics/main/screenshots/pt_dist1_vlan_confirm.png) - 配置上行链路 Trunk 端口(连接到核心交换机) ![汇聚交换机 1 上行链路 Trunk](https://raw.githubusercontent.com/zula69/End-to-End-Cybersecurity-Lab-Network-Design-APT-Simulation-Digital-Forensics/main/screenshots/pt_dist1_uplink.png) - 配置下行链路 Trunk 端口(连接到接入交换机) ![汇聚交换机 1 下行链路 Trunk](https://raw.githubusercontent.com/zula69/End-to-End-Cybersecurity-Lab-Network-Design-APT-Simulation-Digital-Forensics/main/screenshots/pt_dist1_downlinks.png) ### 🔀 汇聚交换机 2 第二台汇聚交换机聚合图书馆和访 WiFi 流量。 - 更改汇聚交换机 2 的主机名 ![汇聚交换机 2 主机名](https://raw.githubusercontent.com/zula69/End-to-End-Cybersecurity-Lab-Network-Design-APT-Simulation-Digital-Forensics/main/screenshots/pt_dist2_hostname.png) - 在汇聚交换机 2 上创建 VLAN ![汇聚交换机 2 VLAN](https://raw.githubusercontent.com/zula69/End-to-End-Cybersecurity-Lab-Network-Design-APT-Simulation-Digital-Forensics/main/screenshots/pt_dist2_vlans.png) - 确认 VLAN 处于活动状态 ![汇聚交换机 2 VLAN 确认](https://raw.githubusercontent.com/zula69/End-to-End-Cybersecurity-Lab-Network-Design-APT-Simulation-Digital-Forensics/main/screenshots/pt_dist2_vlan_confirm.png) - 配置上行链路 Trunk 端口(连接到核心交换机) ![汇聚交换机 2 上行链路](https://raw.githubusercontent.com/zula69/End-to-End-Cybersecurity-Lab-Network-Design-APT-Simulation-Digital-Forensics/main/screenshots/pt_dist2_uplink.png) - 配置下行链路 Trunk 端口 ![汇聚交换机 2 下行链路](https://raw.githubusercontent.com/zula69/End-to-End-Cybersecurity-Lab-Network-Design-APT-Simulation-Digital-Forensics/main/screenshots/pt_dist2_downlinks.png) ### 🖥️ 核心交换机 核心交换机提供三层 VLAN 间路由,为每个 VLAN 分配 SVI IP 地址,并与两台汇聚交换机建立 Trunk 连接。 - 更改核心交换机的主机名 ![核心交换机主机名](https://raw.githubusercontent.com/zula69/End-to-End-Cybersecurity-Lab-Network-Design-APT-Simulation-Digital-Forensics/main/screenshots/pt_core_hostname.png) - 将所有 VLAN 添加到核心交换机 ![核心交换机 VLAN](https://raw.githubusercontent.com/zula69/End-to-End-Cybersecurity-Lab-Network-Design-APT-Simulation-Digital-Forensics/main/screenshots/pt_core_vlans.png) - 为每个 VLAN 设置 SVI 接口和 IP 地址 ![核心交换机 SVI](https://raw.githubusercontent.com/zula69/End-to-End-Cybersecurity-Lab-Network-Design-APT-Simulation-Digital-Forensics/main/screenshots/pt_core_svi.png) - 连接到汇聚交换机 1 的 Trunk ![核心交换机 Trunk 汇聚交换机 1](https://raw.githubusercontent.com/zula69/End-to-End-Cybersecurity-Lab-Network-Design-APT-Simulation-Digital-Forensics/main/screenshots/pt_core_trunk_dist1.png) - 连接到汇聚交换机 2 的 Trunk ![核心交换机 Trunk 汇聚交换机 2](https://raw.githubusercontent.com/zula69/End-to-End-Cybersecurity-Lab-Network-Design-APT-Simulation-Digital-Forensics/main/screenshots/pt_core_trunk_dist2.png) ### 🔥 边缘路由器(防火墙替代) - 更改边缘路由器的主机名 ![边缘路由器主机名](https://raw.githubusercontent.com/zula69/End-to-End-Cybersecurity-Lab-Network-Design-APT-Simulation-Digital-Forensics/main/screenshots/pt_edge_hostname.png) - 在边缘路由器接口上分配 IP 地址 ![边缘路由器 IP](https://raw.githubusercontent.com/zula69/End-to-End-Cybersecurity-Lab-Network-Design-APT-Simulation-Digital-Forensics/main/screenshots/pt_edge_ips.png) - 允许所有 VLAN 访问 ISP 路由器(NAT/路由) ![边缘路由器 NAT](https://raw.githubusercontent.com/zula69/End-to-End-Cybersecurity-Lab-Network-Design-APT-Simulation-Digital-Forensics/main/screenshots/pt_edge_nat.png) - 设置到 ISP 的默认路由 ![边缘路由器默认路由](https://raw.githubusercontent.com/zula69/End-to-End-Cybersecurity-Lab-Network-Design-APT-Simulation-Digital-Forensics/main/screenshots/pt_edge_default_route.png) - 设置返回校园网络的回程路由 ![边缘路由器回程路由](https://raw.githubusercontent.com/zula69/End-to-End-Cybersecurity-Lab-Network-Design-APT-Simulation-Digital-Forensics/main/screenshots/pt_edge_return_route.png) ### 🌐 ISP 路由器 - 配置 ISP 路由器的主机名 ![ISP 路由器主机名](https://raw.githubusercontent.com/zula69/End-to-End-Cybersecurity-Lab-Network-Design-APT-Simulation-Digital-Forensics/main/screenshots/pt_isp_hostname.png) - 在 ISP 路由器上添加 IP 地址 ![ISP 路由器 IP](https://raw.githubusercontent.com/zula69/End-to-End-Cybersecurity-Lab-Network-Design-APT-Simulation-Digital-Forensics/main/screenshots/pt_isp_ips.png) - 配置路由以转发校园流量 ![ISP 路由](https://raw.githubusercontent.com/zula69/End-to-End-Cybersecurity-Lab-Network-Design-APT-Simulation-Digital-Forensics/main/screenshots/pt_isp_routing.png) ### 🖥️ 服务器配置(DMZ — 172.16.1.0/24) - 配置 Web 服务器 ![Web 服务器配置](https://raw.githubusercontent.com/zula69/End-to-End-Cybersecurity-Lab-Network-Design-APT-Simulation-Digital-Forensics/main/screenshots/pt_web_server.png) - 配置 DNS 服务器 ![DNS 服务器配置](https://raw.githubusercontent.com/zula69/End-to-End-Cybersecurity-Lab-Network-Design-APT-Simulation-Digital-Forensics/main/screenshots/pt_dns_server.png) - 配置邮件服务器 ![邮件服务器配置](https://raw.githubusercontent.com/zula69/End-to-End-Cybersecurity-Lab-Network-Design-APT-Simulation-Digital-Forensics/main/screenshots/pt_mail_server.png) ### 🗺️ 最终网络拓扑 ![最终拓扑](https://raw.githubusercontent.com/zula69/End-to-End-Cybersecurity-Lab-Network-Design-APT-Simulation-Digital-Forensics/main/screenshots/pt_final_topology.png) ### ✅ 连通性验证 — Ping 测试 所有 VLAN 都经验证可以通过三层层级正确通信。 - 从学生 PC Ping 到所有其他 VLAN(全部成功) ![Ping 测试](https://raw.githubusercontent.com/zula69/End-to-End-Cybersecurity-Lab-Network-Design-APT-Simulation-Digital-Forensics/main/screenshots/pt_ping_tests.png) ### 🔒 访问控制列表 (ACL) 在核心交换机上实施了四条 ACL,以执行校园安全策略。 #### ACL 1 — 访客 WiFi 策略 ``` Guests (VLAN 50) → ❌ VLAN 10 (Students) Guests (VLAN 50) → ❌ VLAN 20 (Staff) Guests (VLAN 50) → ❌ VLAN 30 (Admin) Guests (VLAN 50) → ❌ VLAN 40 (Library) Guests (VLAN 50) → ✅ Internet only ``` #### ACL 2 — 学生策略 ``` Students (VLAN 10) → ✅ VLAN 40 (Library) Students (VLAN 10) → ✅ DMZ (Web/DNS) Students (VLAN 10) → ❌ VLAN 30 (Admin) Students (VLAN 10) → ❌ VLAN 20 (Staff) ``` #### ACL 3 — DMZ 服务器保护 ``` Internet → ✅ Port 80/443 (HTTP/HTTPS) Internet → ✅ Port 53 (DNS) Internet → ❌ All other ports VLAN 20 (Staff) → ✅ Port 22 (SSH management) All others → ❌ Port 22 ``` #### ACL 4 — 管理办公室保护 ``` VLAN 30 (Admin) → ✅ VLAN 30 VLAN 20 (Staff) → ✅ VLAN 30 VLAN 10 (Students) → ❌ VLAN 30 VLAN 50 (Guests) → ❌ VLAN 30 ``` - 在核心交换机上使用 `show access-lists` 进行 ACL 验证 ![ACL 验证](https://raw.githubusercontent.com/zula69/End-to-End-Cybersecurity-Lab-Network-Design-APT-Simulation-Digital-Forensics/main/screenshots/pt_acl_verify.png) ## 💻 第 2 部分 — VM 实验室设置与 APT 攻击模拟 ### 实验室架构 ``` ┌─────────────────────────────────────────────────────────┐ │ HOST-ONLY NETWORK: 192.168.56.0/24 │ │ │ │ ┌──────────────┐ ┌──────────────────────────┐ │ │ │ Kali Linux │ ──attack─▶ Metasploitable2 Victim │ │ │ │ (Attacker) │ │ 192.168.56.13 │ │ │ │192.168.56.10 │ └──────────────────────────┘ │ │ └──────────────┘ │ │ │ │ (traffic) │ │ ┌──────────────┐ ┌───────────▼──────────────┐ │ │ │ Parrot OS │◀─analyze─│ Kali Linux #2 │ │ │ │ (Forensics) │ │ (Network Watcher) │ │ │ │192.168.56.12 │ │ 192.168.56.11 │ │ │ └──────────────┘ └──────────────────────────┘ │ └─────────────────────────────────────────────────────────┘ ``` | VM | 角色 | 操作系统 | IP 地址 | |----|------|----|------------| | Kali #1 | 攻击者 | Kali Linux | 192.168.56.10 | | Kali #2 | 网络监控器/证据收集者 | Kali Linux | 192.168.56.11 | | Metasploitable2 | 受害者 | Ubuntu (Metasploitable2) | 192.168.56.13 | | Parrot OS | 取证工作站 | Parrot OS 7.1 KDE | 192.168.56.12 | ### 第 1 步 — 网络验证 在开始攻击模拟之前,验证所有 VM 是否可以通过仅主机网络进行通信。 - 从 Kali #1 Ping 到 Metasploitable2 ![从攻击者 Ping 到受害者](https://raw.githubusercontent.com/zula69/End-to-End-Cybersecurity-Lab-Network-Design-APT-Simulation-Digital-Forensics/main/screenshots/vm_ping_attacker_victim.png) - 从 Kali #2 Ping 到所有 VM ![监控器 Ping](https://raw.githubusercontent.com/zula69/End-to-End-Cybersecurity-Lab-Network-Design-APT-Simulation-Digital-Forensics/main/screenshots/vm_ping_watcher.png) - 从 Parrot OS Ping 到所有 VM ![Parrot Ping](https://raw.githubusercontent.com/zula69/End-to-End-Cybersecurity-Lab-Network-Design-APT-Simulation-Digital-Forensics/main/screenshots/vm_ping_parrot.png) ### 第 2 步 — 证据收集设置(Kali #2 监控器) Kali Linux #2 被配置为**被动网络监控器**。它使用 tcpdump 静默捕获网段上的所有流量,而不会发送任何可能惊动攻击者的数据包。 - 启动 tcpdump 以捕获所有网络流量 ![tcpdump 启动](https://raw.githubusercontent.com/zula69/End-to-End-Cybersecurity-Lab-Network-Design-APT-Simulation-Digital-Forensics/main/screenshots/kali2_tcpdump_start.png) - 从 Kali #2 收集针对 Metasploitable2 的 Nmap 扫描结果 ![Nmap 扫描证据](https://raw.githubusercontent.com/zula69/End-to-End-Cybersecurity-Lab-Network-Design-APT-Simulation-Digital-Forensics/main/screenshots/kali2_nmap_evidence.png) - 收集 journalctl 系统日志作为辅助证据 ![journalctl 证据](https://raw.githubusercontent.com/zula69/End-to-End-Cybersecurity-Lab-Network-Design-APT-Simulation-Digital-Forensics/main/screenshots/kali2_journalctl.png) ### 第 3 步 — 侦察(Kali #1 攻击者) 攻击者使用 Nmap 执行网络侦察,以识别受害机器上的开放端口和运行的服务。 - Nmap SYN 扫描以识别 Metasploitable2 上的开放端口 ![Nmap 侦察](https://raw.githubusercontent.com/zula69/End-to-End-Cybersecurity-Lab-Network-Design-APT-Simulation-Digital-Forensics/main/screenshots/kali1_nmap_recon.png) **识别出的主要端口:** | 端口 | 服务 | 版本 | |------|---------|---------| | 21 | FTP | vsftpd 2.3.4 | | 22 | SSH | OpenSSH 4.7p1 | | 139/445 | SMB/Samba | Samba 3.x | | 80 | HTTP | Apache 2.2.8 | | 3306 | MySQL | 5.0.51a | ### 第 4 步 — 漏洞利用(Kali #1 攻击者) #### 尝试 1 — vsftpd 2.3.4(失败) 攻击者首先尝试使用 Metasploit 利用 vsftpd 2.3.4 后门漏洞 (CVE-2011-2523)。该漏洞利用未在此目标上成功。 - 尝试 vsftpd 漏洞利用 — 失败 ![vsftpd 失败](https://raw.githubusercontent.com/zula69/End-to-End-Cybersecurity-Lab-Network-Design-APT-Simulation-Digital-Forensics/main/screenshots/kali1_vsftpd_fail.png) #### 尝试 2 — Samba usermap_script(成功 ✅) 攻击者随后使用 usermap_script 漏洞 (CVE-2007-2447) 瞄准了 Samba 服务,该漏洞允许以 root 身份执行未经身份验证的远程命令。 - 使用 exploit/multi/samba/usermap_script 配置 Metasploit ![Samba 漏洞利用配置](https://raw.githubusercontent.com/zula69/End-to-End-Cybersecurity-Lab-Network-Design-APT-Simulation-Digital-Forensics/main/screenshots/kali1_samba_config.png) - 运行漏洞利用 — 获得 Root shell ![获得 Root shell](https://raw.githubusercontent.com/zula69/End-to-End-Cybersecurity-Lab-Network-Design-APT-Simulation-Digital-Forensics/main/screenshots/kali1_root_shell.png) ### 第 5 步 — 持久化(Kali #1 攻击者) 在获得 root 访问权限后,攻击者创建了一个后门用户帐户,以在初始 shell 关闭的情况下仍能保持持久的访问权限。 - 创建后门用户帐户 ![已创建后门用户](https://raw.githubusercontent.com/zula69/End-to-End-Cybersecurity-Lab-Network-Design-APT-Simulation-Digital-Forensics/main/screenshots/kali1_backdoor_user.png) - 在 /etc/passwd 中验证后门帐户 ![passwd 中的后门](https://raw.githubusercontent.com/zula69/End-to-End-Cybersecurity-Lab-Network-Design-APT-Simulation-Digital-Forensics/main/screenshots/kali1_backdoor_passwd.png) ``` aptbackdoor:x:1003:1003::/home/aptbackdoor:/bin/bash ``` ### 第 6 步 — 数据窃取(Kali #1 攻击者) 攻击者使用端口 5555 上的 Netcat 定位并从受害机器中窃取了机密的员工记录。 - 在受害者上定位机密员工数据 ![查找数据](https://raw.githubusercontent.com/zula69/End-to-End-Cybersecurity-Lab-Network-Design-APT-Simulation-Digital-Forensics/main/screenshots/kali1_find_data.png) - 通过端口 5555 上的 Netcat 窃取数据 ![数据窃取](https://raw.githubusercontent.com/zula69/End-to-End-Cybersecurity-Lab-Network-Design-APT-Simulation-Digital-Forensics/main/screenshots/kali1_exfiltration.png) ### 第 7 步 — 将证据传输到 Parrot OS Kali #2 收集的所有证据都通过 SCP 安全地传输到了 Parrot OS 取证工作站进行分析。 - 将 PCAP、内存转储、磁盘镜像传输到 Parrot OS ![证据传输](https://raw.githubusercontent.com/zula69/End-to-End-Cybersecurity-Lab-Network-Design-APT-Simulation-Digital-Forensics/main/screenshots/kali2_scp_transfer.png) ## 🔬 第 3 部分 — 数字取证分析 ### 第 8 步 — 网络取证 捕获的 PCAP 文件被加载到 Parrot OS 工作站上的 Wireshark 中进行深度数据包检查。 - 数据包统计信息概述 ![数据包统计信息](https://raw.githubusercontent.com/zula69/End-to-End-Cybersecurity-Lab-Network-Design-APT-Simulation-Digital-Forensics/main/screenshots/ws_packet_stats.png) - 协议层级统计信息 ![协议统计信息](https://raw.githubusercontent.com/zula69/End-to-End-Cybersecurity-Lab-Network-Design-APT-Simulation-Digital-Forensics/main/screenshots/ws_protocol_stats.png) - IPv4 对话 — 识别攻击者与受害者的流量 ![IPv4 对话](https://raw.githubusercontent.com/zula69/End-to-End-Cybersecurity-Lab-Network-Design-APT-Simulation-Digital-Forensics/main/screenshots/ws_ipv4_conversations.png) - 按端点划分的流量统计信息 ![流量统计信息](https://raw.githubusercontent.com/zula69/End-to-End-Cybersecurity-Lab-Network-Design-APT-Simulation-Digital-Forensics/main/screenshots/ws_traffic_stats.png) - 应用 SYN 过滤器以识别 Nmap 侦察扫描 (`tcp.flags.syn==1 && tcp.flags.ack==0`) ![SYN 过滤 Nmap](https://raw.githubusercontent.com/zula69/End-to-End-Cybersecurity-Lab-Network-Design-APT-Simulation-Digital-Forensics/main/screenshots/ws_syn_filter.png) - 确认端口 445 上的 Samba 漏洞利用流量 ![确认 Samba 攻击](https://raw.githubusercontent.com/zula69/End-to-End-Cybersecurity-Lab-Network-Design-APT-Simulation-Digital-Forensics/main/screenshots/ws_samba_attack.png) - 从 TCP 流(端口 6200)恢复攻击者命令 ![攻击者命令](https://raw.githubusercontent.com/zula69/End-to-End-Cybersecurity-Lab-Network-Design-APT-Simulation-Digital-Forensics/main/screenshots/ws_attacker_commands.png) - 确认端口 5555 上的数据窃取 — 员工数据以明文可见 ![窃取证据](https://raw.githubusercontent.com/zula69/End-to-End-Cybersecurity-Lab-Network-Design-APT-Simulation-Digital-Forensics/main/screenshots/ws_exfiltration.png) ### 第 9 步 — 内存取证 在攻击窗口期间,使用 LiME 内核模块从受害机器获取了内存转储,并使用 Volatility3 进行了分析。 - 运行 Volatility3 linux.pslist 以列出进程 ![Volatility PSList](https://raw.githubusercontent.com/zula69/End-to-End-Cybersecurity-Lab-Network-Design-APT-Simulation-Digital-Forensics/main/screenshots/vol_pslist.png) - 运行 linux.netstat 以检查网络连接 ![Volatility Netstat](https://raw.githubusercontent.com/zula69/End-to-End-Cybersecurity-Lab-Network-Design-APT-Simulation-Digital-Forensics/main/screenshots/vol_netstat.png) ### 第 10 步 — 磁盘取证 使用 The Sleuth Kit CLI 工具对受害磁盘镜像进行了取证检查。在整个分析过程中,镜像均以**只读**模式挂载,以保持取证完整性并维持证据保管链。 - 使用 mmls 查看分区表 ![mmls 分区](https://raw.githubusercontent.com/zula69/End-to-End-Cybersecurity-Lab-Network-Design-APT-Simulation-Digital-Forensics/main/screenshots/tsk_mmls.png) ``` 002: 000:000 Start: 63 Linux (0x83) ← Boot partition 006: 001:000 Start: 482013 Linux LVM ← Root filesystem ``` - 使用 fsstat 查看文件系统信息 ![fsstat 输出](https://raw.githubusercontent.com/zula69/End-to-End-Cybersecurity-Lab-Network-Design-APT-Simulation-Digital-Forensics/main/screenshots/tsk_fsstat.png) - 使用 fls 列出所有文件,包括已删除的文件 ![fls 所有文件](https://raw.githubusercontent.com/zula69/End-to-End-Cybersecurity-Lab-Network-Design-APT-Simulation-Digital-Forensics/main/screenshots/tsk_fls_all.png) - 仅查看已删除的文件(标有 * 的条目) ![fls 已删除文件](https://raw.githubusercontent.com/zula69/End-to-End-Cybersecurity-Lab-Network-Design-APT-Simulation-Digital-Forensics/main/screenshots/tsk_fls_deleted.png) - 激活 LVM 并以只读方式挂载 Root 文件系统 ![LVM 挂载](https://raw.githubusercontent.com/zula69/End-to-End-Cybersecurity-Lab-Network-Design-APT-Simulation-Digital-Forensics/main/screenshots/tsk_lvm_mount.png) - 浏览挂载的受害者文件 — 文件夹结构 ![受害者文件夹](https://raw.githubusercontent.com/zula69/End-to-End-Cybersecurity-Lab-Network-Design-APT-Simulation-Digital-Forensics/main/screenshots/tsk_victim_folders.png) - 查看 /tmp 目录内容 ![tmp 文件](https://raw.githubusercontent.com/zula69/End-to-End-Cybersecurity-Lab-Network-Design-APT-Simulation-Digital-Forensics/main/screenshots/tsk_tmp_files.png) - **严重发现** — 在 /home/ 中确认了后门用户 ![aptbackdoor 主目录](https://raw.githubusercontent.com/zula69/End-to-End-Cybersecurity-Lab-Network-Design-APT-Simulation-Digital-Forensics/main/screenshots/tsk_aptbackdoor_home.png) - **严重发现** — 在 /etc/passwd 中确认了 aptbackdoor ![aptbackdoor Passwd](https://raw.githubusercontent.com/zula69/End-to-End-Cybersecurity-Lab-Network-Design-APT-Simulation-Digital-Forensics/main/screenshots/tsk_aptbackdoor_passwd.png) - 查看 auth.log — 登录事件和 SSH 连接 ![Auth 日志](https://raw.githubusercontent.com/zula69/End-to-End-Cybersecurity-Lab-Network-Design-APT-Simulation-Digital-Forensics/main/screenshots/tsk_auth_log.png) - 查看系统消息日志 ![Messages 日志](https://raw.githubusercontent.com/zula69/End-to-End-Cybersecurity-Lab-Network-Design-APT-Simulation-Digital-Forensics/main/screenshots/tsk_messages_log.png) - 列出所有登录过的用户 ![用户列表](https://raw.githubusercontent.com/zula69/End-to-End-Cybersecurity-Lab-Network-Design-APT-Simulation-Digital-Forensics/main/screenshots/tsk_user_list.png) - 从日志中过滤出的所有与攻击者相关的连接 ![攻击者连接](https://raw.githubusercontent.com/zula69/End-to-End-Cybersecurity-Lab-Network-Design-APT-Simulation-Digital-Forensics/main/screenshots/tsk_attacker_connections.png) ### 第 11 步 — 文件雕刻 使用 Foremost 根据文件头和文件尾从受害磁盘镜像中雕刻和恢复文件。 - 在受害磁盘镜像上运行 Foremost ![Foremost 雕刻](https://raw.githubusercontent.com/zula69/End-to-End-Cybersecurity-Lab-Network-Design-APT-Simulation-Digital-Forensics/main/screenshots/foremost_run.png) - 查看从磁盘恢复的已雕刻文件 ![已雕刻文件](https://raw.githubusercontent.com/zula69/End-to-End-Cybersecurity-Lab-Network-Design-APT-Simulation-Digital-Forensics/main/screenshots/foremost_carved.png) ### 第 12 步 — 时间线分析 #### 12a — 网络时间线 (PCAP) 使用 Plaso 从捕获的 PCAP 文件生成了超级时间线,提供了带有时间戳的取证事件。 - 在 PCAP 文件上运行 log2timeline ![Log2Timeline PCAP](https://raw.githubusercontent.com/zula69/End-to-End-Cybersecurity-Lab-Network-Design-APT-Simulation-Digital-Forensics/main/screenshots/plaso_pcap_run.png) - 使用 psort 导出到 CSV ![psort PCAP 导出](https://raw.githubusercontent.com/zula69/End-to-End-Cybersecurity-Lab-Network-Design-APT-Simulation-Digital-Forensics/main/screenshots/plaso_pcap_psort.png) - 在 Kate 中查看时间线 — 确认了攻击日期、时区并记录了时间戳 ![Kate 中的 PCAP 时间线](https://raw.githubusercontent.com/zula69/End-to-End-Cybersecurity-Lab-Network-Design-APT-Simulation-Digital-Forensics/main/screenshots/plaso_pcap_kate.png) #### 12b — 磁盘超级时间线(62,631 个事件) 从整个受害磁盘镜像生成了全面的超级时间线,产生了 62,631 个文件系统事件。 - 在受害磁盘镜像上运行 log2timeline(选择了 LVM 卷) ![Log2Timeline 磁盘](https://raw.githubusercontent.com/zula69/End-to-End-Cybersecurity-Lab-Network-Design-APT-Simulation-Digital-Forensics/main/screenshots/plaso_disk_run.png) - 处理完成 — 提取了 62,631 个事件 ![Plaso 磁盘完成](https://raw.githubusercontent.com/zula69/End-to-End-Cybersecurity-Lab-Network-Design-APT-Simulation-Digital-Forensics/main/screenshots/plaso_disk_complete.png) - 将磁盘时间线导出到 CSV ![磁盘时间线 CSV](https://raw.githubusercontent.com/zula69/End-to-End-Cybersecurity-Lab-Network-Design-APT-Simulation-Digital-Forensics/main/screenshots/plaso_disk_csv.png) - 查看磁盘时间线 — 搜索攻击工件 ![磁盘时间线视图](https://raw.githubusercontent.com/zula69/End-to-End-Cybersecurity-Lab-Network-Design-APT-Simulation-Digital-Forensics/main/screenshots/plaso_disk_view.png) ## 📁 证据清单 ``` forensic/ ├── evidence/ │ ├── attack_capture.pcap # Full network capture (tcpdump) │ ├── filtered_evidence.pcap # Filtered attack traffic (Wireshark) │ ├── baseline_scan.txt # Nmap scan results from Kali #2 │ ├── memory.dump # Victim memory image (LiME) │ ├── victim_disk.img # Full disk image (dd) │ ├── super_timeline.csv # Plaso PCAP timeline │ ├── disk_timeline.csv # Plaso disk timeline (62,631 events) │ ├── auth.log # Victim authentication logs │ ├── passwd.txt # Victim /etc/passwd (backdoor confirmed) │ ├── networkminer_findings.txt # tcpflow/p0f network analysis findings │ ├── FINDINGS_SUMMARY.txt # Master forensic findings document │ └── reports/ │ └── IR_Report_ICBT.docx # Full Incident Response Report └── carved_files/ # Files recovered by Foremost ``` ## ⚠️ 免责声明 本项目完全出于**教育和伦理目的**而构建。所有攻击都是在完全隔离的虚拟实验室环境中进行的,没有连接到任何真实的系统、网络或基础设施。所展示的技术旨在培养防御性网络安全技能和取证调查能力。 ## 👤 作者 **Nihara Sulochana Samaranayake** 网络与网络安全 HND ICBT 康提校区 — 卡迪夫城市大学 GitHub: [zula69](https://github.com/zula69)
标签:APT攻击模拟, CTI, SecList, 内存取证, 库, 应急响应, 提权工具, 数字取证, 磁盘取证, 网络架构设计, 自动化脚本