Detection: Office Application Drop Executable

Description

The following analytic detects Microsoft Office applications dropping or creating executables or scripts on a Windows OS. It leverages process creation and file system events from the Endpoint data model to identify Office applications like Word or Excel generating files with extensions such as .exe, .dll, or .ps1. This behavior is significant as it is often associated with spear-phishing attacks where malicious files are dropped to compromise the host. If confirmed malicious, this activity could lead to code execution, privilege escalation, or persistent access, posing a severe threat to the environment.

 1
 2| tstats `security_content_summariesonly` count FROM datamodel=Endpoint.Processes where Processes.process_name IN ("winword.exe","excel.exe","powerpnt.exe","mspub.exe","visio.exe","wordpad.exe","wordview.exe","onenote.exe","onenotem.exe","onenoteviewer.exe","onenoteim.exe","msaccess.exe") by _time span=1h Processes.process_id Processes.process_name Processes.process Processes.dest Processes.process_guid 
 3| `drop_dm_object_name(Processes)` 
 4|join process_guid, _time [
 5| tstats `security_content_summariesonly` count min(_time) as firstTime max(_time) as lastTime FROM datamodel=Endpoint.Filesystem where Filesystem.file_name IN ("*.exe","*.dll","*.pif","*.scr","*.js","*.vbs","*.vbe","*.ps1") by _time span=1h Filesystem.dest Filesystem.file_create_time Filesystem.file_name Filesystem.process_guid Filesystem.file_path 
 6| `drop_dm_object_name(Filesystem)` 
 7| fields _time dest file_create_time file_name file_path process_name process_path process process_guid] 
 8| dedup file_create_time 
 9| table dest, process_name, process, file_create_time, file_name, file_path, process_guid 
10| `office_application_drop_executable_filter`

Data Source

Name Platform Sourcetype Source Supported App
Sysmon EventID 1 Windows icon Windows 'xmlwineventlog' 'XmlWinEventLog:Microsoft-Windows-Sysmon/Operational' N/A

Macros Used

Name Value
security_content_summariesonly summariesonly=summariesonly_config allow_old_summaries=oldsummaries_config fillnull_value=fillnull_config``
office_application_drop_executable_filter search *
office_application_drop_executable_filter is an empty macro by default. It allows the user to filter out any results (false positives) without editing the SPL.

Annotations

- MITRE ATT&CK
+ Kill Chain Phases
+ NIST
+ CIS
- Threat Actors
ID Technique Tactic
T1566 Phishing Initial Access
T1566.001 Spearphishing Attachment Initial Access
KillChainPhase.DELIVERY
NistCategory.DE_CM
Cis18Value.CIS_10
Axiom
GOLD SOUTHFIELD
APT-C-36
APT1
APT12
APT19
APT28
APT29
APT30
APT32
APT33
APT37
APT38
APT39
APT41
Ajax Security Team
Andariel
BITTER
BRONZE BUTLER
BlackTech
Cobalt Group
Confucius
DarkHydrus
Darkhotel
Dragonfly
EXOTIC LILY
Elderwood
Ember Bear
FIN4
FIN6
FIN7
FIN8
Ferocious Kitten
Gallmaker
Gamaredon Group
Gorgon Group
Higaisa
Inception
IndigoZebra
Kimsuky
Lazarus Group
LazyScripter
Leviathan
Machete
Malteiro
Mofang
Molerats
MuddyWater
Mustang Panda
Naikon
Nomadic Octopus
OilRig
PLATINUM
Patchwork
RTM
Rancor
Sandworm Team
SideCopy
Sidewinder
Silence
TA2541
TA459
TA505
TA551
The White Company
Threat Group-3390
Tonto Team
Transparent Tribe
Tropic Trooper
WIRTE
Windshift
Wizard Spider
admin@338
menuPass

Default Configuration

This detection is configured by default in Splunk Enterprise Security to run with the following settings:

Setting Value
Disabled true
Cron Schedule 0 * * * *
Earliest Time -70m@m
Latest Time -10m@m
Schedule Window auto
Creates Notable Yes
Rule Title %name%
Rule Description %description%
Notable Event Fields user, dest
Creates Risk Event True
This configuration file applies to all detections of type TTP. These detections will use Risk Based Alerting and generate Notable Events.

Implementation

To successfully implement this search, you need to be ingesting logs with the process name, parent process, and command-line executions from your endpoints. If you are using Sysmon, you must have at least version 6.0.4 of the Sysmon TA. Tune and filter known instances where renamed rundll32.exe may be used.

Known False Positives

office macro for automation may do this behavior

Associated Analytic Story

Risk Based Analytics (RBA)

Risk Message Risk Score Impact Confidence
process $process_name$ drops a file $file_name$ in host $dest$ 64 80 80
The Risk Score is calculated by the following formula: Risk Score = (Impact * Confidence/100). Initial Confidence and Impact is set by the analytic author.

References

Detection Testing

Test Type Status Dataset Source Sourcetype
Validation Passing N/A N/A N/A
Unit Passing Dataset XmlWinEventLog:Microsoft-Windows-Sysmon/Operational xmlwineventlog
Integration ✅ Passing Dataset XmlWinEventLog:Microsoft-Windows-Sysmon/Operational xmlwineventlog

Replay any dataset to Splunk Enterprise by using our replay.py tool or the UI. Alternatively you can replay a dataset into a Splunk Attack Range


Source: GitHub | Version: 5