Detection rules › Elastic

Suspicious Shortcut Modification

Time window
1m
Sequence by
process.entity_id
Source
github.com/elastic/protections-artifacts

Adversaries may create or modify shortcuts that can execute a program during system boot or user login. Shortcuts are used to reference other files or programs that will be opened or executed when the shortcut is clicked or executed by a system startup process.

MITRE ATT&CK coverage

Rule body

[rule]
description = """
Adversaries may create or modify shortcuts that can execute a program during system boot or user login. Shortcuts are
used to reference other files or programs that will be opened or executed when the shortcut is clicked or executed by a
system startup process.
"""
id = "8bfc0b79-b3f1-4869-98b9-745b0bf1cb6e"
license = "Elastic License v2"
name = "Suspicious Shortcut Modification"
os_list = ["windows"]
version = "1.0.36"

query = '''
sequence by process.entity_id with maxspan=1m
[process where event.action == "start" and
 not user.id : ("S-1-5-18", "S-1-5-19", "S-1-5-20") and process.hash.sha256 != null and
 (
  process.name : ("rundll32.exe", "regsvr32.exe", "powershell.exe", "wscript.exe", "curl.exe", "certutil.exe", "cmd.exe") or
  ((process.Ext.relative_file_creation_time <= 300 or process.Ext.relative_file_name_modify_time <= 300) and
     not process.code_signature.status : "trusted")
 ) and 
 not process.executable : 
           ("?:\\Program Files\\*.exe", 
            "?:\\Program Files (x86)\\*.exe",
            "?:\\Config.Msi\\*.rbf",
            "?:\\Users\\*\\AppData\\Local\\Microsoft\\Edge\\Application\\*\\Installer\\setup.exe",
            "?:\\Windows\\servicing\\TrustedInstaller.exe",
            "?:\\Windows\\SystemApps\\*.exe",
            "?:\\Windows\\System32\\DeviceEnroller.exe",
            "?:\\Windows\\CCM\\UpdateTrustedSites.exe",
            "?:\\Users\\*\\AppData\\Local\\Microsoft\\Edge\\Application\\msedge.exe",
            "C:\\Program Files (x86)\\Lizard\\GPProcessing\\RunScript.exe") and
  not (process.code_signature.subject_name :
          ("Google*",
           "Notepad*",
           "Slack*",
           "Mozilla*",
           "Zoom*",
           "Discord*",
           "Citrix Systems, Inc.") and
       process.code_signature.trusted == true) and
  not (process.executable : "?:\\Users\\*\\Microsoft\\EdgeUpdate\\Install\\*\\setup.exe" and
       process.code_signature.subject_name : "Microsoft*" and process.code_signature.trusted == true) and

  not (process.executable : "?:\\Users\\*\\AppData\\Local\\Microsoft\\Teams\\current\\Teams.exe" and
        process.code_signature.trusted == true and process.code_signature.subject_name : "Microsoft Corporation") and 
  not (process.name : ("wscript.exe", "cscript.exe", "cmd.exe") and process.command_line : "*\\\\*\\SysVol\\*") and 
  not (process.name : "cmd.exe" and process.args : "*.bat ") and
  not (process.name : "powershell.exe" and process.args : ("C:\\Windows\\Managetaskbar\\taskband.ps1", "C:\\Program Files\\ATERA Networks\\AteraAgent\\Packages\\AgentPackageSystemTools\\*_AddOfficeIconsToDesktop.ps1")) and
  /* unsigned Notepad++ installer */
  not process.pe.imphash in ("9dda1a1d1f8a1d13ae0297b47046b26e", "7fa974366048f9c551ef45714595665e") and
  not (process.name : "rundll32.exe" and process.args :"shell32.dll,SHCreateLocalServerRunDll" and process.parent.name : "svchost.exe") and
  not process.hash.sha256 in ("7a8998de0f56fb3303d071d6d87bd9c1b4472bc84bba5090993936a8bc819771", "bd68b94f58ad350ccb89f6b9e2b2f473731239fb0aa1902c21cb83e117d66b2e")
 ]
[file where event.action == "overwrite" and file.extension : "lnk" and process.pid != 4 and 
 process.executable : "?:\\*" and
  file.path :
     ("?:\\Users\\*\\Desktop\\*.lnk",
      "?:\\Users\\*\\Microsoft\\Internet Explorer\\Quick Launch\\*.lnk",
      "?:\\ProgramData\\Microsoft\\Windows\\Start Menu\\Programs\\*.lnk",
      "?:\\Users\\*\\Start Menu\\Programs\\Startup\\*.lnk",
      "?:\\Users\\*\\AppData\\Roaming\\Microsoft\\Windows\\Start Menu\\Programs\\*.lnk") and
  file.Ext.header_bytes : "4c000000*" and
  file.name : ("Google Chrome.lnk", "Outlook.lnk", "Microsoft Outlook.lnk","Microsoft Edge.lnk",
               "Mozilla Thunderbird.lnk", "Firefox.lnk", "Word.lnk", "Excel.lnk", "Notepad++.lnk",
               "File Explorer.lnk", "PowerPoint.lnk", "Zoom.lnk", "slack.lnk", "Discord.lnk") and
  not (file.name == "Notepad++.lnk" and process.code_signature.subject_name == "Notepad++")]
'''

min_endpoint_version = "8.6.0"
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0

[[optional_actions]]
action = "rollback"
field = "process.entity_id"
state = 0

[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1547"
name = "Boot or Logon Autostart Execution"
reference = "https://attack.mitre.org/techniques/T1547/"
[[threat.technique.subtechnique]]
id = "T1547.009"
name = "Shortcut Modification"
reference = "https://attack.mitre.org/techniques/T1547/009/"



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

[internal]
min_endpoint_version = "8.6.0"

Stages and Predicates

Ordered sequence: each step below must occur in order within 1m, correlated by process.entity_id.

Stage 1: process

[process where event.action == "start" and
 not user.id : ("S-1-5-18", "S-1-5-19", "S-1-5-20") and process.hash.sha256 != null and
 (
  process.name : ("rundll32.exe", "regsvr32.exe", "powershell.exe", "wscript.exe", "curl.exe", "certutil.exe", "cmd.exe") or
  ((process.Ext.relative_file_creation_time <= 300 or process.Ext.relative_file_name_modify_time <= 300) and
     not process.code_signature.status : "trusted")
 ) and
 not process.executable :
           ("?:\\Program Files\\*.exe",
            "?:\\Program Files (x86)\\*.exe",
            "?:\\Config.Msi\\*.rbf",
            "?:\\Users\\*\\AppData\\Local\\Microsoft\\Edge\\Application\\*\\Installer\\setup.exe",
            "?:\\Windows\\servicing\\TrustedInstaller.exe",
            "?:\\Windows\\SystemApps\\*.exe",
            "?:\\Windows\\System32\\DeviceEnroller.exe",
            "?:\\Windows\\CCM\\UpdateTrustedSites.exe",
            "?:\\Users\\*\\AppData\\Local\\Microsoft\\Edge\\Application\\msedge.exe",
            "C:\\Program Files (x86)\\Lizard\\GPProcessing\\RunScript.exe") and
  not (process.code_signature.subject_name :
          ("Google*",
           "Notepad*",
           "Slack*",
           "Mozilla*",
           "Zoom*",
           "Discord*",
           "Citrix Systems, Inc.") and
       process.code_signature.trusted == true) and
  not (process.executable : "?:\\Users\\*\\Microsoft\\EdgeUpdate\\Install\\*\\setup.exe" and
       process.code_signature.subject_name : "Microsoft*" and process.code_signature.trusted == true) and
  not (process.executable : "?:\\Users\\*\\AppData\\Local\\Microsoft\\Teams\\current\\Teams.exe" and
        process.code_signature.trusted == true and process.code_signature.subject_name : "Microsoft Corporation") and
  not (process.name : ("wscript.exe", "cscript.exe", "cmd.exe") and process.command_line : "*\\\\*\\SysVol\\*") and
  not (process.name : "cmd.exe" and process.args : "*.bat ") and
  not (process.name : "powershell.exe" and process.args : ("C:\\Windows\\Managetaskbar\\taskband.ps1", "C:\\Program Files\\ATERA Networks\\AteraAgent\\Packages\\AgentPackageSystemTools\\*_AddOfficeIconsToDesktop.ps1")) and
  not process.pe.imphash in ("9dda1a1d1f8a1d13ae0297b47046b26e", "7fa974366048f9c551ef45714595665e") and
  not (process.name : "rundll32.exe" and process.args :"shell32.dll,SHCreateLocalServerRunDll" and process.parent.name : "svchost.exe") and
  not process.hash.sha256 in ("7a8998de0f56fb3303d071d6d87bd9c1b4472bc84bba5090993936a8bc819771", "bd68b94f58ad350ccb89f6b9e2b2f473731239fb0aa1902c21cb83e117d66b2e")
 ]

Stage 2: file

[file where event.action == "overwrite" and file.extension : "lnk" and process.pid != 4 and 
 process.executable : "?:\\*" and
  file.path :
     ("?:\\Users\\*\\Desktop\\*.lnk",
      "?:\\Users\\*\\Microsoft\\Internet Explorer\\Quick Launch\\*.lnk",
      "?:\\ProgramData\\Microsoft\\Windows\\Start Menu\\Programs\\*.lnk",
      "?:\\Users\\*\\Start Menu\\Programs\\Startup\\*.lnk",
      "?:\\Users\\*\\AppData\\Roaming\\Microsoft\\Windows\\Start Menu\\Programs\\*.lnk") and
  file.Ext.header_bytes : "4c000000*" and
  file.name : ("Google Chrome.lnk", "Outlook.lnk", "Microsoft Outlook.lnk","Microsoft Edge.lnk",
               "Mozilla Thunderbird.lnk", "Firefox.lnk", "Word.lnk", "Excel.lnk", "Notepad++.lnk",
               "File Explorer.lnk", "PowerPoint.lnk", "Zoom.lnk", "slack.lnk", "Discord.lnk") and
  not (file.name == "Notepad++.lnk" and process.code_signature.subject_name == "Notepad++")]

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.argsends_with.bat excludes:process.args field:"process.args" value:".bat "
process.nameeqcmd.exeexcludes:process.name field:"process.name" value:"cmd.exe"
process.argseqshell32.dll,SHCreateLocalServerRunDllexcludes:process.args field:"process.args" value:"shell32.dll,SHCreateLocalServerRunDll"
process.nameeqrundll32.exeexcludes:process.name field:"process.name" value:"rundll32.exe"
process.parent.nameeqsvchost.exeexcludes:process.parent.name field:"process.parent.name" value:"svchost.exe"
process.argswildcardC:\Windows\Managetaskbar\taskband.ps1, C:\Program Files\ATERA Networks\AteraAgent\Packages\AgentPackageSystemTools\*_AddOfficeIconsToDesktop.ps1excludes:process.args field:"process.args" value:"C:\Windows\Managetaskbar\taskband.ps1" field:"process.args" value:"C:\Program Files\ATERA Networks\AteraAgent\Packages\AgentPackageSystemTools\*_AddOfficeIconsToDesktop.ps1"
process.nameeqpowershell.exeexcludes:process.name field:"process.name" value:"powershell.exe"
process.code_signature.subject_nameeqMicrosoft Corporationexcludes:process.code_signature.subject_name field:"process.code_signature.subject_name" value:"Microsoft Corporation"
process.code_signature.trustedeqtrueexcludes:process.code_signature.trusted field:"process.code_signature.trusted" value:"true"
process.executablewildcard?:\Users\*\AppData\Local\Microsoft\Teams\current\Teams.exeexcludes:process.executable field:"process.executable" value:"?:\Users\*\AppData\Local\Microsoft\Teams\current\Teams.exe"
process.code_signature.subject_namestarts_withMicrosoftexcludes:process.code_signature.subject_name field:"process.code_signature.subject_name" value:"Microsoft"
process.executablewildcard?:\Users\*\Microsoft\EdgeUpdate\Install\*\setup.exeexcludes:process.executable field:"process.executable" value:"?:\Users\*\Microsoft\EdgeUpdate\Install\*\setup.exe"
process.code_signature.subject_namewildcardGoogle*, Notepad*, Slack*, Mozilla*, Zoom*, Discord*, Citrix Systems, Inc.excludes:process.code_signature.subject_name
process.command_linewildcard*\\*\SysVol\*excludes:process.command_line field:"process.command_line" value:"*\\*\SysVol\*"
process.nameeqwscript.exe, cscript.exe, cmd.exeexcludes:process.name field:"process.name" value:"wscript.exe" field:"process.name" value:"cscript.exe" field:"process.name" value:"cmd.exe"
process.executablewildcard?:\Program Files\*.exe, ?:\Program Files (x86)\*.exe, ?:\Config.Msi\*.rbf, ?:\Users\*\AppData\Local\Microsoft\Edge\Application\*\Installer\setup.exe, ?:\Windows\servicing\TrustedInstaller.exe, ?:\Windows\SystemApps\*.exe, ?:\Windows\System32\DeviceEnroller.exe, ?:\Windows\CCM\UpdateTrustedSites.exe, ?:\Users\*\AppData\Local\Microsoft\Edge\Application\msedge.exe, C:\Program Files (x86)\Lizard\GPProcessing\RunScript.exeexcludes:process.executable
process.hash.sha256in7a8998de0f56fb3303d071d6d87bd9c1b4472bc84bba5090993936a8bc819771, bd68b94f58ad350ccb89f6b9e2b2f473731239fb0aa1902c21cb83e117d66b2eexcludes:process.hash.sha256 field:"process.hash.sha256" value:"7a8998de0f56fb3303d071d6d87bd9c1b4472bc84bba5090993936a8bc819771" field:"process.hash.sha256" value:"bd68b94f58ad350ccb89f6b9e2b2f473731239fb0aa1902c21cb83e117d66b2e"
process.pe.imphashin7fa974366048f9c551ef45714595665e, 9dda1a1d1f8a1d13ae0297b47046b26eexcludes:process.pe.imphash field:"process.pe.imphash" value:"7fa974366048f9c551ef45714595665e" field:"process.pe.imphash" value:"9dda1a1d1f8a1d13ae0297b47046b26e"
user.ideqS-1-5-18, S-1-5-19, S-1-5-20excludes:user.id field:"user.id" value:"S-1-5-18" field:"user.id" value:"S-1-5-19" field:"user.id" value:"S-1-5-20"
file.nameeqNotepad++.lnkexcludes:file.name field:"file.name" value:"Notepad++.lnk"
process.code_signature.subject_nameeqNotepad++excludes:process.code_signature.subject_name field:"process.code_signature.subject_name" value:"Notepad++"

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
  • 4c000000* corpus 2 (elastic 2)
field:"file.Ext.header_bytes" kind:wildcard value:"4c000000*"
file.extensionwildcard
  • lnk corpus 9 (elastic 9)
field:"file.extension" kind:wildcard value:"lnk"
file.namewildcard
  • Discord.lnk
  • Excel.lnk
  • File Explorer.lnk
  • Firefox.lnk
  • Google Chrome.lnk
  • Microsoft Edge.lnk
  • Microsoft Outlook.lnk
  • Mozilla Thunderbird.lnk
  • Notepad++.lnk
  • Outlook.lnk
  • PowerPoint.lnk
  • Word.lnk
  • Zoom.lnk
  • slack.lnk
field:"file.name" kind:wildcard
file.pathwildcard
  • ?:\ProgramData\Microsoft\Windows\Start Menu\Programs\*.lnk
  • ?:\Users\*\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\*.lnk
  • ?:\Users\*\Desktop\*.lnk corpus 3 (elastic 3)
  • ?:\Users\*\Microsoft\Internet Explorer\Quick Launch\*.lnk
  • ?:\Users\*\Start Menu\Programs\Startup\*.lnk
field:"TargetFilename" kind:wildcard
process.Ext.relative_file_creation_timele
  • 300 transforms: number corpus 11 (elastic 11)
field:"process.Ext.relative_file_creation_time" kind:le value:"300"
process.Ext.relative_file_name_modify_timele
  • 300 transforms: number corpus 9 (elastic 9)
field:"process.Ext.relative_file_name_modify_time" kind:le value:"300"
process.executablewildcard
  • ?:\* corpus 18 (elastic 18)
field:"Image" kind:wildcard value:"?:\*"
process.hash.sha256is_not_null
  • (no value, null check)
field:"Hashes" kind:is_not_null
process.namewildcard
  • certutil.exe corpus 44 (elastic 38, splunk 6)
  • cmd.exe corpus 121 (elastic 92, splunk 29)
  • curl.exe corpus 34 (elastic 31, splunk 3)
  • powershell.exe corpus 184 (elastic 140, splunk 44)
  • regsvr32.exe corpus 73 (elastic 68, splunk 5)
  • rundll32.exe corpus 126 (elastic 100, splunk 26)
  • wscript.exe corpus 83 (elastic 82, splunk 1)
field:"process_name" kind:wildcard
process.pidne
  • 4 transforms: number corpus 44 (elastic 44)
field:"process_id" kind:ne value:"4"