Skip to content

Coff0xc/AutoRedTeam-Orchestrator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

157 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

AutoRedTeam-Orchestrator

企业级 AI 红队编排平台
纯 Python 引擎 | MCP + SDK + CLI 三层接口 | 全链路攻击自动化

简体中文 · English

Stars Forks Issues Last Commit

Version Python MCP Tools Tests License

Discord CI


为什么选择 AutoRedTeam?

唯一不依赖外部工具的 AI 渗透测试框架。 26 个漏洞检测器全部纯 Python 实现,外部工具(sqlmap/nuclei/ffuf)自动下载内置,无需手动安装。

┌──────────────────────────────────────────────────────────────────┐
│                AutoRedTeam-Orchestrator v3.1.0                   │
├──────────────────────────────────────────────────────────────────┤
│  ● 132 MCP 工具          ● 26 漏洞检测器     ● 1980 测试用例    │
│  ● 纯 Python Nuclei 引擎 ● MCTS 攻击规划     ● SQLite 知识图谱  │
│  ● LLM 增强决策          ● Docker 沙箱       ● SARIF CI/CD 集成 │
│  ● SDK + CLI + MCP 三层  ● 横向移动/C2/提权  ● OOB 误报验证     │
│  ● 生产级 C2 Server      ● 工具自动下载内置  ● LaZagne 凭据集成 │
│  ● PostExploit 执行层    ● 统一引擎路由器    ● 被动侦察 6 源    │
├──────────────────────────────────────────────────────────────────┤
│  三种使用方式:                                                    │
│    1. MCP — Cursor / Windsurf / Kiro / Claude Desktop / Claude Code │
│    2. SDK — from autort import Scanner, AutoPentest              │
│    3. CLI — autort scan / autort detect / autort pentest         │
└──────────────────────────────────────────────────────────────────┘

目录


快速开始

# 安装
git clone https://github.com/Coff0xc/AutoRedTeam-Orchestrator.git
cd AutoRedTeam-Orchestrator
pip install -r requirements.txt

# 验证
python -c "from autort import Scanner; print('OK')"

三种使用方式

1. MCP — AI 编辑器集成

python mcp_stdio_server.py  # 启动 MCP 服务器

在 AI 编辑器中自然语言驱动:"扫描 http://target.com 的 SQL 注入漏洞"

2. Python SDK

import asyncio
from autort import Scanner, Exploiter, AutoPentest

async def main():
    # 侦察 + 漏洞检测
    scanner = Scanner("http://target.com")
    recon = await scanner.full_recon()
    vulns = await scanner.detect_vulns(categories=["sqli", "xss", "ssrf"])

    # Nuclei 模板扫描 (185K+ 社区模板)
    nuclei_results = await scanner.nuclei_scan(
        severity=["high", "critical"], concurrency=20
    )

    # 一键自动化渗透
    pentest = AutoPentest("http://target.com")
    report = await pentest.run(phases=["recon", "detect", "exploit", "report"])

asyncio.run(main())

3. CLI 命令行

# 侦察
autort scan http://target.com --full

# 漏洞检测
autort detect http://target.com -c sqli,xss,ssrf

# Nuclei 扫描
autort nuclei http://target.com --severity high,critical --tags cve

# 一键渗透
autort pentest http://target.com --phases recon,detect,exploit

# CI 模式 (SARIF 输出 + 非零退出码)
autort detect http://target.com --ci --format sarif -o results.sarif

# 报告生成
autort report SESSION-ID --format html -o report.html

架构总览

                    ┌─────────────────────────────────────┐
                    │         AI Editor / User             │
                    │   (Cursor, Claude Code, CLI, SDK)    │
                    └──────────────┬──────────────────────┘
                                   │
              ┌────────────────────┼────────────────────┐
              │                    │                    │
         MCP (JSON-RPC)      Python SDK           Typer CLI
              │                    │                    │
              ▼                    ▼                    ▼
    ┌─────────────────────────────────────────────────────────┐
    │                    handlers/ (131 tools)                 │
    │   recon(8) detector(27) cve(8) exploit(12) lateral(9)   │
    │   redteam(14) ad(3) persistence(3) cloud(3) api(7) ... │
    └──────────────────────┬──────────────────────────────────┘
                           │
    ┌──────────────────────┼──────────────────────────────────┐
    │                   core/ Engine Layer                     │
    ├─────────────────────────────────────────────────────────┤
    │  detectors/    26 纯 Python 检测器 (SQLi/XSS/SSRF/RCE..)│
    │  exploit/      利用引擎 (SQLi/RCE/SSRF/XXE/SSTI/反序列化)│
    │  recon/        10 阶段侦察 (端口/DNS/指纹/子域名/目录...)│
    │  lateral/      横向移动 (SMB/SSH/WMI/WinRM/PsExec)      │
    │  c2/           C2 框架 (Beacon + DNS/HTTP/WS 隧道)       │
    │  orchestrator/ 编排器 (MCTS规划 + 8阶段流水线)            │
    │  nuclei_engine 纯 Python Nuclei 模板引擎                 │
    │  llm/          统一 LLM Provider (可选)                   │
    │  sandbox/      Docker 沙箱执行器 (可选)                   │
    │  knowledge/    SQLite 知识图谱 (17 实体类型)              │
    │  config/       Pydantic 统一配置                          │
    │  ...20+ 子包                                             │
    └─────────────────────────────────────────────────────────┘

工具矩阵

类别 数量 关键工具
侦察 8 port_scan, subdomain_enum, fingerprint, waf_detect, dir_scan
漏洞检测 27 sqli_scan, xss_scan, ssrf_scan, rce_scan, nuclei_scan + 22 种
CVE 8 cve_search, cve_auto_exploit, cve_generate_poc
利用 12 auto_pentest, exploit_vulnerability, exploit_by_cve
红队 14 c2_beacon_start, payload_obfuscate, waf_bypass, credential_find
横向移动 9 lateral_ssh, lateral_smb, lateral_wmi, lateral_winrm, lateral_psexec
AD 攻击 3 ad_enumerate, ad_kerberos_attack, ad_spn_scan
持久化 3 persistence_windows, persistence_linux, persistence_webshell
API 安全 7 jwt_scan, graphql_scan, websocket_scan, oauth_scan, cors_deep_scan
云安全 3 k8s_scan, grpc_scan, aws_scan
供应链 3 sbom_generate, dependency_audit, cicd_scan
外部工具 8 ext_nmap_scan, ext_nuclei_scan, ext_sqlmap_scan, ext_ffuf_fuzz
会话/报告/AI 9 session_create, generate_report, smart_analyze
知识图谱/MCTS 4 kg_store, kg_query, kg_attack_paths, plan_attack_path
并发/资源/提示 11 parallel_scan + 4 MCP Resources + 6 MCP Prompts
总计 131

核心能力

纯 Python 检测引擎 (无外部依赖)

26 个检测器覆盖 OWASP Top 10+:

检测器 技术 精度
SQLi (错误/时间/布尔/UNION) 60+ DB 错误模式, 双重时间验证, 百分比阈值 ~90%
XSS (反射/DOM/存储) 精确反射匹配 + 基线对比排除自身标签 ~85%
SSRF (云元数据/内部/协议) AWS/GCP/Azure 元数据检测 + 基线响应对比 ~85%
RCE (回显/时间) OS 输出模式 + 双重验证 ~95%
+ SSTI, XXE, LFI, IDOR, CSRF, 反序列化, CRLF, 原型污染, 缓存投毒...

误报过滤 (默认开启)

7 层过滤 + 3 种验证:

检测结果 → WAF检测 → 速率限制 → CAPTCHA → SPA识别 → 动态内容 → 错误页面
         → 统计验证 (Welch t-test) → 布尔盲注验证 → OOB 回调验证

Nuclei 模板引擎

纯 Python 解析 Nuclei YAML 模板,无需 nuclei 二进制:

autort nuclei http://target.com --tags cve,rce --severity critical -n 1000

LLM 增强 (可选)

# 启用 LLM 增强决策
export AUTORT_LLM_PROVIDER=ollama  # openai/anthropic/ollama/deepseek
export AUTORT_LLM_MODEL=llama3.1   # 本地模型, 数据不出本地

# LLM 不可用时自动退回纯规则引擎 — 零影响

Docker 沙箱 (可选)

# config/config.yaml
sandbox:
  enabled: true
  image: "python:3.12-slim"
  memory_limit: "512m"

MCP 配置

Claude Desktop / Claude Code

{
  "mcpServers": {
    "redteam": {
      "command": "python",
      "args": ["E:/path/to/mcp_stdio_server.py"],
      "env": {"PYTHONIOENCODING": "utf-8"}
    }
  }
}

Cursor

{
  "mcpServers": {
    "redteam": {
      "command": "python",
      "args": ["/absolute/path/to/mcp_stdio_server.py"]
    }
  }
}

CI/CD 集成

GitHub Actions

# .github/workflows/security.yml
name: Security Scan
on: [pull_request]
jobs:
  autort:
    runs-on: ubuntu-latest
    steps:
      - uses: Coff0xc/AutoRedTeam-Orchestrator@v3.1
        with:
          target: ${{ secrets.SCAN_TARGET }}
          severity-threshold: high

SARIF 结果自动上传到 GitHub Security tab。


配置说明

环境变量 默认值 说明
AUTORT_SCAN_TIMEOUT 30 扫描超时 (秒)
AUTORT_HTTP_MAX_RETRIES 3 HTTP 重试次数
AUTORT_LLM_PROVIDER none LLM 提供者 (openai/anthropic/ollama/none)
AUTORT_LLM_MODEL auto LLM 模型名
AUTORT_AUTH_MODE strict 认证模式 (strict/permissive/disabled)

完整配置见 .env.exampleconfig/config.yaml


开发指南

# 安装开发依赖
pip install -r requirements-dev.txt

# 测试
pytest                          # 全量测试 (1963 cases)
pytest -m "not slow"            # 跳过慢速测试
pytest --cov=core --cov=handlers --cov-report=html  # 覆盖率报告

# 代码质量
black core/ handlers/ utils/ autort/ cli/
isort core/ handlers/ utils/ autort/ cli/
flake8 core/ handlers/ utils/
mypy core/ handlers/ utils/

路线图

  • v3.1.0 — SDK + CLI + LLM + Nuclei + 沙箱 + CI/CD + 精度优化
  • v3.2.0 — Web Dashboard (React)
  • v3.2.0 — 多 Agent 协作 (ReconAgent/ExploitAgent/ReportAgent)
  • v3.3.0 — Playbook 系统 (预置攻击剧本)
  • v3.3.0 — DVWA/Juice Shop 自动化基准测试

贡献

欢迎 PR!请遵循 贡献指南

# 提交规范
feat: 新功能
fix: 修复
docs: 文档
refactor: 重构
test: 测试
security: 安全修复

许可证

MIT License - Coff0xc


免责声明

本工具仅供授权安全测试教育研究使用。使用者必须在获得目标系统所有者明确书面授权后方可进行测试。任何未经授权的使用均属违法行为,作者不承担任何因非法使用而产生的法律责任。

About

Enterprise AI Red Team Platform | 企业级AI红队平台 | 132 MCP Tools | Pure Python Engines | SDK+CLI+MCP | Auto-Download sqlmap/nuclei/ffuf | Production C2 | LLM Enhanced | Docker Sandbox | SARIF CI/CD | 1980 Tests

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages