Detection rules › Elastic

Execution of Commonly Abused Utilities via Explorer Trampoline

Source
github.com/elastic/protections-artifacts

Identifies the execution of commonly abused utilities to run DLLs or scripts via a separate Windows Explorer trampoline. Explorer can be abused to launch malicious scripts or executables from a trusted parent process.

MITRE ATT&CK coverage

Rule body

[rule]
description = """
Identifies the execution of commonly abused utilities to run DLLs or scripts via a separate Windows Explorer trampoline.
Explorer can be abused to launch malicious scripts or executables from a trusted parent process.
"""
id = "5e8498bb-8cc0-412f-9017-793d94ab76a5"
license = "Elastic License v2"
name = "Execution of Commonly Abused Utilities via Explorer Trampoline"
os_list = ["windows"]
reference = ["https://lolbas-project.github.io/lolbas/Binaries/Explorer/"]
version = "1.0.36"

query = '''
process where event.action == "start" and
  (
   process.name : ("cscript.exe", "wscript.exe", "rundll32.exe", "mshta.exe", "regsvr32.exe") or
   process.pe.original_file_name :
               ("cscript.exe",
                "wscript.exe",
                "rundll32.exe",
                "mshta.exe",
                "regsvr32.exe")
  ) and
  /* Explorer started via DCOM */
  process.parent.name : "explorer.exe" and process.parent.command_line : "*/factory,{75dff2b7-6936-4c06-a8bb-676a7b00b24b}*" and
  not
     (
      process.name : "rundll32.exe" and
      process.args : ("rundll32.exe*\\Users\\*\\AppData\\Local\\Cognitas\\CrossLink6\\csathl32.dll*",
                      /* Issue #340 */
                      "*dfshim.dll*ShOpenVerbApplication*",
                      "dfshim.dll,",
                      "?:\\WINDOWS\\system32\\hotplug.dll,HotPlugSafeRemovalDriveNotification",
                      "cryptext.dll,CryptExtOpen*",
                      "cryptext.dll,CryptExtAddCER",
                      "ndfapi.dll,NdfRunDllDiagnoseWithAnswerFile",
                      "shwebsvc.dll,AddNetPlaceRunDll",
                      "?:\\Program Files\\Windows Photo Viewer\\PhotoViewer.dll*",
                      "?:\\Windows\\system32\\hotplug.dll,HotPlugSafeRemovalDriveNotification",
                      "devmgr.dll,DeviceProperties_RunDLL",
                      "printui.dll,PrintUIEntryDPIAware",
                      "?:\\windows\\System32\\srchadmin.dll",
                      "fdprint,InvokeTask",
                      "cryptext.dll,CryptExtAddPFX",
                      "shell32.dll,SHCreateLocalServerRunDll",
                      "?:\\WINDOWS\\System32\\SHELL32.dll,RunAsNewUser_RunDLL", 
                      "?:\\WINDOWS\\system32\\spool\\DRIVERS\\x64\\3\\*",
                      "C:\\Program Files (x86)\\Stardock\\Fences\\FencesMenu64.dll,StartFences",
                      "C:\\Windows\\System32\\*.cpl")
      ) and
  not (process.name : ("wscript.exe", "cscript.exe") and
       process.args : ("\\\\*.vbs", "C:\\Robocopy\\robocopy_Mail_Config_Veeam.vbs", "C:\\Users\\*\\Documents\\*.vbs", "X:\\*.vbs", "W:\\*.vbs"))
'''

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

[[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.tactic]
id = "TA0001"
name = "Initial Access"
reference = "https://attack.mitre.org/tactics/TA0001/"
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1059"
name = "Command and Scripting Interpreter"
reference = "https://attack.mitre.org/techniques/T1059/"
[[threat.technique.subtechnique]]
id = "T1059.001"
name = "PowerShell"
reference = "https://attack.mitre.org/techniques/T1059/001/"

[[threat.technique.subtechnique]]
id = "T1059.007"
name = "JavaScript"
reference = "https://attack.mitre.org/techniques/T1059/007/"



[threat.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1218"
name = "System Binary Proxy Execution"
reference = "https://attack.mitre.org/techniques/T1218/"
[[threat.technique.subtechnique]]
id = "T1218.005"
name = "Mshta"
reference = "https://attack.mitre.org/techniques/T1218/005/"

[[threat.technique.subtechnique]]
id = "T1218.010"
name = "Regsvr32"
reference = "https://attack.mitre.org/techniques/T1218/010/"

[[threat.technique.subtechnique]]
id = "T1218.011"
name = "Rundll32"
reference = "https://attack.mitre.org/techniques/T1218/011/"



[threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"

[internal]
min_endpoint_version = "7.15.0"

Stages and Predicates

Stage 1: process

process where event.action == "start" and
  (
   process.name : ("cscript.exe", "wscript.exe", "rundll32.exe", "mshta.exe", "regsvr32.exe") or
   process.pe.original_file_name :
               ("cscript.exe",
                "wscript.exe",
                "rundll32.exe",
                "mshta.exe",
                "regsvr32.exe")
  ) and
  process.parent.name : "explorer.exe" and process.parent.command_line : "*/factory,{75dff2b7-6936-4c06-a8bb-676a7b00b24b}*" and
  not
     (
      process.name : "rundll32.exe" and
      process.args : ("rundll32.exe*\\Users\\*\\AppData\\Local\\Cognitas\\CrossLink6\\csathl32.dll*",
                      "*dfshim.dll*ShOpenVerbApplication*",
                      "dfshim.dll,",
                      "?:\\WINDOWS\\system32\\hotplug.dll,HotPlugSafeRemovalDriveNotification",
                      "cryptext.dll,CryptExtOpen*",
                      "cryptext.dll,CryptExtAddCER",
                      "ndfapi.dll,NdfRunDllDiagnoseWithAnswerFile",
                      "shwebsvc.dll,AddNetPlaceRunDll",
                      "?:\\Program Files\\Windows Photo Viewer\\PhotoViewer.dll*",
                      "?:\\Windows\\system32\\hotplug.dll,HotPlugSafeRemovalDriveNotification",
                      "devmgr.dll,DeviceProperties_RunDLL",
                      "printui.dll,PrintUIEntryDPIAware",
                      "?:\\windows\\System32\\srchadmin.dll",
                      "fdprint,InvokeTask",
                      "cryptext.dll,CryptExtAddPFX",
                      "shell32.dll,SHCreateLocalServerRunDll",
                      "?:\\WINDOWS\\System32\\SHELL32.dll,RunAsNewUser_RunDLL",
                      "?:\\WINDOWS\\system32\\spool\\DRIVERS\\x64\\3\\*",
                      "C:\\Program Files (x86)\\Stardock\\Fences\\FencesMenu64.dll,StartFences",
                      "C:\\Windows\\System32\\*.cpl")
      ) and
  not (process.name : ("wscript.exe", "cscript.exe") and
       process.args : ("\\\\*.vbs", "C:\\Robocopy\\robocopy_Mail_Config_Veeam.vbs", "C:\\Users\\*\\Documents\\*.vbs", "X:\\*.vbs", "W:\\*.vbs"))

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.argswildcard\\*.vbs, C:\Robocopy\robocopy_Mail_Config_Veeam.vbs, C:\Users\*\Documents\*.vbs, X:\*.vbs, W:\*.vbsexcludes:process.args
process.nameeqwscript.exe, cscript.exeexcludes:process.name field:"process.name" value:"wscript.exe" field:"process.name" value:"cscript.exe"
process.argswildcardrundll32.exe*\Users\*\AppData\Local\Cognitas\CrossLink6\csathl32.dll*, *dfshim.dll*ShOpenVerbApplication*, dfshim.dll,, ?:\WINDOWS\system32\hotplug.dll,HotPlugSafeRemovalDriveNotification, cryptext.dll,CryptExtOpen*, cryptext.dll,CryptExtAddCER, ndfapi.dll,NdfRunDllDiagnoseWithAnswerFile, shwebsvc.dll,AddNetPlaceRunDll, ?:\Program Files\Windows Photo Viewer\PhotoViewer.dll*, ?:\Windows\system32\hotplug.dll,HotPlugSafeRemovalDriveNotification, devmgr.dll,DeviceProperties_RunDLL, printui.dll,PrintUIEntryDPIAware, ?:\windows\System32\srchadmin.dll, fdprint,InvokeTask, cryptext.dll,CryptExtAddPFX, shell32.dll,SHCreateLocalServerRunDll, ?:\WINDOWS\System32\SHELL32.dll,RunAsNewUser_RunDLL, ?:\WINDOWS\system32\spool\DRIVERS\x64\3\*, C:\Program Files (x86)\Stardock\Fences\FencesMenu64.dll,StartFences, C:\Windows\System32\*.cplexcludes:process.args
process.nameeqrundll32.exeexcludes:process.name field:"process.name" value:"rundll32.exe"

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actioneq
  • start corpus 391 (elastic 391)
field:"EventType" kind:eq value:"start"
process.namewildcard
  • cscript.exe corpus 67 (elastic 65, splunk 2)
  • mshta.exe corpus 84 (elastic 79, splunk 5)
  • 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.parent.command_linewildcard
  • */factory,{75dff2b7-6936-4c06-a8bb-676a7b00b24b}*
field:"ParentCommandLine" kind:wildcard value:"*/factory,{75dff2b7-6936-4c06-a8bb-676a7b00b24b}*"
process.parent.namewildcard
  • explorer.exe corpus 51 (elastic 50, splunk 1)
field:"parent_process_name" kind:wildcard value:"explorer.exe"
process.pe.original_file_namewildcard
  • cscript.exe corpus 32 (sigma 17, elastic 15)
  • mshta.exe corpus 40 (elastic 21, sigma 13, splunk 6)
  • regsvr32.exe corpus 37 (sigma 17, elastic 15, splunk 5)
  • rundll32.exe corpus 78 (sigma 35, elastic 22, splunk 21)
  • wscript.exe corpus 38 (elastic 21, sigma 17)
field:"OriginalFileName" kind:wildcard