
軽量なReact Server ComponentsおよびNext.jsアプリケーション識別用ユーティリティ
RSC-Detectは、React Server Components (RSC) とNext.jsフレームワークを使用しているウェブサイトを識別するために設計された、シンプルで焦点を絞ったツールです。以下のような場面で役立ちます:
このガイドはWindowsとLinuxのインストールをサポートしています。macOSはDMGファイルで提供されています。
GitとPythonが利用可能であることを確認してください。
Gitリンク: https://git-scm.com/install/windows
Pythonリンク: https://www.python.org/ftp/python/3.13.12/python-3.13.12-amd64.exe
GIT CMDを実行してください。
git clone https://github.com/fBUZk2BH/RSC-Detect-CVE-2025-55182.git
cd RSC-Detect-CVE-2025-55182
py -m pip install -r requirements.txt
py main.py
requestsのみ)main.pyのtargetListを編集します:
if __name__ == "__main__":
targetList = [
"https://example.com",
"https://another-site.com",
]
for urlItem in targetList:
analyzeTarget(urlItem)
python main.py
Analyzing target: https://example.com
[Framework Indicators] Detected: ['__NEXT_DATA__', '/_next/static/']
[Framework Headers] Detected: ['x-powered-by: next.js']
Analyzing target: https://another-site.com
No framework indicators detected
1. 対象URLにHTTP GETリクエストを送信
2. HTMLコンテンツとレスポンスヘッダーを解析
3. 既知の指標に対してパターンマッチング
4. 結果を報告
HTML_RSC_PATTERNS = [
'__flight__', # RSC streaming marker
'react-server-streaming', # Server streaming indicator
'__REACT_SERVER_APP__', # RSC application flag
]
CONTENT_TYPE_RSC_PATTERNS = [
'text/x-component', # RSC content type
'text/vnd.rsc', # Vendor RSC type
'application/x-react-server-component', # Full RSC MIME
]
HTML_NEXTJS_PATTERNS = [
"__NEXT_DATA__", # Next.js data hydration
"/_next/static/", # Static asset paths
"/_next/data/", # Data fetching routes
"next-head", # Head component
"next-font", # Font optimization
"next/script", # Script component
]
RSC-Detect-CVE-2025-55182/
├── main.py # メイン検出スクリプト
├── requirements.txt # Python依存関係
└── README.md # ドキュメント
targetList = [
"https://site1.com",
"https://site2.com",
"https://site3.com/app",
]
# 新しいRSCパターンを追加
HTML_RSC_PATTERNS.append('your-custom-pattern')
# 新しいNext.jsパターンを追加
HTML_NEXTJS_PATTERNS.append('custom-next-indicator')
# リクエストタイムアウトを変更(デフォルト: 10秒)
httpResponse = requests.get(targetUrl, timeout=30)
def loadTargetsFromFile(filepath):
with open(filepath, 'r') as f:
return [line.strip() for line in f if line.strip()]
if __name__ == "__main__":
targetList = loadTargetsFromFile('targets.txt')
for urlItem in targetList:
analyzeTarget(urlItem)
import json
def analyzeTargetJson(targetUrl):
results = {
'url': targetUrl,
'rsc_markers': [],
'content_types': [],
'nextjs_html': [],
'nextjs_headers': []
}
try:
httpResponse = requests.get(targetUrl, timeout=10)
htmlContentLower = httpResponse.text.lower()
headersContentLower = str(httpResponse.headers).lower()
results['rsc_markers'] = [p for p in HTML_RSC_PATTERNS if p.lower() in htmlContentLower]
results['content_types'] = [p for p in CONTENT_TYPE_RSC_PATTERNS if p.lower() in headersContentLower]
results['nextjs_html'] = [p for p in HTML_NEXTJS_PATTERNS if p.lower() in htmlContentLower]
results['nextjs_headers'] = [p for p in HEADER_NEXTJS_PATTERNS if p.lower() in headersContentLower]
except Exception as e:
results['error'] = str(e)
return results
# 使用例
results = [analyzeTargetJson(url) for url in targetList]
print(json.dumps(results, indent=2))
from concurrent.futures import ThreadPoolExecutor
def scanConcurrently(targets, maxWorkers=5):
with ThreadPoolExecutor(max_workers=maxWorkers) as executor:
executor.map(analyzeTarget, targets)
# リトライロジックを追加
from requests.adapters import HTTPAdapter
from urllib3.util.retry import Retry
session = requests.Session()
retries = Retry(total=3, backoff_factor=0.5)
session.mount('https://', HTTPAdapter(max_retries=retries))
# SSL検証を無効にする(本番環境では非推奨)
httpResponse = requests.get(targetUrl, timeout=10, verify=False)
# 異なるエンコーディングに対応
httpResponse.encoding = httpResponse.apparent_encoding
このツールは以下の目的で使用されます:
所有していないターゲットをスキャンする前に、必ず許可を得てください。
requests>=2.28.0
urllib3>=1.26.0
コントリビューションを歓迎します!以下の方法で協力できます:
MITライセンス - 個人・商用利用無料。
シンプル • 高速 • 効果的
⭐ 役に立ったらスターをお願いします!
| カテゴリ | 検出されるパターン |
|---|
| 🔵 RSCマーカー | __flight__, react-server-streaming, __REACT_SERVER_APP__ |
| 📄 Content-Type | text/x-component, text/vnd.rsc, application/x-react-server-component |
| ⚡ Next.js HTML | __NEXT_DATA__, /_next/static/, next-font, next/script |
| 📋 ヘッダー | x-powered-by: next.js |
| フレームワーク | 検出率 | 備考 |
|---|
| Next.js 13+ | 高 | 複数の指標が存在 |
| Next.js 12 | 高 | __NEXT_DATA__は信頼性高い |
| React RSC | 中 | 実装に依存 |
| カスタムReact | 低 | カスタムパターンが必要 |