Tutorials / Pentesting

API Pentesting

Prancer enables full-featured API security pentesting—including OWASP API Top 10 coverage and REST API fuzzing—within your Pentest‑as‑Code (PAC) workflow.

  • * *

🇬 Step 1 • Launch PAC Wizard and choose API Scan

  • From the left pane, select PAC Wizard → choose OpenAPI scan (instead of “Web scan”).
  • Set the Application Profile: application name, risk level (safe/standard/attack), applicable compliance frameworks, and scheduling.
  • Click Next to go to the _Scanner & Target_ page: enter the API’s base URL.
  • * *

⚙ Step 2 • Point to a Swagger / OpenAPI definition

Prancer provides two entry paths, with Swagger files (JSON/YAML) receiving priority:

| Mode | How to load | When to choose |

| Swagger (OpenAPI) | APIScan → Type: OpenAPI → DirectionProvider: "git" or "link" → SwaggerFile: <repo path or public URL> | _Prefer this method_, as Prancer builds full API schema & fuzzing tests directly from the specification. ( docs.prancer.io) |

| Postman Collection | Provide paths: PostmanRemoteFile (JSON only) and optional PostmanEnvRemoteFile if using Postman variables (for headers, auth, etc.) ( docs.prancer.io) | |

_— Swagger or Postman options should be only enabled in PAC manifest file._

Once you click Next, you can review and optionally edit the generated PAC YAML.

  • * *

🔍 Step 3 • Add-ons and API-specific scanning

To ensure coverage of fuzzing, schema-based testing and OWASP API Top 10 rules, include the following add-ons:

`AddOns:

`

  • openapi
  • graphql # if using GraphQL endpoints
  • fuzz
  • fuzzdb
  • fuzzdboffensive

These instruct Prancer to inject malformed inputs against schema-defined endpoints and detect authentication/authorization issues, injections, broken object-level authorization, parameter fuzzers, etc. → This is the foundation of API Top 10 compliance from the offensive perspective. ( docs.prancer.io)

  • * *

🔐 Step 4 • Add authentication (for authenticated scans)

To run scans after login, follow Module 6’s guidance but specify authentication in the PAC file:

AuthenticationMethod: jwtAuthentication Authentication: JWTAuth: UsernameSecretKey: myApiUser PasswordSecretKey: myApiPass LoginUrl: /api/auth/login LogoutUrl: /api/auth/logout LoginBodyTemplate: '{"username":"%username%","password":"%password%"}' LoginIndicator: ^.*"token".*$ AuthorizationType: Header AuthorizationKey: Authorization AuthorizationTokenType: Bearer Vault: Aws: SecretManager: arn:aws:secretsmanager:us‑west‑2:123456789012:secret:apiCreds Region: us‑west‑2 AccountId: 123456789012

Prancer pulls credentials from your vault, posts the login, extracts the token using LoginIndicator as regex or JSON path, and fuzzes authenticated API paths.

  • * *

🗄️ Step 5 • PAC Sample file (unauthenticated)

`Collection: my‑client‑apis ConnectionName: my_api_git_connector CloudType: custom ApplicationName: Inventory‑API‑scan RiskLevel: attack Compliance:

ApplicationType: APIScan Schedule: onetime Target: https://api.example.com

  • API‑Top‑10

APIScan: Type: OpenAPI DirectionProvider: git SwaggerFile: openapi/v1/inventory.yaml # repo-relative path, inside connector Connector: my_api_git_connector

paths: include: [ /inventory/.*, /orders/.* ] exclude: []

Scanner: Platform: NewFargate:… AuthenticationMethod: noAuthentication

AddOns:

`

  • openapi
  • fuzz
  • * *

✅ Step 6 • Submit scan & review results

  • Submit the manifest. A Prancer scanner spins up (managed or customer‑provided), runs deep tests (including BlackBox and schema fuzzing), and writes detections to your collection.
  • Navigate to App Findings → Applications page:
  • Filter by Application Type = APIScan
  • Drill into findings to see each endpoint, CVSS, request/response evidence, tags, MITRE mapping
  • Export CSV or full HTML/DOCX reports if needed
  • * *

🧠 Why this setup?

  • Swagger or Postman input: you cleanly define service contracts—no guessing paths
  • fuzz + openapi add-ons: automatically generate invalid/malformed payloads to test boundary conditions
  • Authenticated tests: exercise roles and authorization errors
  • CSPM + MITRE integration: correlate infra misconfigurations to API findings r resulting in a more precise mitigation strategy ( docs.prancer.io)
  • * *

✏️ Useful tips and advanced use cases

  • Error code fuzzing: automated error code fuzzing when we have tags as openAPI.

Validate tags to make sure proper attacks are loaded.

  • Postman + swagger: if you have both, Prancer defaults to Swagger; Postman collection is only used to supplement examples or custom headers
  • Continuous API scanning: choose Schedule: continuous or daily runs to detect drift or new endpoints since last swagger version
  • CI/CD integration: after you test interactively, you can export the .yaml PAC file and invoke via CLI/Pipeline to run automatically on PRs or deploy pipelines (this is supported natively in Prancer PAC CLI)
  • * *

✅ Summary

By leveraging PAC Wizard → APIScan you profile, authenticate, and simulate attacks against your APIs—without writing Python or Java agents. Input your OpenAPI schema or Postman collection, configure the authentication, scan type and add-ons, click Submit, and get actionable App Findings.

This module completes your API scanning path—authenticated, fuzzed, and compliant with modern OWASP standards.

  • * *

Screenshots

Reference screenshots.

<tutorialgallery module="m7" startIndex="1"></tutorialgallery>