TITLE:
Phishing the Phishing Resistant: Phishing for Primary Refresh Tokens in Microsoft Entra
SUMMARY:
Dirk-jan Mollema discusses the vulnerabilities in Microsoft’s phishing-resistant authentication systems, focusing on phishing for Primary Refresh Tokens (PRT) in Microsoft Entra (formerly Azure AD). The lecture covers the token architecture, Windows Hello authentication, token upgrades, and phishing strategies, providing methods for detecting and mitigating such attacks.
OUTLINE:
- Introduction
- Presenter: Dirk-jan Mollema
- Overview of research in Microsoft Entra
- Focus on phishing for Primary Refresh Tokens (PRTs)
- Microsoft Entra Tokens
- Types of tokens: Access, Refresh, and Primary Refresh Tokens (PRTs)
- Token usage on unmanaged vs managed Windows hosts
- Token pyramid: Hierarchical structure of tokens from least to most privileged
- Windows Hello Authentication
- Overview of Windows Hello for Business (WHFB)
- Cryptographic keys for passwordless authentication
- Provisioning WHFB keys via device and PRT
- Phishing “Resistant” Authentication
- Overview of phishing-resistant methods: FIDO keys, Windows Hello, Passkeys
- Limitations: device code phishing, OAuth consent phishing, malware
- Windows Hello Key Provisioning
- Technical components: Device identity, PRT, TPM
- NGC MFA and the need for fresh MFA prompts during provisioning
- Token requirements for WHFB provisioning
- Token Upgrades during Windows Setup
- Windows setup behavior and token upgrade flow
- Use of the Microsoft Authentication Broker client ID to upgrade refresh tokens to PRTs
- Phishing for PRTs
- Credential phishing approach: Steps to capture refresh tokens and upgrade them to PRTs
- Device code phishing approach: Using device code flows to phish for PRTs
- Detection and Mitigations
- Strategies to mitigate phishing attacks, including requiring phishing-resistant MFA and restricting device code flows
- Detecting suspicious behavior through log analytics and monitoring new devices
IDEAS:
- Microsoft Entra (formerly Azure AD) uses a hierarchical token structure for authentication.
- Primary Refresh Tokens (PRTs) facilitate Single Sign-On (SSO) and connect a user to their device.
- Windows Hello for Business (WHFB) enables passwordless authentication using cryptographic keys tied to devices.
- Phishing-resistant authentication methods aim to combat credential phishing but have limitations.
- Device code phishing and OAuth consent phishing bypass traditional phishing-resistant methods.
- Microsoft’s token hierarchy prevents upgrading weaker tokens like access tokens into PRTs.
- The Microsoft Authentication Broker allows refresh tokens to be upgraded to PRTs during Windows setup.
- Attackers can exploit the Windows setup flow to elevate refresh tokens to PRTs.
- Credential phishing can capture tokens using fake login pages.
- Device code phishing tricks users into authenticating a malicious device by using legitimate Microsoft login flows.
- WHFB provisioning relies on MFA to ensure secure enrollment of cryptographic keys.
- The use of Trusted Platform Modules (TPM) secures cryptographic keys and PRT session keys.
- Windows Hello for Business provides strong authentication but can be compromised through token phishing.
- Monitoring device registration and PRT provisioning can help detect malicious activity.
- Enforcing compliant or hybrid-joined devices in conditional access policies limits exposure to phishing attacks.
- Device code phishing allows attackers to bypass the need for fake login pages.
- Disabling or restricting device code flows can mitigate phishing attempts.
- Log analytics and Microsoft Sentinel can be used to detect device code phishing activity.
- Recent MFA claims in tokens indicate a fresh authentication prompt, improving security.
- Research tools like ROADtools can be used to simulate phishing attacks on Entra tokens.
QUOTES:
- “Primary Refresh Tokens are Single Sign On tokens and can be used to sign in to any application and any Entra connected website.”
- “Windows Hello for Business uses cryptographic keys that are unlocked using a PIN or with biometrics to authenticate.”
- “Phishing-resistant methods focus primarily on protecting against credential phishing on fake login pages.”
- “Device code phishing allows attackers to use the legitimate Microsoft login pages to gain access to tokens.”
- “Windows uses the Microsoft Authentication Broker client ID during setup to upgrade refresh tokens to Primary Refresh Tokens.”
- “Primary Refresh Tokens always need a session key to be used, and the session keys are protected by a Trusted Platform Module.”
- “Credential phishing can be prevented by requiring phishing-resistant MFA, but other methods like device code phishing still pose a risk.”
- “Monitoring for newly registered devices with Windows Hello for Business key registration is essential to detecting potential phishing attacks.”
- “The key to successful phishing attacks on Entra lies in the ability to upgrade refresh tokens to Primary Refresh Tokens.”
- “Even if you phish for credentials, you can upgrade those tokens and turn them into a full Single Sign On token with persistence.”
RECOMMENDATIONS:
- Enforce phishing-resistant MFA across all user accounts to reduce credential phishing risks.
- Require compliant or hybrid-joined devices for accessing sensitive resources.
- Restrict device code flow authentication to internal or trusted networks.
- Monitor newly registered devices, particularly those enrolling Windows Hello for Business keys.
- Implement Intune restrictions to prevent unauthorized device enrollment.
- Regularly audit logs using tools like Microsoft Sentinel to detect unusual sign-in behaviors.
- Disable or limit the Microsoft Authentication Broker client to prevent token upgrades during setup.
- Use Conditional Access policies to enforce stricter authentication for high-risk users.
- Educate users on the dangers of device code phishing and ensure awareness of phishing tactics.
- Deploy tools like ROADtools for internal testing and to simulate phishing attempts, identifying vulnerabilities.
ONE SENTENCE SUMMARY:
Phishing attacks can bypass Microsoft’s phishing-resistant methods by targeting Primary Refresh Tokens through credential and device code phishing, but can be mitigated with enhanced MFA and device compliance policies.
Leave a Reply