@abdulr7man/pensieve 0.0.0-stage → 1.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +684 -0
- package/README.md +180 -2
- package/VERSION +1 -0
- package/agents/README.md +16 -0
- package/agents/pensieve-code-auditor.md +58 -0
- package/agents/pensieve-mapper.md +46 -0
- package/agents/pensieve-planner.md +67 -0
- package/agents/pensieve-reconner.md +76 -0
- package/agents/pensieve-reporter.md +61 -0
- package/agents/pensieve-roe-checker.md +46 -0
- package/agents/pensieve-scoper.md +77 -0
- package/agents/pensieve-tester.md +83 -0
- package/agents/pensieve-validator.md +62 -0
- package/bin/pensieve +452 -0
- package/bin/pensieve-installer.cjs +5 -0
- package/commands/pensieve-close.md +6 -0
- package/commands/pensieve-map.md +6 -0
- package/commands/pensieve-new-engagement.md +6 -0
- package/commands/pensieve-pause.md +15 -0
- package/commands/pensieve-plan.md +6 -0
- package/commands/pensieve-progress.md +34 -0
- package/commands/pensieve-quick.md +8 -0
- package/commands/pensieve-recon.md +6 -0
- package/commands/pensieve-report.md +6 -0
- package/commands/pensieve-resume.md +6 -0
- package/commands/pensieve-retest.md +10 -0
- package/commands/pensieve-scope.md +49 -0
- package/commands/pensieve-surface.md +8 -0
- package/commands/pensieve-test.md +6 -0
- package/commands/pensieve-validate.md +6 -0
- package/docker/Dockerfile.pensieve-toolbox +75 -0
- package/docker/compose.pensieve-net.yml +37 -0
- package/docker/squid.conf.template +21 -0
- package/package.json +39 -4
- package/packs/ad/ad-killchain/checklist.md +64 -0
- package/packs/ad/ad-killchain/pack.yaml +19 -0
- package/packs/cloud/cloud-cis/checklist.md +66 -0
- package/packs/cloud/cloud-cis/pack.yaml +20 -0
- package/packs/fintech/practice-core/checklist.md +33 -0
- package/packs/fintech/practice-core/learnings.md +5 -0
- package/packs/fintech/practice-core/pack.yaml +18 -0
- package/packs/infra/ptes-infra/checklist.md +22 -0
- package/packs/infra/ptes-infra/pack.yaml +19 -0
- package/packs/mobile/owasp-masvs/checklist.md +80 -0
- package/packs/mobile/owasp-masvs/pack.yaml +20 -0
- package/packs/owasp-api-v4/checklist.md +85 -0
- package/packs/owasp-api-v4/learnings.md +6 -0
- package/packs/owasp-api-v4/pack.yaml +23 -0
- package/packs/owasp-api-v4/runbooks/API1/SKILL.md +66 -0
- package/packs/owasp-api-v4/runbooks/API10/SKILL.md +67 -0
- package/packs/owasp-api-v4/runbooks/API2/SKILL.md +129 -0
- package/packs/owasp-api-v4/runbooks/API3/SKILL.md +55 -0
- package/packs/owasp-api-v4/runbooks/API4/SKILL.md +59 -0
- package/packs/owasp-api-v4/runbooks/API5/SKILL.md +60 -0
- package/packs/owasp-api-v4/runbooks/API6/SKILL.md +63 -0
- package/packs/owasp-api-v4/runbooks/API7/SKILL.md +70 -0
- package/packs/owasp-api-v4/runbooks/API8/SKILL.md +72 -0
- package/packs/owasp-api-v4/runbooks/API9/SKILL.md +66 -0
- package/packs/thickclient/thickclient-core/checklist.md +60 -0
- package/packs/thickclient/thickclient-core/pack.yaml +24 -0
- package/packs/web/asvs-l2/checklist.md +50 -0
- package/packs/web/asvs-l2/learnings.md +6 -0
- package/packs/web/asvs-l2/pack.yaml +19 -0
- package/packs/web/asvs-l2/runbooks/V2-AUTH-ENUM/SKILL.md +75 -0
- package/packs/web/asvs-l2/runbooks/V2-AUTH-LIVE/SKILL.md +78 -0
- package/packs/web/asvs-l2/runbooks/V2-AUTH-MFA/SKILL.md +76 -0
- package/packs/web/asvs-l2/runbooks/V2-AUTH-RATE/SKILL.md +72 -0
- package/packs/web/owasp-testing-checklist/checklist.md +52 -0
- package/packs/web/owasp-testing-checklist/learnings.md +47 -0
- package/packs/web/owasp-testing-checklist/pack.yaml +21 -0
- package/packs/web/unauth-perimeter/checklist.md +72 -0
- package/packs/web/unauth-perimeter/pack.yaml +18 -0
- package/packs/web/unauth-perimeter/runbooks/PERIM-01/SKILL.md +60 -0
- package/packs/web/unauth-perimeter/runbooks/PERIM-02/SKILL.md +63 -0
- package/packs/web/unauth-perimeter/runbooks/PERIM-03/SKILL.md +62 -0
- package/packs/web/unauth-perimeter/runbooks/PERIM-04/SKILL.md +75 -0
- package/packs/web/unauth-perimeter/runbooks/PERIM-05/SKILL.md +66 -0
- package/packs/web/unauth-perimeter/runbooks/PERIM-06/SKILL.md +59 -0
- package/packs/web/unauth-perimeter/runbooks/PERIM-07/SKILL.md +56 -0
- package/packs/web/unauth-perimeter/runbooks/PERIM-08/SKILL.md +57 -0
- package/packs/web/unauth-perimeter/runbooks/PERIM-09/SKILL.md +62 -0
- package/packs/web/unauth-perimeter/runbooks/PERIM-10/SKILL.md +60 -0
- package/packs/whitebox/code-audit-core/checklist.md +36 -0
- package/packs/whitebox/code-audit-core/learnings.md +6 -0
- package/packs/whitebox/code-audit-core/pack.yaml +14 -0
- package/prompts/orchestrator-core.md +52 -0
- package/reference/attack-playbooks.md +57 -0
- package/reference/otp-relay.md +98 -0
- package/reference/param-profiles.md +48 -0
- package/reference/templates/FINDING.md +97 -0
- package/reference/tool-selection.md +64 -0
- package/reference/vulnerability-finding-standard.md +80 -0
- package/runtimes/hermes/hooks/injection-scan.py +290 -0
- package/runtimes/hermes/hooks/scope-guard.py +136 -0
- package/skills/pensieve/SKILL.md +134 -0
- package/skills/pensieve-close/SKILL.md +31 -0
- package/skills/pensieve-map/SKILL.md +25 -0
- package/skills/pensieve-new-engagement/SKILL.md +28 -0
- package/skills/pensieve-pause/SKILL.md +22 -0
- package/skills/pensieve-plan/SKILL.md +39 -0
- package/skills/pensieve-progress/SKILL.md +35 -0
- package/skills/pensieve-quick/SKILL.md +47 -0
- package/skills/pensieve-recon/SKILL.md +30 -0
- package/skills/pensieve-report/SKILL.md +46 -0
- package/skills/pensieve-resume/SKILL.md +33 -0
- package/skills/pensieve-retest/SKILL.md +35 -0
- package/skills/pensieve-scope/SKILL.md +35 -0
- package/skills/pensieve-surface/SKILL.md +36 -0
- package/skills/pensieve-test/SKILL.md +35 -0
- package/skills/pensieve-validate/SKILL.md +28 -0
- package/skills/pensieve-wiki/SKILL.md +39 -0
- package/src/installer/cli.cjs +209 -0
- package/src/installer/home.cjs +155 -0
- package/src/installer/runtimes.cjs +276 -0
- package/src/installer/uninstall.cjs +342 -0
- package/src/pensieve-sdk/bin/pensieve-sdk.cjs +1045 -0
- package/src/pensieve-sdk/lib/agent-translate.cjs +50 -0
- package/src/pensieve-sdk/lib/approvals.cjs +408 -0
- package/src/pensieve-sdk/lib/audit.cjs +290 -0
- package/src/pensieve-sdk/lib/checklist.cjs +337 -0
- package/src/pensieve-sdk/lib/clientlist.cjs +814 -0
- package/src/pensieve-sdk/lib/close.cjs +133 -0
- package/src/pensieve-sdk/lib/config.cjs +156 -0
- package/src/pensieve-sdk/lib/cvss.cjs +91 -0
- package/src/pensieve-sdk/lib/env.cjs +272 -0
- package/src/pensieve-sdk/lib/evidence.cjs +217 -0
- package/src/pensieve-sdk/lib/findings.cjs +1096 -0
- package/src/pensieve-sdk/lib/frontmatter.cjs +178 -0
- package/src/pensieve-sdk/lib/graph.cjs +607 -0
- package/src/pensieve-sdk/lib/ids.cjs +63 -0
- package/src/pensieve-sdk/lib/init.cjs +79 -0
- package/src/pensieve-sdk/lib/liveness.cjs +176 -0
- package/src/pensieve-sdk/lib/loop.cjs +619 -0
- package/src/pensieve-sdk/lib/migrate.cjs +57 -0
- package/src/pensieve-sdk/lib/monitor.cjs +69 -0
- package/src/pensieve-sdk/lib/pack.cjs +607 -0
- package/src/pensieve-sdk/lib/paths.cjs +73 -0
- package/src/pensieve-sdk/lib/pdf.cjs +291 -0
- package/src/pensieve-sdk/lib/recon.cjs +296 -0
- package/src/pensieve-sdk/lib/renderers/__pycache__/formal_report.cpython-314.pyc +0 -0
- package/src/pensieve-sdk/lib/renderers/formal_report.py +608 -0
- package/src/pensieve-sdk/lib/report.cjs +1135 -0
- package/src/pensieve-sdk/lib/runbook.cjs +124 -0
- package/src/pensieve-sdk/lib/sarif.cjs +154 -0
- package/src/pensieve-sdk/lib/scope.cjs +621 -0
- package/src/pensieve-sdk/lib/security.cjs +61 -0
- package/src/pensieve-sdk/lib/skills.cjs +193 -0
- package/src/pensieve-sdk/lib/state.cjs +610 -0
- package/src/pensieve-sdk/lib/subagent.cjs +658 -0
- package/src/pensieve-sdk/lib/target.cjs +149 -0
- package/src/pensieve-sdk/lib/tools.cjs +66 -0
- package/src/pensieve-sdk/lib/vault.cjs +122 -0
- package/src/pensieve-sdk/lib/vendor/cvss40.LICENSE +22 -0
- package/src/pensieve-sdk/lib/vendor/cvss40.js +1208 -0
- package/src/pensieve-sdk/package.json +11 -0
- package/templates/ACCOUNTS.md +35 -0
- package/templates/ATTACK-SURFACE.md +30 -0
- package/templates/FINDING.md +43 -0
- package/templates/PLAN.md +33 -0
- package/templates/PROJECT.md +29 -0
- package/templates/ROE.md +50 -0
- package/templates/RUN-LOG.md +19 -0
- package/templates/SCOPE.md +32 -0
- package/templates/VALIDATION.md +62 -0
- package/templates/report/REPORT.md +49 -0
- package/workflows/close.md +34 -0
- package/workflows/map.md +39 -0
- package/workflows/new-engagement.md +37 -0
- package/workflows/plan.md +45 -0
- package/workflows/progress.md +28 -0
- package/workflows/quick.md +67 -0
- package/workflows/recon.md +87 -0
- package/workflows/report.md +51 -0
- package/workflows/resume.md +26 -0
- package/workflows/retest.md +53 -0
- package/workflows/scope.md +47 -0
- package/workflows/surface.md +29 -0
- package/workflows/test.md +95 -0
- package/workflows/validate.md +34 -0
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: API6 — Unrestricted Access to Sensitive Business Flows
|
|
3
|
+
item: API6
|
|
4
|
+
description: Money-moving/limited flows automatable without velocity checks; one-time flows replayable — measure within intensity, never flood.
|
|
5
|
+
agents: [pensieve-tester]
|
|
6
|
+
pack: owasp-api-v4
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Tools
|
|
10
|
+
|
|
11
|
+
curl, ffuf, jq
|
|
12
|
+
|
|
13
|
+
## Steps
|
|
14
|
+
|
|
15
|
+
CRITICAL invariant: **MEASURE, never DoS** — parity with API4. Pin every
|
|
16
|
+
volume/rate below the PROJECT.md intensity limit (reference/param-profiles.md
|
|
17
|
+
STEALTH/NORMAL/AGGRESSIVE; AGGRESSIVE still means "no flood"). The goal is to
|
|
18
|
+
state whether a velocity/anti-automation control exists, not to abuse the flow.
|
|
19
|
+
All traffic via the engagement proxy; placeholder targets only; tokens from the
|
|
20
|
+
ACCOUNTS.md matrix.
|
|
21
|
+
|
|
22
|
+
```sh
|
|
23
|
+
export PROXY=http://127.0.0.1:8080
|
|
24
|
+
export RL=5 # requests/sec ceiling — set from PROJECT.md intensity profile
|
|
25
|
+
export N=10 # bounded repetitions — enough to prove no velocity cap, not a flood
|
|
26
|
+
|
|
27
|
+
# 1. Automate a money-moving/limited flow (purchase/transfer/promo/vote) at a
|
|
28
|
+
# paced, intensity-capped rate. Count how many the server accepts before any
|
|
29
|
+
# throttle (429/Retry-After) or business cap (per-user limit) kicks in.
|
|
30
|
+
seq "$N" | xargs -I{} -P1 sh -c '
|
|
31
|
+
curl -sS -x "$0" -X POST -H "Authorization: Bearer $1" \
|
|
32
|
+
-H "Content-Type: application/json" -d "{\"amount\":1,\"to\":\"acct-test\"}" \
|
|
33
|
+
-o /dev/null -w "flow #%{url_effective} status=%{http_code}\n" \
|
|
34
|
+
"https://$2/api/transfer"; sleep "$3"' \
|
|
35
|
+
"$PROXY" "$TOKEN_A" "$TARGET" "$(echo "scale=3; 1/$RL" | bc)"
|
|
36
|
+
|
|
37
|
+
# 2. Replay a one-time flow (coupon/OTP-verify/invite) — submit the SAME token
|
|
38
|
+
# twice and record whether the second use is rejected or silently honoured.
|
|
39
|
+
for i in 1 2; do
|
|
40
|
+
curl -sS -x "$PROXY" -X POST -H "Authorization: Bearer $TOKEN_A" \
|
|
41
|
+
-H 'Content-Type: application/json' -d '{"coupon":"ONE-TIME-TEST"}' \
|
|
42
|
+
-o "api6-replay-$i.json" -w "replay attempt $i status=%{http_code}\n" \
|
|
43
|
+
"https://$TARGET/api/coupon/redeem"
|
|
44
|
+
done
|
|
45
|
+
jq -r '.status // .error // "see body"' api6-replay-1.json api6-replay-2.json
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Expected Evidence
|
|
49
|
+
|
|
50
|
+
A velocity/replay table: one row per sensitive flow with the paced request rate
|
|
51
|
+
used (capped to the PROJECT.md intensity profile), the count accepted before any
|
|
52
|
+
throttle/business cap, and — for one-time flows — the status of the first vs.
|
|
53
|
+
second (replayed) submission. Saved request/response pairs (`api6-replay-*.json`)
|
|
54
|
+
for any flow that accepted automation or a replay. Artifacts cite evidence-ledger
|
|
55
|
+
ids.
|
|
56
|
+
|
|
57
|
+
## Pass/Fail
|
|
58
|
+
|
|
59
|
+
FINDING if a sensitive/limited flow accepts automated repetition with no velocity
|
|
60
|
+
or anti-automation control within the measured (intensity-capped) window, or a
|
|
61
|
+
one-time flow honours a replayed token on the second submission. PASS if the flow
|
|
62
|
+
enforces a per-user velocity cap / anti-automation challenge and rejects the
|
|
63
|
+
replayed one-time token (409/422/invalid). File per templates/FINDING.md.
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: API7 — Server Side Request Forgery
|
|
3
|
+
item: API7
|
|
4
|
+
description: URL-taking params coerced to internal metadata/RFC1918 or a controlled canary — out-of-scope tripwire/SCOPE.md check runs FIRST.
|
|
5
|
+
agents: [pensieve-tester]
|
|
6
|
+
pack: owasp-api-v4
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Tools
|
|
10
|
+
|
|
11
|
+
curl, ffuf, jq
|
|
12
|
+
|
|
13
|
+
## Steps
|
|
14
|
+
|
|
15
|
+
HARD invariant: the out-of-scope tripwire runs FIRST. SSRF coerces the server to
|
|
16
|
+
make requests on your behalf, so a careless probe can reach an out-of-scope host
|
|
17
|
+
through the target. **SCOPE.md wins — out-of-scope adjacency is never authorized.**
|
|
18
|
+
Confirm every canary/callback target is in SCOPE.md before ANY probe. Metadata IP
|
|
19
|
+
169.254.169.254 and RFC1918 ranges are the intended SSRF internal targets, not
|
|
20
|
+
client domains. All traffic via the engagement proxy; placeholder targets only.
|
|
21
|
+
|
|
22
|
+
```sh
|
|
23
|
+
export PROXY=http://127.0.0.1:8080
|
|
24
|
+
|
|
25
|
+
# 1. OUT-OF-SCOPE TRIPWIRE — FIRST, before any SSRF probe.
|
|
26
|
+
# The collaborator/canary host you will coerce the server to call MUST be an
|
|
27
|
+
# engagement-controlled host listed in SCOPE.md. Abort if it is not in scope.
|
|
28
|
+
export CANARY="ssrf-canary.$TARGET" # engagement-controlled; MUST be in SCOPE.md
|
|
29
|
+
grep -qiF "$CANARY" SCOPE.md || { echo "ABORT: $CANARY not in SCOPE.md — no adjacency"; exit 1; }
|
|
30
|
+
echo "tripwire OK: $CANARY is in scope"
|
|
31
|
+
|
|
32
|
+
# 2. URL-taking param -> internal metadata service (cloud credential endpoint).
|
|
33
|
+
curl -sS -x "$PROXY" -X POST -H "Authorization: Bearer $TOKEN_A" \
|
|
34
|
+
-H 'Content-Type: application/json' \
|
|
35
|
+
-d '{"image_url":"http://169.254.169.254/latest/meta-data/"}' \
|
|
36
|
+
-o api7-metadata.json -w 'metadata status=%{http_code} size=%{size_download}\n' \
|
|
37
|
+
"https://$TARGET/api/avatar/from-url"
|
|
38
|
+
|
|
39
|
+
# 3. URL-taking param -> RFC1918 internal host (webhook/import/preview params).
|
|
40
|
+
for u in "http://127.0.0.1:80/" "http://10.0.0.1/" "http://192.168.0.1/"; do
|
|
41
|
+
curl -sS -x "$PROXY" -X POST -H "Authorization: Bearer $TOKEN_A" \
|
|
42
|
+
-H 'Content-Type: application/json' -d "{\"webhook\":\"$u\"}" \
|
|
43
|
+
-o /dev/null -w "internal $u status=%{http_code} time=%{time_total}s\n" \
|
|
44
|
+
"https://$TARGET/api/webhook/test"
|
|
45
|
+
done
|
|
46
|
+
|
|
47
|
+
# 4. Blind SSRF — point the param at the in-scope canary and watch for a callback
|
|
48
|
+
# in the canary's log (out-of-band). No response body needed to confirm.
|
|
49
|
+
curl -sS -x "$PROXY" -X POST -H "Authorization: Bearer $TOKEN_A" \
|
|
50
|
+
-H 'Content-Type: application/json' -d "{\"import_url\":\"http://$CANARY/ssrf-probe\"}" \
|
|
51
|
+
-o /dev/null -w "blind-ssrf trigger status=%{http_code}\n" \
|
|
52
|
+
"https://$TARGET/api/import"
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Expected Evidence
|
|
56
|
+
|
|
57
|
+
The tripwire result (canary confirmed in SCOPE.md) recorded before any probe.
|
|
58
|
+
Saved responses for metadata/RFC1918 probes (`api7-metadata.json`) with a
|
|
59
|
+
status/size/latency table — a 200 with internal content, or a latency/behaviour
|
|
60
|
+
delta distinguishing a reachable internal host from a refused one. For blind
|
|
61
|
+
SSRF: the canary-side callback log entry (out-of-band evidence id). Artifacts
|
|
62
|
+
cite evidence-ledger ids.
|
|
63
|
+
|
|
64
|
+
## Pass/Fail
|
|
65
|
+
|
|
66
|
+
FINDING if a URL-taking parameter causes the server to fetch an internal target
|
|
67
|
+
(metadata credentials returned, RFC1918 host reachable via status/latency delta)
|
|
68
|
+
or triggers an out-of-band callback to the in-scope canary. PASS if URL inputs
|
|
69
|
+
are validated/allow-listed and internal/metadata/RFC1918 targets are refused with
|
|
70
|
+
no callback. File per templates/FINDING.md.
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: API8 — Security Misconfiguration
|
|
3
|
+
item: API8
|
|
4
|
+
description: Verbose errors/debug endpoints/default creds, permissive CORS, missing security headers, GraphQL engine exposure, and fail-open auth.
|
|
5
|
+
agents: [pensieve-tester, pensieve-reconner]
|
|
6
|
+
pack: owasp-api-v4
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Tools
|
|
10
|
+
|
|
11
|
+
curl, httpx, nuclei, graphw00f, jq
|
|
12
|
+
|
|
13
|
+
## Steps
|
|
14
|
+
|
|
15
|
+
All traffic via the engagement proxy; placeholder targets only; tokens from the
|
|
16
|
+
ACCOUNTS.md matrix. The recon-flavoured part (step 4, GraphQL engine fingerprint)
|
|
17
|
+
is for pensieve-reconner when a GraphQL signal appears; the rest is pensieve-tester.
|
|
18
|
+
|
|
19
|
+
```sh
|
|
20
|
+
export PROXY=http://127.0.0.1:8080
|
|
21
|
+
|
|
22
|
+
# 1. Verbose errors / stack traces / debug endpoints — malformed input and common
|
|
23
|
+
# debug paths; look for stack traces, framework banners, env dumps.
|
|
24
|
+
curl -sS -x "$PROXY" -H "Authorization: Bearer $TOKEN_A" \
|
|
25
|
+
-o api8-err.json -w 'err status=%{http_code}\n' \
|
|
26
|
+
"https://$TARGET/api/items?id[]=break"
|
|
27
|
+
for p in /debug /actuator/env /.env /server-status /api/__debug; do
|
|
28
|
+
curl -sS -x "$PROXY" -o /dev/null -w "$p status=%{http_code}\n" "https://$TARGET$p"
|
|
29
|
+
done
|
|
30
|
+
|
|
31
|
+
# 2. CORS — reflected origin + wildcard-with-credentials.
|
|
32
|
+
curl -sS -x "$PROXY" -D - -o /dev/null \
|
|
33
|
+
-H "Origin: https://example.com" "https://$TARGET/api/me" \
|
|
34
|
+
| grep -i '^access-control-'
|
|
35
|
+
|
|
36
|
+
# 3. Missing security headers + TLS/config drift — httpx header + tech snapshot,
|
|
37
|
+
# plus a nuclei misconfig sweep (intensity-capped tags only).
|
|
38
|
+
httpx -x "$PROXY" -u "https://$TARGET" -title -tech-detect -status-code -include-response \
|
|
39
|
+
-o api8-httpx.txt
|
|
40
|
+
nuclei -proxy "$PROXY" -u "https://$TARGET" -tags misconfig,exposure -severity medium,high \
|
|
41
|
+
-o api8-nuclei.txt
|
|
42
|
+
|
|
43
|
+
# 4. RECON (pensieve-reconner) — GraphQL engine fingerprint when /graphql signals.
|
|
44
|
+
# Engine identity picks which later attacks apply; exposure alone is API8 material.
|
|
45
|
+
graphw00f -t "https://$TARGET/graphql" -o api8-graphw00f.txt || echo "no graphql signal"
|
|
46
|
+
|
|
47
|
+
# 5. Fail-open auth (Engagement learning, F-001) — send a validly-FORMATTED but
|
|
48
|
+
# UNBOUND token, and the same request with the binding claim/header REMOVED.
|
|
49
|
+
# Acceptance where it should be rejected = fail-open misconfiguration.
|
|
50
|
+
curl -sS -x "$PROXY" -o /dev/null -w 'unbound-token status=%{http_code}\n' \
|
|
51
|
+
-H "Authorization: Bearer $TOKEN_UNBOUND" "https://$TARGET/api/me"
|
|
52
|
+
curl -sS -x "$PROXY" -o /dev/null -w 'binding-header-removed status=%{http_code}\n' \
|
|
53
|
+
-H "Authorization: Bearer $TOKEN_A" "https://$TARGET/api/me"
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## Expected Evidence
|
|
57
|
+
|
|
58
|
+
Saved error/debug responses (`api8-err.json`, debug-path status table), the CORS
|
|
59
|
+
header dump (reflected `Access-Control-Allow-Origin` + `-Allow-Credentials`),
|
|
60
|
+
`api8-httpx.txt` (header/TLS snapshot), `api8-nuclei.txt` (misconfig/exposure
|
|
61
|
+
hits), `api8-graphw00f.txt` (engine fingerprint, if any), and the fail-open
|
|
62
|
+
status pair from step 5. Artifacts cite evidence-ledger ids.
|
|
63
|
+
|
|
64
|
+
## Pass/Fail
|
|
65
|
+
|
|
66
|
+
FINDING if any of: stack traces/debug endpoints/default creds are exposed; CORS
|
|
67
|
+
reflects an arbitrary origin with credentials allowed; security headers are
|
|
68
|
+
missing or TLS config drifts; a GraphQL engine/introspection is exposed with
|
|
69
|
+
reachable sensitive data; or auth fails open on an unbound/binding-removed token
|
|
70
|
+
(200 where 401 is required). PASS if errors are generic, debug paths 404, CORS is
|
|
71
|
+
allow-listed without credentials, required headers are present, and auth rejects
|
|
72
|
+
unbound/binding-missing tokens (401). File per templates/FINDING.md.
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: API9 — Improper Inventory Management
|
|
3
|
+
item: API9
|
|
4
|
+
description: Old/unversioned endpoints alive, staging/swagger/GraphQL introspection exposed, undocumented hosts from recon not in the client inventory.
|
|
5
|
+
agents: [pensieve-tester, pensieve-reconner]
|
|
6
|
+
pack: owasp-api-v4
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Tools
|
|
10
|
+
|
|
11
|
+
curl, httpx, ffuf, graphw00f, httpie, jq
|
|
12
|
+
|
|
13
|
+
## Steps
|
|
14
|
+
|
|
15
|
+
All traffic via the engagement proxy; placeholder targets only; tokens from the
|
|
16
|
+
ACCOUNTS.md matrix. This is recon-flavoured (pensieve-reconner builds the inventory
|
|
17
|
+
diff; pensieve-tester judges reachability). Judge API9 by DATA reachable through an
|
|
18
|
+
exposed surface, not by introspection/exposure alone. SCOPE.md wins — undocumented
|
|
19
|
+
hosts are finding material, reported not exploited beyond scope.
|
|
20
|
+
|
|
21
|
+
```sh
|
|
22
|
+
export PROXY=http://127.0.0.1:8080
|
|
23
|
+
|
|
24
|
+
# 1. Old/unversioned endpoints still alive — probe v1 vs v2 (and no-version) for
|
|
25
|
+
# the same route; an older version answering is deprecated-surface material.
|
|
26
|
+
for v in "" "v1/" "v2/" "v3/" "internal/" "beta/"; do
|
|
27
|
+
curl -sS -x "$PROXY" -H "Authorization: Bearer $TOKEN_A" \
|
|
28
|
+
-o /dev/null -w "ver=${v:-none} status=%{http_code} size=%{size_download}\n" \
|
|
29
|
+
"https://$TARGET/api/${v}orders/1001"
|
|
30
|
+
done
|
|
31
|
+
|
|
32
|
+
# 2. Staging/docs/swagger surface — ffuf a doc/version wordlist; httpx to capture
|
|
33
|
+
# status/size/title baseline for anything that answers.
|
|
34
|
+
ffuf -x "$PROXY" -u "https://$TARGET/FUZZ" -w api-inventory.txt \
|
|
35
|
+
-mc 200,301,302,401,403 -o api9-ffuf.json -of json
|
|
36
|
+
httpx -x "$PROXY" -l api9-hosts.txt -status-code -title -tech-detect -o api9-httpx.txt
|
|
37
|
+
|
|
38
|
+
# 3. GraphQL introspection exposed — fingerprint the engine, then probe the schema.
|
|
39
|
+
# Introspection ENABLED is API9 material; judge by the sensitive fields exposed.
|
|
40
|
+
graphw00f -t "https://$TARGET/graphql" -o api9-graphw00f.txt || echo "no graphql signal"
|
|
41
|
+
http -b --proxy https:"$PROXY" POST "https://$TARGET/graphql" \
|
|
42
|
+
query='{ __schema { types { name } } }' > api9-introspection.json
|
|
43
|
+
jq '.data.__schema.types | length' api9-introspection.json
|
|
44
|
+
|
|
45
|
+
# 4. Undocumented hosts — diff the recon/ host inventory against the client's own
|
|
46
|
+
# documented inventory; hosts present in recon but NOT in the client list are
|
|
47
|
+
# finding material (confirm each is in SCOPE.md before probing — no adjacency).
|
|
48
|
+
comm -23 <(sort -u recon/hosts.txt) <(sort -u client-inventory.txt) > api9-undocumented.txt
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Expected Evidence
|
|
52
|
+
|
|
53
|
+
An endpoint/host inventory diff: the version-probe status/size table (which old/
|
|
54
|
+
unversioned routes answer), `api9-ffuf.json`/`api9-httpx.txt` for exposed docs/
|
|
55
|
+
staging surface, `api9-graphw00f.txt` + `api9-introspection.json` (engine +
|
|
56
|
+
schema type count) when GraphQL is present, and `api9-undocumented.txt` listing
|
|
57
|
+
hosts in recon/ absent from the client inventory. Each exposed surface cites the
|
|
58
|
+
DATA reachable through it. Artifacts cite evidence-ledger ids.
|
|
59
|
+
|
|
60
|
+
## Pass/Fail
|
|
61
|
+
|
|
62
|
+
FINDING if a deprecated/unversioned endpoint, staging/swagger surface, or exposed
|
|
63
|
+
GraphQL introspection serves reachable sensitive data, or if recon surfaces an
|
|
64
|
+
in-scope host the client did not document. PASS if only current, documented,
|
|
65
|
+
inventoried endpoints answer and introspection/docs expose no reachable sensitive
|
|
66
|
+
data. File per templates/FINDING.md.
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# Thick-client — core checklist (traffic, binary protections, files/IPC, reversing)
|
|
2
|
+
|
|
3
|
+
| ID | Category | Status | Finding |
|
|
4
|
+
|----|----------|--------|---------|
|
|
5
|
+
| TC1 | Traffic interception and protocol analysis | | |
|
|
6
|
+
| TC2 | Binary protections (packing, anti-debug, anti-reverse) | | |
|
|
7
|
+
| TC3 | Local storage (files, IPC, shared storage) | | |
|
|
8
|
+
| TC4 | Authentication (local, token, keychain) | | |
|
|
9
|
+
| TC5 | Reverse engineering (decompiler, symbol recovery) | | |
|
|
10
|
+
| TC6 | Network and endpoint (C2, beaconing, outbound) | | |
|
|
11
|
+
| TC7 | Supply chain (code signing, integrity) | | |
|
|
12
|
+
|
|
13
|
+
## TC1 — Traffic interception and protocol analysis
|
|
14
|
+
|
|
15
|
+
- test: mitmproxy / mitm4android on the client — capture all traffic; report any cleartext or unencrypted protocol
|
|
16
|
+
- test: TLS version and cert — verify TLS 1.2+ and that the client validates the certificate (no skip, no custom trust)
|
|
17
|
+
- test: custom protocol / binary protocol — if the client uses a binary or custom protocol, capture and report if it is unauthenticated or cleartext
|
|
18
|
+
- test: outbound to unknown host — report any outbound connection to a host outside the known API set (C2 candidate)
|
|
19
|
+
|
|
20
|
+
## TC2 — Binary protections (packing, anti-debug, anti-reverse)
|
|
21
|
+
|
|
22
|
+
- test: packer detection — report if the binary is packed (UPX, Themida, VMProtect, etc.) and whether the packer is removable
|
|
23
|
+
- test: anti-debug — report if the client detects a debugger / frida / mitmproxy and degrades (e.g., stops, throws)
|
|
24
|
+
- test: anti-tamper / integrity check — report if the client verifies its own integrity and what happens on a tamper
|
|
25
|
+
- test: anti-reverse — report if the client obfuscates strings, uses a custom VM, or has a hard-to-parse control flow
|
|
26
|
+
|
|
27
|
+
## TC3 — Local storage (files, IPC, shared storage)
|
|
28
|
+
|
|
29
|
+
- test: local files / database — enumerate the client's data dir; report any cleartext PII, tokens, or keys in files or SQLite
|
|
30
|
+
- test: IPC — report any shared storage, content provider, or binder that exposes client state to other processes
|
|
31
|
+
- test: file permissions — report any client file with world-readable or world-writable permissions
|
|
32
|
+
- test: temp / scratch files — report if the client writes sensitive data to a world-readable temp path
|
|
33
|
+
|
|
34
|
+
## TC4 — Authentication (local, token, keychain)
|
|
35
|
+
|
|
36
|
+
- test: local auth / biometrics — report if the client does not require local auth to unlock a sensitive screen
|
|
37
|
+
- test: token / keychain — report if the token is stored in plaintext, or in a world-readable file, or in memory without protection
|
|
38
|
+
- test: MFA — verify whether MFA is enforced on sensitive actions; report if optional or skippable
|
|
39
|
+
- test: session persistence — report if the session survives app kill without re-auth
|
|
40
|
+
|
|
41
|
+
## TC5 — Reverse engineering (decompiler, symbol recovery)
|
|
42
|
+
|
|
43
|
+
- test: decompiler — run a decompiler (jadx / ghidra / radare2) on the client; report if the binary is unobfuscated or if symbols are recoverable
|
|
44
|
+
- test: symbol / string recovery — report if sensitive strings (API keys, endpoints, tokens) are recoverable from the binary
|
|
45
|
+
- test: dynamic vs static — verify whether the client detects dynamic analysis (frida, mitm, debugger) and how it reacts
|
|
46
|
+
|
|
47
|
+
## TC6 — Network and endpoint (C2, beaconing, outbound)
|
|
48
|
+
|
|
49
|
+
- test: C2 / beaconing — report any periodic outbound connection to an unknown host (beacon, C2)
|
|
50
|
+
- test: outbound policy — report if the client can reach an external host that is not in the known API set
|
|
51
|
+
- test: DNS / resolver — verify the client does not leak hostnames to a resolver outside the expected set
|
|
52
|
+
- test: local network discovery — report if the client scans the local network (Nmap-like) without scope
|
|
53
|
+
|
|
54
|
+
## TC7 — Supply chain (code signing, integrity)
|
|
55
|
+
|
|
56
|
+
- test: code signing — verify the client binary is signed and that the signature is valid and not tampered
|
|
57
|
+
- test: integrity verification — report if the client does not verify its own signature or integrity on startup
|
|
58
|
+
- test: updates — report if the client can download and run an update without signature verification
|
|
59
|
+
|
|
60
|
+
## Engagement learnings
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
name: Thick-client core (traffic, binary protections, files/IPC, reversing)
|
|
2
|
+
slug: thickclient/thickclient-core
|
|
3
|
+
version: "1.0"
|
|
4
|
+
tier: DEFAULT
|
|
5
|
+
applies_to:
|
|
6
|
+
- web
|
|
7
|
+
- api
|
|
8
|
+
- gray
|
|
9
|
+
- white
|
|
10
|
+
- black
|
|
11
|
+
- infra
|
|
12
|
+
source: practice-internal (custom + reversing conventions; see thickclient skill)
|
|
13
|
+
license: internal
|
|
14
|
+
tools:
|
|
15
|
+
- mitmproxy|A|apt|mitmproxy
|
|
16
|
+
- wireshark|A|apt|wireshark
|
|
17
|
+
- gdb|A|apt|gdb
|
|
18
|
+
- strace|A|apt|strace
|
|
19
|
+
- radare2|A|apt|radare2
|
|
20
|
+
- xxd|A|builtin|xxd
|
|
21
|
+
- nmap|A|builtin|nmap
|
|
22
|
+
- ghidra|B|host-manual|host-bound decompiler (JVM; see thickclient skill)
|
|
23
|
+
checklist: checklist.md
|
|
24
|
+
notes: "Thick-client lane: traffic interception, binary protections, file and IPC and shared storage, local auth, and reversing. Lane-B tools (ghidra/IDA-class) are host-bound and declared in the plan. Name the CWE and the technique in each finding."
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# ASVS Level 2 — Verification Checklist
|
|
2
|
+
|
|
3
|
+
Status: `-` untested · `~` in progress · `x` tested-clean · `F-NNN` finding
|
|
4
|
+
(ASVS 4.x category ids kept for traceability; L2 = most apps with sensitive data.)
|
|
5
|
+
|
|
6
|
+
| ID | Area | Status | Notes |
|
|
7
|
+
|----|------|--------|-------|
|
|
8
|
+
| V2-AUTH-01 | Credential controls: throttling, breach-corpus denial, no default creds | - | |
|
|
9
|
+
| V2-AUTH-02 | MFA/step-up on sensitive functions | - | |
|
|
10
|
+
| V2-AUTH-LIVE | Login-path liveness gate: assert the genuine auth-stage marker before ANY auth-surface conclusion | - | |
|
|
11
|
+
| V2-AUTH-RATE | Real-path rate limiting: nonexistent-user burst on the genuine crypto path, distinct statuses + timing | - | |
|
|
12
|
+
| V2-AUTH-ENUM | User-enumeration differential: existing vs nonexistent response BYTES at the same stage | - | |
|
|
13
|
+
| V2-AUTH-MFA | Per-account MFA enforcement: test every ACCOUNTS row; single-account verdicts generalize wrongly | - | |
|
|
14
|
+
| V3-SESS-01 | Session tokens: CSPRNG entropy, rotation on login/priv-change, idle+absolute timeout | - | |
|
|
15
|
+
| V3-SESS-02 | Logout invalidates server-side; back-button/cache tests | - | |
|
|
16
|
+
| V4-ACCL-01 | Access control server-side on every function+data ref (IDOR/BOLA sweep) | - | |
|
|
17
|
+
| V4-ACCL-02 | Privilege escalation: vertical (user→admin) and horizontal (user→user, tenant→tenant) | - | |
|
|
18
|
+
| V5-VALI-01 | Input validation: server-side, allowlist; type/format/length per field | - | |
|
|
19
|
+
| V5-VALI-02 | Injection sweep: SQLi, NoSQLi, OS cmd, LDAP, template (SSTI), XSS (reflected/stored/DOM) | - | |
|
|
20
|
+
| V7-ERRL-01 | Error handling: no stack traces/secrets; consistent responses (no oracle) | - | |
|
|
21
|
+
| V8-DATA-01 | Sensitive data at rest: classification respected, no secrets in client code/logs | - | |
|
|
22
|
+
| V9-COMM-01 | Transport: TLS1.2+, HSTS, no sensitive data in URL | - | |
|
|
23
|
+
| V10-MALI-01 | File upload: type/content validation, storage outside webroot, AV/quarantine | - | |
|
|
24
|
+
| V12-FILE-01 | Path traversal/LFI/RFI on file params and download endpoints | - | |
|
|
25
|
+
| V13-API-01 | API: schema enforcement, content-type checks, rate limits, versioning exposure | - | |
|
|
26
|
+
| V14-CONF-01 | Config: headers (CSP/XFO/XCTO/Referrer-Policy), debug off, default pages removed | - | |
|
|
27
|
+
|
|
28
|
+
## Per-item guidance
|
|
29
|
+
|
|
30
|
+
- AUTH LANE RULE (V2-AUTH-LIVE..MFA): liveness first — before ANY auth-surface
|
|
31
|
+
conclusion, assert the request produced a genuine auth-stage marker (the
|
|
32
|
+
app's real error code / stage transition in the body). A naive POST without
|
|
33
|
+
the client crypto is SILENTLY IGNORED by crypto-gated logins (the page just
|
|
34
|
+
re-renders) — such a run proves nothing, and a negative naive-POST burst is
|
|
35
|
+
INVALID evidence. Rate-limit and enumeration verdicts are only valid on a
|
|
36
|
+
path proven LIVE.
|
|
37
|
+
- V2-AUTH-RATE: never a real account in the burst; single-attempt-then-stop
|
|
38
|
+
when touching real credentials; obey PROJECT.md intensity.
|
|
39
|
+
- V2-AUTH-ENUM: the oracle is reported only with a body-quoted differential —
|
|
40
|
+
response bytes, not status codes.
|
|
41
|
+
- V2-AUTH-MFA: MFA enforcement differs per account/role — test each row of the
|
|
42
|
+
ACCOUNTS.md matrix (MFA columns) and record which accounts enforce.
|
|
43
|
+
- V4-ACCL-01: enumerate object ids from recon; replay cross-account (needs the account matrix, ADR-010).
|
|
44
|
+
- V5-VALI-02: sqlmap only with plan approval + non-destructive flags; SSTI probe with arithmetic payloads first.
|
|
45
|
+
- V13-API-01: diff OpenAPI vs observed endpoints; undocumented = finding candidate (CWE-1059-class).
|
|
46
|
+
|
|
47
|
+
## Engagement learnings
|
|
48
|
+
|
|
49
|
+
- test: V3-SESS-01: confirm session/token tokens carry caller-binding (IPHash / session) and are rejected when the binding claim is absent or mismatches; a missing binding that is silently skipped is a defect. Source: captcha-bound-tokens-20260929 (F-001).
|
|
50
|
+
- test: V8-DATA-01: confirm signing secrets are not stored as plaintext in source code, logs, or client bundles; verify rotation + external secret store. Source: captcha-bound-tokens-20260929 (F-001).
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
# Engagement learnings — candidate pool
|
|
2
|
+
|
|
3
|
+
_appended by pensieve-sdk pack.learn; promoted into the checklist by the pack author (ADR-022)_
|
|
4
|
+
|
|
5
|
+
- L-001 [promoted] (2026-09-30) V3-SESS-01: confirm session/token tokens carry caller-binding (IPHash / session) and are rejected when the binding claim is absent or mismatches; a missing binding that is silently skipped is a defect. Source: captcha-bound-tokens-20260929 (F-001).
|
|
6
|
+
- L-002 [promoted] (2026-09-30) V8-DATA-01: confirm signing secrets are not stored as plaintext in source code, logs, or client bundles; verify rotation + external secret store. Source: captcha-bound-tokens-20260929 (F-001).
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
name: ASVS Level 2 (web/API verification)
|
|
2
|
+
slug: web/asvs-l2
|
|
3
|
+
version: "1.0"
|
|
4
|
+
tier: DEEP
|
|
5
|
+
applies_to:
|
|
6
|
+
- web
|
|
7
|
+
- api
|
|
8
|
+
- gray
|
|
9
|
+
- white
|
|
10
|
+
source: https://owasp.org/www-project-application-security-verification-standard/
|
|
11
|
+
license: CC-BY-SA-4.0 (document); structure adapted for PENSIEVE
|
|
12
|
+
tools:
|
|
13
|
+
- curl|A|builtin|curl
|
|
14
|
+
- httpx|A|builtin|httpx
|
|
15
|
+
- nuclei|A|builtin|nuclei
|
|
16
|
+
- ffuf|A|builtin|ffuf
|
|
17
|
+
- sqlmap|A|builtin|sqlmap
|
|
18
|
+
checklist: checklist.md
|
|
19
|
+
notes: ASVS 4.x L2 categories as verification lanes. Deeper than the default web pack — use for regulated/standard engagements.
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: V2-AUTH-ENUM — User-enumeration differential
|
|
3
|
+
item: V2-AUTH-ENUM
|
|
4
|
+
description: Existing vs nonexistent username at the SAME auth stage — compare response BYTES, not status codes; report the oracle only with a body-quoted differential.
|
|
5
|
+
agents: [pensieve-tester]
|
|
6
|
+
pack: web/asvs-l2
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Tools
|
|
10
|
+
|
|
11
|
+
curl, jq, cmp/diff
|
|
12
|
+
|
|
13
|
+
## Steps
|
|
14
|
+
|
|
15
|
+
PREREQUISITE: V2-AUTH-LIVE proved the request shape LIVE. Enumeration
|
|
16
|
+
evidence is a BODY differential at the same auth stage — status codes are
|
|
17
|
+
deliberately uniform in most hardened apps while the bodies still leak. On
|
|
18
|
+
a not-live path any negative is INVALID evidence (the naive POST never
|
|
19
|
+
reached the auth stage), so no differential can be read at all.
|
|
20
|
+
|
|
21
|
+
```sh
|
|
22
|
+
export PROXY=http://127.0.0.1:8080
|
|
23
|
+
export TS=$(date -u +%Y%m%dT%H%M%SZ)
|
|
24
|
+
|
|
25
|
+
# 1. LIVENESS GATE (V2-AUTH-LIVE) — confirm BOTH probe requests below land at
|
|
26
|
+
# the same auth stage: the genuine auth-stage marker must appear in each
|
|
27
|
+
# body before any differential is read. A differential between two
|
|
28
|
+
# DIFFERENT stages is noise, not an oracle.
|
|
29
|
+
|
|
30
|
+
# 2. DIFFERENTIAL PAIR — identical request shape, existing vs nonexistent
|
|
31
|
+
# username. Existing account: ONE wrong-password attempt only
|
|
32
|
+
# (single-attempt-then-stop; never the real password, never a repeat).
|
|
33
|
+
curl -sS -x "$PROXY" -o authenum-exists-$TS.json \
|
|
34
|
+
-w 'exists status=%{http_code} bytes=%{size_download} time=%{time_total}\n' \
|
|
35
|
+
-H 'Content-Type: application/json' \
|
|
36
|
+
-d '{"username":"'"$USER_A"'","password":"<wrong-once>","<crypto fields>":"<genuine>"}' \
|
|
37
|
+
https://$TARGET/login
|
|
38
|
+
curl -sS -x "$PROXY" -o authenum-nosuch-$TS.json \
|
|
39
|
+
-w 'nosuch status=%{http_code} bytes=%{size_download} time=%{time_total}\n' \
|
|
40
|
+
-H 'Content-Type: application/json' \
|
|
41
|
+
-d '{"username":"nosuchuser-xyz","password":"<wrong-once>","<crypto fields>":"<genuine>"}' \
|
|
42
|
+
https://$TARGET/login
|
|
43
|
+
|
|
44
|
+
# 3. BYTE-LEVEL DIFFERENTIAL — bytes first (not status codes), then body diff:
|
|
45
|
+
cmp -l authenum-exists-$TS.json authenum-nosuch-$TS.json | wc -l # differing byte count
|
|
46
|
+
diff <(jq -S . authenum-exists-$TS.json) <(jq -S . authenum-nosuch-$TS.json) \
|
|
47
|
+
| tee authenum-diff-$TS.txt
|
|
48
|
+
# nonce/echo fields (request ids, timestamps) must be excluded before the
|
|
49
|
+
# verdict — re-diff with them stripped if the ONLY differences look echoed:
|
|
50
|
+
diff <(jq -S 'del(.requestId,.timestamp,.nonce)' authenum-exists-$TS.json) \
|
|
51
|
+
<(jq -S 'del(.requestId,.timestamp,.nonce)' authenum-nosuch-$TS.json)
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Expected Evidence
|
|
55
|
+
|
|
56
|
+
The `authenum-exists-$TS.json` / `authenum-nosuch-$TS.json` pair, the
|
|
57
|
+
`-w` bytes/status/time line for each, and `authenum-diff-$TS.txt`.
|
|
58
|
+
WHICH LINES MATTER: the byte counts (`bytes=`), and any diff line whose
|
|
59
|
+
left/right values differ in MESSAGE CONTENT — a different error code, a
|
|
60
|
+
different message key, an extra field (e.g. a password-stage prompt that
|
|
61
|
+
only appears for real accounts), or a meaningful timing gap (existing users
|
|
62
|
+
often take measurably longer — password hashing runs only for them).
|
|
63
|
+
Echoed nonce fields explain away a diff; strip and re-diff before deciding.
|
|
64
|
+
|
|
65
|
+
## Pass/Fail
|
|
66
|
+
|
|
67
|
+
FINDING (enumeration oracle, CWE-204/203) only with a BODY-QUOTED
|
|
68
|
+
differential at the same auth stage: the finding quotes both bodies (the
|
|
69
|
+
```body-quote convention per the 21-01 controls) and names the exact marker
|
|
70
|
+
that distinguishes existing from nonexistent. A status-code difference
|
|
71
|
+
ALONE is not sufficient evidence. PASS when the bodies are byte-identical
|
|
72
|
+
after nonce-stripping AND no timing gap — but only on a path V2-AUTH-LIVE
|
|
73
|
+
proved LIVE; on a not-live path the verdict is INCONCLUSIVE, never PASS.
|
|
74
|
+
GUARDRAILS: one attempt per username; the existing-account attempt uses a
|
|
75
|
+
wrong password exactly once and stops.
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: V2-AUTH-LIVE — Login-path liveness gate
|
|
3
|
+
item: V2-AUTH-LIVE
|
|
4
|
+
description: Assert the genuine auth-stage marker before ANY auth-surface conclusion — a naive POST without the client crypto is silently ignored and a negative naive-POST burst is INVALID evidence.
|
|
5
|
+
agents: [pensieve-tester]
|
|
6
|
+
pack: web/asvs-l2
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Tools
|
|
10
|
+
|
|
11
|
+
curl, jq, the engagement browser (through the proxy) for flow capture
|
|
12
|
+
|
|
13
|
+
## Steps
|
|
14
|
+
|
|
15
|
+
THE GATE RUNBOOK: run this FIRST on every authentication surface (login,
|
|
16
|
+
OTP verify, password reset, step-up). V2-AUTH-RATE, V2-AUTH-ENUM and
|
|
17
|
+
V2-AUTH-MFA interpret results ONLY on a path this gate proved LIVE. Status
|
|
18
|
+
codes lie — the marker lives in the BODY.
|
|
19
|
+
|
|
20
|
+
```sh
|
|
21
|
+
export PROXY=http://127.0.0.1:8080 # engagement proxy from PROJECT.md
|
|
22
|
+
export TS=$(date -u +%Y%m%dT%H%M%SZ)
|
|
23
|
+
export MARKER_FILE=authlive-marker-$TS.env
|
|
24
|
+
|
|
25
|
+
# 1. LIVENESS GATE — capture the GENUINE auth-stage marker from one real
|
|
26
|
+
# failed login of a test account from the ACCOUNTS.md matrix (single
|
|
27
|
+
# attempt, then stop — never repeat with real credentials).
|
|
28
|
+
# Drive the app's own login UI once through the proxy (browser or app
|
|
29
|
+
# replay), save the request it actually sends, and note the body marker:
|
|
30
|
+
# the app's real error CODE key, a stage/transaction id, or a
|
|
31
|
+
# localized message key — NOT the HTTP status, NOT the re-rendered page.
|
|
32
|
+
curl -sS -x "$PROXY" -o authlive-genuine-$TS.json \
|
|
33
|
+
-w 'genuine status=%{http_code} time=%{time_total}\n' \
|
|
34
|
+
-H 'Content-Type: application/json' \
|
|
35
|
+
-d '{"username":"'"$USER_A"'","password":"<the genuine request shape incl. client crypto fields>"}' \
|
|
36
|
+
https://$TARGET/login
|
|
37
|
+
# extract candidate marker keys/lines for the ledger:
|
|
38
|
+
jq -r 'paths(scalars) as $p | "\($p|join(".")) = \(getpath($p))"' authlive-genuine-$TS.json \
|
|
39
|
+
| tee authlive-marker-lines-$TS.txt
|
|
40
|
+
printf 'AUTH_STAGE_MARKER=<paste the genuine marker line here>\n' > "$MARKER_FILE"
|
|
41
|
+
|
|
42
|
+
# 2. NAIVE POST — same endpoint, deliberately WITHOUT the client crypto
|
|
43
|
+
# (no encrypted-password field, no challenge/device token, plain form
|
|
44
|
+
# fields), nonexistent username:
|
|
45
|
+
curl -sS -x "$PROXY" -o authlive-naive-$TS.txt \
|
|
46
|
+
-w 'naive status=%{http_code} size=%{size_download} time=%{time_total}\n' \
|
|
47
|
+
--data-urlencode 'username=nosuchuser-xyz' --data-urlencode 'password=x' \
|
|
48
|
+
https://$TARGET/login
|
|
49
|
+
|
|
50
|
+
# 3. MARKER CHECK — does the naive response body carry the genuine marker?
|
|
51
|
+
source "$MARKER_FILE"
|
|
52
|
+
grep -c "$AUTH_STAGE_MARKER" authlive-naive-$TS.txt \
|
|
53
|
+
| tee authlive-verdict-$TS.txt # 0 => the naive POST never reached the auth stage
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## Expected Evidence
|
|
57
|
+
|
|
58
|
+
The capture pair `authlive-genuine-$TS.json` + `authlive-naive-$TS.txt`, the
|
|
59
|
+
marker-lines extraction, and the `authlive-verdict-$TS.txt` grep count.
|
|
60
|
+
WHICH LINES MATTER: the marker line in the genuine body (e.g. an error-code
|
|
61
|
+
key like `{"errorCode":"AUTH-1001"}` or a stage transition token), and that
|
|
62
|
+
same line present-or-absent in the naive body. The genuine request shape
|
|
63
|
+
(with crypto fields redacted to names only) goes in the run notes — later
|
|
64
|
+
auth-lane runbooks replay it.
|
|
65
|
+
|
|
66
|
+
## Pass/Fail
|
|
67
|
+
|
|
68
|
+
This item is a GATE, not a finding. LIVE: the naive POST reproduces the
|
|
69
|
+
genuine auth-stage marker — the endpoint accepts unencrypted requests, and
|
|
70
|
+
V2-AUTH-RATE / V2-AUTH-ENUM may run against this request shape. NOT LIVE:
|
|
71
|
+
the naive POST returns the page re-render / silent ignore (no marker) —
|
|
72
|
+
crypto-gated login. Then EVERY negative result on the naive shape is
|
|
73
|
+
INVALID evidence: never report "no rate limit" or "no enumeration
|
|
74
|
+
difference" from it. Instead re-derive the genuine request (extract the
|
|
75
|
+
client crypto — password encryption, challenge tokens, device attestation —
|
|
76
|
+
from the app bundle/JS) and re-run this gate. TRAP: a 200 + re-rendered
|
|
77
|
+
login page LOOKS like "wrong password" but actually proves the request
|
|
78
|
+
never entered the auth stage at all.
|