Detection rules › Elastic

Download Activity via a Headless Browser

Source
github.com/elastic/protections-artifacts

Identifies the use of a browser to download a file from a remote URL and from a suspicious parent process. Adversaries may use browsers to avoid ingress tool transfer restrictions.

MITRE ATT&CK coverage

TacticTechniques
Command & Control

Rule body

[rule]
description = """
Identifies the use of a browser to download a file from a remote URL and from a suspicious parent process. Adversaries
may use browsers to avoid ingress tool transfer restrictions.
"""
id = "e35465eb-2a6b-4b6a-abbf-0bc3d9a068d0"
license = "Elastic License v2"
name = "Download Activity via a Headless Browser"
os_list = ["windows"]
reference = ["https://lolbas-project.github.io/lolbas/Binaries/Msedge/"]
version = "1.0.5"

query = '''
process where event.action in ("start", "already_running") and
 process.name : ("chrome.exe", "msedge.exe", "brave.exe", "browser.exe", "dragon.exe", "vivaldi.exe") and
 (
  (process.args : "--headless*" and process.args : ("http*", "data:text/html;base64,*")) or
  process.command_line : ("*mh0dHBzOi8vd2ViaG9vay5zaXRl*", "*93ZWJob29rLnNpdGU*") or
  (process.args_count == 2 and process.args : "data:text/html;base64,*")
  ) and
  process.parent.name :
     ("cmd.exe", "powershell.exe", "wscript.exe", "cscript.exe", "mshta.exe", "conhost.exe", "msiexec.exe",
      "explorer.exe", "rundll32.exe", "winword.exe", "excel.exe", "onenote.exe", "hh.exe", "powerpnt.exe", "forfiles.exe",
      "pcalua.exe", "wmiprvse.exe") and
  not process.args : ("http://localhost/Allure#graph",  "--print-to-pdf=*")
'''

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

[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1105"
name = "Ingress Tool Transfer"
reference = "https://attack.mitre.org/techniques/T1105/"


[threat.tactic]
id = "TA0011"
name = "Command and Control"
reference = "https://attack.mitre.org/tactics/TA0011/"

[internal]
min_endpoint_version = "7.16.0"

Stages and Predicates

Stage 1: process

process where event.action in ("start", "already_running") and
 process.name : ("chrome.exe", "msedge.exe", "brave.exe", "browser.exe", "dragon.exe", "vivaldi.exe") and
 (
  (process.args : "--headless*" and process.args : ("http*", "data:text/html;base64,*")) or
  process.command_line : ("*mh0dHBzOi8vd2ViaG9vay5zaXRl*", "*93ZWJob29rLnNpdGU*") or
  (process.args_count == 2 and process.args : "data:text/html;base64,*")
  ) and
  process.parent.name :
     ("cmd.exe", "powershell.exe", "wscript.exe", "cscript.exe", "mshta.exe", "conhost.exe", "msiexec.exe",
      "explorer.exe", "rundll32.exe", "winword.exe", "excel.exe", "onenote.exe", "hh.exe", "powerpnt.exe", "forfiles.exe",
      "pcalua.exe", "wmiprvse.exe") and
  not process.args : ("http://localhost/Allure#graph",  "--print-to-pdf=*")

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.argswildcardhttp://localhost/Allure#graph, --print-to-pdf=*excludes:process.args field:"process.args" value:"http://localhost/Allure#graph" field:"process.args" value:"--print-to-pdf=*"

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actionin
  • already_running corpus 2 (elastic 2)
  • start corpus 391 (elastic 391)
field:"EventType" kind:in
process.argswildcard
  • --headless* corpus 2 (elastic 2)
  • data:text/html;base64,*
  • http* corpus 9 (elastic 9)
field:"process.args" kind:wildcard
process.args_counteq
  • 2 transforms: number corpus 37 (elastic 37)
field:"process.args_count" kind:eq value:"2"
process.command_linewildcard
  • *93ZWJob29rLnNpdGU*
  • *mh0dHBzOi8vd2ViaG9vay5zaXRl*
field:"CommandLine" kind:wildcard
process.namewildcard
  • brave.exe corpus 7 (elastic 7)
  • browser.exe corpus 7 (elastic 7)
  • chrome.exe corpus 16 (elastic 14, splunk 2)
  • dragon.exe corpus 7 (elastic 7)
  • msedge.exe corpus 12 (elastic 12)
  • vivaldi.exe corpus 6 (elastic 6)
field:"process_name" kind:wildcard
process.parent.namewildcard
  • cmd.exe corpus 36 (elastic 31, splunk 4, kusto 1)
  • conhost.exe corpus 8 (elastic 8)
  • cscript.exe corpus 16 (elastic 15, splunk 1)
  • excel.exe corpus 28 (elastic 27, splunk 1)
  • explorer.exe corpus 51 (elastic 50, splunk 1)
  • forfiles.exe corpus 6 (elastic 6)
  • hh.exe corpus 6 (elastic 5, splunk 1)
  • mshta.exe corpus 24 (elastic 22, splunk 2)
  • msiexec.exe corpus 19 (elastic 14, splunk 3, kusto 2)
  • onenote.exe corpus 3 (elastic 3)
  • pcalua.exe corpus 5 (elastic 5)
  • powerpnt.exe corpus 23 (elastic 23)
  • powershell.exe corpus 39 (elastic 36, kusto 2, splunk 1)
  • rundll32.exe corpus 20 (elastic 20)
  • winword.exe corpus 26 (elastic 26)
  • wmiprvse.exe corpus 25 (elastic 19, splunk 5, kusto 1)
  • wscript.exe corpus 24 (elastic 23, splunk 1)
field:"parent_process_name" kind:wildcard