Detection rules › Sublime MQL

Attachment: HTML attachment with Javascript location

Severity
high
Type
rule
Source
github.com/sublime-security/sublime-rules

Recursively scans files and archives to detect HTML smuggling techniques.

Threat classification

Sublime's own taxonomy (not MITRE ATT&CK).

CategoryValues
Attack typesCredential Phishing, Malware/Ransomware
Tactics and techniquesEvasion, HTML smuggling, Scripting

Event coverage

Rule body MQL

type.inbound
and any(attachments,
        (
          .file_extension in~ ("html", "htm", "shtml", "dhtml")
          or .file_extension in~ $file_extensions_common_archives
          or .file_type == "html"
        )
        and .size <= 5000
        and any(file.explode(.),
                any(.scan.javascript.identifiers, . == "location")
                and length(.scan.javascript.identifiers) < 100
        )
)

Detection logic

Scope: inbound message.

Recursively scans files and archives to detect HTML smuggling techniques.

  1. inbound message
  2. any of attachments where all hold:
    • any of:
      • .file_extension in ('html', 'htm', 'shtml', 'dhtml')
      • .file_extension in $file_extensions_common_archives
      • .file_type is 'html'
    • .size ≤ 5000
    • any of file.explode(.) where all hold:
      • any of .scan.javascript.identifiers where:
        • . is 'location'
      • length(.scan.javascript.identifiers) < 100

Inspects: attachments[].file_extension, attachments[].file_type, attachments[].size, type.inbound. Sensors: file.explode. Reference lists: $file_extensions_common_archives.

Indicators matched (6)

FieldMatchValue
attachments[].file_extensionmemberhtml
attachments[].file_extensionmemberhtm
attachments[].file_extensionmembershtml
attachments[].file_extensionmemberdhtml
attachments[].file_typeequalshtml
file.explode(attachments[])[].scan.javascript.identifiers[]equalslocation