Detection rules › Sublime MQL

Attachment: HTML smuggling with raw array buffer

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, Free subdomain host, HTML smuggling

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 any(file.explode(.),
                any(.scan.strings.strings,
                    // arrayBuffer, eg repetition:
                    // [0xa0,0x8e,0xd0,0x60,...]
                    regex.icontains(., '(\W?0x[a-zA-Z0-9]{2}\W?,\s*){100}')
                )
                and any(.scan.strings.strings, strings.contains(., ".map"))
        )
)

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'
    • any of file.explode(.) where all hold:
      • any of .scan.strings.strings where:
        • . matches '(\\W?0x[a-zA-Z0-9]{2}\\W?,\\s*){100}'
      • any of .scan.strings.strings where:
        • . contains '.map'

Inspects: attachments[].file_extension, attachments[].file_type, type.inbound. Sensors: file.explode, regex.icontains, strings.contains. Reference lists: $file_extensions_common_archives.

Indicators matched (7)

FieldMatchValue
attachments[].file_extensionmemberhtml
attachments[].file_extensionmemberhtm
attachments[].file_extensionmembershtml
attachments[].file_extensionmemberdhtml
attachments[].file_typeequalshtml
regex.icontainsregex(\W?0x[a-zA-Z0-9]{2}\W?,\s*){100}
strings.containssubstring.map