Detection rules › Sigma

Potential Azure Browser SSO Abuse

Status
test
Severity
low
Log source
product windows, category image_load
Author
Den Iuzvyk
Source
github.com/SigmaHQ/sigma

Detects abusing Azure Browser SSO by requesting OAuth 2.0 refresh tokens for an Azure-AD-authenticated Windows user (i.e. the machine is joined to Azure AD and a user logs in with their Azure AD account) wanting to perform SSO authentication in the browser. An attacker can use this to authenticate to Azure AD in a browser as that user.

MITRE ATT&CK coverage

Event coverage

ProviderEventTitle
SysmonEvent ID 7Image loaded

Rule body yaml

title: Potential Azure Browser SSO Abuse
id: 50f852e6-af22-4c78-9ede-42ef36aa3453
status: test
description: |
    Detects abusing Azure Browser SSO by requesting OAuth 2.0 refresh tokens for an Azure-AD-authenticated Windows user (i.e. the machine is joined to Azure AD and a user logs in with their Azure AD account) wanting to perform SSO authentication in the browser.
    An attacker can use this to authenticate to Azure AD in a browser as that user.
references:
    - https://posts.specterops.io/requesting-azure-ad-request-tokens-on-azure-ad-joined-machines-for-browser-sso-2b0409caad30
author: Den Iuzvyk
date: 2020-07-15
modified: 2023-04-18
tags:
    - attack.persistence
    - attack.privilege-escalation
    - attack.execution
    - attack.stealth
    - attack.t1574.001
logsource:
    category: image_load
    product: windows
detection:
    selection:
        ImageLoaded: 'C:\Windows\System32\MicrosoftAccountTokenProvider.dll'
    filter_main_bgtaskhost:
        Image|startswith:
            - 'C:\Windows\System32\'
            - 'C:\Windows\SysWOW64\'
        Image|endswith: '\BackgroundTaskHost.exe'
        # CommandLine|contains: '-ServerNameBackgroundTaskHost.WebAccountProvider'
    filter_optional_devenv:
        Image|startswith:
            - 'C:\Program Files\Microsoft Visual Studio\'
            - 'C:\Program Files (x86)\Microsoft Visual Studio\'
        Image|endswith: '\IDE\devenv.exe'
    filter_optional_ie:
        Image:
            - 'C:\Program Files (x86)\Internet Explorer\iexplore.exe'
            - 'C:\Program Files\Internet Explorer\iexplore.exe'
    filter_optional_edge_1:
        - Image|startswith: 'C:\Program Files (x86)\Microsoft\EdgeWebView\Application\'
        - Image|endswith: '\WindowsApps\MicrosoftEdge.exe'
        - Image:
              - 'C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe'
              - 'C:\Program Files\Microsoft\Edge\Application\msedge.exe'
    filter_optional_edge_2:
        Image|startswith:
            - 'C:\Program Files (x86)\Microsoft\EdgeCore\'
            - 'C:\Program Files\Microsoft\EdgeCore\'
        Image|endswith:
            - '\msedge.exe'
            - '\msedgewebview2.exe'
    filter_optional_onedrive:
        Image|endswith: '\AppData\Local\Microsoft\OneDrive\OneDrive.exe'
    filter_optional_null:
        Image: null
    condition: selection and not 1 of filter_main_* and not 1 of filter_optional_*
falsepositives:
    - False positives are expected since this rules is only looking for the DLL load event. This rule is better used in correlation with related activity
level: low

Stages and Predicates

Stage 0: condition

selection and not 1 of filter_main_* and not 1 of filter_optional_*

Stage 1: selection

selection:
    ImageLoaded: 'C:\Windows\System32\MicrosoftAccountTokenProvider.dll'

Stage 2: not filter_main_bgtaskhost

filter_main_bgtaskhost:
    Image|startswith:
        - 'C:\Windows\System32\'
        - 'C:\Windows\SysWOW64\'
    Image|endswith: '\BackgroundTaskHost.exe'

Stage 3: not filter_optional_*

filter_optional_devenv:
    Image|startswith:
        - 'C:\Program Files\Microsoft Visual Studio\'
        - 'C:\Program Files (x86)\Microsoft Visual Studio\'
    Image|endswith: '\IDE\devenv.exe'
filter_optional_ie:
    Image:
        - 'C:\Program Files (x86)\Internet Explorer\iexplore.exe'
        - 'C:\Program Files\Internet Explorer\iexplore.exe'
filter_optional_edge_1:
    - Image|startswith: 'C:\Program Files (x86)\Microsoft\EdgeWebView\Application\'
    - Image|endswith: '\WindowsApps\MicrosoftEdge.exe'
    - Image:
          - 'C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe'
          - 'C:\Program Files\Microsoft\Edge\Application\msedge.exe'
filter_optional_edge_2:
    Image|startswith:
        - 'C:\Program Files (x86)\Microsoft\EdgeCore\'
        - 'C:\Program Files\Microsoft\EdgeCore\'
    Image|endswith:
        - '\msedge.exe'
        - '\msedgewebview2.exe'
filter_optional_onedrive:
    Image|endswith: '\AppData\Local\Microsoft\OneDrive\OneDrive.exe'
filter_optional_null:
    Image: null

Exclusions

Top-level NOT(...) conjuncts: predicates this rule actively suppresses.

FieldKindExcluded values
Imagestarts_withC:\Windows\SysWOW64\
Imagestarts_withC:\Windows\System32\
Imageends_with\BackgroundTaskHost.exe
Imageends_with\msedge.exe
Imageends_with\msedgewebview2.exe
Imagestarts_withC:\Program Files (x86)\Microsoft\EdgeCore\
Imagestarts_withC:\Program Files\Microsoft\EdgeCore\
Imagestarts_withC:\Program Files (x86)\Microsoft Visual Studio\
Imagestarts_withC:\Program Files\Microsoft Visual Studio\
Imageends_with\IDE\devenv.exe
Imageends_with\AppData\Local\Microsoft\OneDrive\OneDrive.exe
Imageends_with\WindowsApps\MicrosoftEdge.exe
ImageeqC:\Program Files (x86)\Internet Explorer\iexplore.exe
ImageeqC:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe
ImageeqC:\Program Files\Internet Explorer\iexplore.exe
ImageeqC:\Program Files\Microsoft\Edge\Application\msedge.exe
Imageis_null(no value, null check)
Imagestarts_withC:\Program Files (x86)\Microsoft\EdgeWebView\Application\

Indicators

Each row is a field, operator, and value that the rule matches. The corpus column counts how many other rules in the catalog look for the same combination: high numbers point to widely-used, community-vetted indicators. Blank or 1 shows that the indicator is specific to this rule.

FieldKindValues
ImageLoadedeq
  • C:\Windows\System32\MicrosoftAccountTokenProvider.dll