Skip to content

AI prompt · Web pentesting

Prompt: analyse an HTTP request and response

Prompt that explains an HTTP request/response pair captured in an authorised test: headers, cookies, parameters, weakness hypotheses and next tests.

By Steven Carrier Published

Works with: Claude, other chat assistants

You are an application security tester. Analyse the HTTP request/response pair below, captured during an authorised penetration test.

Authorised scope: {{scope}}
Request context: {{context}}
Request:
{{http_request}}

Response:
{{http_response}}

Proceed as follows:
1. explain in a few sentences what this request does and what the server returns;
2. point out the security-relevant elements: headers (present, missing or inconsistent), cookie attributes (Secure, HttpOnly, SameSite, scope), parameters and values that look like identifiers, tokens or privileges, and information disclosure (versions, paths, error messages);
3. put forward hypotheses of weakness to verify, each with the element that motivates it and the test that would confirm or rule it out; state clearly that these are hypotheses, not findings;
4. suggest the next tests in priority order, staying within the authorised scope;
5. list the information you lack to conclude.

Do not present any hypothesis as a confirmed vulnerability. Provide no exploitation payload. Suggest no test against a host that is not in scope.

Replace the highlighted variables before use.

This prompt helps you break down a request intercepted with your analysis proxy: understand what it does, spot what deserves a test, and avoid overlooking a header or a cookie attribute. It saves time on long or hard-to-read exchanges (tokens, nested JSON, redirects), without replacing your own reading of the request.

Fill in the variables

Variable Example
{{scope}} https://staging.example.org and https://api.staging.example.org, excluding the back office
{{context}} "update my profile" action in the application, test account with the user role, grey box
{{http_request}} PUT /api/v2/profile/1042 HTTP/1.1, Host: api.staging.example.org, headers and JSON body (token and cookies replaced with [TOKEN])
{{http_response}} HTTP/1.1 200 OK, headers, Set-Cookie and JSON body of the response

Paste the whole exchange, headers included: the model cannot judge a missing header if it does not see the entire response. Replace real secrets with placeholders.

Review the output

  • Keep each hypothesis separate from a finding: nothing is confirmed until you have replayed the test yourself within scope.
  • Check header and cookie attribute recommendations against official documentation (OWASP Secure Headers Project, browser or framework documentation): a model may cite obsolete or non-existent directives.
  • Make sure the follow-up tests stay within the scope and constraints of the engagement (accounts, hours, load).
  • Discard hypotheses based on a header that an intermediary (CDN, reverse proxy) may have added, unless you have checked what a real user sees.
  • Anonymise before sending: tokens, session cookies, API keys, identifiers and personal data, plus the client’s domain names if your agreement requires it. Share nothing that it does not allow you to pass to an AI service.
  • To structure the tests that follow, reuse the web test plan prompt.

Sources

Related resources

  • AI prompt · Web pentesting

    API test plan prompt

    Prompt that builds an API test plan from an OpenAPI excerpt: endpoints by risk, authorisation matrix and tests per OWASP API Top 10 category.

    Published

  • Cheatsheet · Web pentesting

    Burp Suite cheatsheet

    Burp Suite for an authorised web test: proxy and CA certificate, scope, HTTP history, Repeater, careful Intruder use, Decoder and evidence export.

    Published

  • AI prompt · Web pentesting · Infrastructure and AD pentesting

    Critical vulnerability alert prompt

    Prompt that drafts the urgent client notification when a critical vulnerability is found during testing: facts, impact and immediate containment advice.

    Published

BEAROPS

Need a penetration test?

BEAROPS experts test your applications, infrastructure and cloud, black box or grey box, following OWASP, NIST and ANSSI guidance.