Ruby570bocadito/T-100AI
GitHub: Ruby570bocadito/T-100AI
一款 100% 离线、基于本地 LLM 的攻击性安全终端,将 Ollama 与沙箱执行引擎、渗透测试技能和插件系统结合在一起。
Stars: 0 | Forks: 0
# T-100AI — AI 驱动的攻击安全终端
[](https://python.org)
[](https://ollama.ai)
[](LICENSE)
[](https://github.com/Ruby570bocadito/T-100AI/actions)
[]
[]
**T-100AI** 是一款基于本地 AI 驱动的攻击安全终端。它将本地 LLM (Ollama) 与沙箱执行引擎、用于渗透测试的 AI 技能以及插件系统结合在一起 —— 所有操作均 100% 离线进行,实现零数据泄露。
## 架构
```
flowchart LR
U[User]
T[T-100AI Terminal]
L[Ollama Local LLM]
S[Sandbox Executor]
K[Security Tools]
U -->|Commands / Prompts| T
T -->|Context + Queries| L
L -->|Generated Actions| T
T -->|Execute Action| S
S -->|Scope Validation| S
S -->|Approved Call| K
K -->|Raw Output| S
S -->|Filtered Result| T
T -->|Formatted Response| U
```
## 快速开始
```
# Clone
git clone https://github.com/Ruby570bocadito/T-100AI.git
cd T-100AI
# 安装
pip install -r requirements.txt
# 确保 Ollama 正在运行
ollama pull mistral:7b
# 启动
python -m t100ai.cli.main
```
## 功能
| 功能 | 描述 |
|---------|-------------|
| **本地 LLM 集成** | 完整的 Ollama 集成(支持 mistral、llama3、qwen、gemma、deepseek)。数据绝对不会离开您的设备。 |
| **沙箱执行** | 范围验证、速率限制、自动 sudo 授权、智能黑名单。 |
| **高级 MCP** | 工具模板、链式调用、自动发现、输出解析器、交互式 prompt 构建器。 |
| **AI 技能** | 侦察、OSINT、Web、后渗透、取证、活动目录、报告。 |
| **多 Agent 协调器** | 并行子 Agent:侦察 → 利用 → 分析 → 报告。支持条件工作流。 |
| **工作流引擎** | 条件步骤、循环、变量、交互式编辑器、实时执行。 |
| **护栏机制** | Prompt 注入检测、敏感数据过滤、工具授权门控、审计日志。 |
| **插件系统** | 自定义技能加载器、社区插件、可扩展的工具注册表。 |
| **离线模式** | 无需互联网即可使用全部功能。原生支持物理隔离,无任何遥测数据。 |
## 命令
| 命令 | 描述 |
|---------|-------------|
| `/help` | 显示交互式帮助菜单 |
| `/scan ` | 运行 AI 引导的侦察 |
| `/recon ` | OSINT 与子域名枚举 |
| `/post ` | 后渗透操作 |
| `/forensics ` | 对目标进行取证分析 |
| `/workflow ` | 执行已保存的工作流 |
| `/skill ` | 加载安全技能 |
| `/sandbox ` | 在沙箱中运行命令 |
| `/config` | 编辑配置 |
| `/quit` | 退出 |
## 项目结构
```
T-100AI/
├── pyproject.toml # Build config + dependencies
├── requirements.txt # All dependencies
├── run.sh / run.bat # Quick launch scripts
├── Dockerfile # Multi-stage Kali + Python
├── docker-compose.yml # T-100AI + Ollama stack
├── .github/workflows/ci.yml # CI pipeline (lint + test + coverage)
├── src/t100ai/
│ ├── cli/
│ │ ├── main.py # Typer CLI entry point + REPL
│ │ └── session_commands.py # Session command handlers
│ ├── core/
│ │ ├── engine.py # Main execution engine (2000+ lines)
│ │ ├── config.py # Configuration (Pydantic)
│ │ ├── session.py # Session management
│ │ ├── sandbox.py # Sandbox executor
│ │ ├── guardrails.py # Prompt injection + data filtering
│ │ ├── permissions.py # Permission levels
│ │ ├── llm_handler.py # LLM interaction handler
│ │ ├── command_executor.py # Command execution
│ │ ├── command_router.py # Command routing
│ │ ├── templates.py # Prompt templates
│ │ ├── models.py # Data models
│ │ ├── audit.py # Audit logging
│ │ ├── engagement.py # Engagement tracking
│ │ ├── report_generator.py # Report generation
│ │ ├── session_manager.py # Session persistence
│ │ ├── storage.py # Storage backend
│ │ ├── tool_service.py # Tool service
│ │ ├── wordlist_loader.py # Wordlist loading
│ │ ├── mitre.py # MITRE ATT&CK integration
│ │ ├── mitre_navigator.py # MITRE Navigator
│ │ ├── i18n.py # Internationalization
│ │ └── log_rotation.py # Log rotation
│ ├── llm/
│ │ ├── client.py # Ollama client
│ │ ├── handler.py # LLM handler
│ │ ├── connection_manager.py # Connection management
│ │ ├── prompt_builder.py # Dynamic prompt builder
│ │ └── service.py # LLM service
│ ├── skills/
│ │ ├── base.py # Base skill class
│ │ ├── manager.py # Skill manager
│ │ ├── recon.py # Reconnaissance skill
│ │ ├── osint.py # OSINT skill
│ │ ├── web.py # Web security skill
│ │ ├── postex.py # Post-exploitation skill
│ │ ├── forense.py # Forensics skill
│ │ ├── ad.py # Active Directory skill
│ │ ├── report.py # Reporting skill
│ │ └── advanced_framework.py # Advanced skill framework
│ ├── mcp/
│ │ ├── registry.py # Tool registry
│ │ ├── advanced_registry.py # Advanced registry
│ │ ├── executor.py # Tool executor
│ │ └── tool.py # Tool definitions
│ ├── plugins/
│ │ ├── base.py # Plugin base class
│ │ ├── plugin_manager.py # Plugin manager
│ │ ├── marketplace.py # Plugin marketplace
│ │ └── examples/ # Example plugins
│ ├── workflows/
│ │ ├── definitions.py # Built-in workflows
│ │ └── executor.py # Workflow executor
│ ├── agents/
│ │ └── orchestrator.py # Multi-agent orchestrator
│ ├── analysis/
│ │ ├── attack_graph.py # Attack graph analysis
│ │ ├── chain_of_custody.py # Evidence chain of custody
│ │ ├── cvss_scorer.py # CVSS scoring
│ │ ├── finding_cluster.py # Finding clustering
│ │ ├── ioc_manager.py # IOC management
│ │ ├── kill_chain.py # Kill chain analysis
│ │ ├── purple_team.py # Purple team exercises
│ │ └── risk_prioritizer.py # Risk prioritization
│ ├── api/
│ │ └── server.py # API server
│ ├── compliance/
│ │ └── frameworks.py # Compliance frameworks
│ ├── utils/
│ │ ├── audit.py # Audit utilities
│ │ ├── errors.py # Error handling
│ │ ├── history.py # Command history
│ │ ├── logging.py # Structured logging
│ │ ├── perf_profiler.py # Performance profiling
│ │ └── sensitive.py # Sensitive data handling
│ └── wordlists/
│ └── dictionaries.py # 700+ integrated wordlists
├── wordlists/
│ └── dictionaries.py # Standalone wordlist module
└── tests/ # Test suite (20+ test files)
```
## Docker
```
# Full stack (T-100AI + Ollama)
docker compose up -d
docker compose exec t100ai python -m t100ai.cli.main
# 或 standalone
docker build -t t100ai .
docker run -it --rm \
-e T100AI_OLLAMA_HOST=http://host.docker.internal:11434 \
t100ai
```
## 配置
通过环境变量进行配置:
| 变量 | 默认值 | 描述 |
|----------|---------|-------------|
| `T100AI_OLLAMA_HOST` | `http://localhost:11434` | Ollama API endpoint |
| `T100AI_DATA_DIR` | `.` | 数据目录 |
| `OLLAMA_MODEL` | — | 模型名称(通过 .env 设置) |
或者通过 `pyproject.toml` + 配置文件系统进行配置。
## 开发
```
pip install -e ".[dev,ollama,export,workflows]"
# 运行带 coverage 的测试
pytest tests/ -v --cov=src/t100ai
# Lint
ruff check src/ tests/
# Type check
mypy src/t100ai --ignore-missing-imports
```
## 安全与道德准则
T-100AI 仅供**经过授权的安全专业人员**使用。请始终遵守以下准则:
- 在测试任何系统之前,获得明确的书面授权
- 仅在隔离环境中进行生产测试
- 遵循负责任的漏洞披露规范
- 切勿对您不拥有或未获得书面授权的系统进行测试
## 许可证
MIT © [Ruby570bocadito](https://github.com/Ruby570bocadito)
标签:AI风险缓解, DLL 劫持, LLM评估, Ollama, Python, 大语言模型, 无后门, 请求拦截, 逆向工具