← Back to SOC feed Coverage →

Base64 Detector and Decoder

kql MEDIUM Azure-Sentinel
DeviceProcessEvents
huntingmicrosoftofficial
This rule was pulled from an open-source repository and enriched with AI. Validate in a test environment before deploying to production.
View original rule at Azure-Sentinel →
Retrieved: 2026-05-19T23:00:00Z · Confidence: medium

Hunt Hypothesis

Adversaries may use Base64 encoding to obfuscate malicious command-line arguments in processes, making it harder to detect malicious activity through simple string matching. SOC teams should proactively hunt for Base64-encoded strings in process command lines to identify potential obfuscated payloads and early-stage compromise in their Azure Sentinel environment.

KQL Query

DeviceProcessEvents 
| extend SplitLaunchString = split(ProcessCommandLine, " ")
| mvexpand SplitLaunchString
| where SplitLaunchString matches regex "^[A-Za-z0-9+/]{50,}[=]{0,2}$"
| extend Base64 = tostring(SplitLaunchString)
| extend DecodedString = base64_decodestring(Base64)
| where isnotempty(DecodedString)

Analytic Rule Definition

id: 89fc1421-8387-4c2b-9bcb-75ead57ccb2c
name: Base64 Detector and Decoder
description: |
  This query will identify strings in process command lines which match Base64 encoding format, extract the string to a column called Base64, and decode it in a column called DecodedString.
requiredDataConnectors:
- connectorId: MicrosoftThreatProtection
  dataTypes:
  - DeviceProcessEvents
tactics:
- Execution
query: |
  DeviceProcessEvents 
  | extend SplitLaunchString = split(ProcessCommandLine, " ")
  | mvexpand SplitLaunchString
  | where SplitLaunchString matches regex "^[A-Za-z0-9+/]{50,}[=]{0,2}$"
  | extend Base64 = tostring(SplitLaunchString)
  | extend DecodedString = base64_decodestring(Base64)
  | where isnotempty(DecodedString)

Required Data Sources

Sentinel TableNotes
DeviceProcessEventsEnsure this data connector is enabled

MITRE ATT&CK Context

References

False Positive Guidance

Original source: https://github.com/Azure/Azure-Sentinel/blob/main/Hunting Queries/Microsoft 365 Defender/Execution/Base64 Detector and Decoder.yaml