
WPRecon は、Go で構築されたモダンな WordPress セキュリティ偵察ツールです。セキュリティエンジニアが WordPress インストールの脆弱性、設定ミス、情報漏洩の問題を特定するのに役立ちます。
チェックがハードコードされた従来の脆弱性スキャナーとは異なり、WPRecon は YAML 駆動のテンプレートアーキテクチャ を採用しており、以下を可能にします。
応答内の肯定的なヒットを識別します。
マッチした応答からアクション可能なデータを抽出します。
150 以上のプロダクション対応テンプレートが含まれています。
# リポジトリをクローン
git clone https://github.com/ffx64/wprecon.git
cd wprecon
# バイナリをビルド
go build -o wprecon ./cmd/wprecon/main.go
# PATH に移動(オプション)
sudo mv wprecon /usr/local/bin/
go install github.com/ffx64/wprecon/cmd/wprecon@latest
docker build -t wprecon .
docker run wprecon scan https://example.com
利用可能なすべてのテンプレートを使用して WordPress サイトをスキャンします。
wprecon scan https://example.com
選択したテンプレートのみを実行します。
wprecon scan https://example.com -t wordpress-detection,plugin-detection,user-enumeration
# 自動化向けの JSON 出力
wprecon scan https://example.com --output json
# 見やすいテーブル(デフォルト)
wprecon scan https://example.com --output table
# 20 の同時ワーカーと 100 req/s を使用
wprecon scan https://example.com --workers 20 --rate-limit 100
wprecon list-templates
wprecon --help
スキャンを実行すると、WPRecon は詳細な発見事項を生成します。
テーブル形式:
ID | テンプレート | 名前 | 重要度 | 対象 | 証拠
---------------------|------------------------|--------------------------|----------|---------------------|----------
finding_001 | wordpress-version | WordPress バージョン発見 | info | example.com | 6.2.1
finding_002 | plugin-detection | プラグイン検出 | low | example.com | Yoast SEO 16.0
finding_003 | security-headers | セキュリティヘッダー不足 | medium | example.com | X-Frame-Options
JSON 形式:
{
"scan_id": "scan_uuid_001",
"timestamp": "2026-04-10T14:37:00Z",
"target": "https://example.com",
"total_findings": 15,
"findings": [
{
"id": "finding_uuid_001",
"template_id": "wordpress-detection",
"name": "WordPress インストール検出",
"description": "ターゲット上で WordPress CMS インストールが特定されました",
"severity": "info",
"cvss_score": 0.0,
"matched_url": "https://example.com/wp-admin/",
"http_method": "GET",
"status_code": 200,
"response_time_ms": 245,
"evidence": {
"version": "6.2.1",
"wp_version_header": "6.2.1"
},
"timestamp": "2026-04-10T14:37:00Z",
"remediation": "WordPress を最新バージョンに更新してください"
}
]
}
wprecon/
├── cmd/wprecon/
│ └── main.go # CLI エントリポイント
├── internal/
│ ├── app/
│ │ ├── cli.go # CLI コマンドハンドラー
│ │ └── api.go # REST API ハンドラー
│ ├── engine/
│ │ ├── scanner.go # スキャンオーケストレーション
│ │ ├── worker_pool.go # 並列化エンジン
│ │ ├── context.go # スキャンコンテキスト管理
│ │ ├── logger.go # ロギングユーティリティ
│ │ └── rate_limit.go # レート制限
│ ├── executor/
│ │ ├── http_executor.go # HTTP クライアント
│ │ ├── request_builder.go # リクエスト構築
│ │ └── variables.go # 変数解決
│ ├── matchers/
│ │ └── matchers.go # 応答マッチングロジック
│ ├── extractors/
│ │ └── extractors.go # データ抽出
│ ├── templates/
│ │ ├── loader.go # テンプレート検出
│ │ └── parser.go # YAML 解析
│ ├── pipeline/
│ │ └── pipeline.go # スキャンワークフロー
│ └── domain/
│ ├── template.go # データモデル
│ ├── finding.go
│ ├── http.go
│ ├── matcher.go
│ └── extractor.go
├── templates/ # YAML テンプレートライブラリ
│ ├── wordpress/ # WordPress 固有
│ ├── cves/ # CVE 検出
│ ├── exposures/ # 情報漏洩
│ ├── common/ # 汎用チェック
│ └── waf/ # WAF 検出
└── go.mod # 依存関係
┌─────────────────────────────────────────────┐
│ ユーザーインターフェース (CLI/API) │
└─────────────────────────────────────────────┘
│
├─→ テンプレートローダー
├─→ レート制限
└─→ ワーカープールマネージャー
│
▼
┌─────────────────────────────────────────────┐
│ スキャンパイプラインエンジン │
│ ┌────────→ リクエストビルダー │
│ │ ┌────────→ HTTP 実行機 │
│ │ │ ┌────────→ マッチャー(5 種類) │
│ │ │ │ ┌────────→ 抽出機(2 種類) │
│ │ │ │ │ ┌────────→ 発見レポート │
│ │ │ │ │ │ │
│ ▼ ▼ ▼ ▼ ▼ │
│ テンプレート → リクエスト → 応答 → 発見 │
└─────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────┐
│ 出力フォーマッターとストレージ │
│ (JSON, テーブル, レポート生成) │
└─────────────────────────────────────────────┘
テンプレートは、WPRecon が特定の脆弱性や情報をスキャンする方法を定義する YAML ファイルです。
id: wordpress-version-detection
name: WordPress バージョン検出
description: readme.html から WordPress バージョンを検出して抽出します
severity: info
author: WPRecon Team
requests:
- url: "{{BaseURL}}/readme.html"
method: GET
matchers:
- type: status
status:
- 200
- type: word
words:
- "WordPress"
extractors:
- type: regex
regex:
- 'Version (\d+\.\d+\.\d+)'
templates/custom/ に新しい YAML ファイルを作成例:
# カスタムテンプレートを作成
cat > templates/custom/my-check.yaml << 'EOF'
id: my-custom-check
name: カスタムチェック
description: カスタム脆弱性を検出します
severity: medium
author: あなたの名前
requests:
- url: "{{BaseURL}}/vulnerable-endpoint"
method: GET
matchers:
- type: status
status:
- 200
- type: word
words:
- "vulnerable"
EOF
# カスタムテンプレートでスキャン
wprecon scan https://example.com -t my-custom-check
# HTTP タイムアウト (デフォルト: 10s)
export WPRECON_TIMEOUT=15
# ワーカー数 (デフォルト: 10)
export WPRECON_WORKERS=20
# 1秒あたりのリクエスト数 (デフォルト: 50)
export WPRECON_RATE_LIMIT=100
# ログレベル (デフォルト: info)
export WPRECON_LOG_LEVEL=debug
# テンプレートディレクトリ (デフォルト: ./templates)
export WPRECON_TEMPLATE_DIRS=/path/to/templates:/path/to/more/templates
wprecon scan <target> \
--templates-dir ./custom-templates \
--workers 20 \
--rate-limit 100 \
--timeout 15 \
--output json \
--log-level debug
WordPress インストールの包括的なセキュリティ評価:
wprecon scan https://example.com --output json > assessment_report.json
デプロイパイプラインでの自動脆弱性スキャン:
# GitHub Actions の例
- name: WordPress セキュリティスキャン
run: |
wprecon scan ${{ secrets.STAGING_URL }} \
--output json \
--templates wordpress-detection,plugin-detection,cve-checks
複数のターゲットを効率的にスキャン:
cat targets.txt | while read target; do
wprecon scan "$target" --output json >> results.json
done
# バイナリをビルド
go build -o wprecon ./cmd/wprecon/main.go
# 複数プラットフォーム向けにビルド
GOOS=linux GOARCH=amd64 go build -o wprecon-linux ./cmd/wprecon/main.go
GOOS=darwin GOARCH=amd64 go build -o wprecon-darwin ./cmd/wprecon/main.go
GOOS=windows GOARCH=amd64 go build -o wprecon-windows.exe ./cmd/wprecon/main.go
google/uuid v1.6.0 - 発見項目の UUID 生成
gopkg.in/yaml.v3 - YAML テンプレート解析
git checkout -b feature/my-template)templates/ にテンプレートを追加wprecon scan https://test.site -t your-templateこのプロジェクトは MIT ライセンスの下でライセンスされています。詳細は LICENSE ファイルを参照してください。
❤️ を込めて Matheus (ffx64) へ
| 機能 | 説明 |
|---|
| 並列スキャン | 設定可能なワーカープール(デフォルト: 10 ワーカー)による同時リクエスト処理 |
| レート制限 | 組み込みのリクエストスロットリング(デフォルト: 50 req/s)によりネットワークに優しい |
| 自動リトライ | 失敗した HTTP リクエストの自動リトライロジック |
| ホットリロードテンプレート | 再コンパイル不要 - テンプレートを追加してすぐにスキャン |
| 変数解決 | 動的変数: {{BaseURL}}, {{Timestamp}}, {{RandomInt}} |
| マルチフォーマット出力 | 人間が読めるテーブルと構造化 JSON |
| CLI および API モード | コマンドラインと REST API の両方のインターフェース |
| 重要度レベル | 情報、低、中、高、クリティカルの 5 段階で発見事項を分類 |
| テンプレート | 目的 |
|---|
wordpress-detection | WordPress インストールの検出 |
wordpress-version | WordPress バージョンのフィンガープリンティング |
plugins.yaml | インストール済みプラグインの検出 |
themes.yaml | インストール済みテーマの検出 |
users.yaml | WordPress ユーザーの列挙 |