本文へスキップ
Skillpedia
セキュリティ35k · #8181

performing-api-fuzzing-with-restler

できること

このツールは、アプリが通信に使うオンラインサービスであるAPIのセキュリティ上の欠陥を見つけるのに役立ちます。さまざまなデータの組み合わせで自動的にAPIをテストし、何かが壊れないかを確認します。

使う場面

  • ✓APIを公開する前に、セキュリティをテストするとき。
  • ✓特定の一連のAPIコマンドが問題を引き起こすかを確認するとき。
  • ✓APIが攻撃される可能性を示すエラーを探すとき。

スキルのリンク

https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/performing-api-fuzzing-with-restler/SKILL.md

コピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。

使い方

いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/performing-api-fuzzing-with-restler/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

AIへの頼み方の例

“OpenAPI仕様書を使って、私のAPIのセキュリティをテストし、エラーがないか確認してください。”

毎週5つの新しいスキル。1分で読めます。

仕組み

ツールはRESTlerというプログラムを使い、説明ファイル(OpenAPI/Swagger)からAPIの仕組みを理解します。その後、悪意のあるデータを含むさまざまな種類のデータをAPIに送り、脆弱性を探します。

技術的な内容(元のSKILL.md)

作者による元のテキスト(英語)をGitHubからそのまま表示しています。

Performing API Fuzzing with RESTler

When to Use

  • Performing automated security testing of REST APIs using their OpenAPI/Swagger specifications
  • Discovering bugs that only manifest through specific sequences of API calls (stateful testing)
  • Finding 500 Internal Server Error responses that indicate unhandled exceptions or crash conditions
  • Testing API input validation by fuzzing parameters with malformed, boundary, and injection payloads
  • Running continuous security regression testing in CI/CD pipelines for API changes

Do not use against production environments without explicit authorization and monitoring. RESTler creates and deletes resources aggressively during fuzzing.

Prerequisites

  • Written authorization specifying the target API and acceptable testing scope
  • Python 3.12+ and .NET 8.0 runtime installed
  • RESTler downloaded from https://github.com/microsoft/restler-fuzzer
  • OpenAPI/Swagger specification (v2 or v3) for the target API
  • API authentication credentials (tokens, API keys, or OAuth credentials)
  • Isolated test/staging environment (RESTler can create thousands of resources per hour)

Workflow

Step 1: RESTler Installation and Setup

# Clone and build RESTler
git clone https://github.com/microsoft/restler-fuzzer.git
cd restler-fuzzer

# Build RESTler
python3 ./build-restler.py --dest_dir /opt/restler

# Verify installation
/opt/restler/restler/Restler --help

# Alternative: Use pre-built release
# Download from https://github.com/microsoft/restler-fuzzer/releases

Step 2: Compile the API Specification

# Compile the OpenAPI spec into a RESTler fuzzing grammar
/opt/restler/restler/Restler compile \
    --api_spec /path/to/openapi.yaml

# Output directory structure:
# Compile/
#   grammar.py          - Generated fuzzing grammar
#   grammar.json        - Grammar in JSON format
#   dict.json           - Custom dictionary for fuzzing values
#   engine_settings.json - Engine configuration
#   config.json         - Compilation config

Custom dictionary for targeted fuzzing (dict.json):

{
    "restler_fuzzable_string": [
        "fuzzstring",
        "' OR '1'='1",
        "\" OR \"1\"=\"1",
        "<script>alert(1)</script>",
        "../../../etc/passwd",
        "${7*7}",
        "{{7*7}}",
        "a]UNION SELECT 1,2,3--",
        "\"; cat /etc/passwd; echo \"",
        "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
    ],
    "restler_fuzzable_int": [
        "0",
        "-1",
        "999999999",
        "2147483647",
        "-2147483648"
    ],
    "restler_fuzzable_bool": ["true", "false", "null", "1", "0"],
    "restler_fuzzable_datetime": [
        "2024-01-01T00:00:00Z",
        "0000-00-00T00:00:00Z",
        "9999-12-31T23:59:59Z",
        "invalid-date"
    ],
    "restler_fuzzable_uuid4": [
        "00000000-0000-0000-0000-000000000000",
        "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa"
    ],
    "restler_custom_payload": {
        "/users/{userId}": ["1", "0", "-1", "admin", "' OR 1=1--"],
        "/orders/{orderId}": ["1", "0", "999999999"]
    }
}

Step 3: Configure Authentication

# authentication_token.py - RESTler authentication module
import requests
import json
import time

class AuthenticationProvider:
    def __init__(self):
        self.token = None
        self.token_expiry = 0
        self.auth_url = "https://target-api.example.com/api/v1/auth/login"
        self.credentials = {
            "email": "fuzzer@test.com",
            "password": "FuzzerPass123!"
        }

    def get_token(self):
        """Get or refresh authentication token."""
        current_time = time.time()
        if self.token and current_time < self.token_expiry - 60:
            return self.token

        resp = requests.post(self.auth_url, json=self.credentials)
        if resp.status_code == 200:
            data = resp.json()
            self.token = data["access_token"]
            self.token_expiry = current_time + 3600  # Assume 1-hour TTL
            return self.token
        else:
            raise Exception(f"Authentication failed: {resp.status_code}")

    def get_auth_header(self):
        """Return the authentication header for RESTler."""
        token = self.get_token()
        return f"Authorization: Bearer {token}"

# Export the token refresh command for RESTler
auth = AuthenticationProvider()
print(auth.get_auth_header())

Engine settings for authentication (engine_settings.json):

…

よくある質問

このツールを使うには許可が必要ですか?

はい。特に本番環境のAPIをテストする場合は、書面による許可が必要です。ツールは大量のデータを短時間で作成・削除できるためです。

「ファジング」とは何ですか?

プログラムにランダムなデータや想定外のデータを送り、誤動作したりクラッシュしたりしないかを確認するテスト手法です。

「ステートフルなバグ」とは何ですか?

APIの操作を1つずつ個別にテストするのではなく、一連の操作を順番に実行したときにだけ現れる欠陥のことです。

詳細

作者による元の説明

Uses Microsoft RESTler to perform stateful REST API fuzzing: compiles an OpenAPI/Swagger spec into a RESTler grammar, configures authentication, and runs test/fuzz-lean/fuzz modes that generate request sequences exercising producer-consumer dependencies, then flags 500 errors, auth bypasses, resource leaks, and injection bugs. Use when fuzzing REST APIs for stateful bugs or running RESTler-based a

repo: mukul975/Anthropic-Cybersecurity-Skills

人気

GitHubのスター
35k
ランキング
#8181
ライセンス
Apache-2.0
更新日
2026/8/31

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル