Detection rules › Elastic

Executable File with Unusual Extension

Status
production
Kind
building block (feeds higher-level correlation rules; not a standalone alert)
Severity
low
Time window
119m
Author
Elastic
Source
github.com/elastic/detection-rules

Identifies the creation or modification of an executable file with an unexpected file extension. Attackers may attempt to evade detection by masquerading files using the file extension values used by image, audio, or document file types.

MITRE ATT&CK coverage

Rule body elastic

[metadata]
creation_date = "2023/09/25"
integration = ["endpoint"]
maturity = "production"
updated_date = "2024/05/21"

[rule]
author = ["Elastic"]
building_block_type = "default"
description = """
Identifies the creation or modification of an executable file with an unexpected file extension. Attackers may attempt
to evade detection by masquerading files using the file extension values used by image, audio, or document file types.
"""
from = "now-119m"
index = ["logs-endpoint.events.file-*"]
interval = "60m"
language = "eql"
license = "Elastic License v2"
name = "Executable File with Unusual Extension"
risk_score = 21
rule_id = "ecd4857b-5bac-455e-a7c9-a88b66e56a9e"
severity = "low"
tags = [
    "Domain: Endpoint",
    "OS: Windows",
    "Use Case: Threat Detection",
    "Tactic: Defense Evasion",
    "Rule Type: BBR",
    "Data Source: Elastic Defend",
]
timestamp_override = "event.ingested"
type = "eql"

query = '''
file where host.os.type == "windows" and event.action != "deletion" and

 /* MZ header or its common base64 equivalent TVqQ */
 file.Ext.header_bytes : ("4d5a*", "54567151*") and

 (
   /* common image file extensions */
   file.extension : ("jpg", "jpeg", "emf", "tiff", "gif", "png", "bmp", "fpx", "eps", "svg", "inf") or

   /* common audio and video file extensions */
   file.extension : ("mp3", "wav", "avi", "mpeg", "flv", "wma", "wmv", "mov", "mp4", "3gp") or

   /* common document file extensions */
   file.extension : ("txt", "pdf", "doc", "docx", "rtf", "ppt", "pptx", "xls", "xlsx", "hwp", "html")
  ) and
  not process.pid == 4 and
  not process.executable : "?:\\Program Files (x86)\\Trend Micro\\Client Server Security Agent\\Ntrtscan.exe"
'''


[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1036"
name = "Masquerading"
reference = "https://attack.mitre.org/techniques/T1036/"
[[rule.threat.technique.subtechnique]]
id = "T1036.008"
name = "Masquerade File Type"
reference = "https://attack.mitre.org/techniques/T1036/008/"



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

Stages and Predicates

Stage 1: file

file where host.os.type == "windows" and event.action != "deletion" and
 file.Ext.header_bytes : ("4d5a*", "54567151*") and
 (
   file.extension : ("jpg", "jpeg", "emf", "tiff", "gif", "png", "bmp", "fpx", "eps", "svg", "inf") or
   file.extension : ("mp3", "wav", "avi", "mpeg", "flv", "wma", "wmv", "mov", "mp4", "3gp") or
   file.extension : ("txt", "pdf", "doc", "docx", "rtf", "ppt", "pptx", "xls", "xlsx", "hwp", "html")
  ) and
  not process.pid == 4 and
  not process.executable : "?:\\Program Files (x86)\\Trend Micro\\Client Server Security Agent\\Ntrtscan.exe"

Exclusions

Top-level NOT(...) conjuncts: predicates this rule actively suppresses.

FieldKindExcluded values
process.executableeq?:\Program Files (x86)\Trend Micro\Client Server Security Agent\Ntrtscan.exe

Indicators

Each row is a field, operator, and value that the rule matches. The corpus column counts how many other rules in the catalog look for the same combination: high numbers point to widely-used, community-vetted indicators. Blank or 1 shows that the indicator is specific to this rule.

FieldKindValues
event.actionne
  • deletion corpus 11 (elastic 11)
file.Ext.header_byteswildcard
  • 4d5a* corpus 5 (elastic 5)
  • 54567151*
file.extensionwildcard
  • 3gp corpus 2 (elastic 2)
  • avi corpus 2 (elastic 2)
  • bmp corpus 2 (elastic 2)
  • doc corpus 2 (elastic 2)
  • docx corpus 2 (elastic 2)
  • emf corpus 2 (elastic 2)
  • eps corpus 2 (elastic 2)
  • flv corpus 2 (elastic 2)
  • fpx corpus 2 (elastic 2)
  • gif corpus 2 (elastic 2)
  • html corpus 2 (elastic 2)
  • hwp
  • inf corpus 2 (elastic 2)
  • jpeg corpus 2 (elastic 2)
  • jpg corpus 2 (elastic 2)
  • mov corpus 2 (elastic 2)
  • mp3 corpus 2 (elastic 2)
  • mp4 corpus 2 (elastic 2)
  • mpeg corpus 2 (elastic 2)
  • pdf
  • png corpus 2 (elastic 2)
  • ppt corpus 2 (elastic 2)
  • pptx corpus 2 (elastic 2)
  • rtf corpus 2 (elastic 2)
  • svg
  • tiff corpus 2 (elastic 2)
  • txt
  • wav corpus 2 (elastic 2)
  • wma corpus 2 (elastic 2)
  • wmv corpus 2 (elastic 2)
  • xls corpus 2 (elastic 2)
  • xlsx corpus 2 (elastic 2)
process.pidne
  • 4 corpus 5 (elastic 5)