
RustベースのXSSスキャナー。コンテキストを考慮したペイロード選択、WAF検出とバイパス、クローリング、ブラインドXSSコールバック、静的DOMシンク分析を備えています。
Rustで書かれた高度なXSS検出ツール。コンテキストを認識するペイロードインテリジェンスと、幅広いインジェクション手法を組み合わせています。
このツールはXSStrikeとXSSERに触発されて作成されました。ペイロードは以下の様々なソースから収集しました:
皆さん、ありがとう。素晴らしいです ❤️
警告: 自身が所有するシステム、またはテストに対する明示的な書面による許可を得たシステムに対してのみ使用してください。
<title>、<textarea> など)を検出し、すべてを盲目的に発射するのではなく、そのコンテキストに最も適したペイロードを選択しますReferer、User-Agent、X-Forwarded-For、X-Real-IP、その他のヘッダー、およびCookie値をテストしますinnerHTML、eval、document.write、location.href、jQueryの .html()、その他の危険なシンクをソース検出付きで静的に検査しますgit clone https://github.com/fabian-affolter/xssearch
cd xssearch
nix-shell --run "cargo build --release"
# binary: target/release/xssearch
LTOとシンボル除去を有効にしたリリースビルド:
nix-shell --argstr release true --run "$BUILD"
Rust 1.75以上が必要です。
cargo build --release
NixまたはNixOSユーザー向けにパッケージが利用可能です。最新のリリースは unstable チャンネルにのみ存在する場合があることに注意してください。
nix-env -iA nixos.xssearch
xssearch [OPTIONS] <--url <URL> | --file <URLS_FILE>>
| フラグ | 説明 |
|---|---|
-u, --url <URL> | 対象URL。FUZZ を使用してカスタムインジェクションポイントを指定 |
-f, --file <FILE> | 1行に1つのURLを記述したファイル |
-d, --data <DATA> | POSTボディ。FUZZ を使用してインジェクションポイントを指定 |
-H, --header <H> | 追加のリクエストヘッダー、繰り返し指定可能 |
--cookie <COOKIE> | Cookie文字列 |
--proxy <URL> | HTTP/HTTPSプロキシ |
--timeout <N> | リクエストタイムアウト(秒)(デフォルト: 10) |
--user-agent <UA> | カスタムUser-Agent |
--follow-redirects | HTTPリダイレクトを追跡 |
--threads <N> | 同時リクエスト数(デフォルト: 2) |
--delay <MS> | リクエスト間の遅延(ミリ秒) |
--crawl | 対象をスパイダーしてリンクとフォームを収集 |
--crawl-depth <N> | クロール深度(デフォルト: 3) |
--headers-inject | 一般的なHTTPヘッダーをインジェクションポイントとしてテスト |
--cookie-inject | Cookie値をインジェクションポイントとしてテスト |
--blind <URL> | ブラインドXSSコールバックURL |
--dom | 静的なDOM XSSシンク分析 |
--fuzz | 反映コンテキストに関係なくすべてのペイロードを発射 |
--payload-set <SET> | all | html | js | attr | poly | dom | mxss | waf (デフォルト: all) |
--payloads-file <FILE> | カスタムペイロードファイル、1行に1つ |
--encode <LIST> | カンマ区切りのエンコーディング: url,html,unicode,double,base64 |
--prefix <STR> | すべてのペイロードの先頭に付加する文字列 |
--suffix <STR> | すべてのペイロードの末尾に付加する文字列 |
--waf-detect | スキャン前にWAFをフィンガープリント |
--waf-bypass | ペイロードにWAFバイパストランスフォームを適用 |
--output-json <FILE> | 検出結果をJSONファイルに書き込み |
--output-md <FILE> | 検出結果をMarkdownファイルに書き込み |
-v, --verbose | 詳細出力(コンテキスト、すべてのプローブを表示) |
-V, --version | バージョンを表示して終了 |
xssearch -u "https://example.com/search?q=test"
xssearch -u "https://example.com/login" -d "user=admin&pass=FUZZ"
xssearch -u "https://example.com/" --crawl --waf-detect --headers-inject -v
xssearch -u "https://example.com/?q=FUZZ" --waf-detect --waf-bypass --encode url,html
xssearch -u "https://example.com/contact" -d "msg=FUZZ" \
--blind "https://abc123.oast.fun/xssearch"
xssearch -u "https://example.com/app" --dom --no-banner
xssearch -u "https://example.com/?q=test" --output-json results.json
xssearch -u "https://example.com/?q=test" --output-md report.md
xssearch -f targets.txt --crawl --waf-detect --output-json results.json --output-md report.md
xssearch -u "https://example.com/?q=test" --proxy http://127.0.0.1:8080 -v
ツールを検証する最速の方法は、意図的に脆弱なPythonサーバーをローカルで起動することです:
python3 - <<'EOF'
import http.server, urllib.parse
class H(http.server.BaseHTTPRequestHandler):
def log_message(self, *a): pass
def do_GET(self):
p = urllib.parse.urlparse(self.path)
q = urllib.parse.parse_qs(p.query)
val = q.get('q', [''])[0]
body = f'<html><body><p>Search: {val}</p></body></html>'.encode()
self.send_response(200)
self.send_header('Content-Type', 'text/html')
self.end_headers()
self.wfile.write(body)
http.server.HTTPServer(('127.0.0.1', 9999), H).serve_forever()
EOF
次にスキャンします:
xssearch -u "http://127.0.0.1:9999/?q=test" -v
期待される出力: HTMLコンテキストのペイロードによる [Vuln] XSS in 'q'。
これらのイメージはセキュリティツールのテスト専用に構築されており、実際のユーザーデータは含まれていません。
docker run -d -p 8080:80 vulnerables/web-dvwa
# Set security level to Low in the UI first
xssearch -u "http://localhost:8080/vulnerabilities/xss_r/?name=test" \
--cookie "PHPSESSID=<your-session>; security=low"
docker run -d -p 8081:8080 webgoat/goat-and-wolf
xssearch -u "http://localhost:8081/WebGoat/" --crawl --crawl-depth 2 -v
docker run -d -p 3000:3000 bkimminich/juice-shop
xssearch -u "http://localhost:3000/" --crawl --dom -v
docker run -d -p 8082:80 raesene/bwapp
# Activate bWAPP at http://localhost:8082/install.php first
xssearch -u "http://localhost:8082/xss_get.php?firstname=test&lastname=test" \
--cookie "PHPSESSID=<your-session>; security_level=0"
これらのサイトはセキュリティツールのテスト専用に提供されています。認証やセットアップは不要です。
| ターゲット | URL | XSSエントリーポイント |
|---|---|---|
| Acunetixテストサイト | http://testphp.vulnweb.com/ | search.php?test=、アーティストコメント、検索フォーム |
| IBM Altoro Mutual | http://demo.testfire.net/ | 検索パラメータ、フィードバックフォーム |
| HP WebInspectデモ | http://zero.webappsecurity.com/ | ログインフォーム、検索、アカウントフィールド |
| Google Gruyere | https://google-gruyere.appspot.com/ | スニペット、プロフィールフィールド(インスタンスURLが必要) |
検索パラメータ(反射型XSS):
xssearch -u "http://testphp.vulnweb.com/search.php?test=query" \
--waf-detect -v
ヘッダーインジェクション付きの完全クロール:
xssearch -u "http://testphp.vulnweb.com/" \
--crawl --crawl-depth 3 \
--headers-inject \
--dom \
--output-json testphp-findings.json
検索フォーム:
xssearch -u "http://demo.testfire.net/search.aspx?txtSearch=test" \
--waf-detect --fuzz -v
ルートからクロール:
xssearch -u "http://zero.webappsecurity.com/" \
--crawl --crawl-depth 2 \
--waf-detect \
--output-json zero-findings.json
まず個人インスタンスを起動してから、それをスキャンします:
# The instance URL is displayed after clicking "Start" on the Gruyere homepage
xssearch -u "https://google-gruyere.appspot.com/<instance-id>/feed.gtl" \
--dom --crawl -v
公開ターゲットは断続的に遅くなったりオフラインになったりする場合があります。リクエストがタイムアウトする場合は --timeout 30 を使用してください。
ターミナル出力は色分けされたラベルを使用します: