Skip to content

Phase 2 — Attack

Phase 2 generates authorized browser behavior against the protected application. Phase 1 must be complete. This phase does not create, update, or delete infrastructure.

Step 8: Run the deterministic browser generator

Section titled “Step 8: Run the deterministic browser generator”
Terminal window
open -na "Google Chrome" --args \
--remote-debugging-port=9222 \
--user-data-dir="$TMPDIR/csd-demo-chrome"

Node.js 22 or newer is required. The runner owns an isolated context/page and leaves Chrome running.

Terminal window
node scripts/csd-traffic.mjs --list

The output must list exactly: login-credential-skimmer, registration-harvester, payment-overlay-card-skimmer, obfuscated-loader, multi-cdn-injection, tag-manager-hijack, multi-channel-exfiltration, high-volume-domain-exfiltration, form-overlay, keylogger-simulation, and maximum-detection.

Terminal window
mkdir -p .artifacts/csd
node scripts/csd-traffic.mjs \
--scenario login-credential-skimmer \
--cdp-endpoint http://127.0.0.1:9222 \
--timeout 30s \
--settle 10s \
--receipt .artifacts/csd/phase-2-login-credential-skimmer.json

--scenario is repeatable when a focused run needs more than one scenario. An execution accepts one selector form only: repeated --scenario or --all. There is no default execution selector.

Terminal window
node scripts/csd-traffic.mjs \
--scenario maximum-detection \
--receipt .artifacts/csd/phase-2-maximum-detection.json

Use --all only when every independent scenario is required:

Terminal window
node scripts/csd-traffic.mjs \
--all \
--receipt .artifacts/csd/phase-2-all.json

--timeout bounds runner operations. --settle only collects late browser events; neither option promises platform timing. A custom target requires --target plus exact repeatable --allow-host values. Unsafe redirects and final origins fail closed.

To stream a receipt, use --receipt -. Stdout contains only JSON and human logs use stderr:

Terminal window
node scripts/csd-traffic.mjs \
--scenario maximum-detection \
--receipt - \
| jq '{schema_version, run_id, requested_scenarios, success, eventual_csd_evidence}'
Terminal window
jq '{
schema_version, run_id, started_at, ended_at, duration_ms,
tool, requested_scenarios, target, allowlist, cdp_endpoint,
scenarios: [.scenarios[] | {
name, target, status, immediate_evidence, dom_cleanup, console, network,
protected_document, instrumentation, cleanup, error, success, eventual_csd_evidence
}],
success, caveats, error, eventual_csd_evidence
}' .artifacts/csd/phase-2-maximum-detection.json
Immediate checkRequired result
Target/documentExact authorized HTTPS top-frame origin and expected route
Protected pageReady, with __imp_apg__ present
Scenario executionRequired assertions, synthetic native-setter markers where applicable, and terminal Log/console markers
Candidate requestsActual response, loading failure, or timed-out terminal state retained per attempt
High-volume scenarioExactly five script attempts plus two POST attempts
Overlay/keyloggerGeometry/removal or aggregate periodic POST-count evidence only; no entered values
CleanupDOM artifacts, listeners, timers, target, and context cleaned up
Aggregatesuccess, caveats, and error independent from eventual_csd_evidence

A requested destination receives an atomic receipt even after execution or cleanup failure. The primary error remains in error; runner cleanup failures remain in cleanup.errors. A candidate CDN failure remains observed browser evidence and is never converted to a successful load.

Terminal window
node scripts/csd-traffic.mjs \
--print-script maximum-detection \
> .artifacts/csd/maximum-detection.browser.js

Review the generated file and paste it into DevTools Console on the documented route. --print-script is the only manual payload source. Manual execution cannot prove the automated receipt or cleanup contract.

Step 9: Run explicit post-receipt CSD reads

Section titled “Step 9: Run explicit post-receipt CSD reads”

The runner has no embedded/raw API client. Begin only after the immediate receipt passes. Use separate read-only xcsh_api operations scoped to the receipt’s start/end window, protected origin, and exact reviewed Network hosts. Keep the result under eventual_csd_evidence and label each surface OBSERVED, NOT_OBSERVED, PENDING, or ERROR.

StateMeaning
OBSERVEDA matching reviewed record is present in the queried window.
NOT_OBSERVEDThe completed query returned no matching record.
PENDINGMore observation is planned; no timing promise is implied.
ERRORThe API read failed or returned unusable evidence.

The browser run remains successful when correlation is pending, empty, or unavailable. Correlation does not prove deterministic latency, complete coverage, or causation.

Test IDCheckGate
BROWSER-1Authorized final HTTPS origin and protected document readyRequired
BROWSER-2__imp_apg__ presentRequired
BROWSER-3Immediate assertions plus Page/Runtime/Network/Log evidence in receiptRequired
BROWSER-4Deterministic cleanup completedRequired
BROWSER-5Browser dip request observedRecord PASS/PENDING; investigate absence before customer claims
DET-1Matching script recordsOBSERVED / NOT_OBSERVED / PENDING / ERROR
DET-2Observed subset of candidate domainsNever require every candidate
DET-3Matching detected-domain entryRequired only by the Phase 3 mitigation workflow
DET-4Matching form-field entriesOptional; overlay/keylogger claims remain browser-limited

Proceed to Phase 3 — Mitigate only when its explicit detected-domain prerequisite is satisfied. Otherwise Phase 2 can still be a successful browser run with platform evidence pending.