EXPLORE
← Back to Explore
sublimehighRule

Attachment: HTML smuggling with fromCharCode and other signals

Recursively scans files and archives to detect HTML smuggling techniques.

Detection Query

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(.),
                length(.scan.javascript.identifiers) < 100
                and "location" in .scan.javascript.identifiers
                and "charCodeAt" in .scan.javascript.identifiers
                and "fromCharCode" in .scan.javascript.identifiers
                and "indexOf" in .scan.javascript.identifiers
                and "try" in .scan.javascript.keywords
                and "catch" in .scan.javascript.keywords
        )
)

Data Sources

Email MessagesEmail HeadersEmail Attachments

Platforms

email
Raw Content
name: "Attachment: HTML smuggling with fromCharCode and other signals"
description: |
  Recursively scans files and archives to detect HTML smuggling techniques.
references:
  - "https://www.microsoft.com/security/blog/2021/11/11/html-smuggling-surges-highly-evasive-loader-technique-increasingly-used-in-banking-malware-targeted-attacks/"
type: "rule"
severity: "high"
source: |
  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(.),
                  length(.scan.javascript.identifiers) < 100
                  and "location" in .scan.javascript.identifiers
                  and "charCodeAt" in .scan.javascript.identifiers
                  and "fromCharCode" in .scan.javascript.identifiers
                  and "indexOf" in .scan.javascript.identifiers
                  and "try" in .scan.javascript.keywords
                  and "catch" in .scan.javascript.keywords
          )
  )
attack_types:
  - "Credential Phishing"
  - "Malware/Ransomware"
tactics_and_techniques:
  - "Evasion"
  - "HTML smuggling"
  - "Scripting"
detection_methods:
  - "Archive analysis"
  - "Content analysis"
  - "File analysis"
  - "Javascript analysis"
  - "HTML analysis"
id: "a68ce0ef-dc81-5889-8d0d-735e3521d735"