Detection rules › Elastic

Suspicious Windows Script File Name

Source
github.com/elastic/protections-artifacts

Identifies the execution of a Windows script with a file name following commonly used phishing naming convention via including legit document and image extensions or keywords that may lure a victim user into opening the malicious script.

MITRE ATT&CK coverage

Rule body

[rule]
description = """
Identifies the execution of a Windows script with a file name following commonly used phishing naming convention via
including legit document and image extensions or keywords that may lure a victim user into opening the malicious script.
"""
id = "8c69476a-d8ea-46da-8052-6a4f9254125c"
license = "Elastic License v2"
name = "Suspicious Windows Script File Name"
os_list = ["windows"]
version = "1.0.34"

query = '''
process where event.action == "start" and
 (process.pe.original_file_name : ("cscript.exe", "wscript.exe", "mshta.exe") or (process.name : "javaw.exe" and process.args : "-jar")) and
 process.args_count >= 2 and
 process.command_line : ("*\\AppData\\*", "*\\outlook\\*", "*\\users\\public\\*", "*Menu\\Programs\\Startup\\*", "*\\Downloads\\*") and
 /* script name commonly used in phishing */
 process.args :
     (
      "*.pdf.js",
      "*.pdf.vbs",
      "*_pdf.vbs",
      "*_pdf.js",
      "*.doc.js",
      "*.doc.vbs",
      "*.docx.js",
      "*.docx.vbs",
      "*.ppt.js",
      "*.ppt.vbs",
      "*.xls.js",
      "*.xlsx.js",
      "*.xls.vbs",
      "*.xlsx.vbs",
      "*.jpg.js",
      "*.png.js",
      "*.jpg.vbs",
      "*.png.vbs",
      "*.pdf.hta",
      "_pdf.hta",
      "*pdf.wsf",
      "*.doc.hta",
      "*.xls.hta",
      "*.jpg.hta",
       "*.jpg.jar",
       "*_jpg.jar",
       "*.pdf.jar",
       "*_pdf.jar",
       "*.png.jar",
       "*_png.jar",
        "*.doc.jar",
       "*_doc.jar",
      "*Receipt.js",
      "*Receipt.vbs",
      "*Delivery*.js",
      "*Delivery*.vbs",
      "*Invoice*.js",
      "*Invoice*.vbs",
      "*Fedex*.js",
      "*Fedex*.vbs",
      "*Supplies.js",
      "*Supplies.vbs",
      "*PayOff Wire*",
      "*PURCHASE ORDER*",
      "*payment.js",
      "*payment.vbs",
      "*Quotation*.js",
      "*Quotation*.vbs",
      "*dhl*.js",
      "*dhl*.vbs",
      "*Confirmation*.js",
      "*Confirmation*.vbs",
      "*Wire Transfer*.js",
      "*Wire Transfer*.vbs",
      "*Moneygram*",
      "*agreement*.js",
      "*agreement*.vbs",
      "*Billing*.wsf",
      "*Billing*.vbs",
      "*Billing*.js",
      "*SafeDocu#*",
      "*\\Doc??????.js") and
 not (process.args : "C:\\Users\\Invoices-*" and process.args : "remove")
'''

min_endpoint_version = "7.15.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 = "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.005"
name = "Visual Basic"
reference = "https://attack.mitre.org/techniques/T1059/005/"

[[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/"

[internal]
min_endpoint_version = "7.15.0"

Stages and Predicates

Stage 1: process

process where event.action == "start" and
 (process.pe.original_file_name : ("cscript.exe", "wscript.exe", "mshta.exe") or (process.name : "javaw.exe" and process.args : "-jar")) and
 process.args_count >= 2 and
 process.command_line : ("*\\AppData\\*", "*\\outlook\\*", "*\\users\\public\\*", "*Menu\\Programs\\Startup\\*", "*\\Downloads\\*") and
 process.args :
     (
      "*.pdf.js",
      "*.pdf.vbs",
      "*_pdf.vbs",
      "*_pdf.js",
      "*.doc.js",
      "*.doc.vbs",
      "*.docx.js",
      "*.docx.vbs",
      "*.ppt.js",
      "*.ppt.vbs",
      "*.xls.js",
      "*.xlsx.js",
      "*.xls.vbs",
      "*.xlsx.vbs",
      "*.jpg.js",
      "*.png.js",
      "*.jpg.vbs",
      "*.png.vbs",
      "*.pdf.hta",
      "_pdf.hta",
      "*pdf.wsf",
      "*.doc.hta",
      "*.xls.hta",
      "*.jpg.hta",
       "*.jpg.jar",
       "*_jpg.jar",
       "*.pdf.jar",
       "*_pdf.jar",
       "*.png.jar",
       "*_png.jar",
        "*.doc.jar",
       "*_doc.jar",
      "*Receipt.js",
      "*Receipt.vbs",
      "*Delivery*.js",
      "*Delivery*.vbs",
      "*Invoice*.js",
      "*Invoice*.vbs",
      "*Fedex*.js",
      "*Fedex*.vbs",
      "*Supplies.js",
      "*Supplies.vbs",
      "*PayOff Wire*",
      "*PURCHASE ORDER*",
      "*payment.js",
      "*payment.vbs",
      "*Quotation*.js",
      "*Quotation*.vbs",
      "*dhl*.js",
      "*dhl*.vbs",
      "*Confirmation*.js",
      "*Confirmation*.vbs",
      "*Wire Transfer*.js",
      "*Wire Transfer*.vbs",
      "*Moneygram*",
      "*agreement*.js",
      "*agreement*.vbs",
      "*Billing*.wsf",
      "*Billing*.vbs",
      "*Billing*.js",
      "*SafeDocu#*",
      "*\\Doc??????.js") and
 not (process.args : "C:\\Users\\Invoices-*" and process.args : "remove")

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.argseqremoveexcludes:process.args field:"process.args" value:"remove"
process.argsstarts_withC:\Users\Invoices-excludes:process.args field:"process.args" value:"C:\Users\Invoices-"

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
  • *.doc.hta
  • *.doc.jar
  • *.doc.js
  • *.doc.vbs
  • *.docx.js
  • *.docx.vbs
  • *.jpg.hta
  • *.jpg.jar
  • *.jpg.js
  • *.jpg.vbs
  • *.pdf.hta
  • *.pdf.jar
  • *.pdf.js
  • *.pdf.vbs
  • *.png.jar
  • *.png.js
  • *.png.vbs
  • *.ppt.js
  • *.ppt.vbs
  • *.xls.hta
  • *.xls.js
  • *.xls.vbs
  • *.xlsx.js
  • *.xlsx.vbs
  • *Billing*.js
  • *Billing*.vbs
  • *Billing*.wsf
  • *Confirmation*.js
  • *Confirmation*.vbs
  • *Delivery*.js
  • *Delivery*.vbs
  • *Fedex*.js
  • *Fedex*.vbs
  • *Invoice*.js
  • *Invoice*.vbs
  • *Moneygram*
  • *PURCHASE ORDER*
  • *PayOff Wire*
  • *Quotation*.js
  • *Quotation*.vbs
  • +23 more values (see full rule source)
field:"process.args" kind:wildcard
process.args_countge
  • 2 transforms: number corpus 18 (elastic 18)
field:"process.args_count" kind:ge value:"2"
process.command_linewildcard
  • *Menu\Programs\Startup\*
  • *\AppData\* corpus 11 (sigma 8, elastic 3)
  • *\Downloads\* corpus 15 (sigma 14, elastic 1)
  • *\outlook\*
  • *\users\public\* corpus 18 (sigma 17, elastic 1)
field:"CommandLine" kind:wildcard
process.namewildcard
  • javaw.exe corpus 9 (elastic 9)
field:"process_name" kind:wildcard value:"javaw.exe"
process.pe.original_file_namewildcard
  • cscript.exe corpus 32 (sigma 17, elastic 15)
  • mshta.exe corpus 40 (elastic 21, sigma 13, splunk 6)
  • wscript.exe corpus 38 (elastic 21, sigma 17)
field:"OriginalFileName" kind:wildcard