К основному содержанию
скилл CX Codex

authenticated-session-acquisition — скилл Claude Code: MFA

Скилл authenticated-session-acquisition получает легальную сессию через MFA/OTP и сохраняет её для тестирования post-auth API и браузерных сценариев.

MIT 126 установок ★ 632 обновлён 2026-07-29

Установить в Claude Code · Через Skills CLI (Vercel) Все способы и платформы ↓
npx skills add transilienceai/communitytools --skill authenticated-session-acquisition -a claude-code
Открыть на GitHub

Что делает authenticated-session-acquisition

Скилл проходит вход в разрешённый тестовый контур через SMS OTP или TOTP MFA, затем сохраняет два артефакта: storageState.json с cookies и localStorage для Playwright и bearer.txt с access/ID token и expires_at для повторных API-запросов. Пути передаются исполнителям как ссылки на файлы, поэтому токены не попадают в промпты и отчётные файлы.

Режим выбирается по доступам клиента: TOTP из Base32 seed генерируется через tools/totp_now.py <BASE32_SEED>, одноразовый код вводит оператор, либо запуск ставится на паузу до завершения MFA. В справочнике есть рецепты для Auth0, Okta, Amazon Cognito и Descope. Без тестового аккаунта, seed или канала передачи OTP post-auth поверхность помечается как deferred, а не как пройденная.

Какие задачи решает

  • получить тестовую сессию после SMS OTP или TOTP MFA
  • сохранить cookies и localStorage для Playwright
  • передать Bearer-токен исполнителям API-тестов
  • проверить авторизованный запрос до запуска post-auth проверок

Примеры запросов агенту

  • Получи сессию для тестового тенанта через TOTP и сохрани артефакты в OUTPUT_DIR/<asset>/session/.
  • Проведи вход через OTP, дождись кода оператора и экспортируй storageState.json и bearer.txt.
  • Проверь минимальный авторизованный запрос и передай пути к артефактам исполнителям post-auth тестов.

Как установить authenticated-session-acquisition

1Через Skills CLI (Vercel)

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

2Вручную: положить файлы

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

Папка скилла целиком; для одного проекта — .claude/skills/authenticated-session-acquisition/

По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов

Вопросы об authenticated-session-acquisition

Как установить authenticated-session-acquisition в Claude Code?

Выполните npx skills add transilienceai/communitytools --skill authenticated-session-acquisition -a claude-code, затем проверьте файл ~/.claude/skills/authenticated-session-acquisition/SKILL.md.

Что делает authenticated-session-acquisition?

Скилл получает легальную MFA/OTP-сессию и экспортирует storageState.json для Playwright и bearer.txt для прямого повторения API-запросов. Он не атакует механизм аутентификации.

Какие способы прохождения MFA поддерживает скилл?

Есть режим TOTP из Base32 seed через tools/totp_now.py, ввод одноразового кода оператором и возобновление после паузы перед OTP. Для сценариев описаны Auth0, Okta, Amazon Cognito и Descope.

Исходный текст

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

Похожие скиллы

Все скиллы по теме «Безопасность» →
playwright-testing laurigates Скилл playwright-testing помогает писать E2E-тесты для веб-приложений в Playwright: проверять браузеры, мобильные viewport, API и визуальные снимки. CX Codex +1 106установок playwright-cli microsoft Скилл playwright-cli для Claude Code управляет браузером, проверяет веб-страницы и работает с тестами Playwright. Агент подключает его для действий на странице и запуска браузерных проверок. CX Codex +1 221 700установок playwright-generate-test официальный github Скилл playwright-generate-test создаёт Playwright-тест по сценарию через Playwright MCP. Подходит, когда нужно пройти сценарий в браузере перед генерацией кода. CX Codex +1 18 162установок playwright-explore-website официальный github Скилл playwright-explore-website исследует сайт через Playwright MCP, фиксирует пользовательские сценарии и предлагает тест-кейсы. Подходит для первичной проверки интерфейса. CX Codex +1 14 792установок Browser Automation Claude Office Skills Скилл Browser Automation для Claude Code управляет браузером через Puppeteer/Playwright: открывает страницы, нажимает элементы и извлекает данные. Включается для скрейпинга, проверок и автоматизации веб-сценариев. CX Codex +1 5 400установок web-debug sentimony Скилл web-debug запускает проверки локальных веб-приложений через Playwright: ищет проблемы в интерфейсе, собирает логи браузера и делает скриншоты. CX Codex +1 4 500установок

Из того же набора42

Весь набор →
pentest-engagement Скилл pentest-engagement проводит пентест веб-приложений или сканирование сети по заданному скоупу, проверяет уязвимости и собирает отчёт в PDF. CX Codex +1 157установок regression-sweep Скилл regression-sweep для Claude Code еженедельно перепроверяет подтверждённые уязвимости и выявляет дрейф: исправления, смягчения или возвращения. Запускается по понедельникам или вручную после крупного патча. CX Codex +1 149установок ti-ingest Скилл ti-ingest преобразует отчёты о CVE и затронутых активах в очередь задач для пайплайна валидации эксплойтов. CX Codex +1 147установок pci-secure-software Скилл pci-secure-software прогоняет приложение по каталогу Test Requirement из PCI SSS v2.0 и выдаёт по каждому вердикт со ссылкой на строку кода или документ. CX Codex +1 141установок cloud-defense Скилл cloud-defense для Claude Code сопоставляет этапы атаки после компрометации облака с сигналами журналов и мерами защиты. Аудирует AWS, Azure и GCP. CX Codex +1 133установок transilience-report-style Скилл transilience-report-style для Claude Code задаёт оформление отчётов Threat Intelligence при генерации PDF формата A4 через ReportLab. По умолчанию используется светлая тема. CX Codex +1 133установок network-appliance-offensive Скилл network-appliance-offensive для активного тестирования периметровых экранов, VPN и прочих сетевых приборов. CX Codex +1 120установок protect-with-password Скилл protect-with-password для Claude Code генерирует надёжный пароль и шифрует указанные файлы алгоритмом AES-256. Включается по запросу защитить документы перед передачей. CX Codex +1 115установок

Спонсоры проекта

Компании, которые помогают держать аналитику открытой