[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6ETPH9C6ES52X4CGV4F8CV2":3,"skill-same:01M6ETPH9C6ES52X4CGV4F8CV2":91},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":39,"linkOnly":40,"markdownContent":41,"markdownBody":42,"frontMatter":43,"refName":52,"commitSha":53,"skillDirectory":54,"forksCount":55,"repositoryHtmlUrl":56,"repositoryHomepageUrl":6,"ownerHtmlUrl":57,"ownerBlogUrl":6,"ownerDescription":58,"updatedAt":59,"install":60,"resources":73},"01M6ETPH9C6ES52X4CGV4F8CV2","detecting-oauth-token-theft",null,"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. Activates for requests involving OAuth token theft detection, token replay prevention, Azure AD conditional access token protection, or cloud identity attack investigation.","luokai0\u002Fai-agent-skills-by-luo-kai","luokai0","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F266954973?v=4","01M6E16VNT42JB8B3X3254QWJ7","luo kai","01M6E16VTFVP6S5XJF1V1MPV90",14,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fluokai0\u002Fai-agent-skills-by-luo-kai\u002Fblob\u002Fmain\u002Fai-agent-skills\u002F21-external-registries\u002F08-pinkpixel-collection\u002Fdetecting-oauth-token-theft\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38],"detecting","token","OAuth","detecting oauth token theft","identity-security","token replay","id","replay","access","prevention","pass-the-cookie","security","token-replay","azure-ad","entra-id","cloud-security","azure","entra id","identity","cybersecurity","2026-11-10 10:12:30",false,"---\nname: detecting-oauth-token-theft\ndescription: >\n  Detects and responds to OAuth token theft and replay attacks in cloud\n  environments, focusing on Microsoft Entra ID (Azure AD) token protection,\n  conditional access policies, and sign-in anomaly detection. Covers access\n  token theft, refresh token replay, Primary Refresh Token (PRT) abuse, and\n  pass-the-cookie attacks. Activates for requests involving OAuth token theft\n  detection, token replay prevention, Azure AD conditional access token\n  protection, or cloud identity attack investigation.\ndomain: cybersecurity\nsubdomain: cloud-security\ntags: [oauth, token-theft, azure-ad, entra-id, conditional-access, token-replay, identity-security, PRT]\nversion: 1.0.0\nauthor: mahipal\nlicense: Apache-2.0\n---\n\n# Detecting OAuth Token Theft\n\n## When to Use\n\n- Investigating alerts for impossible travel or anomalous token usage in Microsoft Entra ID\n- Responding to a suspected session hijacking or pass-the-cookie attack\n- Configuring proactive defenses against OAuth token theft in an Azure\u002FM365 environment\n- Detecting OAuth device code phishing campaigns that bypass MFA\n- Analyzing sign-in logs for token replay indicators\n- Implementing Token Protection conditional access policies to bind tokens to devices\n\n**Do not use** for on-premises Kerberos ticket attacks (pass-the-ticket, golden ticket); use Active Directory-specific investigation techniques for those scenarios.\n\n## Prerequisites\n\n- Microsoft Entra ID P2 license (required for Identity Protection risk detections and conditional access)\n- Global Administrator or Security Administrator role in the Entra admin center\n- Microsoft Defender for Cloud Apps (MDCA) license for session anomaly detection\n- Access to Entra ID Sign-in Logs and Audit Logs (requires Diagnostic Settings configured to Log Analytics or Sentinel)\n- Familiarity with OAuth 2.0 authorization flows (authorization code, device code, client credentials)\n- Microsoft Sentinel or equivalent SIEM ingesting Entra ID sign-in and audit logs\n\n## Workflow\n\n### Step 1: Understand the Token Theft Attack Surface\n\nIdentify which token types are at risk and how they are stolen:\n\n```\nToken Type            | Lifetime     | Theft Vector                    | Impact\n----------------------|-------------|----------------------------------|------------------\nAccess Token          | 60-90 min   | Memory dump, proxy interception  | API access for token lifetime\nRefresh Token         | Up to 90 days| Browser cookie theft, malware   | Persistent access, new access tokens\nPrimary Refresh Token | Session-based| Mimikatz, AADInternals, malware | Full SSO to all M365\u002FAzure apps\nSession Cookie        | Varies      | XSS, browser exploit, AitM proxy | Full session hijacking\nDevice Code Token     | 15 min auth | Phishing (device code flow abuse)| Attacker gets refresh token via social engineering\n```\n\nCommon attack techniques:\n- **AitM Phishing (Adversary-in-the-Middle)**: Attacker proxies the legitimate login page via tools like Evilginx2, capturing session cookies and tokens after the user completes MFA\n- **Device Code Phishing**: Attacker generates a device code, sends it to the victim via email\u002FTeams, victim authenticates, attacker receives the token\n- **PRT Extraction**: Attacker with local admin on a device extracts the Primary Refresh Token using Mimikatz (`sekurlsa::cloudap`) or AADInternals\n- **Browser Cookie Theft**: Malware or infostealer exfiltrates browser cookies containing session tokens\n\n### Step 2: Configure Entra ID Sign-in Risk Detection\n\nEnable Identity Protection to flag anomalous token usage:\n\n```\nEntra Admin Center > Protection > Identity Protection > Risk Detections\n\nKey risk detections for token theft:\n- Anomalous Token        : Token has unusual characteristics (claim anomalies)\n- Token Issuer Anomaly   : Token issued by an unusual token issuer\n- Unfamiliar Sign-in     : Sign-in from a location not seen before for the user\n- Impossible Travel      : Sign-ins from geographically distant locations in impossible time\n- Malicious IP Address   : Sign-in from a known malicious IP\n- Suspicious Browser     : Sign-in from a suspicious or attacker-controlled browser\n```\n\nConfigure risk-based conditional access:\n\n```\nEntra Admin Center > Protection > Conditional Access > New Policy\n\nPolicy Name: \"Block High-Risk Sign-ins - Token Theft Protection\"\nAssignments:\n  Users: All users (exclude break-glass accounts)\n  Cloud Apps: All cloud apps\nConditions:\n  Sign-in Risk: High\nGrant:\n  Block access\n\nPolicy Name: \"Require MFA for Medium-Risk Sign-ins\"\nAssignments:\n  Users: All users\n  Cloud Apps: All cloud apps\nConditions:\n  Sign-in Risk: Medium\nGrant:\n  Require multifactor authentication\n  Require password change\n```\n\n### Step 3: Enable Token Protection (Preview)\n\nConfigure Token Protection to bind sign-in session tokens to the device:\n\n```\nEntra Admin Center > Protection > Conditional Access > New Policy\n\nPolicy Name: \"Enforce Token Protection for Desktop Sessions\"\nAssignments:\n  Users: All users (start with a pilot group)\n  Cloud Apps: Office 365 Exchange Online, Office 365 SharePoint Online\n  Conditions:\n    Device Platforms: Windows\nSession:\n  Require token protection for sign-in sessions (Preview): Enabled\nGrant:\n  Require device to be marked as compliant\n  OR Require Hybrid Azure AD joined device\n```\n\nToken Protection ensures that access tokens are cryptographically bound to the device's Trusted Platform Module (TPM). If an attacker steals a token and replays it from a different device, the token is rejected because the proof-of-possession key does not match.\n\n### Step 4: Detect Token Replay in Sign-in Logs\n\nQuery Entra sign-in logs for indicators of token theft:\n\n```kusto\n\u002F\u002F KQL query for Microsoft Sentinel or Log Analytics\n\u002F\u002F Detect sign-ins where the token was issued in one location and used in another\nSigninLogs\n| where TimeGenerated > ago(7d)\n| where RiskDetail contains \"token\" or RiskEventTypes_V2 has \"anomalousToken\"\n| project TimeGenerated, UserPrincipalName, IPAddress, Location,\n          RiskDetail, RiskLevelDuringSignIn, AppDisplayName,\n          DeviceDetail, ClientAppUsed, TokenIssuerType\n| sort by TimeGenerated desc\n\n\u002F\u002F Detect impossible travel with token reuse\nSigninLogs\n| where TimeGenerated > ago(7d)\n| where ResultType == 0  \u002F\u002F Successful sign-ins only\n| summarize Locations=make_set(Location), IPs=make_set(IPAddress),\n            Count=count() by UserPrincipalName, bin(TimeGenerated, 1h)\n| where array_length(Locations) > 1\n| sort by TimeGenerated desc\n\n\u002F\u002F Detect device code flow abuse (often used in phishing)\nSigninLogs\n| where TimeGenerated > ago(7d)\n| where AuthenticationProtocol == \"deviceCode\"\n| project TimeGenerated, UserPrincipalName, IPAddress, Location,\n          AppDisplayName, DeviceDetail, ResultType\n| sort by TimeGenerated desc\n\n\u002F\u002F Detect token replay: same token used from multiple IPs\nAADNonInteractiveUserSignInLogs\n| where TimeGenerated > ago(7d)\n| where ResultType == 0\n| summarize IPs=make_set(IPAddress), IPCount=dcount(IPAddress)\n            by UserPrincipalName, CorrelationId\n| where IPCount > 1\n| sort by IPCount desc\n```\n\n### Step 5: Investigate and Respond to Token Theft\n\nWhen a token theft event is detected, follow this response procedure:\n\n```powershell\n# Step 5a: Revoke all refresh tokens for the compromised user\n# Microsoft Graph PowerShell\nConnect-MgGraph -Scopes \"User.ReadWrite.All\"\nRevoke-MgUserSignInSession -UserId \"user@contoso.com\"\n\n# Step 5b: Force password reset\nUpdate-MgUser -UserId \"user@contoso.com\" -PasswordProfile @{\n    ForceChangePasswordNextSignIn = $true\n}\n\n# Step 5c: Review and revoke OAuth app consent grants\n# Check for malicious app consent (common post-compromise persistence)\nGet-MgUserOauth2PermissionGrant -UserId \"user@contoso.com\" |\n    Select-Object ClientId, ConsentType, Scope\n\n# Remove suspicious OAuth grants\nRemove-MgOauth2PermissionGrant -OAuth2PermissionGrantId \"\u003Cgrant-id>\"\n\n# Step 5d: Review enterprise app registrations for rogue apps\nGet-MgServicePrincipal -Filter \"displayName eq 'Suspicious App'\" |\n    Select-Object AppId, DisplayName, SignInAudience\n\n# Step 5e: Check for mail forwarding rules (common post-compromise action)\nGet-MgUserMailFolderRule -UserId \"user@contoso.com\" -MailFolderId \"Inbox\" |\n    Where-Object { $_.Actions.ForwardTo -ne $null -or $_.Actions.RedirectTo -ne $null }\n```\n\n### Step 6: Implement Continuous Access Evaluation (CAE)\n\nEnable CAE to revoke tokens in near-real-time when conditions change:\n\n```\nEntra Admin Center > Protection > Conditional Access > Continuous Access Evaluation\n\nSettings:\n  Strictly enforce location policies: Enabled\n\nCAE ensures that when you revoke a user's session or change their\nrisk level, the enforcement happens within minutes rather than waiting\nfor the access token to naturally expire (60-90 minutes).\n\nCritical events that trigger immediate token revocation with CAE:\n- User account disabled or deleted\n- Password changed or reset\n- MFA enabled for the user\n- Admin explicitly revokes refresh tokens\n- Azure AD Identity Protection detects elevated user risk\n- Network location change violates conditional access policy\n```\n\n### Step 7: Configure Defender for Cloud Apps Session Policies\n\nSet up real-time session monitoring to detect and block suspicious token usage:\n\n```\nMicrosoft Defender for Cloud Apps > Policies > Session Policies\n\nPolicy: \"Block download from unmanaged device with stolen token\"\n  Session Control Type: Monitor and block activities\n  Activity Source: App = Office 365, SharePoint Online\n  Activity Filter: Device tag does not equal \"Compliant\"\n  Activity Type: Download\n  Action: Block\n\nPolicy: \"Alert on mass file download (exfiltration via stolen token)\"\n  Session Control Type: Monitor only\n  Activity Source: App = Office 365\n  Activity Filter: Repeated activity > 10 downloads in 5 minutes\n  Action: Alert administrators\n```\n\n## Key Concepts\n\n| Term | Definition |\n|------|------------|\n| **Primary Refresh Token (PRT)** | A long-lived token issued to a registered device that provides SSO to all Azure AD-integrated applications, cryptographically bound to the device's TPM |\n| **Token Protection** | Entra ID conditional access feature that binds sign-in session tokens to the device, preventing replay from other devices |\n| **Continuous Access Evaluation (CAE)** | Protocol that enables near-real-time enforcement of security policies by allowing resource providers to subscribe to Entra ID critical events |\n| **AitM (Adversary-in-the-Middle)** | Phishing technique where an attacker proxies the legitimate authentication flow to capture session cookies after the victim completes MFA |\n| **Device Code Flow** | OAuth 2.0 authorization grant for input-constrained devices; abused by attackers who send device codes to victims via phishing |\n| **Proof of Possession (PoP)** | Cryptographic mechanism where a token includes a claim tied to a device key, ensuring the token can only be used by the device that obtained it |\n| **Refresh Token** | Long-lived OAuth token (up to 90 days) used to obtain new access tokens without re-authentication; primary target for persistent access |\n\n## Verification\n\n- [ ] Identity Protection risk detections are enabled and generating alerts for anomalous token activity\n- [ ] Conditional access policies block high-risk sign-ins and require MFA for medium-risk\n- [ ] Token Protection policy is applied to pilot group and confirmed working (test from unregistered device fails)\n- [ ] KQL queries in Sentinel return results when tested against synthetic token anomaly events\n- [ ] Continuous Access Evaluation is enabled and verified (revoke session, confirm access blocked within minutes)\n- [ ] Defender for Cloud Apps session policies are active and monitoring download activity\n- [ ] Device code flow is restricted via conditional access (block or require compliant device)\n- [ ] Incident response runbook includes token revocation, password reset, and OAuth consent review steps\n- [ ] Mail forwarding rules and OAuth app grants are audited for compromised accounts\n","# Detecting OAuth Token Theft\n\n## When to Use\n\n- Investigating alerts for impossible travel or anomalous token usage in Microsoft Entra ID\n- Responding to a suspected session hijacking or pass-the-cookie attack\n- Configuring proactive defenses against OAuth token theft in an Azure\u002FM365 environment\n- Detecting OAuth device code phishing campaigns that bypass MFA\n- Analyzing sign-in logs for token replay indicators\n- Implementing Token Protection conditional access policies to bind tokens to devices\n\n**Do not use** for on-premises Kerberos ticket attacks (pass-the-ticket, golden ticket); use Active Directory-specific investigation techniques for those scenarios.\n\n## Prerequisites\n\n- Microsoft Entra ID P2 license (required for Identity Protection risk detections and conditional access)\n- Global Administrator or Security Administrator role in the Entra admin center\n- Microsoft Defender for Cloud Apps (MDCA) license for session anomaly detection\n- Access to Entra ID Sign-in Logs and Audit Logs (requires Diagnostic Settings configured to Log Analytics or Sentinel)\n- Familiarity with OAuth 2.0 authorization flows (authorization code, device code, client credentials)\n- Microsoft Sentinel or equivalent SIEM ingesting Entra ID sign-in and audit logs\n\n## Workflow\n\n### Step 1: Understand the Token Theft Attack Surface\n\nIdentify which token types are at risk and how they are stolen:\n\n```\nToken Type            | Lifetime     | Theft Vector                    | Impact\n----------------------|-------------|----------------------------------|------------------\nAccess Token          | 60-90 min   | Memory dump, proxy interception  | API access for token lifetime\nRefresh Token         | Up to 90 days| Browser cookie theft, malware   | Persistent access, new access tokens\nPrimary Refresh Token | Session-based| Mimikatz, AADInternals, malware | Full SSO to all M365\u002FAzure apps\nSession Cookie        | Varies      | XSS, browser exploit, AitM proxy | Full session hijacking\nDevice Code Token     | 15 min auth | Phishing (device code flow abuse)| Attacker gets refresh token via social engineering\n```\n\nCommon attack techniques:\n- **AitM Phishing (Adversary-in-the-Middle)**: Attacker proxies the legitimate login page via tools like Evilginx2, capturing session cookies and tokens after the user completes MFA\n- **Device Code Phishing**: Attacker generates a device code, sends it to the victim via email\u002FTeams, victim authenticates, attacker receives the token\n- **PRT Extraction**: Attacker with local admin on a device extracts the Primary Refresh Token using Mimikatz (`sekurlsa::cloudap`) or AADInternals\n- **Browser Cookie Theft**: Malware or infostealer exfiltrates browser cookies containing session tokens\n\n### Step 2: Configure Entra ID Sign-in Risk Detection\n\nEnable Identity Protection to flag anomalous token usage:\n\n```\nEntra Admin Center > Protection > Identity Protection > Risk Detections\n\nKey risk detections for token theft:\n- Anomalous Token        : Token has unusual characteristics (claim anomalies)\n- Token Issuer Anomaly   : Token issued by an unusual token issuer\n- Unfamiliar Sign-in     : Sign-in from a location not seen before for the user\n- Impossible Travel      : Sign-ins from geographically distant locations in impossible time\n- Malicious IP Address   : Sign-in from a known malicious IP\n- Suspicious Browser     : Sign-in from a suspicious or attacker-controlled browser\n```\n\nConfigure risk-based conditional access:\n\n```\nEntra Admin Center > Protection > Conditional Access > New Policy\n\nPolicy Name: \"Block High-Risk Sign-ins - Token Theft Protection\"\nAssignments:\n  Users: All users (exclude break-glass accounts)\n  Cloud Apps: All cloud apps\nConditions:\n  Sign-in Risk: High\nGrant:\n  Block access\n\nPolicy Name: \"Require MFA for Medium-Risk Sign-ins\"\nAssignments:\n  Users: All users\n  Cloud Apps: All cloud apps\nConditions:\n  Sign-in Risk: Medium\nGrant:\n  Require multifactor authentication\n  Require password change\n```\n\n### Step 3: Enable Token Protection (Preview)\n\nConfigure Token Protection to bind sign-in session tokens to the device:\n\n```\nEntra Admin Center > Protection > Conditional Access > New Policy\n\nPolicy Name: \"Enforce Token Protection for Desktop Sessions\"\nAssignments:\n  Users: All users (start with a pilot group)\n  Cloud Apps: Office 365 Exchange Online, Office 365 SharePoint Online\n  Conditions:\n    Device Platforms: Windows\nSession:\n  Require token protection for sign-in sessions (Preview): Enabled\nGrant:\n  Require device to be marked as compliant\n  OR Require Hybrid Azure AD joined device\n```\n\nToken Protection ensures that access tokens are cryptographically bound to the device's Trusted Platform Module (TPM). If an attacker steals a token and replays it from a different device, the token is rejected because the proof-of-possession key does not match.\n\n### Step 4: Detect Token Replay in Sign-in Logs\n\nQuery Entra sign-in logs for indicators of token theft:\n\n```kusto\n\u002F\u002F KQL query for Microsoft Sentinel or Log Analytics\n\u002F\u002F Detect sign-ins where the token was issued in one location and used in another\nSigninLogs\n| where TimeGenerated > ago(7d)\n| where RiskDetail contains \"token\" or RiskEventTypes_V2 has \"anomalousToken\"\n| project TimeGenerated, UserPrincipalName, IPAddress, Location,\n          RiskDetail, RiskLevelDuringSignIn, AppDisplayName,\n          DeviceDetail, ClientAppUsed, TokenIssuerType\n| sort by TimeGenerated desc\n\n\u002F\u002F Detect impossible travel with token reuse\nSigninLogs\n| where TimeGenerated > ago(7d)\n| where ResultType == 0  \u002F\u002F Successful sign-ins only\n| summarize Locations=make_set(Location), IPs=make_set(IPAddress),\n            Count=count() by UserPrincipalName, bin(TimeGenerated, 1h)\n| where array_length(Locations) > 1\n| sort by TimeGenerated desc\n\n\u002F\u002F Detect device code flow abuse (often used in phishing)\nSigninLogs\n| where TimeGenerated > ago(7d)\n| where AuthenticationProtocol == \"deviceCode\"\n| project TimeGenerated, UserPrincipalName, IPAddress, Location,\n          AppDisplayName, DeviceDetail, ResultType\n| sort by TimeGenerated desc\n\n\u002F\u002F Detect token replay: same token used from multiple IPs\nAADNonInteractiveUserSignInLogs\n| where TimeGenerated > ago(7d)\n| where ResultType == 0\n| summarize IPs=make_set(IPAddress), IPCount=dcount(IPAddress)\n            by UserPrincipalName, CorrelationId\n| where IPCount > 1\n| sort by IPCount desc\n```\n\n### Step 5: Investigate and Respond to Token Theft\n\nWhen a token theft event is detected, follow this response procedure:\n\n```powershell\n# Step 5a: Revoke all refresh tokens for the compromised user\n# Microsoft Graph PowerShell\nConnect-MgGraph -Scopes \"User.ReadWrite.All\"\nRevoke-MgUserSignInSession -UserId \"user@contoso.com\"\n\n# Step 5b: Force password reset\nUpdate-MgUser -UserId \"user@contoso.com\" -PasswordProfile @{\n    ForceChangePasswordNextSignIn = $true\n}\n\n# Step 5c: Review and revoke OAuth app consent grants\n# Check for malicious app consent (common post-compromise persistence)\nGet-MgUserOauth2PermissionGrant -UserId \"user@contoso.com\" |\n    Select-Object ClientId, ConsentType, Scope\n\n# Remove suspicious OAuth grants\nRemove-MgOauth2PermissionGrant -OAuth2PermissionGrantId \"\u003Cgrant-id>\"\n\n# Step 5d: Review enterprise app registrations for rogue apps\nGet-MgServicePrincipal -Filter \"displayName eq 'Suspicious App'\" |\n    Select-Object AppId, DisplayName, SignInAudience\n\n# Step 5e: Check for mail forwarding rules (common post-compromise action)\nGet-MgUserMailFolderRule -UserId \"user@contoso.com\" -MailFolderId \"Inbox\" |\n    Where-Object { $_.Actions.ForwardTo -ne $null -or $_.Actions.RedirectTo -ne $null }\n```\n\n### Step 6: Implement Continuous Access Evaluation (CAE)\n\nEnable CAE to revoke tokens in near-real-time when conditions change:\n\n```\nEntra Admin Center > Protection > Conditional Access > Continuous Access Evaluation\n\nSettings:\n  Strictly enforce location policies: Enabled\n\nCAE ensures that when you revoke a user's session or change their\nrisk level, the enforcement happens within minutes rather than waiting\nfor the access token to naturally expire (60-90 minutes).\n\nCritical events that trigger immediate token revocation with CAE:\n- User account disabled or deleted\n- Password changed or reset\n- MFA enabled for the user\n- Admin explicitly revokes refresh tokens\n- Azure AD Identity Protection detects elevated user risk\n- Network location change violates conditional access policy\n```\n\n### Step 7: Configure Defender for Cloud Apps Session Policies\n\nSet up real-time session monitoring to detect and block suspicious token usage:\n\n```\nMicrosoft Defender for Cloud Apps > Policies > Session Policies\n\nPolicy: \"Block download from unmanaged device with stolen token\"\n  Session Control Type: Monitor and block activities\n  Activity Source: App = Office 365, SharePoint Online\n  Activity Filter: Device tag does not equal \"Compliant\"\n  Activity Type: Download\n  Action: Block\n\nPolicy: \"Alert on mass file download (exfiltration via stolen token)\"\n  Session Control Type: Monitor only\n  Activity Source: App = Office 365\n  Activity Filter: Repeated activity > 10 downloads in 5 minutes\n  Action: Alert administrators\n```\n\n## Key Concepts\n\n| Term | Definition |\n|------|------------|\n| **Primary Refresh Token (PRT)** | A long-lived token issued to a registered device that provides SSO to all Azure AD-integrated applications, cryptographically bound to the device's TPM |\n| **Token Protection** | Entra ID conditional access feature that binds sign-in session tokens to the device, preventing replay from other devices |\n| **Continuous Access Evaluation (CAE)** | Protocol that enables near-real-time enforcement of security policies by allowing resource providers to subscribe to Entra ID critical events |\n| **AitM (Adversary-in-the-Middle)** | Phishing technique where an attacker proxies the legitimate authentication flow to capture session cookies after the victim completes MFA |\n| **Device Code Flow** | OAuth 2.0 authorization grant for input-constrained devices; abused by attackers who send device codes to victims via phishing |\n| **Proof of Possession (PoP)** | Cryptographic mechanism where a token includes a claim tied to a device key, ensuring the token can only be used by the device that obtained it |\n| **Refresh Token** | Long-lived OAuth token (up to 90 days) used to obtain new access tokens without re-authentication; primary target for persistent access |\n\n## Verification\n\n- [ ] Identity Protection risk detections are enabled and generating alerts for anomalous token activity\n- [ ] Conditional access policies block high-risk sign-ins and require MFA for medium-risk\n- [ ] Token Protection policy is applied to pilot group and confirmed working (test from unregistered device fails)\n- [ ] KQL queries in Sentinel return results when tested against synthetic token anomaly events\n- [ ] Continuous Access Evaluation is enabled and verified (revoke session, confirm access blocked within minutes)\n- [ ] Defender for Cloud Apps session policies are active and monitoring download activity\n- [ ] Device code flow is restricted via conditional access (block or require compliant device)\n- [ ] Incident response runbook includes token revocation, password reset, and OAuth consent review steps\n- [ ] Mail forwarding rules and OAuth app grants are audited for compromised accounts\n",{"name":5,"tags":44,"author":49,"domain":38,"license":15,"version":50,"subdomain":34,"description":51},[45,46,32,33,47,31,23,48],"oauth","token-theft","conditional-access","PRT","mahipal","1.0.0","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. Activates for requests involving OAuth token theft detection, token replay prevention, Azure AD conditional access token protection, or cloud identity attack investigation.\n","main","4d2fb89cdfb75f3f6fd3c6c5ec9ad90ea129eb3c","ai-agent-skills\u002F21-external-registries\u002F08-pinkpixel-collection\u002Fdetecting-oauth-token-theft",2,"https:\u002F\u002Fgithub.com\u002Fluokai0\u002Fai-agent-skills-by-luo-kai","https:\u002F\u002Fgithub.com\u002Fluokai0","a solo builder.","2026-05-06 04:29:04",{"source":8,"skillName":5,"commands":61,"prompt":71,"zipAvailable":72},[62,65,68],{"tool":63,"command":64},"npx","npx skills add luokai0\u002Fai-agent-skills-by-luo-kai --skill detecting-oauth-token-theft",{"tool":66,"command":67},"bunx","bunx skills add luokai0\u002Fai-agent-skills-by-luo-kai --skill detecting-oauth-token-theft",{"tool":69,"command":70},"pnpm","pnpm dlx skills add luokai0\u002Fai-agent-skills-by-luo-kai --skill detecting-oauth-token-theft","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fluokai0\u002Fai-agent-skills-by-luo-kai\u002Fblob\u002Fmain\u002Fai-agent-skills\u002F21-external-registries\u002F08-pinkpixel-collection\u002Fdetecting-oauth-token-theft\u002FSKILL.md",true,[74,79,85],{"path":75,"resourceType":75,"resourceTypeDesc":76,"sizeBytes":77,"sourceHtmlUrl":78},"LICENSE","许可证",11255,"https:\u002F\u002Fgithub.com\u002Fluokai0\u002Fai-agent-skills-by-luo-kai\u002Fblob\u002Fmain\u002Fai-agent-skills\u002F21-external-registries\u002F08-pinkpixel-collection\u002Fdetecting-oauth-token-theft\u002FLICENSE",{"path":80,"resourceType":81,"resourceTypeDesc":82,"sizeBytes":83,"sourceHtmlUrl":84},"references\u002Fapi-reference.md","REFERENCE","参考文档",1629,"https:\u002F\u002Fgithub.com\u002Fluokai0\u002Fai-agent-skills-by-luo-kai\u002Fblob\u002Fmain\u002Fai-agent-skills\u002F21-external-registries\u002F08-pinkpixel-collection\u002Fdetecting-oauth-token-theft\u002Freferences\u002Fapi-reference.md",{"path":86,"resourceType":87,"resourceTypeDesc":88,"sizeBytes":89,"sourceHtmlUrl":90},"scripts\u002Fagent.py","SCRIPT","脚本",7214,"https:\u002F\u002Fgithub.com\u002Fluokai0\u002Fai-agent-skills-by-luo-kai\u002Fblob\u002Fmain\u002Fai-agent-skills\u002F21-external-registries\u002F08-pinkpixel-collection\u002Fdetecting-oauth-token-theft\u002Fscripts\u002Fagent.py",[92,119,136,161,188,213],{"skillNo":93,"name":94,"nameZh":6,"description":95,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":96,"licenseFileUrl":6,"sourceHtmlUrl":97,"categories":98,"keywords":99,"publishedAt":39},"01M6F2SKTE208174C7S7JJCZC7","write-contracts","Generates secure Aptos Move V2 smart contracts with Object model, Digital Asset integration, security patterns, and storage type guidance. Includes comprehensive storage decision framework for optimal data structure selection. Triggers on: 'write contract', 'create NFT collection', 'build marketplace', 'implement minting', 'generate Move module', 'create token contract', 'build DAO', 'implement staking'. Ask storage questions when: 'store', 'track', 'registry', 'mapping', 'list', 'collection'.","MIT","https:\u002F\u002Fgithub.com\u002Fluokai0\u002Fai-agent-skills-by-luo-kai\u002Fblob\u002Fmain\u002Fai-agent-skills\u002F22-clawhub-skills\u002Fwrite-contracts\u002FSKILL.md",[],[100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,20,116,117,118],"write","contracts","write contracts","storage","secure","create","generate","collection","model","decision","ask","smart-contracts","selection","objects","structure","nft","aptos","critical","move",{"skillNo":120,"name":121,"nameZh":6,"description":122,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":96,"licenseFileUrl":6,"sourceHtmlUrl":123,"categories":124,"keywords":125,"publishedAt":39},"01M6F2RFXJ6T9MKW0A7N7GM45B","web-search","通用网络搜索技能，支持多引擎搜索（百度、必应、DuckDuckGo），无需API密钥即可获取实时信息","https:\u002F\u002Fgithub.com\u002Fluokai0\u002Fai-agent-skills-by-luo-kai\u002Fblob\u002Fmain\u002Fai-agent-skills\u002F22-clawhub-skills\u002Fweb-search-ex-skill\u002FSKILL.md",[],[126,127,128,129,130,131,132,133,134,135],"web","search","web search","搜索","baidu","bing","duckduckgo","百度","多引擎","internet",{"skillNo":137,"name":138,"nameZh":6,"description":139,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":96,"licenseFileUrl":6,"sourceHtmlUrl":140,"categories":141,"keywords":142,"publishedAt":39},"01M6F2K968G1FZEZFPW2E6B222","solo-build","Execute implementation plan tasks with TDD workflow, auto-commit, and phase gates. Use when user says \"build it\", \"start building\", \"execute plan\", \"implement tasks\", \"ship it\", or references a track ID. Do NOT use for planning (use \u002Fplan) or scaffolding (use \u002Fscaffold).","https:\u002F\u002Fgithub.com\u002Fluokai0\u002Fai-agent-skills-by-luo-kai\u002Fblob\u002Fmain\u002Fai-agent-skills\u002F22-clawhub-skills\u002Fsolo-build\u002FSKILL.md",[],[143,144,145,146,147,148,149,150,127,151,152,153,100,154,155,156,157,158,159,160],"build","solo","solo build","MCP","workflow","commit","tasks","code","Bash","plan","read","auto","references","context7","query","scaffolding","ship it","project",{"skillNo":162,"name":163,"nameZh":6,"description":164,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":96,"licenseFileUrl":6,"sourceHtmlUrl":165,"categories":166,"keywords":167,"publishedAt":39},"01M6F2GKN39SGHSPWYB3662YC8","react-email","Use when building HTML email templates with React components, adding a visual email editor to an application using the React Email visual editor, rendering emails to HTML, or sending emails with Resend. Covers welcome emails, password resets, notifications, order confirmations, newsletters, transactional emails, and the embeddable email editor component.","https:\u002F\u002Fgithub.com\u002Fluokai0\u002Fai-agent-skills-by-luo-kai\u002Fblob\u002Fmain\u002Fai-agent-skills\u002F22-clawhub-skills\u002Freact-email-skills\u002FSKILL.md",[],[168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187],"react","email","react email","github","editor","components","react components","component","welcome","https","notifications","password","node","use","html","resend","visual","emails","rendering","with",{"skillNo":189,"name":190,"nameZh":6,"description":191,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":96,"licenseFileUrl":6,"sourceHtmlUrl":192,"categories":193,"keywords":194,"publishedAt":39},"01M6F2FBVGVDFSG8SSFJGXA40C","APITester Agent-Driven API Testing","Test API endpoints and document responses. Define tests in plain English, run them, get formatted results. Agent-driven Postman alternative.","https:\u002F\u002Fgithub.com\u002Fluokai0\u002Fai-agent-skills-by-luo-kai\u002Fblob\u002Fmain\u002Fai-agent-skills\u002F22-clawhub-skills\u002Fopenclaw-api-tester\u002FSKILL.md",[],[195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212],"testing","api","api testing","driven","APITester Agent Driven API Testing","test","run","postman","results","plain english","tester","endpoints","document","get","define","tests","english","api-tester",{"skillNo":214,"name":215,"nameZh":6,"description":216,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":96,"licenseFileUrl":6,"sourceHtmlUrl":217,"categories":218,"keywords":219,"publishedAt":39},"01M6F273Y3NGAPVJZ608BC0G9G","hubspot-implementation-plan","Generate a phased implementation plan from a HubSpot audit report. Creates prioritized, sequenced cleanup processes with effort estimates, dependencies, and automation feasibility. Use after running \u002Fhubspot-audit.","https:\u002F\u002Fgithub.com\u002Fluokai0\u002Fai-agent-skills-by-luo-kai\u002Fblob\u002Fmain\u002Fai-agent-skills\u002F22-clawhub-skills\u002Fhubspot-implementation-plan\u002FSKILL.md",[],[152,220,221,222,223,224,225,106,226,227,228,229,230,181,231,232,187,233],"implementation","hubspot","hubspot implementation plan","automation","feasibility","cleanup","planning","report","audit","audit report","phased implementation","dependencies","processes","hubspot audit"]