Windows MSExchange Management events indicating likely MS Exchange RCE CVE-2021-42321 exploitation

Flags Exchange management events showing Get-App cmdlet failures and unhandled InvalidCastException during CVE-2021-42321 RCE attempts.

FreeReviewedSigma · High · v5
Product
windows
Service
msexchange-management
Author
Florian Roth (Nextron Systems), @testanull (SigmaHQ), DRL 1.1
Published
2021-11-18
Updated
2026-07-31
title: Windows MSExchange Management events indicating likely MS Exchange RCE CVE-2021-42321 exploitation
id: 38980bdb-d8dc-41b6-abc8-71fd985fbad6
status: test
description: "This rule matches Windows msexchange-management log entries with EventID 6 or 8 that contain evidence of Exchange PowerShell cmdlet failures. It looks for “Cmdlet failed. Cmdlet Get-App” and an “Unhandled exception: System.InvalidCastException” string, which can appear during exploitation attempts targeting CVE-2021-42321. Telemetry relies on the Exchange management logging captured by the Windows msexchange-management service, specifically the EventID and the embedded message/data fields containing those error fragments."
references:
  - https://msrc.microsoft.com/update-guide/vulnerability/CVE-2021-42321
  - https://github.com/SigmaHQ/sigma/blob/master/rules-emerging-threats/2021/Exploits/CVE-2021-42321/win_exchange_cve_2021_42321.yml
author: Florian Roth (Nextron Systems), @testanull, Huntrule Team
date: 2021-11-18
modified: 2022-07-12
tags:
  - attack.lateral-movement
  - attack.t1210
  - detection.emerging-threats
logsource:
  product: windows
  service: msexchange-management
detection:
  selection:
    EventID:
      - 6
      - 8
    Data|contains:
      - "Cmdlet failed. Cmdlet Get-App, "
      - "Task Get-App throwing unhandled exception: System.InvalidCastException:"
  condition: selection
falsepositives:
  - Unknown, please report false positives via https://github.com/SigmaHQ/sigma/issues
level: high
license: DRL-1.1
related:
  - id: c92f1896-d1d2-43c3-92d5-7a5b35c217bb
    type: derived