Skip to content
subcloakdocs

Guides

Pentest your own app

Tamper with requests at a breakpoint or with Rewrite rules, replay and race them, check headers and leaked secrets, on systems you own or may test.

This guide uses Cloak Proxy to probe your own app’s API for common weaknesses: tampering with a request mid-flight, replaying it with changed parameters, sending it many times at once to find race conditions and missing rate limits, checking the response security headers and for leaked secrets, and rewriting or scripting systematic edits across many requests. It finishes with how to record findings.

Written authorization for the target, if it isn’t yours Keep it on file before you start
Cloak Proxy capturing the app, with HTTPS decrypted See Debug a mobile app or macOS traffic
A test account you can safely change data with Tampering can create, modify or delete real records

A breakpoint holds a request while the app waits, so you can change exactly what reaches the server.

  1. Capture the request you want to probe, right-click it, and choose Tools → Breakpoint…. Leave Pause on request on. Keep the matcher tight so only this call pauses.

    To pause just the next call once, choose Break on Next Request instead. It adds a request-only breakpoint for that method and URL and removes it after one request has paused, so there’s nothing to clean up. Since 0.2.0

    A breakpoint scoped to one endpoint.

    1. Tool on/off
    2. Matcher — keep it tight
    3. Pause on request and/or response
    The Breakpoint tool with a rule matching one endpoint and Pause on Request and Response checkboxes
  2. Trigger the call. The Breakpoint window opens with the request held.

    A held request. Change any part before it's sent.

    1. Request paused
    2. Headers, including Authorization
    3. Execute sends your version
    4. Abort drops it
    A request paused at a breakpoint, with editable method, URL, headers (including an Authorization bearer token) and body
  3. Tamper and observe. Common checks:

    Change What it probes
    An id in the path or body to another user’s Broken object-level authorization (IDOR)
    Remove or alter the Authorization header Missing authentication checks
    A role, isAdmin or price field in the body Mass assignment / privilege escalation
    Oversized or malformed body Input validation and error handling
  4. Click Execute to send your edit, Cancel to send the original, or Abort to drop it. If the rule also pauses the response, inspect or change what comes back.

For quicker iteration than a breakpoint, resend a captured request with changes.

  1. Right-click a request and choose Edit and Repeat… (⌥ ⌘ E). The Compose window opens prefilled.

  2. Change a parameter, header or token and press Send (⌘ ↩). Repeat with different values to sweep an input.

  3. Decode tokens and encoded values inline: select text in a request or response, right-click, and use Quick Preview to decode Base64, a JWT, URL-encoding, timestamps or JSON — useful for reading a session token or a signed parameter before you tamper with it.

Since 0.2.0

Some bugs only show up when the same request arrives many times at once: a coupon redeemed twice, a balance withdrawn twice, a login form with no rate limit. Repeat Advanced sends one captured request many times and summarizes what came back.

  1. Right-click the request, such as a redeem or transfer call made with a test account, and choose Repeat Advanced… (⇧ ⌥ ⌘ R).

    Repeat Advanced: how many, how many at once, and the delay between starts.

    1. How many requests to send
    2. How many run at the same time
    3. Wait between starts
    4. Start sending
    The Repeat Advanced sheet for GET api.example.com/v1/users with Requests 10, At the same time 1 and Delay between starts 0 ms, a note about testing only servers you may test, and Close and Send 10 buttons
  2. Set Requests (up to 10,000), At the same time (up to 100) and Delay between starts (in steps of 50 ms). For a race, send a handful at once with no delay, for example 10 requests, 10 at the same time. For a rate limit, send more, one at a time.

  3. Click Send followed by the count. The sheet shows a progress bar, then:

    Line Shows
    Sent How many were sent out of the total, and how long it took.
    Status How many of each status code came back, such as 200 × 1 409 × 9, plus failed × N for requests that got no response.
    Time Minimum, average, p95 and maximum response time.
  4. Click Show in Traffic List to select the new requests. They appear under the app Cloak Proxy (Repeat), and each went through your debugging tools.

More than one success for an action that should happen once points to a race condition. All 200s where you expected 429 Too Many Requests points to a missing rate limit. Stop cancels a run that’s still sending.

Open Insights (⌥ ⌘ I) to review the responses in bulk.

  1. On the Security tab, read each host’s A–F grade and issues: missing HSTS/CSP/nosniff/clickjacking protection, cookies without Secure/HttpOnly/SameSite, wildcard CORS with credentials, and disclosed software versions.

    Security grades and the specific header and cookie issues behind them.

    1. Hosts by grade
    2. Each issue, with Show Request
    The Security tab grading hosts A to F with a detailed issue list for one host
  2. On the Secrets tab, look for keys, tokens in URLs, card numbers and credentials over plain HTTP. Values are masked; click Show Request to see where each came from. See Find leaked secrets.

Since 0.2.0

To apply the same change to every matching request or response, start with the Rewrite tool. Each rule is a list of actions, with no script to write.

  1. Right-click a captured request and choose Tools › Rewrite…, or open Tools › Edit Rewrite Rules… (⌥ ⌘ R) and add a rule. To affect only your app’s traffic, type its name in Only these apps.

    A Rewrite rule: each action changes one part of the request or response.

    1. Only these apps
    2. Swap the token for another user's
    3. Drop a parameter
    4. Flip a field in every response
    5. Add another action
    A Rewrite rule for GET api.example.com/v1/users limited to MyApp, with actions that set the Authorization request header, remove the debug query parameter, set the response status to 503 and replace active true with active false in the response body
  2. Click Add Action and pick what to change:

    Probe Action
    Replay as another user Request header › Set Authorization to a second test account’s token
    Missing authentication Request header › Remove Authorization
    Hidden parameters Query parameter › Set debug or admin to true
    Client-side trust Response body › Find and replace "isAdmin": false with "isAdmin": true, to see what the app unlocks
    Error handling Response status › Set to 500 or 503
  3. Use the app and watch the traffic list. Actions run in order, before Scripting and breakpoints.

Use Scripting, below, when a change needs logic, such as a value computed from the request.

To apply the same change across every matching request (not one at a time), use the Scripting tool. Scripts run onRequest before a request is sent and onResponse before the app sees it.

  1. Open Tools → Scripting, add a rule, and set its matcher to the host or path you’re probing.

    Scripting: change every matching request or response in JavaScript.

    1. Tool on/off
    2. Run onRequest / onResponse
    3. Check Syntax and Snippets
    4. The onRequest / onResponse handlers
    The Scripting tool with an onRequest/onResponse template, Run toggles, Check Syntax, Snippets and a Console
  2. Write the change. For example, strip the auth header to test whether endpoints enforce it, or flip a flag in every response to see what the client exposes:

    function onRequest(context, url, request) {
    // Probe missing-auth handling across every matching call:
    delete request.headers["Authorization"];
    return request;
    }
    function onResponse(context, url, request, response) {
    // response.body is an object for JSON
    console.log(response.statusCode, url);
    return response;
    }
  3. Click Check Syntax, watch the Console for console.log output, and read the results in the traffic list (scripted flows are tagged Script). sharedState persists across scripts (for example to carry a token between calls) until you Reset sharedState.

  1. Highlight and comment interesting requests: right-click → Highlight by color, and Add Comment….

  2. Export the evidence for your report. Use Insights → Export Report for a Markdown summary, or export the relevant requests as HAR with Redact secrets ticked so you don’t leak live tokens into the report. Highlights and comments go with them: HAR keeps comments in the standard comment field, and session files keep both. Redaction doesn’t change comment text, so keep secrets out of your comments.

  3. Export the tool rules you used (Tools → Export Rules…) so a teammate can reproduce the test.

  1. Turn off Breakpoint, Rewrite, Scripting and any other tool you enabled, and Reset sharedState.

  2. Delete or disable the probing rules so they don’t fire later.

  3. On a device, remove the Wi-Fi proxy and profile when you’re done.