Aller au contenu

scan

Ce contenu n’est pas encore disponible dans votre langue.

Probes one or more URLs to determine whether each response is cacheable per HTTP semantics (RFC 9111), whether it’s actually being cached, and how the fronting CDN/reverse proxy handles the cache key.

Terminal window
cache-detective scan --url https://example.com/

Exactly one of these must be set:

FlagDescription
--urlSingle target URL to scan
--listPath to a newline-delimited list of URLs (#-prefixed lines are comments)
--sitemapURL of a sitemap.xml to scan (flat <urlset> only, not <sitemapindex>)
--harPath to a .har file to import GET/HEAD requests from
--crawlCrawl same-origin links starting from --url instead of scanning it alone
FlagDefaultDescription
--path-prefix(none)Restrict --crawl to URLs under this path prefix
--max-pages50Maximum pages to discover with --crawl
--respect-robotstrueHonor robots.txt Disallow rules for * during --crawl
Terminal window
cache-detective scan --url https://example.com/ --crawl --path-prefix /blog --max-pages 100
FlagDefaultDescription
--methodGETHTTP method to test
--header(none)Custom request header "Name=Value" (repeatable)
--cookie(none)Cookie "name=value" to send with every request (repeatable)
--bearer(none)Bearer token for authenticated cache testing
--auth-profiles(none)Path to a JSON file mapping target origin (scheme://host[:port]) to per-origin headers/cookies/bearer, overriding --header/--cookie/--bearer for matching resources
--max-retries0Maximum retry attempts per probe request on transient failures (0 = no retries)
--retry-delay500msBase delay between retry attempts (grows with backoff, honors Retry-After)
--requests3Probe requests issued per resource for live cache-state detection
--interval500msDelay between consecutive probe requests to the same resource
--timeout15sPer-request timeout
--stale-window-max-wait30sMaximum time to wait for a resource to enter its declared stale-while-revalidate window before giving up on actively confirming it
--max-concurrencynumber of CPUsMaximum concurrent checks
--max-resource-concurrencynumber of CPUsMaximum concurrent resources per check
Terminal window
cache-detective scan --url https://example.com/account \
--bearer "$TOKEN" \
--cookie "session=abc123" \
--header "X-Api-Version=2"

--header, --cookie, and --bearer apply the same credentials to every resource in the scan. When a --list, --sitemap, --har, or --crawl run spans multiple hosts that each need different credentials, use --auth-profiles instead: a JSON file mapping each target’s origin to its own headers, cookies, and/or bearer token. A resource whose origin has no matching entry falls back to --header/--cookie/--bearer.

auth-profiles.json
{
"https://api.example.com": {
"bearer": "eyJhbGciOi...",
"headers": { "X-Api-Version": ["2"] }
},
"https://admin.example.com": {
"cookies": { "session": "abc123" }
}
}
Terminal window
cache-detective scan --list urls.txt --auth-profiles auth-profiles.json
FlagDefaultDescription
--aggressivefalseEnable cache poisoning/deception probing
--max-aggressive-requests10Hard cap on extra probe requests per resource for --aggressive checks (and the read-only vary-key check), even with --aggressive set
--cache-buster-modequeryHow --aggressive checks isolate poison/confirm requests from the resource’s real cache entry: query, header, or both
--cache-buster-paramcd_cachebusterQuery parameter name used in query/both cache-buster mode
--cache-buster-headerX-Cache-Detective-BusterRequest header name used in header/both cache-buster mode
--unkeyed-wordlist(none)Path to a newline-delimited wordlist of extra candidate names to supplement the bundled header/cookie/query-parameter unkeyed-input mining wordlists
Terminal window
cache-detective scan --url https://staging.example.com/ --aggressive

--aggressive also gates stale-if-error confirmation — since confirming it means asking the origin to simulate a failure.

Every check that writes attacker-controlled content or an error response back through the resource’s own URL (unkeyed header injection, error-response caching, response splitting, CPDoS) sends its poison-then-confirm request pair to a cache-buster-isolated URL/header instead of the plain resource URL — a fresh random token per attempt, reused for both the poisoning request and its confirmation. This is what lets the check confirm a shared cache actually replays what it just planted, without ever poisoning the cache entry a real visitor’s plain request to that URL would read from.

If a target’s cache normalizes/strips one buster form (e.g. drops unrecognized query params), point it at the other:

Terminal window
cache-detective scan --url https://staging.example.com/ --aggressive --cache-buster-mode header

The unkeyed-header-injection check (§5) mines each of three input surfaces — headers, cookies, and query parameters — against a bundled default wordlist per surface. --unkeyed-wordlist supplements all three with app-specific candidate names of your own, e.g. an internal feature-flag cookie or an API-gateway routing header the bundled lists don’t cover:

wordlist.txt
# blank lines and "#" comments are ignored
X-Internal-Route
feature-flag
api_version
Terminal window
cache-detective scan --url https://staging.example.com/ --aggressive --unkeyed-wordlist wordlist.txt

--max-aggressive-requests is shared across all three surfaces (headers mined before cookies before query parameters), so mining the full bundled wordlist — let alone a custom one — may need raising it well past its default of 10.

scan shares its output/reporting flags with the rest of the CerberAuth CLI suite:

FlagDefaultDescription
--formatterminalTerminal display format
--no-colorfalseDisable ANSI colors in terminal output
--quietfalseSuppress terminal display of the report
--output(none)File path to additionally write the report to
--output-formatjsonFormat for --output
--show-all-findingsfalseShow every finding on stdout, not just active ones
--report-url(none)HTTP endpoint to POST the report to
--report-header(none)Additional HTTP headers for the report transport (key=value)
--report-formatjsonFormat for --report-url
Terminal window
cache-detective scan --url https://example.com/ --output-format json --output report.json --quiet

scan exits 1 if any check itself failed to execute (network errors, timeouts, …) and 0 otherwise — findings are reported but don’t affect the exit code on their own. To gate a build on specific findings, parse the JSON output (see the GitHub Actions guide) or use diff to detect drift against a baseline.