T1137.005 Elastic Security · Elastic

Detect Outlook Rules in Elastic Security

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/

Elastic Detection Query

Elastic Security (Elastic)
eql
sequence by host.id with maxspan=5m
  [process where event.type == "start"
   and process.parent.name : "outlook.exe"
   and process.name : ("cmd.exe", "powershell.exe", "wscript.exe", "cscript.exe",
                        "mshta.exe", "rundll32.exe", "regsvr32.exe", "certutil.exe")]

// Standalone: Outlook spawning processes from user-writable directories
process where event.type == "start"
  and process.parent.name : "outlook.exe"
  and (
    process.executable : ("*\\Users\\*", "*\\Temp\\*", "*\\AppData\\*", "*\\ProgramData\\*")
    and not process.executable : "*\\Microsoft Office\\*"
  )

// Standalone: Ruler tool detection
process where event.type == "start"
  and (
    process.name : "ruler.exe"
    or (process.args : "--rules" and process.args : ("add", "--target"))
    or process.command_line : "*ruler*rules*"
  )
high severity high confidence

Detects Outlook Rules persistence (T1137.005) via three patterns: (1) Outlook spawning known LOLBin/shell executables indicating rule-triggered execution, (2) Outlook launching processes from user-writable directories indicating 'run application' rule abuse, and (3) use of the Ruler attack tool for automated mailbox rule manipulation.

Data Sources

Elastic Endpoint SecurityWinlogbeat with SysmonElastic Agent (endpoint integration)

Required Tables

logs-endpoint.events.process-*winlogbeat-*

False Positives & Tuning

  • Outlook add-ins or plugins that legitimately spawn child processes such as PDF readers, archiving tools, or antivirus scanners triggered by email attachments
  • IT automation scripts that use Outlook COM automation and spawn helper processes for mail processing or archiving workflows
  • Security awareness training platforms that send test phishing emails and use Ruler-like tooling in authorized red team exercises
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