Skip to main content
skill CX Codex

authenticated-session-acquisition — Claude Code skill: MFA

The authenticated-session-acquisition skill obtains a legitimate MFA/OTP session and saves reusable artifacts for browser and post-auth API testing.

MIT 126 installs ★ 632 updated 2026-07-29

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add transilienceai/communitytools --skill authenticated-session-acquisition -a claude-code
Open on GitHub

What authenticated-session-acquisition does

The skill signs in to an authorized target through SMS OTP or TOTP MFA, then writes two reusable files: Playwright storageState.json with cookies and localStorage, plus bearer.txt containing the access or ID token and expires_at. Executors receive file paths rather than inline credentials, so secrets stay out of prompts and engagement notes.

It supports three operating modes. A Base32 TOTP seed is handled with tools/totp_now.py <BASE32_SEED>; an operator can enter a one-time code; or the browser context can pause before the challenge and resume later. Reference recipes cover Auth0, Okta, Amazon Cognito, and Descope. Without a test account, TOTP seed, or a way to relay the OTP, the post-auth area is recorded as deferred instead of being marked covered.

What it helps with

  • acquire a test session behind SMS OTP or TOTP MFA
  • export cookies and localStorage for Playwright flows
  • hand a Bearer token to direct API executors
  • verify an authorized request before post-auth testing

Example prompts for the agent

  • Acquire a session for the test tenant through TOTP and save the artifacts under OUTPUT_DIR/<asset>/session/.
  • Drive the login to the OTP step, enter the operator-provided code, and export storageState.json and bearer.txt.
  • Verify one authorized request, then give the post-auth executors the artifact paths.

How to install authenticated-session-acquisition

1Skills CLI (Vercel)

npx skills add transilienceai/communitytools --skill authenticated-session-acquisition -a claude-code

2Manually: put the files in place

~/.claude/skills/authenticated-session-acquisition/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/authenticated-session-acquisition/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about authenticated-session-acquisition

How do I install authenticated-session-acquisition in Claude Code?

Run npx skills add transilienceai/communitytools --skill authenticated-session-acquisition -a claude-code, then check ~/.claude/skills/authenticated-session-acquisition/SKILL.md.

What does authenticated-session-acquisition do?

It obtains a legitimate session through MFA or OTP and exports storageState.json for Playwright plus bearer.txt for direct API replay. It does not attack the authentication mechanism.

Which MFA workflows does the skill support?

It can generate TOTP from a Base32 seed with tools/totp_now.py, accept a one-time code from an operator, or resume after a paused OTP step. The reference flows cover Auth0, Okta, Amazon Cognito, and Descope.

Source text

SKILL.md · MIT
---
name: authenticated-session-acquisition
description: Acquire an authenticated session THROUGH MFA/OTP on an in-scope target and emit a reusable session artifact (Playwright storageState + Bearer) so executors can test the post-auth attack surface. Use when the highest-value authenticated classes (BOLA/IDOR/mass-assignment/injection on the real data APIs) are blocked because login is gated by SMS-OTP or TOTP MFA. Distinct from the authentication skill (which ATTACKS auth); this one legitimately authenticates and hands the session to the rest of the engagement.
---

# Authenticated Session Acquisition

On financial and multi-tenant targets the login is gated by SMS OTP / TOTP MFA that an autonomous run cannot satisfy, so the post-auth surface (BOLA/IDOR/mass-assignment/injection on the real data APIs, session handling, API pivots) silently collapses to pre-auth findings only. This skill's job is narrow and concrete: **get one legitimate authenticated session and hand it to the executors as a reusable artifact.** It does not attack the auth mechanism — see [`authentication`](../authentication/SKILL.md) for that.

## The artifact contract (how the session reaches executors)

Emit both, into the engagement's OUTPUT_DIR, referenced BY NAME (never inline secrets — [`credential-loading.md`](../coordination/reference/credential-loading.md)):

- `OUTPUT_DIR/<asset>/session/storageState.json` — the Playwright storage state (cookies + localStorage) for browser-driven post-auth testing.
- `OUTPUT_DIR/<asset>/session/bearer.txt` — the raw access/ID token (+ its `expires_at`) for direct API replay.

Executors consume these exactly like any env-loaded secret: the scope file's `creds_env` names the realm, and the session path is passed as a file reference, so no token is ever written into a prompt, `experiments.md`, or `attack-chain.md`. Re-run this skill when the token expires (record `expires_at`; refresh rather than re-login where a refresh token exists).

## Modes (pick by what the client can provide)

| Mode | When | How |
|------|------|-----|
| **TOTP-from-seed** | The client shared the TOTP secret (Base32 seed) for a test account | Generate the current code deterministically with [`tools/totp_now.py`](../../tools/totp_now.py) `<BASE32_SEED>`, submit it in the login flow. Fully autonomous, repeatable. |
| **Explicit-OTP** | The operator can read a one-time code (SMS/email/authenticator) at run time | Drive login to the OTP prompt, the operator supplies the code once, continue. |
| **Human-in-the-loop resume** | OTP arrives out-of-band and the run must pause | Persist the pre-OTP browser context, pause; the operator completes the challenge; resume and capture `storageState`. |

## Provider recipes

Detailed per-IdP flows are in [`reference/session-acquisition.md`](reference/session-acquisition.md): **Auth0**, **Okta**, **Amazon Cognito** (SRP auth + the UNSIGNED unauthenticated-posture check), and **Descope**. Each recipe ends by exporting `storageState.json` + `bearer.txt` in the contract above.

## When a session cannot be acquired — defer honestly, do not fake

If no test account / OTP seed is available and no OTP can be relayed, the realm's post-auth surface is untestable **through no fault of the tester**. Record it honestly instead of a fabricated `NA` or a silent miss:

1. File a client-input request at `reports/client-input-requests/CIR-NNN.md` naming exactly what's needed ("needs test account / OTP seed / allowlist for `<realm>`").
2. Set a realm-level `BLOCKED_REASON` in `attack-chain.md`.
3. Mark that realm's post-auth coverage cells `status:"deferred"` in `coverage.json`, each carrying `deferral_reason` + `client_input_request` (the CIR path) — see [`coverage-matrix.md`](../coordination/reference/coverage-matrix.md). The deterministic gate then discloses the deferred surface in the report rather than hiding it, and only the parent orchestrator (via `coverage_gate.py --accept-deferrals`) may finalize a substantiated-deferred engagement. A scope that is *entirely* auth-gated never completes.

The preflight cred-reach probe ([`preflight-checklist.md`](../coordination/reference/preflight-checklist.md), Phase-1 gate) is what triggers this path: present creds are not working creds; verify reachability per realm before spawning post-auth executors.

## Workflow

1. Read the scope: which realms/tenants are in `creds_env`, which assets are behind them, `roe.reversible_writes` for the test tenant.
2. Identify the IdP (login redirect host / `/.well-known/openid-configuration` / SDK bundle) → pick the recipe.
3. Acquire the session in the appropriate mode → write `storageState.json` + `bearer.txt`.
4. Verify: one minimal authenticated request returns an authorized response (not 401/403/login-redirect).
5. Hand the artifact paths to the post-auth executor batch; on failure, run the defer path above.

## Anti-Patterns

- Do not paste tokens, seeds, or cookies into prompts, `experiments.md`, `attack-chain.md`, or any `tools/*.md` — reference the artifact file by path only.
- Do not brute-force or bypass the OTP/MFA challenge here — that is an `authentication` finding, not session acquisition.
- Do not mark an MFA-blocked cell `covered`/`NA` — mark it `deferred` with a filed CIR so the gate discloses it.
- Do not test outside the authenticated tenant you were given, and honor `roe.reversible_writes` (create-then-delete only in your own test tenant).

## Reference

- [`reference/session-acquisition.md`](reference/session-acquisition.md) — per-IdP acquisition recipes (Auth0 / Okta / Cognito / Descope) + the storageState/Bearer export.
- [`tools/totp_now.py`](../../tools/totp_now.py) — stdlib RFC-6238 TOTP generator (the TOTP-from-seed mode).

© transilienceai · MIT · transilienceai/communitytools

Similar skills

All skills for Security →

From the same set42

The whole set →
pentest-engagement pentest-engagement runs scoped penetration tests on web applications or networks, verifies findings immediately, and produces a structured PDF report. CX Codex +1 157installs regression-sweep regression-sweep is a Claude Code skill that rechecks confirmed vulnerabilities weekly for patches, mitigations, and re-introductions. It runs on Mondays or manually after major deployments. CX Codex +1 149installs ti-ingest ti-ingest parses threat-intel payloads with CVEs and affected assets into queue files for validation agents. CX Codex +1 147installs pci-secure-software Checks an app against PCI Secure Software Standard v2.0 and returns a status for every Test Requirement, tied to a cited line of code or docs. CX Codex +1 141installs cloud-defense cloud-defense maps post-compromise cloud attack stages to log signals and preventive controls. Use it for AWS, Azure, and GCP detection work or posture reviews. CX Codex +1 133installs transilience-report-style transilience-report-style is a Claude Code skill that defines styling for Threat Intelligence reports generated as A4 PDFs with ReportLab. Light theme is the default. CX Codex +1 133installs network-appliance-offensive network-appliance-offensive — a skill for active security testing of firewalls, VPN endpoints, and network appliances. CX Codex +1 120installs protect-with-password protect-with-password — a skill for Claude Code produces a secure password and locks specified files using AES-256. Triggers when encrypting deliverable documents prior to sharing. CX Codex +1 115installs

Project sponsors

Companies that keep this analytics open