Back to catalog
Static reviewDevelopment

Skill dossier

attacking-oauth-with-device-code-phishing

Source declaration

Run OAuth 2.0 device-code and illicit-consent phishing attacks against Microsoft Entra ID, using TokenTactics-style tooling to steal access and refresh tokens, bypass MFA, and pivot across Microsoft 365 services. Use for authorized red-team engagements simulating device-code or consent-grant phishing against a tenant you have explicit written permission to test.

The author's original description, preserved in English. It describes intent, not verified performance.

Run OAuth 2.0 device-code and illicit-consent phishing attacks against Microsoft Entra ID, using TokenTactics-style tooling to steal access and refresh tokens, bypass MFA, and pivot across Microsoft 365 services. Use for authorized red-team engagements simulating device-code or consent-grant phishing against a tenant you have explicit written permission to test.

developmentreferencesscripts

Research summary

Machine-generated analysis; pending human review

These observations come from deterministic source parsing, not a human security review or controlled task evaluation.

Run OAuth 2.0 device-code and illicit-consent phishing attacks against Microsoft Entra ID, using TokenTactics-style tooling to steal access and refresh tokens, bypass MFA, and pivot across Microsoft 365 services. Use for authorized red-team engagements simulating device-code or consent-grant phishing against a tenant you have explicit written permission to test. This bilingual summary is generated deterministically from collected source text and file structure; it is pending human editorial review.

Review scope

Deterministic static analysis of collected SKILL.md and supporting text/code. Machine-assisted candidates and findings await human editorial review; no dynamic behavior or effect is assessed.

Observable capabilities

  • Workflow [Source statement; provisional, not tested. Evidence: skills/attacking-oauth-with-device-code-phishing/SKILL.md:L83]

Limitations & scope

  • Static analysis cannot assess runtime behavior, command success, network reachability, or model output quality.
  • No commands, scripts, network requests, model calls, or controlled skill executions were performed.
  • Category, tags, capabilities, workflows, and bilingual editorial summaries are deterministic candidates pending human review, not verified outcomes.
  • Exact token counts are unavailable until a later pipeline performs and records an official model-specific count.

Relevant for

  • Practitioners evaluating whether to inspect and install the source skill; this audience is inferred from the product context, not measured usage. [Evidence: skills/attacking-oauth-with-device-code-phishing/SKILL.md:L1-L26]

What ships with the skill

The file inventory comes from the collected source at the recorded commit. Paths and sizes are structural observations, not a measure of quality.

files
5
Markdown files
3
scripts
1
references
2
Size
36.9 KB
Structural complexity
Low

File inventory

PathTypeBytes
skills/attacking-oauth-with-device-code-phishing/LICENSEOther11 KB
skills/attacking-oauth-with-device-code-phishing/references/api-reference.mdReference3 KB
skills/attacking-oauth-with-device-code-phishing/references/standards.mdReference1.5 KB
skills/attacking-oauth-with-device-code-phishing/scripts/agent.pyScript6.5 KB
skills/attacking-oauth-with-device-code-phishing/SKILL.mdInstruction14.8 KB

SKILL.md frontmatter

{
  "name": "attacking-oauth-with-device-code-phishing",
  "description": "Run OAuth 2.0 device-code and illicit-consent phishing attacks against Microsoft Entra ID, using TokenTactics-style tooling to steal access and refresh tokens, bypass MFA, and pivot across Microsoft 365 services. Use for authorized red-team engagements simulating device-code or consent-grant phishing against a tenant you have explicit written permission to test.",
  "domain": "cybersecurity",
  "subdomain": "identity-access-management",
  "tags": [
    "device-code-phishing",
    "oauth",
    "entra-id",
    "token-theft",
    "mfa-bypass",
    "illicit-consent",
    "tokentactics",
    "red-team"
  ],
  "version": "1.0",
  "author": "mahipal",
  "license": "Apache-2.0",
  "nist_csf": [
    "PR.AA-03"
  ],
  "mitre_attack": [
    "T1528"
  ]
}

A reading of the operating sequence

This workflow reconstructs the apparent sequence from source material. Unless controlled evaluation is explicitly recorded, it is provisional—not an observed trace.

  1. 01
    Action

    Overview

    Source-described action candidate under “Overview”; not verified execution.

  2. 02
    Decision

    When to Use

    Source-described decision candidate under “When to Use”; not verified execution.

  3. 03
    Action

    Objectives

    Source-described action candidate under “Objectives”; not verified execution.

  4. 04
    Action

    MITRE ATT&CK Mapping

    Source-described action candidate under “MITRE ATT&CK Mapping”; not verified execution.

  5. 05
    Action

    Workflow

    Source-described action candidate under “Workflow”; not verified execution.

  6. 06
    Action

    Request a device code directly via the token endpoint:

    Source-described action candidate under “Phase 1: Initiate the Device-Code Request”; not verified execution.

Inspect all extracted workflow candidates (27 candidate steps)
  1. 07
    Action

    The JSON response contains the fields you weaponize:

    Source-described action candidate under “Phase 1: Initiate the Device-Code Request”; not verified execution.

  2. 08
    Action

    Note the 15-minute (`expiresin: 900`) validity window — the pretext must drive the victim to authenticate quickly.

    Source-described action candidate under “Phase 1: Initiate the Device-Code Request”; not verified execution.

  3. 09
    Action

    Craft a pretext that references the genuine `https://microsoft.com/devicelogin` URL and the `usercode` (e.g., "IT is enrolling your account in the new Teams Rooms device; open microsoft.com/devicelogin and enter code B7HVQXKZ2 within 15 minutes").

    Source-described action candidate under “Phase 2: Deliver the Pretext”; not verified execution.

  4. 10
    Output

    Send through sanctioned phishing infrastructure. Hyperlinked codes/URLs frequently land in spam, so present the URL and code as plain text.

    Source-described output candidate under “Phase 2: Deliver the Pretext”; not verified execution.

  5. 11
    Action

    Time delivery to the start of a polling cycle so the code is fresh.

    Source-described action candidate under “Phase 2: Deliver the Pretext”; not verified execution.

  6. 12
    Action

    Poll at the server-specified `interval` (5 seconds); `authorizationpending` is expected until the victim completes sign-in:

    Source-described action candidate under “Phase 3: Poll and Capture Tokens”; not verified execution.

  7. 13
    Action

    On success the response yields `accesstoken`, `refreshtoken`, `idtoken`, `expiresin`, and the granted `scope`.

    Source-described action candidate under “Phase 3: Poll and Capture Tokens”; not verified execution.

  8. 14
    Action

    Decode the access token to confirm the captured identity, audience, and scopes:

    Source-described action candidate under “Phase 3: Poll and Capture Tokens”; not verified execution.

  9. 15
    Action

    Use TokenTactics refresh functions to pivot the refresh token to specific services:

    Source-described action candidate under “Phase 4: Refresh Across Microsoft 365 Resources”; not verified execution.

  10. 16
    Action

    Equivalently with roadtx, redeem the refresh token for a new resource:

    Source-described action candidate under “Phase 4: Refresh Across Microsoft 365 Resources”; not verified execution.

  11. 17
    Input

    Demonstrate mailbox access to prove impact (read-only, scoped to engagement rules):

    Source-described input candidate under “Phase 4: Refresh Across Microsoft 365 Resources”; not verified execution.

  12. 18
    Input

    Register a multi-tenant app in an attacker tenant requesting delegated scopes such as `Mail.Read`, `Files.ReadWrite.All`, `offlineaccess`.

    Source-described input candidate under “Phase 5: Illicit Consent Grant Variant”; not verified execution.

  13. 19
    Action

    Build a user-consent URL and phish it:

    Source-described action candidate under “Phase 5: Illicit Consent Grant Variant”; not verified execution.

  14. 20
    Decision

    When the victim consents, exchange the returned `code` for tokens:

    Source-described decision candidate under “Phase 5: Illicit Consent Grant Variant”; not verified execution.

  15. 21
    Action

    The consented OAuth grant persists as a service-principal grant in the victim tenant until an admin revokes it (`Remove-MgServicePrincipalOauth2PermissionGrant`).

    Source-described action candidate under “Phase 5: Illicit Consent Grant Variant”; not verified execution.

  16. 22
    Action

    Authenticate roadrecon with the captured token / refresh token and dump the directory:

    Source-described action candidate under “Phase 6: Enumerate Impact with ROADtools”; not verified execution.

  17. 23
    Action

    Identify high-value access: role assignments, owned applications, accessible SharePoint sites, and additional consent grants.

    Source-described action candidate under “Phase 6: Enumerate Impact with ROADtools”; not verified execution.

  18. 24
    Output

    Record exactly what data and roles the stolen tokens reached for the engagement report.

    Source-described output candidate under “Phase 6: Enumerate Impact with ROADtools”; not verified execution.

  19. 25
    Action

    Tools and Resources

    Source-described action candidate under “Tools and Resources”; not verified execution.

  20. 26
    Action

    Defensive Recommendations

    Source-described action candidate under “Defensive Recommendations”; not verified execution.

  21. 27
    Action

    Validation Criteria

    Source-described action candidate under “Validation Criteria”; not verified execution.

Potential risk surfaces

Static findings identify points to inspect before installation. They do not establish that a skill is safe, malicious, or effective.

Attention recommended

60 deterministic lexical finding(s) require review across the collected text. Findings can occur in documentation and do not prove execution or exploitability; binary-only files were not scanned.

Network accessObserved
File writesObserved
Credential useObserved
Medium

Network access is mentioned

40 occurrences

A URL or network client appears in this source line. Review destinations, data sent, and trust boundaries; static text cannot establish actual network activity. This rule matched 40 location(s) in the collected text; 3 representative location(s) are cited. Matching text may be documentation, and the analyzer did not execute it.

Note

File modification is described or implemented

19 occurrences

This line contains a possible file-write or redirection operation. Check destination paths and overwrite behavior; the static review did not write any file. This rule matched 19 location(s) in the collected text; 3 representative location(s) are cited. Matching text may be documentation, and the analyzer did not execute it.

High

Credential or secret material is referenced

This line resembles a credential literal or reads a sensitive environment value. Do not expose its contents; verify whether it is a placeholder, required secret, or accidentally committed material. This rule matched 1 location(s) in the collected text; 1 representative location(s) are cited. Matching text may be documentation, and the analyzer did not execute it.

Where context can be spent

Discovery, activation, and resource layers have different meanings. Exact values appear only when the official token-counting method was run with a named model.

Exact token counts unavailable

All token values, including per-file inventory, are null until the pipeline performs an official exact count with an explicit model.

No token measurement was recorded with the required official method. This dossier does not substitute character counts, file sizes, or estimates.

Controlled evaluation

No controlled evaluation

This skill has only the evidence identified above. No task success, token efficiency, latency, or quality advantage is claimed.

Not tested

Use with the source in view

Install command
Inspect the pinned source at https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/54a798831d2266a3ca61ce68a7acb80b81160d57/skills/attacking-oauth-with-device-code-phishing/SKILL.md and follow the source repository's installation instructions. No installation was performed or verified by this static analyzer. Source license: Apache-2.0.

Prerequisites

  • Static analysis cannot assess runtime behavior, command success, network reachability, or model output quality.
  • No commands, scripts, network requests, model calls, or controlled skill executions were performed.
  • Category, tags, capabilities, workflows, and bilingual editorial summaries are deterministic candidates pending human review, not verified outcomes.
  • Exact token counts are unavailable until a later pipeline performs and records an official model-specific count.

Example prompts

Not provided

A decision, with its limits attached

Strengths

  • The snapshot contains 5 collected file(s), 3 Markdown file(s), and 1 script file(s), enabling source-level inspection. [Evidence: skills/attacking-oauth-with-device-code-phishing/SKILL.md:L1]

Considerations

  • No functional, security, or model-quality result has been established. Human review must inspect source context and all cited findings before installation or publication.
Research conclusion

Provisional deterministic static inventory only; pending human editorial review and, separately, controlled evaluation. No install recommendation, security assurance, or effectiveness claim is made.

Traceable by construction

The dossier is a time-bound reading of a public artifact, not an endorsement. Use the source link to inspect the exact upstream material.

mukul975Anthropic-Cybersecurity-Skillsskills/attacking-oauth-with-device-code-phishing
Source type
Community
Commit
54a798831d2266a3ca61ce68a7acb80b81160d57
Collected
20 Nov 2026
Last checked
20 Nov 2026
Upstream license
Apache-2.0
Repository stars
36,446
Content basis

Deterministic lexical parsing, YAML frontmatter validation, file inventory, source-described workflow extraction, and heuristic provisional classification of the supplied files only. Generated by machine; no LLM, execution, dynamic testing, or human editorial approval.