
高度なSQLインジェクションスキャナーで、AIを活用した分析、倫理的コンプライアンスフレームワーク、プロフェッショナルなレポート機能を備えています。
プロダクション対応のSQLインジェクションスキャナー。6つの検出手法、AIによる修復アドバイス、SARIF出力、CI/CD統合を備えています。
クイックスタート · ドキュメント · Docker · AI解析 · GitHubでスター
HTMLレポート — 重要度バッジとOWASPマッピング付きの検出概要 |
検出テーブル — PYTHIA-SQLコード、DBMS検出、CWE-89マッピング |
Pythiaはプロダクション対応のSQLインジェクション検出スキャナーであり、倫理を最優先しています。ペネトレーションテスター、セキュリティ研究者、DevSecOpsエンジニア向けに構築され、6つの検出方法でSQLインジェクションの脆弱性を特定し、CI/CDパイプラインに直接統合できます。
--fail-on、--sarif、--diffフラグでパイプライン統合~/.argos/argos.db)| 検出手法 | 説明 | 必要モード |
|---|---|---|
| Error-Based | レスポンス内のSQLエラー (MySQL, PostgreSQL, MSSQL, Oracle, SQLite) | Safe |
| Boolean-Blind | TRUE/FALSE条件によるレスポンスの違い | Safe |
| Time-Based Blind | SLEEP/WAITFORペイロードによる応答遅延 | Aggressive |
| UNION-Based | UNION SELECTによるデータ抽出 | Aggressive |
| Second-Order | 保存→取得のインジェクションパターン (POST→GETチェーン) | Aggressive |
| ORDER BY Injection | 数値ソートパラメータインジェクション | Aggressive |
python -m pyth --target http://example.com/products?id=1 --html
- **14 発見コード**: DBMS固有(MySQL、PostgreSQL、MSSQL、Oracle、SQLite)+ 手法固有
- **DBMS フィンガープリンティング**: 自動データベース種別とバージョン検出
- **WAF バイパス**: アグレッシブモードで170以上のバイパスペイロード(hex、URLエンコード、インラインコメント、大文字小文字のバリエーション)
- **セッション変数検出**: DVWA-highスタイルの認証パターンに対するPOST→GETチェーン
- **スマートクローラ**: BFS(幅優先探索)によるポップアップ/onclick抽出(`--js`)、サイトマップ、robots.txt
- **偽陽性の強化**: SequenceMatcher類似性スコアリング + マルチペイロード確認
### CI/CD 統合```bash
# Pipeline-friendly: exit 10 if high+ findings found
python -m pyth --target https://staging.app.com --aggressive --fail-on high
echo $? # 0=clean, 10=findings found, 1=error
# SARIF for GitHub Security / GitLab SAST
python -m pyth --target https://app.com --aggressive --sarif > results.sarif
# Compare vs last scan — show what's new, what's fixed
python -m pyth --target https://app.com --aggressive --diff last --html
python -m pyth --target https://api.example.com/v1/users
--auth-header "Authorization: Bearer eyJhbGc..."
--auth-header "X-API-Key: sk-prod-xxx"
--aggressive --html
Pass `--auth-header` multiple times for multiple headers.
### AIを活用した分析
コマンドラインからAIプロバイダーを選択してください:
| Provider | 最適用途 | 速度 | コスト | プライバシー |
| -------------------------------- | --------------------------------- | ---------- | ----------- | ------------ |
| **OpenAI gpt-4o-mini** (デフォルト) | 高品質・低コスト | 高速 | ~$0.02/スキャン | 標準 |
| **Anthropic Claude** | プライバシー重視、コード修正 | 高速 | ~$0.06/スキャン | 強化 |
| **Ollama (ローカル)** | 完全なプライバシー | 低速 (CPU) | 無料 | 100%オフライン |```bash
# Standard analysis
python -m pyth --target http://example.com --use-ai --ai-tone technical --html
# Agent mode: AI queries NVD for real CVEs (no API key for NVD)
python -m pyth --target http://example.com --use-ai --ai-agent --html
# Multi-provider comparison
python -m pyth --target http://example.com --use-ai \
--ai-compare "openai:gpt-4o-mini,anthropic:claude-3-5-haiku-20241022" --html
# With budget cap
python -m pyth --target http://example.com --use-ai --ai-budget 0.05 --html
JSONレポート (機械可読, v0.2.0 schema)```json { "tool": "pythia", "version": "0.2.0", "target": "http://localhost:8081", "mode": "aggressive", "summary": { "total": 26, "critical": 18, "high": 6, "medium": 2 }, "findings": [ { "id": "PYTHIA-SQL-001", "title": "Error-Based SQL Injection (MySQL/MariaDB)", "severity": "critical", "confidence": "high", "parameter": "id", "vector": "GET", "dbms": "MySQL 8.0.32", "cvss": 9.8, "contextual_score": 9.9, "risk_factors": ["no_ssl", "pii_detected"], "payload": "' OR '1'='1' --", "owasp": { "id": "A03", "name": "Injection" }, "cwe": { "id": "CWE-89", "name": "SQL Injection" }, "detection_method": "error-based" } ], "notes": { "scan_duration_seconds": 87.3, "requests_sent": 342, "rate_limit_applied": "5.0 req/s", "false_positive_disclaimer": "..." }, "diff": null }
**HTML レポート** (人間に優しい)
- フィルターバー: 深刻度、OWASPカテゴリ、検出方法、DBMS
- 各検出結果に OWASP/CWE/CVE バッジ (外部参照へのリンク付き)
- CVSS 基本スコア + コンテキストスコア (色分け表示)
- ペイロード可視化付きの展開可能な証拠セクション
- AI 分析タブ (標準 / エージェント / 比較)
- 差分セクション (新規 / 修正 / 継続中の検出結果)
- Oracle テーマ (紫色 `#6a11cb`) — クライアントにそのまま提出可能
### 検出コード
全コード → **OWASP A03 Injection** / **CWE-89 SQL Injection**