cbry-96/threat-analysis-and-remediation

GitHub: cbry-96/threat-analysis-and-remediation

一个网络安全实战项目,完整展示了对被入侵服务器的数字取证、WordPress渗透测试及基于NIST和ISO 27001标准的安全加固与事件响应流程。

Stars: 0 | Forks: 0

# 🔐 最终项目 — 网络安全 ### 数字取证 · WordPress 渗透测试 · ISO 27001:2022 #### 4Geeks Academy · 网络安全训练营 · 2026年5月 ![Debian](https://img.shields.io/badge/Target-Debian%20Linux-A81D33?style=for-the-badge&logo=debian&logoColor=white) ![WordPress](https://img.shields.io/badge/Attack%20Surface-WordPress%206.9.4-21759B?style=for-the-badge&logo=wordpress&logoColor=white) ![Parrot OS](https://img.shields.io/badge/Attacker-Parrot%20OS-05A8E6?style=for-the-badge&logo=linux&logoColor=white) ![NIST](https://img.shields.io/badge/Framework-NIST%20SP%20800--61-003087?style=for-the-badge) ![ISO 27001](https://img.shields.io/badge/Standard-ISO%2027001%3A2022-00447C?style=for-the-badge) ![Status](https://img.shields.io/badge/Estado-Completado-success?style=flat-square) ![Vulns](https://img.shields.io/badge/Vulnerabilidades-5%20identificadas-critical?style=flat-square) ![Remediated](https://img.shields.io/badge/Remediadas-100%25-brightgreen?style=flat-square) ![RCE](https://img.shields.io/badge/RCE-Confirmado-red?style=flat-square) ![ISO](https://img.shields.io/badge/ISO%2027001-67%25%20Implementado-blue?style=flat-square) ![Date](https://img.shields.io/badge/Fecha-22%20Mayo%202026-orange?style=flat-square)
## 📋 描述 这是 **4Geeks Academy** 网络安全训练营的最终项目。在此项目中,我担任网络安全分析师,负责恢复和保护被入侵的 Debian Linux 服务器,模拟真实的企业安全事件响应场景。 | 指标 | 数值 | |-----------|-------| | 🎯 目标系统 | Debian GNU/Linux 6.1.0-25-amd64 · `192.168.1.131` | | 💻 攻击机 | Parrot OS · `192.168.1.11` | | 🔴 严重漏洞 | 3 个 (FTP, WordPress RCE, 数据库凭证) | | ✅ 补救措施 | 100% — 全部修复并验证 | | ⚡ 实现 RCE 耗时 | 从侦察算起不到 20 分钟 | | 🛡️ ISO 27001 | 已实施 6/9 项控制措施 (67%) | | 📅 日期 | 2026年5月22日 | ## 🗂️ 仓库结构 ``` 📁 análisis y remediación de amenazas/ │ ├── 📄 README.md ← Este archivo │ ├── 📁 docs/ │ ├── 📁 fase1/ ← Análisis forense │ │ ├── 📄 Informe_Incidente_Seguridad_Fase1.docx | | | 📄 Informe_Incidente_Seguridad_Fase1.pdf │ │ └── 📄 README.md │ │ │ ├── 📁 fase2/ ← Pentesting WordPress │ │ ├── 📄 Informe_Pentesting_WordPress_Fase2.docx | | | 📄 Informe_Pentesting_WordPress_Fase2.pdf │ │ └── 📄 README.md │ │ │ ├── 📁 fase3/ ← NIST + ISO 27001 │ │ ├── 📄 Plan_Respuesta_SGSI_ISO27001_Fase3.docx │ │ ├── 📄 Plan_Respuesta_SGSI_ISO27001_Fase3.pdf │ │ └── 📄 README.md │ │ │ └── 📁 presentacion/ ← Presentación ejecutiva │ ├── 📄 Presentacion_Ejecutiva_Gerencia.pptx │ └── 📄 README.md │ ├── 📁 red/ ← Diagramas de red │ ├── 📄 diagrama-red.md │ ├── 📄 diagrama-red-packet.pkt │ ├── 📄 diagrama-red-packet.pdf │ └── 📄 README.md │ ├── 📁 scripts/ ← Scripts implementados │ ├── 📄 backup-4geeks.sh │ └── 📄 README.md │ └── 📄 .gitignore ``` ## ⚔️ 第 1 阶段 — 被入侵服务器的取证分析 ### 已识别的发现 | # | 发现 | 严重程度 | 服务 | |---|----------|-----------|----------| | 1 | FTP 以明文传输凭证 | 🔴 严重 | 端口 21 · vsftpd | | 2 | Apache HTTP 未加密且未进行安全加固 | 🟠 高危 | 端口 80 · Apache 2.4.67 | | 3 | SSH 无安全限制 | 🟡 中危 | 端口 22 · OpenSSH 9.2p1 | | 4 | CUPS 不必要地处于活动状态 | 🟡 中危 | 端口 631 · cupsd | | 5 | 自 2024 年 7 月以来的日志包含恶意证据 | 🟠 高危 | journalctl / auth.log | ### 执行的补救命令 ``` # FTP 已禁用 systemctl stop vsftpd && systemctl disable vsftpd ss -tulnp | grep :21 # → Sin salida ✅ # CUPS 已禁用 systemctl stop cups && systemctl disable cups # SSH hardening # /etc/ssh/sshd_config: PermitRootLogin no MaxAuthTries 3 LoginGraceTime 30 systemctl restart sshd # 系统已更新 apt update && apt upgrade -y # 密码已更改 passwd debian ``` ## 🕵️ 第 2 阶段 — WordPress 渗透测试 ### 攻击链 (5 个步骤) ``` [Parrot OS 192.168.1.11] │ ├─ nmap -sV -sC -O -p- 192.168.1.131 │ → Puerto 80: WordPress 6.9.4 + /wp-admin/ en robots.txt │ ├─ wpscan → Usuario: wordpress-user (WP JSON API) │ XML-RPC habilitado │ ├─ cat /var/www/html/wp-config.php | grep DB_PASSWORD │ → DB_PASSWORD = '123456' ← CRÍTICO │ ├─ mysql → UPDATE wp_users SET user_pass=MD5('hacked123') │ → Acceso a http://192.168.1.131/wp-admin/ ✅ │ └─ Plugin malicioso shell.php subido e instalado curl ".../shell.php?cmd=whoami" → www-data ← RCE ✅ ``` ### 被利用的漏洞 | CWE | 描述 | 严重程度 | |-----|-------------|-----------| | CWE-200 | REST API 未经身份验证暴露用户信息 | 🔴 严重 | | CWE-256 | `DB_PASSWORD='123456'` 明文存储 | 🔴 严重 | | CWE-434 | 插件编辑器 → RCE | 🔴 严重 | | CWE-749 | XML-RPC 暴露 | 🟠 高危 | | CWE-16 | `siteurl='localhost'` 配置错误 | 🟠 高危 | ## 🛡️ 第 3 阶段 — 响应计划 + ISO 27001 ISMS ### NIST SP 800-61 生命周期 | 阶段 | 状态 | 活动 | |------|--------|-------------| | 🔵 准备 | ✅ | 清单,工具,已实施的技术控制 | | 🟡 检测 | ✅ | 已识别 IoCs,日志分析,WPScan,Nmap | | 🟠 遏制 | ✅ | 服务已停止,插件已删除,凭证已撤销 | | 🟢 恢复 | ✅ | 系统已更新,安全加固,已验证 | ### ISO 27001:2022 — 控制状态 (22/05/2026) | 控制措施 | 描述 | 状态 | |---------|-------------|--------| | A.5.1 | 安全策略 | ✅ 已实施 | | A.5.29 | 事件管理 | ✅ 已实施 | | A.8.3 | 特权访问 | ✅ 已实施 | | A.8.13 | 自动备份 | ✅ 已实施 — 22/05/2026 | | A.8.15 | 日志保留 90 天 | ✅ 已实施 — 22/05/2026 | | A.8.20 | UFW 防火墙 | ✅ 已实施 — 22/05/2026 | | A.8.24 | HTTPS + HSTS | ✅ 已实施 — 22/05/2026 | | A.8.5 | 安全身份验证 | 🔄 部分完成 | | A.8.8 | 漏洞管理 | 🔄 部分完成 | | A.8.32 | 变更管理 | ⏳ 待处理 | ## 🔧 已实施的技术控制措施 (22/05/2026) ### A.8.20 — UFW 防火墙 ``` ufw default deny incoming ufw default allow outgoing ufw allow 22/tcp && ufw allow 80/tcp && ufw allow 443/tcp ufw enable # → Status: active ✅ ``` ### A.8.24 — 带 SSL 证书的 HTTPS ``` a2enmod ssl headers # RSA 2048-bit 证书 — CN: 192.168.1.131 — Org: 4Geeks Academy # HSTS: Strict-Transport-Security: max-age=31536000 curl -k https://192.168.1.131 → HTTP/1.1 200 OK ✅ ``` ### A.8.13 — 自动备份 ``` # /backup/scripts/backup.sh # mysqldump + tar.gz → /backup/data/ # Cron: 0 2 * * * root /backup/scripts/backup.sh # Retención: find -mtime +90 -delete # Evidencia: db_*.sql.gz (796KB) + web_*.tar.gz (32MB) ✅ ``` ### A.8.15 — 日志保留 90 天 ``` # /etc/systemd/journald.conf: MaxRetentionSec=90day SystemMaxUse=500M # logrotate Apache: rotate 90 + daily + compress ✅ ``` ## 🌐 网络拓扑 ``` ANTES (comprometida) DESPUÉS (segura) ───────────────────── ───────────────────── Internet Internet │ │ [Switch] [Firewall UFW] / \ 22 / 80 / 443 [Parrot] [Debian] │ :11 :131 [Switch segmentado] 21·22·80·631 / \ [Parrot] [Debian] VLAN lab 22·443 only ``` ## 🎤 高管演示 面向非技术管理层的 10 张幻灯片: 1. 封面 2. 执行摘要 (KPIs:5 个漏洞,3 个严重,100% 已修复,4 小时) 3. 第 1 阶段发现 — 取证 4. WordPress 攻击链 — 第 2 阶段 5. 对 CIA 三要素的影响 6. 已执行的纠正措施 (9 项行动) 7. NIST 计划 + ISO 27001 控制措施 8. 建议 (3 个时间跨度) 9. **22/05/2026 实施的 ISO 控制措施** ← 新增 10. 结论 ## 🛠️ 使用的工具 | 工具 | 版本 | 用途 | |-------------|---------|-----------| | Nmap | 7.95 | 侦察与端口扫描 | | WPScan | 3.8.28 | WordPress 枚举与审计 | | Parrot OS | 最新版 | 攻击者操作系统 | | Debian GNU/Linux | 12 Bookworm | 目标系统 | | MariaDB | 10.11 | WordPress 数据库 | | Apache | 2.4.67 | Web 服务器 | | UFW | — | 已实施的防火墙 | | OpenSSL | — | SSL RSA 2048 证书 | | Packet Tracer | 8.x | 网络图表 | ## 📚 方法论与框架 - **[NIST SP 800-61 Rev. 2](https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-61r2.pdf)** — 计算机安全事件处理指南 - **[ISO/IEC 27001:2022](https://www.iso.org/standard/82875.html)** — 信息安全管理体系 - **[PTES](http://www.pentest-standard.org/)** — 渗透测试执行标准 - **[OWASP Top 10:2021](https://owasp.org/Top10/)** — Web 应用安全风险 - **[CIS Controls v8](https://www.cisecurity.org/controls/)** — 互联网安全中心 - **[ENS](https://www.boe.es/eli/es/rd/2022/05/03/311)** — 国家安全计划 (西班牙) ## 👤 作者
**Bryan Calderón Herrera** 网络与电信工程师 网络安全训练营 — 4Geeks Academy · 2026 [![LinkedIn](https://img.shields.io/badge/LinkedIn-Connect-0A66C2?style=for-the-badge&logo=linkedin&logoColor=white)](https://linkedin.com/in/tu-perfil) [![GitHub](https://img.shields.io/badge/GitHub-Follow-181717?style=for-the-badge&logo=github&logoColor=white)](https://github.com/tu-usuario)
*本项目出于教育目的在受控实验室环境中开发。* *所有渗透测试均在明确授权下的自有系统上进行。* **4Geeks Academy · 网络安全训练营 · 2026年5月22日**
标签:CISA项目, CTI, Cutter, Debian, ISO 27001, 安全测试工具, 库, 应急响应, 数字取证, 文件完整性监控, 网络安全, 自动化脚本, 隐私保护