attacking-oauth-with-device-code-phishing

attacking-oauth-with-device-code-phishing is a skill for Claude Code, Codex from Youngmaidainon/Agent-Level-Up. It costs 80 tokens per session (3,559 once invoked), scanned A, original, MIT.

A guide to testing OAuth device-code and consent phishing against Microsoft Entra ID, Microsoft's cloud identity service. It describes how an attacker may trick a user into granting access, for authorized red-team work only.

In plain words
What is it for?
Use it in an approved security assessment to simulate device-code phishing, test MFA-related defenses, and examine access to Microsoft 365 services.
Why use it?
It helps defenders understand and validate weaknesses in identity sign-in and consent processes without treating unauthorized access as acceptable.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is pwsh -c "Import-Module ./TokenTactics/TokenTactics.psd1".

Good fit Use it in an approved security assessment to simulate device-code phishing, test MFA-related defenses, and examine access to Microsoft 365 services.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/Youngmaidainon/Agent-Level-Up
agentmods
npx agentmods add skills/youngmaidainon/agent-level-up/attacking-oauth-with-device-code-phishing

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for attacking-oauth-with-device-code-phishing

README.md
[![agentmods](https://agentmods.dev/badge/skills/youngmaidainon/agent-level-up/attacking-oauth-with-device-code-phishing.svg)](https://agentmods.dev/skills/youngmaidainon/agent-level-up/attacking-oauth-with-device-code-phishing)
Your own site
<a href="https://agentmods.dev/skills/youngmaidainon/agent-level-up/attacking-oauth-with-device-code-phishing"><img src="https://agentmods.dev/badge/skills/youngmaidainon/agent-level-up/attacking-oauth-with-device-code-phishing.svg" alt="Measured on agentmods" height="20"></a>
Per session 80 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,559 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00080 $0.03559
Opus 5 $0.00040 $0.01780
Sonnet 5 $0.00016 $0.00712
Haiku 4.5 $0.00008 $0.00356

Measured 4d ago against content hash 822446dc67a8, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

attacking-oauth-with-device-code-phishing scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/agent.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

curl -s -X POST \
cyber-security/ctf/attacking-oauth-with-device-code-phishing/SKILL.md · 246 lines

How it starts

The opening of the file, as written. The whole thing — 246 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Attacking OAuth with Device-Code Phishing

Legal Notice: This skill is for authorized security testing, red-team engagements, and educational purposes only. Device-code and consent-grant phishing manipulate real users into authorizing attacker-controlled access to corporate identities. Execute only against tenants you own or have explicit written authorization (rules of engagement) to test. Unauthorized use violates the Computer Fraud and Abuse Act and equivalent laws worldwide.

Overview

The OAuth 2.0 Device Authorization Grant (RFC 8628) was designed for input-constrained devices (smart TVs, CLI tools) that cannot easily present a browser-based login. A device requests a short user_code and a device_code, displays the user_code and a verification URL to the user, and polls the token endpoint while the user authenticates on a separate, fully-featured device. Attackers weaponize this flow: instead of a smart TV, the "device" is the attacker's machine. The attacker initiates the device-code request, then phishes a victim to visit the legitimate Microsoft verification page (https://microsoft.com/devicelogin) and enter the attacker-generated user_code. Because the victim authenticates on the genuine Microsoft login page — completing MFA — the resulting tokens are minted to the attacker's polling session. This bypasses MFA entirely: the second factor is satisfied by the victim, but the bearer tokens land with the attacker (mapped to MITRE ATT&CK T1528 – Steal Application Access Token).

Microsoft Threat Intelligence, Volexity, and Proofpoint documented sharp growth in device-code phishing through 2025, with Russia-aligned actors (tracked by Microsoft as Storm-2372) among the most prolific. Mandiant's M-Trends reporting similarly highlights OAuth token theft as a leading cloud initial-access vector. A closely related technique is the illicit consent grant ("OAuth phishing"): the attacker registers a multi-tenant app and tricks the victim into clicking an /adminconsent or user-consent URL, granting the malicious app delegated Microsoft Graph permissions (Mail.Read, Files.ReadWrite.All, offline_access) that persist independently of password resets. This skill covers both, plus token replay across Microsoft 365 services using TokenTactics and validation/access mapping with ROADtools.

Read the full file on GitHub · 246 lines

Files

What ships with it

3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 246 lines · 80 tokens per session scan A 822446dc67a8

Subscribe to this mod's changes

attacking-oauth-with-device-code-phishing is a skill published in the GitHub repository Youngmaidainon/Agent-Level-Up (3 stars, last pushed 13d ago), licensed MIT. It adds 80 tokens to every session and 3,559 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

detecting-oauth-token-theft

Detects and responds to OAuth token theft and replay attacks in cloud environments, focusing on Microsoft Entra ID (Azure AD) token protection, conditional access policies, and sign-in anomaly detection. Covers access token theft, refresh token replay, Primary Refresh Token (PRT) abuse, and pass-the-cookie attacks.…

xalgorix/xalgorix · 97 tokens

detecting-suspicious-oauth-application-consent

Detect risky OAuth application consent grants in Azure AD / Microsoft Entra ID using Microsoft Graph API, audit logs, and permission analysis to identify illicit consent grant attacks.

xalgorix/xalgorix · 44 tokens

hunting-saas-sso-token-abuse

Detect SSO and OAuth token replay and SaaS lateral movement.

adriannoes/awesome-agentic-ai · 23 tokens

azure-ad-illicit-consent-grant

Exploit Illicit Consent Grants in Azure Active Directory (Entra ID). This skill covers crafting a malicious OAuth application to trick victims into granting broad permissions (like reading emails, modifying files) without requiring their password or MFA.

ShulkwiSEC/bb-huge · 56 tokens

azure-ad-illicit-consent-grant

Exploit Illicit Consent Grants in Azure Active Directory (Entra ID). This skill covers crafting a malicious OAuth application to trick victims into granting broad permissions (like reading emails, modifying files) without requiring their password or MFA.

akashrpatil/awesome-offensive-security-skills · 56 tokens

update-llms

Updates the llms.txt file to reflect changes in documentation. Use when editing repository details or specifications. For creating from scratch, see create-llms.

tuliosousapro/SaaS-blueprint · 36 tokens