Skip to content

Commit 2ad2e0e

Browse files
committed
feat(rules): Add Embedded script execution via shortcut file rule
Detects execution of embedded scripts delivered via Windows shortcut (.lnk) files. Adversaries can exploit the attack chain where a shortcut file is accessed by a scripting or command interpreter, followed by the creation of a payload in user-writable locations and the subsequent execution of a script.
1 parent 3d2d769 commit 2ad2e0e

1 file changed

Lines changed: 61 additions & 0 deletions

File tree

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Embedded script execution via shortcut file
2+
id: 2d94a68b-03fe-4ece-9a99-f4de8ff7261d
3+
version: 1.0.0
4+
description: |
5+
Detects execution of embedded scripts delivered via Windows shortcut (.lnk) files.
6+
Adversaries can exploit the attack chain where a shortcut file is accessed by a
7+
scripting or command interpreter, followed by the creation of a payload in
8+
user-writable locations and the subsequent execution of a script.
9+
labels:
10+
tactic.id: TA0002
11+
tactic.name: Execution
12+
tactic.ref: https://attack.mitre.org/tactics/TA0002/
13+
technique.id: T1204
14+
technique.name: User Execution
15+
technique.ref: https://attack.mitre.org/techniques/T1204/
16+
subtechnique.id: T1204.002
17+
subtechnique.name: Malicious File
18+
subtechnique.ref: https://attack.mitre.org/techniques/T1204/002/
19+
references:
20+
- https://unit42.paloaltonetworks.com/lnk-malware/
21+
- https://github.com/knight0x07/Lnk2Vbs/blob/main/lnk2vbs.py
22+
23+
condition: >
24+
sequence
25+
maxspan 1m
26+
by ps.sessionid
27+
|open_file and
28+
ps.name iin ('cmd.exe', 'findstr.exe', 'find.exe', 'powershell.exe', 'pwsh.exe') and
29+
file.path imatches '?:\\*.lnk'
30+
|
31+
|create_file and
32+
ps.name iin ('cmd.exe', 'powershell.exe', 'pwsh.exe') and
33+
file.path imatches
34+
(
35+
'?:\\Users\\*\\AppData\\Local\\*',
36+
'?:\\Users\\*\\AppData\\LocalLow\\*',
37+
'?:\\Users\\*\\AppData\\Roaming\\*',
38+
'?:\\Users\\Public\\*'
39+
)
40+
|
41+
|spawn_process and
42+
ps.name iin
43+
(
44+
'wscript.exe',
45+
'mshta.exe',
46+
'powershell.exe',
47+
'pwsh.exe',
48+
'cmd.exe',
49+
'connhost.exe',
50+
'rundll32.exe',
51+
'forfiles.exe',
52+
'wmic.exe',
53+
'msbuild.exe'
54+
)
55+
|
56+
action:
57+
- name: kill
58+
59+
severity: high
60+
61+
min-engine-version: 3.0.0

0 commit comments

Comments
 (0)