who0xac/Pinakastra
GitHub: who0xac/Pinakastra
一款基于 AI 的渗透测试框架,集成自动化侦察、漏洞探测与智能利用以提升安全评估效率。
Stars: 62 | Forks: 8
# 🔱 Pinakastra
**结合自动化侦察的 AI 驱动渗透测试框架**
Pinakastra 是一款先进的侦察与利用工具,它将被动/主动枚举与 AI 驱动的漏洞检测和利用相结合。专为渗透测试人员和 Bug Bounty 猎手打造。
[](https://github.com/who0xac/Pinakastra/stargazers)
[](https://github.com/who0xac/Pinakastra/releases)
[](https://go.dev)
[](https://www.linux.org)
## ✨ Pinakastra 能做什么?
1. **发现子域名** - subfinder, findomain, assetfinder, sublist3r, chaos, crtsh, shodan, puredns
2. **探测存活主机** - httpx
3. **解析 IP** - dnsx(包含 ASN 和地理位置)
4. **发现 URL** - Katana (爬虫) + GAU (归档抓取)
5. **扫描端口** - Nmap(结合 AI 驱动的 CVE 检测)
6. **分析安全性** - Headers, CORS, TLS, 密钥, 云资产, 接管
7. **主动利用** - XSS, SQLi, SSRF, Open Redirect, Path Traversal, IDOR, JWT
8. **生成报告** - JSON, CSV, TXT 格式
## 🚀 功能
### 🔍 侦察
- **子域名发现** - 8 个被动数据源 + DNS 暴力破解
- **HTTP 探测** - 存活主机检测与技术指纹识别
- **IP 解析** - ASN 查询与地理位置定位
- **URL 发现** - Katana + GAU 及智能过滤
- **端口扫描** - Nmap 及服务检测
**智能 URL 过滤:**
- 移除静态资源(图片、CSS、字体),同时保留敏感文件
- 保留 .env, .sql, .bak, .config, .js 文件以用于安全测试
- 优先处理 API、admin、auth 和 upload 等 endpoint
- 限制每个子域名最多 150 个 URL,每种模式 5 个 URL(减少 70% 数据量)
- 确保不遗漏任何敏感点
### 🛡️ 安全分析
- 安全 Headers, TLS/SSL, CORS
- 子域名接管(支持 50+ 种服务)
- 云资产发现(S3, Azure, GCP)
- 密钥检测(API 密钥、token)
### 🤖 AI 驱动的主动利用
**漏洞测试:**
- **XSS, SQLi, SSRF, Open Redirect, Path Traversal, IDOR, JWT**
- **每种类型 10 个 payload**:7 个硬编码的高级 payload + 3 个 AI 生成的绕过 payload
- **模型**:deepseek-r1:7b(需要 6-7GB RAM)
**AI 功能:**
- 端口扫描 CVE 分析
- 自适应 Payload 生成
- NVD 数据库 CVE 验证
- 顺序化 AI 生成(边生成边测试)
- 智能检测(减少误报)
## 📦 安装
### 1. 检查所需工具
**所需工具:** subfinder, httpx, dnsx, katana, gau, puredns, findomain, assetfinder, chaos, nmap, sublist3r, crtsh, shodan
```
pinakastra check
```
### 2. 安装 Pinakastra
```
go install github.com/who0xac/pinakastra/cmd/pinakastra@main
```
### 3. 安装 AI
**安装 Ollama:**
```
curl -fsSL https://ollama.com/install.sh | sh
```
**拉取 DeepSeek 模型:**
```
ollama pull deepseek-r1:7b
```
**启动 Ollama:**
```
ollama serve
```
**验证:**
```
curl http://localhost:11434/api/tags
ollama list
```
## 📖 用法
```
# 使用 AI 的基本扫描
pinakastra -d target.com --enable-ai
# 使用选项
pinakastra -d target.com --enable-ai -o ./results --no-bruteforce --use-tor
```
**选项:**
- `-o` - 自定义输出目录
- `--no-portscan` - 跳过端口扫描
- `--no-bruteforce` - 跳过 DNS 暴力破解
- `--use-tor` - 使用 TOR 代理
## ⚙️ 配置
**Pinakastra 配置:** `~/.config/pinakastra/`
```
~/.config/pinakastra/
├── config.yaml # API keys (Chaos, Shodan)
├── configs/
│ └── resolvers.txt # DNS resolvers for puredns
└── wordlists/
└── subdomains.txt # Subdomain wordlist (auto-downloaded)
```
**配置文件:** `~/.config/pinakastra/config.yaml`
```
api_keys:
chaos: "your-chaos-api-key"
shodan: "your-shodan-api-key"
```
**Subfinder 配置:** `~/.config/subfinder/provider-config.yaml`
## 📤 输出
结果保存在:`./output/-/`
```
subdomains.txt # All discovered subdomains
live_hosts.txt # Live HTTP/HTTPS hosts
resolved_ips.txt # IPs with ASN and geolocation
urls.txt # All discovered URLs
open_ports.txt # Open ports with services
vulnerabilities.json # Exploitation results (JSON)
vulnerabilities.csv # Exploitation results (CSV)
vulnerabilities.txt # Exploitation results (TXT)
security_headers.txt # Security header analysis
tls_analysis.txt # TLS/SSL analysis
cors_issues.txt # CORS misconfiguration
cloud_assets.txt # Cloud storage buckets
secrets_found.txt # API keys, tokens
subdomain_takeover.txt # Takeover vulnerabilities
```
## 🎯 主动利用
| 漏洞 | 硬编码 | AI | 总计 | 检测方式 |
|--------------|-----------|----|----|-----------|
| XSS | 7 | 3 | 10 | 响应反射 |
| SQL 注入 | 7 | 3 | 10 | 错误消息 + 基于时间 |
| SSRF | 7 | 3 | 10 | 云元数据检测 |
| Open Redirect | 7 | 3 | 10 | Location header 验证 |
| Path Traversal | 7 | 3 | 10 | 文件签名 |
| IDOR | 7 | 3 | 10 | 响应差异 |
| JWT | - | 分析 | - | Token 验证 |
## ⚠️ 免责声明
**仅供授权的安全测试使用。** 仅对您拥有或获得明确书面授权测试的系统使用。作者不对滥用行为负责。请始终遵循负责任的漏洞披露原则并遵守当地法律。
**由 who0xac 用 ❤️ 构建**
标签:EVTX分析, GitHub, Go, Ruby工具, XXE攻击, 人工智能, 安全侦察, 实时处理, 密码管理, 渗透测试, 漏洞扫描, 用户模式Hook绕过, 自动化测试