
jshunterは、JavaScriptファイルを解析し、エンドポイントを抽出するために設計されたコマンドラインツールです。このツールは、APIエンドポイントや潜在的なセキュリティ脆弱性などの機密データの特定に特化しており、バグバウンティハンターやセキュリティ研究者にとって不可欠なリソースとなっています。
JSHunter は、JavaScriptのセキュリティ解析とエンドポイント発見のための包括的なコマンドラインツールです。セキュリティ専門家、ペネトレーションテスター、開発者向けに設計されており、高精度な検出アルゴリズムとプロフェッショナルなレポート機能を備えたエンタープライズグレードの解析機能を提供します。
https://github.com/user-attachments/assets/5a5f60fa-f8dc-4aac-bd06-2e93779f9af4
JSHunterの動作例 — CLIの実際のターミナルキャプチャ(表示されているシークレットはすべてテスト用のダミーデータです)
高度な解析アルゴリズムによるエンタープライズグレードの精度
認証とヘッダー:
-H): 繰り返し可能な認証ヘッダーとカスタムリクエストヘッダー-c): 保護されたリソースへのアクセス用セッションCookie-U): ステルス用のカスタムUA文字列またはファイルベースのローテーションパフォーマンスと信頼性:
-R): 検出を回避するための設定可能なリクエスト遅延(ミリ秒)-T): さまざまなネットワーク環境に対応するカスタムタイムアウト設定-y): 失敗したリクエストに対する指数バックオフ付きの自動リトライメカニズムプロフェッショナル統合:
-p): Burp Suiteおよびカスタムプロキシとの完全統合(HTTP/HTTPS/SOCKS5)-k): テスト環境向けのオプションの証明書検証バイパス-t): 最適なパフォーマンスのための設定可能な並行リクエスト処理セキュリティプロフェッショナル機能: ペネトレーションテストとセキュリティ評価用に設計 例:
jshunter -l targets.txt -p 127.0.0.1:8080 -H "Authorization: Bearer token" -R 1000
コア解析ツール:
-d): 詳細な解析のため、圧縮・難読化されたJavaScriptを展開-m): ソースマップから元のソースコードを抽出・解析-z): 難読化技術とパターンの識別・分類動的解析:
-e): 動的コード実行(eval()、Function()、ランタイム生成)を解析コードインテリジェンス:
プロフェッショナルな使用方法: 最大限のカバレッジを得るために解析ツールとセキュリティ検出を組み合わせる 例:
jshunter -u target.js -d -m -e -s -g(完全な難読化解除+セキュリティ解析)
コアセキュリティ検出:
-s): APIキー、アクセストークン、パスワード、ハードコードされた認証情報-x): 認証トークンの抽出、検証、ペイロード検査-F): 設定解析、APIキー、データベースURLの検出高度な解析:
-P): 隠しフォームパラメータ、変数、設定キー-PU): 完全なURLコンテキストによる高度なパラメータ解析-g): スキーマ検出、クエリ抽出、エンドポイント発見-B): セキュリティバイパスパターンと回避技術スコープとコンテキスト:
-i): プライベート/内部リソースの識別と分類-L): 包括的なURL抽出と関係性マッピングプロフェッショナル向けヒント: 包括的な解析のためにフラグを組み合わせる(例:
jshunter -u target.js -s -x -F -g)
コア出力形式:
-o): 包括的な結果をカスタムファイルの場所に保存-j): 自動化とプログラム処理のための構造化データ形式-C): 経営層向けレポートと解析用のスプレッドシート互換形式プロフェッショナル統合:
-n): 即時テストのためのBurp Suite Professionalとの直接統合-r): ターゲットを絞った結果フィルタリングのためのカスタムパターンマッチング-v): デバッグ情報とコンテキストを含む詳細な解析出力結果管理:
--found-only): フォーカスしたセキュリティレポートのために空の結果を非表示-q): 自動スクリプトとCI/CD統合のためにバナーを抑制レポートワークフロー: 自動化にはJSON、管理レポートにはCSV、即時テストにはBurpエクスポートを使用 例:
jshunter -l targets.txt -s -j -o security-findings.json(構造化セキュリティレポート)
go install -v github.com/cc1a2b/jshunter/cmd/jshunter@latest
jshunter --help
### ソースからビルドする```bash
git clone https://github.com/cc1a2b/jshunter.git
cd jshunter
go build -o jshunter ./cmd/jshunter
jshunter -u "https://example.com/app.js"
jshunter -l urls.txt
jshunter -f app.js
### 完全なセキュリティ分析```bash
# Find API keys, secrets, and credentials
jshunter -u "https://target.com/app.js" -s
# Full analysis with deobfuscation, GraphQL, and Firebase detection
jshunter -u "https://target.com/app.js" -d -s -g -F -x -L
# Professional security assessment with all tools
jshunter -u "https://target.com/app.js" -d -m -e -s -x -P -g -F -B -L
# Export comprehensive results for reporting
jshunter -l targets.txt -s -g -F -j -o security_findings.json
---```bash
jshunter -u "https://example.com/app.js"
jshunter -l urls.txt
cat urls.txt | grep ".js" | jshunter
jshunter -u "https://example.com/app.js" -s -x -F
jshunter -u "https://target.com/app.js" -d -m -e -s -x -P -g -F -B -L
jshunter -u "https://target.com/bundle.js" -d -m -s -g -F
jshunter -l targets.txt -s -x -F -g -j -o security_findings.json
jshunter -l targets.txt -p 127.0.0.1:8080 -s -g -F -n -o burp_findings.txt
jshunter -l targets.txt -p socks5://127.0.0.1:9050 -s -x -F
jshunter -l urls.txt -R 2000 -H "Authorization: Bearer token" -s -x -F -g -q
jshunter -l urls.txt -ep -P -PU -L -w 2
jshunter -f obfuscated.js -d -z -e -s -v
---
## コマンドリファレンス
`jshunter --help` でいつでも完全なヘルプを表示できます。```
Usage:
-u, --url URL Input a URL
-l, --list FILE.txt Input a file with URLs (.txt)
-f, --file FILE.js Path to JavaScript file
--har FILE Ingest a Chrome DevTools HAR archive
Basic Options:
-t, --threads INT Number of concurrent threads (default: 5)
-c, --cookies <cookies> Authentication cookies for protected resources
-p, --proxy host:port HTTP/SOCKS5 proxy (e.g., 127.0.0.1:8080 for Burp Suite)
-q, --quiet Suppress ASCII art output
--no-color Disable ANSI color (auto-off when not a TTY)
-o, --output FILENAME Output file path
-r, --regex <pattern> RegEx for filtering results
--update, --up Update the tool to latest version
-ep, --end-point Extract endpoints from JavaScript files
-k, --skip-tls Skip TLS certificate verification
-fo, --found-only Only show results when sensitive data is found
HTTP Configuration:
-H, --header "Key: Value" Custom HTTP headers (repeatable, including Auth)
-U, --user-agent UA Custom User-Agent string or file path
-R, --rate-limit MS Request rate limiting delay (milliseconds)
-T, --timeout SEC HTTP request timeout (seconds)
-y, --retry INT Retry attempts for failed requests (default: 2)
--per-host INT Per-host outbound concurrency cap (default: 4)
--max-bytes N Cap response body read in bytes (default: 32MiB)
--allow-internal Permit localhost / RFC1918 / link-local targets
--cache-dir DIR Persist responses on disk; revalidate via ETag
JavaScript Analysis:
-d, --deobfuscate Deobfuscate minified and obfuscated JavaScript
-m, --sourcemap Fetch and parse source maps + sourcesContent[]
-e, --eval Analyze dynamic code execution (eval, Function)
-z, --obfs-detect Detect code obfuscation patterns and techniques
--inline-html Scan inline <script> tags + SRI/CSP in HTML responses
--csp-origins Emit CSP-allowed origins as candidate endpoints
Security Analysis:
-s, --secrets Detect API keys, tokens, and credentials
-x, --tokens Extract JWT and authentication tokens
-P, --params Discover hidden parameters and variables
-PU, --param-urls Advanced parameter extraction with URL context
-i, --internal Filter for internal/private endpoints
-g, --graphql Analyze GraphQL endpoints and queries
-B, --bypass Detect WAF bypass patterns and techniques
-F, --firebase Analyze Firebase configurations and keys
-L, --links Extract and analyze all embedded links
Detection Tuning:
-mc, --min-confidence FLOAT Minimum confidence (0.0-1.0) for a finding (default: 0.50)
-sc, --show-confidence Print [conf=X.XX] alongside each finding
--no-fp-filter Disable the false-positive filter (debug)
--ignore-file FILE Permanent suppressions (.jshunterignore)
--diff PREVIOUS.json Report only NEW findings vs previous JSON envelope
--rules-file FILE.json Load an external JSON rule pack
--only-rules id,glob Run only matching rules (supports * glob)
--disable-rule id,glob Disable matching rules (supports * glob)
Verification:
--verify Probe findings against provider read-only endpoints
--verify-timeout SEC Timeout per verification probe (default: 10)
--verify-workers INT Concurrent verifier worker pool (default: 8)
Scope & Discovery:
-w, --crawl DEPTH Recursive JavaScript discovery depth (default: 1)
-D, --domain DOMAIN Limit analysis to specific domain
-E, --ext Filter by JavaScript file extensions
--robots Fetch /robots.txt for each input host and exit
Output Formats:
-j, --json Structured JSON output (schema_version 2)
--ndjson Newline-delimited JSON (jq / SIEM streaming)
--sarif SARIF 2.1.0 (GitHub code-scanning compatible)
-C, --csv CSV format for spreadsheet analysis
-v, --verbose Detailed analysis and debug output
-n, --burp Burp Suite compatible export format
--stats Per-stage counters on stderr at end of run
Registry:
--list-rules Print the rule registry as a table and exit
--explain RULE_ID Print full rule details and exit
--self-test Run rule registry against built-in TP/FP fixtures
-h, --help Display this help message
すべてのシークレットクラスのマッチは [0.0, 1.0] でスコアリングされます。スコアはルールごとの事前確率から始まり、以下の要素で調整されます:
デフォルトの --min-confidence 0.50 は、パターンのみに一致するロングテールを除外します。高精度のトリアージには --min-confidence 0.80 を、生のフィルタリングなし出力には --no-fp-filter を使用してください。
バリデータとは、正規表現のマッチ 後 に実行されるルールごとの整合性チェックです。
これは誤検知に対する最強の防御策です。たまたま形状に適合したランダムな文字列でも、
報告される前にチェックサム、構造的デコード、または長さ/文字セットの証明を通過する必要があります
(そして合格すると +0.10 が加算されます)。
キュレーションされたレジストリには、クラウドおよびシークレットマネージャー
(AWS、Azure、GCP/PKCS#8、HashiCorp Vault、Terraform、Fly.io、Tailscale)、バージョン
管理およびCI/CD(GitHub、GitLab、Docker Hub、Atlassian、Sentry、CircleCI、
Buildkite)、決済(Stripe、Square、Braintree、Plaid)、AI/LLMプロバイダ
(OpenAI、Anthropic、Groq、Perplexity、Replicate、OpenRouter、Fireworks、
HuggingFace)、メッセージング(Slack、Discord、Telegram、Twilio、Intercom、SendGrid、
Mailgun)、SaaSおよびデータベース(Notion、Airtable、Figma、Postman、Databricks、
PlanetScale、Grafana、New Relic、Dropbox、RubyGems、Supabase)、およびPKI素材
(RSA/EC/DSA/OpenSSH/PGP/PKCS#8秘密鍵、PuTTY .ppk、データベース接続
URI)にわたる 85以上の検出器 が含まれています。権威あるテーブルについては jshunter --list-rules を、
個々のルールのパターン、バリデータ、フィクスチャについては jshunter --explain <rule_id> を実行してください。
プレフィックスなしの「ベアハッシュ」形状は、構造的バリデータまたは必須コンテキストゲートが誤検知を
排除できる場合にのみ提供されます。
jshunter -l targets.txt -d -m -e -z -s -x -P -PU -g -F -B -L -j -v -o complete_assessment.json
jshunter -l targets.txt -d -m -z -e -s -g -F --found-only -o deobfuscated_findings.json
jshunter -l targets.txt -R 2000 -U "Mozilla/5.0..." -H "X-Forwarded-For: 1.1.1.1" -s -x -F -q
jshunter -l targets.txt -p 127.0.0.1:8080 -s -x -g -F -B -n -o burp_comprehensive.txt
jshunter -l targets.txt -ep -P -PU -L -w 3 -i -j -o endpoint_discovery.json
### エンタープライズ&自動化統合```bash
# CI/CD Security Pipeline Integration
jshunter -f dist/bundle.js -d -s -x -F -j --found-only > security-scan.json
# Comprehensive automated security reporting
jshunter -l production-js.txt -d -s -x -P -g -F -B -C -o enterprise-security-report.csv
# Source map analysis for development security
jshunter -f app.js -m -s -x -F -v -o sourcemap-analysis.json
# Firebase and GraphQL focused assessment
jshunter -l targets.txt -g -F -L -j -o api_security_findings.json
コントリビューションを歓迎します!以下の方法で支援できます:
git clone https://github.com/cc1a2b/jshunter.git cd jshunter go mod tidy go build -o jshunter ./cmd/jshunter
---
## ライセンス
JSHunter は **MIT ライセンス** の下で公開されています。詳細については [LICENSE](https://github.com/cc1a2b/jshunter/blob/master/LICENSE) を参照してください。```
Copyright (c) 2024-2026 Hussain Alsharman
Licensed under MIT License - free for commercial and personal use
JSHunterがセキュリティ調査や業務に役立つ場合:
このリポジトリにStarを付ける • @cc1a2bをフォロー • 他の人と共有する
JSHunter - プロフェッショナルなJavaScriptセキュリティ分析
cc1a2bがセキュリティコミュニティのために制作
| シグナル | 効果 |
|---|
| ソースパスがベンダー/チャンクバンドルのように見える | −0.15 |
| 周囲のコンテキストにフィクスチャ用語が含まれる | −0.30 |
| プロバイダ固有のバリデータが合格 | +0.10 |
| 必須コンテキストキーワードが存在する(汎用ルール) | +0.05 |
| シャノンエントロピー ≥ 4.5 | +0.05 |
| 文字クラスの多様性 ≥ 3 | +0.05 |
| ベンダーノイズのデニーリストにマッチ | スコアリング前に除外 |
| 長さ / エントロピーがルールの下限を下回る | スコアリング前に除外 |
行が //# sourceMappingURL= マーカーである | スコアリング前に除外 |
| プロバイダ | バリデータ |
|---|
| AWS | プレフィックスファミリー(AKIA/ASIA/A3T…)+ 16文字のbase32ボディ |
| Stripe | キーファミリー(sk/rk/pk_live/test_)および whsec_ ウェブフックのbase62ボディ |
| GitHub | CRC32 base62チェックサムがランダムボディに対して検証される |
| OpenAI | ファミリープレフィックス + 長さウィンドウ(sk-/sk-proj-/sk-svcacct-) |
| Slack | ハイフン区切りセグメント形状(数値の内部セグメント、英数字の末尾) |
| JWT | base64urlデコードされたJSONヘッダーに alg フィールド + JSONペイロード |
| Twilio | 32桁の16進ボディ + エントロピーゲート |
| Azure | AccountKey= base64ボディが正確に64バイトにデコードされる; AD …<digit>Q~… |
| Telegram | <8-10桁のID>:AA… 分割、base64urlシークレット + エントロピーゲート |
| Intercom | base64が tok: プレフィックス付きペイロードにデコードされる |
| Sentry | sntrys_ 組織トークンペイロードがbase64デコードされ、url クレームを含むJSONになる |
| Terraform | <14>.atlasv1.<60-70> 3セグメント構造 |
| Square | sq0atp-/sq0csp-/sq0idp- ファミリー + 正確なボディ長 + エントロピー |
| Braintree | access_token$<env>$<16 base36>$<32 hex> 4セグメント構造 |
| Airtable | pat<14>.<64 hex> 2セグメント分割 |
| Postman | PMAK-<24 hex>-<34 hex> セグメント長 + エントロピー |
| Database | テンプレート化/デフォルト/低エントロピーの場合、接続URIパスワードは拒否される |