Skip to content

Commit e3ca65e

Browse files
authored
feat(rule): Suspicious Office template created (#238)
1 parent 3aa6999 commit e3ca65e

2 files changed

Lines changed: 82 additions & 32 deletions

File tree

rules/persistence_boot_or_logon_autostart_execution.yml

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -24,23 +24,23 @@
2424
condition: >
2525
create_file
2626
and
27-
(
28-
file.extension in ('.vbs', '.js', '.jar', '.exe', '.dll', '.com', '.ps1', '.hta', '.cmd', '.vbe')
29-
or
30-
(file.is_exec or file.is_dll)
31-
)
27+
(
28+
file.extension in ('.vbs', '.js', '.jar', '.exe', '.dll', '.com', '.ps1', '.hta', '.cmd', '.vbe')
29+
or
30+
(file.is_exec or file.is_dll)
31+
)
3232
and
3333
file.name imatches startup_locations
3434
and
3535
not
3636
ps.exe imatches
37-
(
38-
'?:\\Windows\\System32\\wuauclt.exe',
39-
'?:\\Windows\\System32\\msiexec.exe',
40-
'?:\\Windows\\SysWOW64\\msiexec.exe',
41-
'?:\\Windows\\System32\\svchost.exe',
42-
'?:\\ProgramData\\Microsoft\\Windows Defender\\Platform\\*.exe'
43-
)
37+
(
38+
'?:\\Windows\\System32\\wuauclt.exe',
39+
'?:\\Windows\\System32\\msiexec.exe',
40+
'?:\\Windows\\SysWOW64\\msiexec.exe',
41+
'?:\\Windows\\System32\\svchost.exe',
42+
'?:\\ProgramData\\Microsoft\\Windows Defender\\Platform\\*.exe'
43+
)
4444
min-engine-version: 2.0.0
4545
- name: Unusual process modified the registry run key
4646
description: |
@@ -55,26 +55,26 @@
5555
and
5656
not
5757
ps.exe imatches
58-
(
59-
'?:\\Windows\\System32\\svchost.exe',
60-
'?:\\Windows\\SysWOW64\\msiexec.exe',
61-
'?:\\Windows\\System32\\msiexec.exe',
62-
'?:\\Windows\\System32\\drvinst.exe',
63-
'?:\\Windows\\System32\\WinSAT.exe',
64-
'?:\\Windows\\System32\\reg.exe',
65-
'?:\\Windows\\regedit.exe',
66-
'?:\\Windows\\SysWOW64\\reg.exe',
67-
'?:\\Windows\\System32\\csrss.exe',
68-
'?:\\Windows\\SysWOW64\\DriverStore\\*.exe',
69-
'?:\\Windows\\System32\\DriverStore\\*.exe',
70-
'?:\\Windows\\Installer\\*.exe',
71-
'?:\\Windows\\explorer.exe',
72-
'?:\\Windows\\IMECache\\*.exe',
73-
'?:\\Windows\\System32\\sihost.exe',
74-
'?:\\Windows\\SysWOW64\\prevhost.exe',
75-
'?:\\Windows\\System32\\conhost.exe',
76-
'?:\\Windows\\System32\\taskhostw.exe'
77-
)
58+
(
59+
'?:\\Windows\\System32\\svchost.exe',
60+
'?:\\Windows\\SysWOW64\\msiexec.exe',
61+
'?:\\Windows\\System32\\msiexec.exe',
62+
'?:\\Windows\\System32\\drvinst.exe',
63+
'?:\\Windows\\System32\\WinSAT.exe',
64+
'?:\\Windows\\System32\\reg.exe',
65+
'?:\\Windows\\regedit.exe',
66+
'?:\\Windows\\SysWOW64\\reg.exe',
67+
'?:\\Windows\\System32\\csrss.exe',
68+
'?:\\Windows\\SysWOW64\\DriverStore\\*.exe',
69+
'?:\\Windows\\System32\\DriverStore\\*.exe',
70+
'?:\\Windows\\Installer\\*.exe',
71+
'?:\\Windows\\explorer.exe',
72+
'?:\\Windows\\IMECache\\*.exe',
73+
'?:\\Windows\\System32\\sihost.exe',
74+
'?:\\Windows\\SysWOW64\\prevhost.exe',
75+
'?:\\Windows\\System32\\conhost.exe',
76+
'?:\\Windows\\System32\\taskhostw.exe'
77+
)
7878
min-engine-version: 2.0.0
7979
- name: Network connection via startup folder executable or script
8080
description: |
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
- group: Office Template Macros
2+
description: |
3+
Adversaries may abuse Microsoft Office templates to obtain
4+
persistence on a compromised system. Microsoft Office contains
5+
templates that are part of common Office applications and are
6+
used to customize styles. The base templates within
7+
the application are used each time an application starts.
8+
Office Visual Basic for Applications (VBA) macros can be
9+
inserted into the base template and used to execute code
10+
when the respective Office application starts in order to
11+
obtain persistence. Examples for both Word and Excel have
12+
been discovered and published.
13+
By default, Word has a Normal.dotm template created that
14+
can be modified to include a malicious macro.
15+
Excel does not have a template file created by default, but
16+
one can be added that will automatically be loaded. Shared
17+
templates may also be stored and pulled from remote locations.
18+
labels:
19+
tactic.id: TA0006
20+
tactic.name: Persistence
21+
tactic.ref: https://attack.mitre.org/tactics/TA0006/
22+
technique.id: T1137
23+
technique.name: Office Application Startup
24+
technique.ref: https://attack.mitre.org/techniques/T1137/
25+
subtechnique.id: T1137.001
26+
subtechnique.name: Office Template Macros
27+
subtechnique.ref: https://attack.mitre.org/techniques/T1137/001/
28+
rules:
29+
- name: Suspicious Office template created
30+
description: |
31+
Detects when attackers drop macro-enabled files in specific
32+
folders to trigger their execution every time the victim user
33+
opens an Office application.
34+
condition: >
35+
create_file
36+
and
37+
file.name imatches
38+
(
39+
'?:\\Users\\*\\AppData\\Roaming\\Microsoft\\Word\\Startup\\*',
40+
'?:\\Users\\*\\AppData\\Roaming\\Microsoft\\Templates\\*.dotm',
41+
'?:\\Users\\*\\AppData\\Roaming\\Microsoft\\Excel\\XLSTART\\*',
42+
'?:\\Users\\*\\AppData\\Roaming\\Microsoft\\AddIns\\*',
43+
'?:\\Users\\*\\AppData\\Roaming\\Microsoft\\Outlook\\*.otm'
44+
)
45+
and
46+
not
47+
ps.name iin msoffice_binaries
48+
output: >
49+
%file.name Office template written by unusual %ps.exe process
50+
min-engine-version: 2.0.0

0 commit comments

Comments
 (0)