Detection rules › Elastic

Potential Execution via LNK Stomping

Time window
3s
Sequence by
process.entity_id, process.parent.entity_id
Source
github.com/elastic/protections-artifacts

Identifies the overwrite of a Windows shortcut (lnk) file by processes that defaults to handle archive extraction. This could be the result of an attempt to bypass bypass Microsoft SmartScreen protection.

MITRE ATT&CK coverage

Rule body

[rule]
description = """
Identifies the overwrite of a Windows shortcut (lnk) file by processes that defaults to handle archive extraction. This
could be the result of an attempt to bypass bypass Microsoft SmartScreen protection.
"""
id = "27d1b0dc-a50c-4e7b-9ec5-961351fbe819"
license = "Elastic License v2"
name = "Potential Execution via LNK Stomping"
os_list = ["windows"]
reference = ["https://www.elastic.co/security-labs/dismantling-smart-app-control"]
version = "1.0.3"

query = '''
sequence with maxspan=3s
[file where event.action == "overwrite" and file.extension : "lnk" and
 process.name : ("explorer.exe", "7zFM.exe", "WinRAR.exe", "Bandizip.exe") and file.Ext.header_bytes : "4c0000000114020000000000c0000000" and
 process.thread.Ext.call_stack_summary : "ntdll.dll|*|windows.storage.dll|shell32.dll|*" and
 (
  file.path : ("?:\\Users\\*\\Downloads\\*.lnk", "?:\\Users\\*\\AppData\\Local\\Temp\\*.lnk") or
  file.Ext.windows.zone_identifier == 3
  )] by process.entity_id
 [process where event.action == "start" and
  process.parent.name : ("explorer.exe", "7zFM.exe", "WinRAR.exe", "Bandizip.exe") and
   not process.executable : ("C:\\Program Files (x86)\\*.exe", "C:\\Program Files\\*.exe")] by process.parent.entity_id
'''

min_endpoint_version = "8.7.0"
optional_actions = []
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 1

[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1566"
name = "Phishing"
reference = "https://attack.mitre.org/techniques/T1566/"
[[threat.technique.subtechnique]]
id = "T1566.001"
name = "Spearphishing Attachment"
reference = "https://attack.mitre.org/techniques/T1566/001/"

[[threat.technique.subtechnique]]
id = "T1566.002"
name = "Spearphishing Link"
reference = "https://attack.mitre.org/techniques/T1566/002/"



[threat.tactic]
id = "TA0001"
name = "Initial Access"
reference = "https://attack.mitre.org/tactics/TA0001/"
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1204"
name = "User Execution"
reference = "https://attack.mitre.org/techniques/T1204/"
[[threat.technique.subtechnique]]
id = "T1204.001"
name = "Malicious Link"
reference = "https://attack.mitre.org/techniques/T1204/001/"



[threat.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"

[internal]
min_endpoint_version = "8.7.0"

Stages and Predicates

Ordered sequence: each step below must occur in order within 3s, correlated by process.entity_id, process.parent.entity_id.

Stage 1: file

[file where event.action == "overwrite" and file.extension : "lnk" and
 process.name : ("explorer.exe", "7zFM.exe", "WinRAR.exe", "Bandizip.exe") and file.Ext.header_bytes : "4c0000000114020000000000c0000000" and
 process.thread.Ext.call_stack_summary : "ntdll.dll|*|windows.storage.dll|shell32.dll|*" and
 (
  file.path : ("?:\\Users\\*\\Downloads\\*.lnk", "?:\\Users\\*\\AppData\\Local\\Temp\\*.lnk") or
  file.Ext.windows.zone_identifier == 3
  )] by process.entity_id

Stage 2: process

[process where event.action == "start" and
  process.parent.name : ("explorer.exe", "7zFM.exe", "WinRAR.exe", "Bandizip.exe") and
   not process.executable : ("C:\\Program Files (x86)\\*.exe", "C:\\Program Files\\*.exe")] by process.parent.entity_id

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.executablewildcardC:\Program Files (x86)\*.exe, C:\Program Files\*.exeexcludes:process.executable field:"process.executable" value:"C:\Program Files (x86)\*.exe" field:"process.executable" value:"C:\Program Files\*.exe"

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actioneq
  • overwrite corpus 8 (elastic 8)
  • start corpus 391 (elastic 391)
field:"EventType" kind:eq
file.Ext.header_byteswildcard
  • 4c0000000114020000000000c0000000 corpus 2 (elastic 2)
field:"file.Ext.header_bytes" kind:wildcard value:"4c0000000114020000000000c0000000"
file.Ext.windows.zone_identifiereq
  • 3 transforms: number corpus 6 (elastic 6)
field:"file.Ext.windows.zone_identifier" kind:eq value:"3"
file.extensionwildcard
  • lnk corpus 9 (elastic 9)
field:"file.extension" kind:wildcard value:"lnk"
file.pathwildcard
  • ?:\Users\*\AppData\Local\Temp\*.lnk corpus 2 (elastic 2)
  • ?:\Users\*\Downloads\*.lnk corpus 2 (elastic 2)
field:"TargetFilename" kind:wildcard
process.namewildcard
  • 7zFM.exe corpus 7 (elastic 7)
  • Bandizip.exe corpus 5 (elastic 5)
  • WinRAR.exe corpus 9 (elastic 9)
  • explorer.exe corpus 21 (elastic 19, splunk 2)
field:"process_name" kind:wildcard
process.parent.namewildcard
  • 7zFM.exe corpus 12 (elastic 12)
  • Bandizip.exe corpus 5 (elastic 5)
  • WinRAR.exe corpus 15 (elastic 14, splunk 1)
  • explorer.exe corpus 51 (elastic 50, splunk 1)
field:"parent_process_name" kind:wildcard
process.thread.Ext.call_stack_summarywildcard
  • ntdll.dll|*|windows.storage.dll|shell32.dll|* corpus 2 (elastic 2)
field:"process.thread.Ext.call_stack_summary" kind:wildcard value:"ntdll.dll|*|windows.storage.dll|shell32.dll|*"