Detection rules › Sigma

Exchange Exploitation Used by HAFNIUM

Status
test
Severity
high
Log source
category webserver
Author
Florian Roth (Nextron Systems)
Source
github.com/SigmaHQ/sigma

Detects exploitation attempts in Exchange server logs as described in blog posts reporting on HAFNIUM group activity

MITRE ATT&CK coverage

TacticTechniques
Initial AccessT1190 Exploit Public-Facing Application

Rule body yaml

title: Exchange Exploitation Used by HAFNIUM
id: 67bce556-312f-4c81-9162-c3c9ff2599b2
status: test
description: Detects exploitation attempts in Exchange server logs as described in blog posts reporting on HAFNIUM group activity
references:
    - https://www.volexity.com/blog/2021/03/02/active-exploitation-of-microsoft-exchange-zero-day-vulnerabilities/
    - https://www.microsoft.com/security/blog/2021/03/02/hafnium-targeting-exchange-servers/
author: Florian Roth (Nextron Systems)
date: 2021-03-03
modified: 2023-01-02
tags:
    - attack.initial-access
    - attack.t1190
    - attack.g0125
    - detection.emerging-threats
logsource:
    category: webserver
detection:
    selection_1:
        cs-method: 'POST'
        cs-uri-query|contains: '/owa/auth/Current/themes/resources/'
    selection_2:
        cs-method: 'POST'
        cs-uri-query|contains: '/owa/auth/Current/'
        cs-user-agent:
            - 'DuckDuckBot/1.0;+(+http://duckduckgo.com/duckduckbot.html)'
            - 'facebookexternalhit/1.1+(+http://www.facebook.com/externalhit_uatext.php)'
            - 'Mozilla/5.0+(compatible;+Baiduspider/2.0;++http://www.baidu.com/search/spider.html)'
            - 'Mozilla/5.0+(compatible;+Bingbot/2.0;++http://www.bing.com/bingbot.htm)'
            - 'Mozilla/5.0+(compatible;+Googlebot/2.1;++http://www.google.com/bot.html'
            - 'Mozilla/5.0+(compatible;+Konqueror/3.5;+Linux)+KHTML/3.5.5+(like+Gecko)+(Exabot-Thumbnails)'
            - 'Mozilla/5.0+(compatible;+Yahoo!+Slurp;+http://help.yahoo.com/help/us/ysearch/slurp)'
            - 'Mozilla/5.0+(compatible;+YandexBot/3.0;++http://yandex.com/bots)'
            - 'Mozilla/5.0+(X11;+Linux+x86_64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/51.0.2704.103+Safari/537.36'
    selection_3:
        cs-uri-query|contains: '/ecp/'
        cs-method: 'POST'
        cs-user-agent:
            - 'ExchangeServicesClient/0.0.0.0'
            - 'python-requests/2.19.1'
            - 'python-requests/2.25.1'
    selection_4:
        cs-uri-query|contains:
            - '/aspnet_client/'
            - '/owa/'
        cs-method: 'POST'
        cs-user-agent:
            - 'antSword/v2.1'
            - 'Googlebot/2.1+(+http://www.googlebot.com/bot.html)'
            - 'Mozilla/5.0+(compatible;+Baiduspider/2.0;++http://www.baidu.com/search/spider.html)'
    selection_5:
        cs-uri-query|contains:
            - '/owa/auth/Current/'
            - '/ecp/default.flt'
            - '/ecp/main.css'
        cs-method: 'POST'
    selection_6:
        cs-method: 'POST'
        cs-uri-query|contains|all:
            - '/ecp/'
            - '.js'
    condition: 1 of selection_*
falsepositives:
    - Legitimate access to other web applications that use the same folder names as Exchange (e.g. owa, ecp) but are not Microsoft Exchange related
level: high

Stages and Predicates

Stage 0: condition

1 of selection_*

Stage 1: selection_1

selection_1:
    cs-method: 'POST'
    cs-uri-query|contains: '/owa/auth/Current/themes/resources/'

Stage 2: selection_2

selection_2:
    cs-method: 'POST'
    cs-uri-query|contains: '/owa/auth/Current/'
    cs-user-agent:
        - 'DuckDuckBot/1.0;+(+http://duckduckgo.com/duckduckbot.html)'
        - 'facebookexternalhit/1.1+(+http://www.facebook.com/externalhit_uatext.php)'
        - 'Mozilla/5.0+(compatible;+Baiduspider/2.0;++http://www.baidu.com/search/spider.html)'
        - 'Mozilla/5.0+(compatible;+Bingbot/2.0;++http://www.bing.com/bingbot.htm)'
        - 'Mozilla/5.0+(compatible;+Googlebot/2.1;++http://www.google.com/bot.html'
        - 'Mozilla/5.0+(compatible;+Konqueror/3.5;+Linux)+KHTML/3.5.5+(like+Gecko)+(Exabot-Thumbnails)'
        - 'Mozilla/5.0+(compatible;+Yahoo!+Slurp;+http://help.yahoo.com/help/us/ysearch/slurp)'
        - 'Mozilla/5.0+(compatible;+YandexBot/3.0;++http://yandex.com/bots)'
        - 'Mozilla/5.0+(X11;+Linux+x86_64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/51.0.2704.103+Safari/537.36'

Stage 3: selection_3

selection_3:
    cs-uri-query|contains: '/ecp/'
    cs-method: 'POST'
    cs-user-agent:
        - 'ExchangeServicesClient/0.0.0.0'
        - 'python-requests/2.19.1'
        - 'python-requests/2.25.1'

Stage 4: selection_4

selection_4:
    cs-uri-query|contains:
        - '/aspnet_client/'
        - '/owa/'
    cs-method: 'POST'
    cs-user-agent:
        - 'antSword/v2.1'
        - 'Googlebot/2.1+(+http://www.googlebot.com/bot.html)'
        - 'Mozilla/5.0+(compatible;+Baiduspider/2.0;++http://www.baidu.com/search/spider.html)'

Stage 5: selection_5

selection_5:
    cs-uri-query|contains:
        - '/owa/auth/Current/'
        - '/ecp/default.flt'
        - '/ecp/main.css'
    cs-method: 'POST'

Stage 6: selection_6

selection_6:
    cs-method: 'POST'
    cs-uri-query|contains|all:
        - '/ecp/'
        - '.js'

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
cs-methodeq
  • POST
cs-uri-querymatch
  • .js
  • /aspnet_client/
  • /ecp/
  • /ecp/default.flt
  • /ecp/main.css
  • /owa/
  • /owa/auth/Current/
  • /owa/auth/Current/themes/resources/
cs-user-agenteq
  • DuckDuckBot/1.0;+(+http://duckduckgo.com/duckduckbot.html)
  • ExchangeServicesClient/0.0.0.0
  • Googlebot/2.1+(+http://www.googlebot.com/bot.html)
  • Mozilla/5.0+(X11;+Linux+x86_64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/51.0.2704.103+Safari/537.36
  • Mozilla/5.0+(compatible;+Baiduspider/2.0;++http://www.baidu.com/search/spider.html)
  • Mozilla/5.0+(compatible;+Bingbot/2.0;++http://www.bing.com/bingbot.htm)
  • Mozilla/5.0+(compatible;+Googlebot/2.1;++http://www.google.com/bot.html
  • Mozilla/5.0+(compatible;+Konqueror/3.5;+Linux)+KHTML/3.5.5+(like+Gecko)+(Exabot-Thumbnails)
  • Mozilla/5.0+(compatible;+Yahoo!+Slurp;+http://help.yahoo.com/help/us/ysearch/slurp)
  • Mozilla/5.0+(compatible;+YandexBot/3.0;++http://yandex.com/bots)
  • antSword/v2.1
  • facebookexternalhit/1.1+(+http://www.facebook.com/externalhit_uatext.php)
  • python-requests/2.19.1
  • python-requests/2.25.1