r74tech/virga

GitHub: r74tech/virga

在 beacon 中嵌入本地 LLM 的现代化 C2 框架,支持通过自然语言指令实现自主后渗透操作。

Stars: 4 | Forks: 1

# Virga 一个现代化的 Command & Control (C2) 框架,在 beacon implant 中嵌入了本地 LLM,用于自主后渗透操作。通过在受控主机上完全运行 AI,Virga 最大限度地减少了 C2 连接,并使代理能够通过自然语言指令独立完成复杂任务。 ## 法律声明 **警告**:本工具仅用于授权的安全测试和研究。未经事先双方同意使用本软件攻击目标是非法的。最终用户有责任遵守所有适用的地方、州和联邦法律。开发者不承担任何责任,也不对因滥用本程序造成的任何损害负责。 ## 快速开始 ``` # Clone the repository git clone https://github.com/r74tech/virga.git cd virga # Build everything make # Run server and CLI together make run # Or run separately make run-server # Terminal 1 make run-cli # Terminal 2 ``` ## 系统要求 - Go 1.24+ - gcc - Make - mingw (用于 Windows 交叉编译) - bun (用于 Web UI 开发和文档) ## 安装说明 ### 从源代码构建 ``` # Build and run without installation make deps make download-llama-all # Build all components make build ``` ## 系统架构 ``` virga/ ├── cmd/ # Entry points │ ├── server/ # C2 server │ ├── cli/ # Command-line interface │ └── mcp-stdio/ # MCP STDIO server ├── internal/ # Core implementation │ ├── server/ # Server logic │ ├── cli/ # CLI implementation │ ├── implant/ # Implant/agent code │ └── shared/ # Shared utilities ├── web/ # Web dashboard (React + Vite) ├── docs/ # Documentation (VitePress) ├── examples/ # Extension examples ├── configs/ # Configuration files └── scripts/ # Build and utility scripts ``` ## 核心功能 ### 服务器端 - 多协议支持 (HTTP/HTTPS,采用 AES-256-GCM 加密) - 具有实时监控的会话管理 - 文件传输和远程命令执行 - 支持自定义证书的 TLS ### 命令行界面 (CLI) - 支持命令补全的交互式 shell - 直接命令执行模式 (--exec) - Beacon/payload 生成 - 会话交互和管理 - 文件上传/下载操作 - 可配置的输出 (静默模式、颜色控制) ### Web Dashboard - 实时会话监控和管理 - 交互式命令执行界面 - 使用 Cytoscape 进行网络拓扑可视化 ### Implant/Beacon - 跨平台支持 (x64/ARM64 架构上的 Windows, Linux, macOS) - 嵌入式 llama AI,用于自主操作 (见 [AI 功能](docs/usage/ai-features.md)) - 内存数据库 (MemDB) 用于数据收集 - 带有抖动 (jitter) 的可配置休眠间隔 - 环境检测和反调试 ## 常见任务 ### 构建 ``` make # Build all components make server # Build server only make cli # Build CLI only make clean # Clean build artifacts ``` ### 运行 ``` make run # Run server and CLI together make run-server # Run server only make run-cli # Run CLI only make run-local # Run without installation make kill-ports # Kill processes on default ports ``` ### 开发 ``` make dev # Hot reload mode (requires entr) ``` ### Web UI 开发 ``` cd web bun install # Install dependencies bun run dev # Start development server bun run build # Build for production ``` ### 文档 ``` cd docs bun install # Install dependencies bun run docs:dev # Start documentation server bun run docs:build # Build documentation ``` ### 安装 ``` make install # Install to system (may need sudo) make install-user # Install to ~/.local/bin make uninstall # Remove installation ``` ## 配置说明 ### 服务器配置 示例配置请参见 `configs/server.yaml`。 ### 环境变量 ``` # Server SERVER_PORT=9000 make run-server SERVER_CONFIG=my-config.yaml make run-server # CLI CLI_HOST=192.168.1.100 make run-cli CLI_PORT=9000 make run-cli CLI_ARGS="--log-level off --no-color" make run-cli # Installation INSTALL_DIR=/custom/path make install ``` ### CLI 选项 ``` # Output control virga-cli --quiet # Minimal output virga-cli --no-color # Disable colors virga-cli --log-level off # Disable logging # Debug mode virga-cli --debug # Enable debug output VIRGA_CLI_LOG_LEVEL=debug virga-cli # Via environment variable # Connection options virga-cli --host 192.168.1.100 --port 9000 virga-cli --config custom-config.yaml ``` ## MCP Inspector 用于 MCP 开发和调试 (可选): ``` # Run MCP inspector (uses bunx, no installation needed) bun mcp:inspect ``` ## 安全性 - 所有通信均使用 TLS 加密 - 认证 token 绝不存储在磁盘上 - 对所有用户输入进行输入验证 - 使用 Trivy 和 Gosec 进行定期安全审计 如发现安全问题,请发送邮件至 r74tech@proton.me,而非使用 issue tracker。 ## 许可证 本项目基于 MIT 许可证授权 - 详情请参见 [LICENSE](LICENSE) 文件。 ## 致谢 - [Qitmeer/llama.go](https://github.com/Qitmeer/llama.go) 提供了 llama.cpp 的 Go 绑定 - Cobalt Strike 提供了 BOF 格式的灵感 - Go 社区提供了优秀的库和工具 - 安全研究人员提供了宝贵的反馈和贡献
标签:Beacon, C2框架, Command & Control, DLL 劫持, DNS 反向解析, EVTX分析, Golang, Go语言, HTTP工具, Implant, IP 地址批量处理, LLM, Mingw, Mr. Robot, React, Syscalls, TGT, Unmanaged PE, Vite, 人工智能, 后渗透, 命令控制, 大语言模型, 安全学习资源, 安全测试, 安全编程, 底层编程, 攻击性安全, 攻防演练, 数据展示, 数据采集, 日志审计, 流量嗅探, 用户模式Hook绕过, 程序破解, 端侧AI, 红队, 网络信息收集, 网络安全, 网络安全审计, 自主代理, 自动化攻击, 跨平台编译, 远程控制, 隐私保护