Detection rules › Sublime MQL

Attachment: HTML smuggling with excessive line break obfuscation

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

Credential Phishing attacks have been observed using excessive line breaks to obfuscate javascript functions within html files.

Threat classification

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

CategoryValues
Attack typesCredential Phishing, Malware/Ransomware
Tactics and techniquesEncryption, Evasion, 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 any(file.explode(.),
                any(.scan.strings.strings,
                    // return new line padded obfuscation 
                    regex.contains(., '(\\r\\n\S{2}){50,}')
                    and strings.contains(., 'decodeURIComponent')
                )
        )
)

Detection logic

Scope: inbound message.

Credential Phishing attacks have been observed using excessive line breaks to obfuscate javascript functions within html files.

  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:
      • any of .scan.strings.strings where all hold:
        • . matches '(\\\\r\\\\n\\S{2}){50,}'
        • . contains 'decodeURIComponent'

Inspects: attachments[].file_extension, attachments[].file_type, type.inbound. Sensors: file.explode, regex.contains, 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.containsregex(\\r\\n\S{2}){50,}
strings.containssubstringdecodeURIComponent