Detection rules › Elastic

Script Execution from WebDav

Source
github.com/elastic/protections-artifacts

Identifies attempt to execute Windows scripts from a remote WebDav Share. Adversaries may abuse this method to evade dropping malicious files to victim file system.

MITRE ATT&CK coverage

Rule body

[rule]
description = """
Identifies attempt to execute Windows scripts from a remote WebDav Share. Adversaries may abuse this method to evade
dropping malicious files to victim file system.
"""
id = "4bdd5646-f7b2-4e1d-962d-fd0f591f8f87"
license = "Elastic License v2"
name = "Script Execution from WebDav"
os_list = ["windows"]
version = "1.0.4"

query = '''
process where event.action == "start" and
 process.name : ("cmd.exe", "powershell.exe", "conhost.exe", "replace.exe", "wscript.exe", "cscript.exe", "mshta.exe", "regsvr32.exe") and
 (process.command_line : ("*@SSL\\*", "*\\webdav\\*", "*\\DavWWWRoot\\*") or process.args : ("\\\\*.*@8080\\*", "\\\\*.*@80\\*", "\\\\*.*@8443\\*", "\\\\*.*@443\\*")) and
 not (process.name : "cmd.exe" and process.args : "\\\\?\\UNC\\*.sharepoint.com@SSL\\DavWWWRoot\\*")
'''

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

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

[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1204"
name = "User Execution"
reference = "https://attack.mitre.org/techniques/T1204/"
[[threat.technique.subtechnique]]
id = "T1204.002"
name = "Malicious File"
reference = "https://attack.mitre.org/techniques/T1204/002/"



[threat.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1021"
name = "Remote Services"
reference = "https://attack.mitre.org/techniques/T1021/"
[[threat.technique.subtechnique]]
id = "T1021.002"
name = "SMB/Windows Admin Shares"
reference = "https://attack.mitre.org/techniques/T1021/002/"



[threat.tactic]
id = "TA0008"
name = "Lateral Movement"
reference = "https://attack.mitre.org/tactics/TA0008/"

[internal]
min_endpoint_version = "7.15.0"

Stages and Predicates

Stage 1: process

process where event.action == "start" and
 process.name : ("cmd.exe", "powershell.exe", "conhost.exe", "replace.exe", "wscript.exe", "cscript.exe", "mshta.exe", "regsvr32.exe") and
 (process.command_line : ("*@SSL\\*", "*\\webdav\\*", "*\\DavWWWRoot\\*") or process.args : ("\\\\*.*@8080\\*", "\\\\*.*@80\\*", "\\\\*.*@8443\\*", "\\\\*.*@443\\*")) and
 not (process.name : "cmd.exe" and process.args : "\\\\?\\UNC\\*.sharepoint.com@SSL\\DavWWWRoot\\*")

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.argswildcard\\?\UNC\*.sharepoint.com@SSL\DavWWWRoot\*excludes:process.args field:"process.args" value:"\\?\UNC\*.sharepoint.com@SSL\DavWWWRoot\*"
process.nameeqcmd.exeexcludes:process.name field:"process.name" value:"cmd.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.argswildcard
  • \\*.*@443\*
  • \\*.*@8080\*
  • \\*.*@80\*
  • \\*.*@8443\*
field:"process.args" kind:wildcard
process.command_linewildcard
  • *@SSL\*
  • *\DavWWWRoot\* corpus 3 (sigma 2, elastic 1)
  • *\webdav\*
field:"CommandLine" kind:wildcard
process.namewildcard
  • cmd.exe corpus 121 (elastic 92, splunk 29)
  • conhost.exe corpus 12 (elastic 11, splunk 1)
  • cscript.exe corpus 67 (elastic 65, splunk 2)
  • mshta.exe corpus 84 (elastic 79, splunk 5)
  • powershell.exe corpus 184 (elastic 140, splunk 44)
  • regsvr32.exe corpus 73 (elastic 68, splunk 5)
  • replace.exe corpus 2 (elastic 2)
  • wscript.exe corpus 83 (elastic 82, splunk 1)
field:"process_name" kind:wildcard