T1137.005 Splunk · SPL

Detect Outlook Rules in Splunk

Adversaries abuse Microsoft Outlook rules to achieve persistence and execute code. Malicious inbox rules can be configured to run a script or application when a specially crafted email is received. Rules are stored in the mailbox and persist across Outlook restarts and even OS reinstalls. The Ruler tool automates creation of malicious rules. Hidden inbox rules (stored without display names) are particularly stealthy.

MITRE ATT&CK

Tactic
Persistence
Technique
T1137 Office Application Startup
Sub-technique
T1137.005 Outlook Rules
Canonical reference
https://attack.mitre.org/techniques/T1137/005/

SPL Detection Query

Splunk (SPL)
spl
index=wineventlog sourcetype="XmlWinEventLog:Microsoft-Windows-Sysmon/Operational" EventCode=1
| eval detection_type=case(
    match(ParentImage, "(?i)outlook\.exe") AND
      match(Image, "(?i)(cmd|powershell|wscript|cscript|mshta|rundll32|regsvr32|certutil)\.exe"),
      "Outlook_Rule_Shell_Spawn",
    match(ParentImage, "(?i)outlook\.exe") AND
      match(Image, "(?i)\\\\(Users|Temp|AppData|ProgramData)\\\\") AND
      NOT match(Image, "(?i)Microsoft\\\\Office"),
      "Outlook_Rule_UserDir_Exec",
    (match(CommandLine, "(?i)--rules") OR match(Image, "(?i)ruler\.exe")),
      "Ruler_Rules_Detected",
    true(), null()
  )
| where isnotnull(detection_type)
| eval risk_score=case(
    detection_type="Outlook_Rule_Shell_Spawn", 8,
    detection_type="Outlook_Rule_UserDir_Exec", 9,
    detection_type="Ruler_Rules_Detected", 10,
    true(), 5
  )
| table _time, host, User, detection_type, risk_score, Image, CommandLine, ParentImage, ParentCommandLine
| sort - risk_score, - _time
high severity medium confidence

Detects Outlook Rules persistence via Sysmon EventCode 1. Assigns risk scores: Outlook spawning shell interpreters (score 8), Outlook running executables from user directories (score 9), and Ruler tool detection (score 10). Sorted by risk score to prioritize highest-fidelity alerts. The Ruler tool score of 10 reflects its near-exclusive use for malicious purposes.

Data Sources

Process: Process CreationSysmon Event ID 1

Required Sourcetypes

XmlWinEventLog:Microsoft-Windows-Sysmon/Operational

False Positives & Tuning

  • Legitimate organizational VBScript rules triggered by Outlook for workflow automation
  • IT automation tools launched by Outlook rules for ticket/incident management
  • Email-triggered scripts for compliance archiving systems
Download portable Sigma rule (.yml)

Other platforms for T1137.005


Testing Methodology

Validate this detection against 3 adversary techniques from Atomic Red Team. Each test below lists the behaviour to exercise and the telemetry you should expect to see. Executable commands and cleanup steps are available with Pro.

  1. Test 1Create Malicious Outlook Inbox Rule via PowerShell (Exchange)

    Expected signal: Security Event ID 4624 for Exchange PowerShell authentication. Office 365 Unified Audit Log: Operation=New-InboxRule with RunScript action. Sysmon EventCode 3 network connection to Exchange Online.

  2. Test 2Enumerate Inbox Rules for Hidden/Suspicious Entries

    Expected signal: Sysmon EventCode 1 with powershell.exe executing Get-InboxRule. Exchange EWS audit log showing mailbox access from local machine.

  3. Test 3Test Ruler Tool Detection (Simulated Command)

    Expected signal: Sysmon EventCode 1 with cmd.exe process. For actual Ruler execution: Image=ruler.exe, CommandLine containing '--rules' and '--trigger'. Sysmon EventCode 3 connection to Exchange EWS.

Unlock Pro Content

Get the full detection package for T1137.005 including response playbook, investigation guide, and atomic red team tests.

Response PlaybookInvestigation GuideHunting QueriesAtomic Red Team TestsTuning Guidance

Related Detections