Detection rules › Splunk

Malicious Document Execution (Windows Event Log)

Group by
_time, host, parent_process_name
Source
github.com/anvilogic-forge/armory

This rule is attempting to detect anytime a Microsoft Office OR Adobe program (ex. Word, Excel, Adobe) spawns a process that could be indicative of those Office programs used to deliver malicious code

MITRE ATT&CK coverage

References

Telemetry coverage

Rule body

id: '1050.1080'
title: Malicious Document Execution
description: 'This rule is attempting to detect anytime a Microsoft Office OR Adobe
  program (ex. Word, Excel, Adobe) spawns a process that could be indicative of those
  Office programs used to deliver malicious code. -- Threat Actor Association: Actinium/Gamaredon/Primitive
  Bear, APT10/menuPass, APT29, APT34/OilRig, APT37, Arid Viper/APT C-23, Blind Eagle/APT-C-36,
  Carbanak, Evilnum, FIN6, FIN7, Gamaredon Group/Shuckworm, Kimsuky, Lazarus, ModifiedElephant,
  MuddyWater, NewsPenguin, RedEyes, RomCom, SideWinder, TA428, TA505, TA551, Turla
  (akaSecret Blizzard, KRYPTON, and UAC-0003), Winter Vivern, WIRTE, Wizard Spider
  -- Software Association: Bazarloder, Black Basta, Clop, Conti, Dridex, Emotet, GlowSand,
  Hancitor, IcedID, Lockbit, MINEBRIDGE, MirrorBlast, PowerShortShell, QakBot, RATDispenser,
  Sodinokibi/REvil, SquirrelWaffle, Trickbot, Zumkong -- #TrendingThreat #Russia #Ukraine'
logic_format: Splunk
logic: '`get_endpoint_data` `get_endpoint_data_winevent` (TERM(EventCode=4688) OR
  "<EventID>4688<" OR Type=Process) (TERM("powershell.exe") OR TERM("cmd.exe") OR
  TERM("wscript.exe") OR TERM("cscript.exe") OR "regsvr32.exe" OR "rundll32.exe" OR
  "wmic" OR "control.exe") ((TERM(Microsoft) TERM(Office)) OR TERM(WINWORD.EXE) OR
  TERM(EXCEL.EXE) OR TERM(POWERPNT.EXE) OR TERM(MSACCESS.EXE) OR TERM(OUTLOOK.EXE)
  OR TERM(VISIO.EXE) OR TERM(WINPROJ.EXE) OR TERM(pdf) OR TERM(wordpad.exe) OR TERM(ONENOTE.EXE))|
  regex "(?i)(Microsoft Office)|(WINWORD\.EXE)|(EXCEL\.EXE)|(POWERPNT\.EXE)|(MSACCESS\.EXE)|(OUTLOOK\.EXE)|(ONENOTE\.EXE)|(VISIO\.EXE)|(WINPROJ\.EXE)|(AcroRd32\.exe)|(Acrobat\.exe)|(FoxitPhantomPDF\.exe)|(FoxitReader\.exe)|(wordpad\.exe)"
  | table _time, host, user process, parent_*, process_*, signature_id | bin span=1s
  | stats values(*) as * by _time, host, parent_process_name | where match(parent_process_path,"(?i)(Microsoft
  Office)|(WINWORD\.EXE)|(EXCEL\.EXE)|(POWERPNT\.EXE)|(MSACCESS\.EXE)|(OUTLOOK\.EXE)|(ONENOTE\.EXE)|(VISIO\.EXE)|(WINPROJ\.EXE)|(AcroRd32\.exe)|(Acrobat\.exe)|(FoxitPhantomPDF\.exe)|(FoxitReader\.exe)|(wordpad\.exe)") '
techniques:
- initial-access:phishing:spearphishing attachment
- execution:user execution:malicious link
- execution:user execution:malicious file
technique_id:
- T1566.001
- T1204.001
- T1204.002
data_category:
- Windows event logs
references:
- https://success.trendmicro.com/solution/000279049

Stages and Predicates

Stage 1: search

`get_endpoint_data` `get_endpoint_data_winevent` (TERM(EventCode=4688) OR "<EventID>4688<" OR Type=Process) (TERM("powershell.exe") OR TERM("cmd.exe") OR TERM("wscript.exe") OR TERM("cscript.exe") OR "regsvr32.exe" OR "rundll32.exe" OR "wmic" OR "control.exe") ((TERM(Microsoft) TERM(Office)) OR TERM(WINWORD.EXE) OR TERM(EXCEL.EXE) OR TERM(POWERPNT.EXE) OR TERM(MSACCESS.EXE) OR TERM(OUTLOOK.EXE) OR TERM(VISIO.EXE) OR TERM(WINPROJ.EXE) OR TERM(pdf) OR TERM(wordpad.exe) OR TERM(ONENOTE.EXE))

Stage 2: regex

| regex "(?i)(Microsoft Office)|(WINWORD\.EXE)|(EXCEL\.EXE)|(POWERPNT\.EXE)|(MSACCESS\.EXE)|(OUTLOOK\.EXE)|(ONENOTE\.EXE)|(VISIO\.EXE)|(WINPROJ\.EXE)|(AcroRd32\.exe)|(Acrobat\.exe)|(FoxitPhantomPDF\.exe)|(FoxitReader\.exe)|(wordpad\.exe)"

Stage 3: table

| table _time, host, user process, parent_*, process_*, signature_id

Stage 4: bucket

| bin span=1s

Stage 5: stats

| stats values(*) as * by _time, host, parent_process_name

Stage 6: where

| where match(parent_process_path,"(?i)(Microsoft Office)|(WINWORD\.EXE)|(EXCEL\.EXE)|(POWERPNT\.EXE)|(MSACCESS\.EXE)|(OUTLOOK\.EXE)|(ONENOTE\.EXE)|(VISIO\.EXE)|(WINPROJ\.EXE)|(AcroRd32\.exe)|(Acrobat\.exe)|(FoxitPhantomPDF\.exe)|(FoxitReader\.exe)|(wordpad\.exe)")

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
EventCodeeq
  • 4688 corpus 317 (splunk 283, kusto 33, elastic 1)
field:"EventID" kind:eq value:"4688"
_rawregex_match
    • "(?i)(Microsoft Office)
    • (WINWORD.EXE)
    • (EXCEL.EXE)
    • (POWERPNT.EXE)
    • (MSACCESS.EXE)
    • (OUTLOOK.EXE)
    • (ONENOTE.EXE)
    • (VISIO.EXE)
    • (WINPROJ.EXE)
    • (AcroRd32.exe)
    • (Acrobat.exe)
    • (FoxitPhantomPDF.exe)
    • (FoxitReader.exe)
    • (wordpad.exe)"
field:"_raw" kind:regex_match
parent_process_pathregex_match
    • "(?i)(Microsoft Office)
    • (WINWORD.EXE)
    • (EXCEL.EXE)
    • (POWERPNT.EXE)
    • (MSACCESS.EXE)
    • (OUTLOOK.EXE)
    • (ONENOTE.EXE)
    • (VISIO.EXE)
    • (WINPROJ.EXE)
    • (AcroRd32.exe)
    • (Acrobat.exe)
    • (FoxitPhantomPDF.exe)
    • (FoxitReader.exe)
    • (wordpad.exe)"
field:"parent_process_name" kind:regex_match

Search terms

These SPL tokens match against raw event text.

StageTerm
1"<EventID>4688<"
1"powershell.exe"
1"cmd.exe"
1"wscript.exe"
1"cscript.exe"
1"regsvr32.exe"
1"rundll32.exe"
1"wmic"
1"control.exe"
1Microsoft
1Office
1WINWORD.EXE
1EXCEL.EXE
1POWERPNT.EXE
1MSACCESS.EXE
1OUTLOOK.EXE
1VISIO.EXE
1WINPROJ.EXE
1pdf
1wordpad.exe
1ONENOTE.EXE