EXPLORE
← Back to Explore
sublimehighRule

Attachment: HTML smuggling 'body onload' linking to suspicious destination

Potential HTML Smuggling. This rule inspects HTML attachments that contain a single link and leveraging an HTML body onload event. The linked domain must be in the URLhaus trusted repoters list, or have a suspicious TLD.

Detection Query

type.inbound
and any(attachments,
        (
          .file_extension in~ ("html", "htm", "shtml", "dhtml", "xhtml")
          or (
            .file_extension is null
            and .file_type == "unknown"
            and .content_type == "application/octet-stream"
          )
          or .file_extension in~ $file_extensions_common_archives
          or .file_type == "html"
          or .content_type == "text/html"
        )
        and any(file.explode(.),
                not length(.scan.url.invalid_urls) > 0
                and length(.scan.url.urls) == 1
                and any(.scan.strings.strings,
                        strings.ilike(., "*body onload*")
                )
                and (
                  any(.scan.url.urls,
                      .domain.root_domain in $abuse_ch_urlhaus_domains_trusted_reporters

                      // To-do uncomment below when list is created
                      // or .domain.root_domain in $suspicious_root_domains
                      or .domain.tld in $suspicious_tlds
                  )
                )
        )
)

Data Sources

Email MessagesEmail HeadersEmail Attachments

Platforms

email
Raw Content
name: "Attachment: HTML smuggling 'body onload' linking to suspicious destination"
description: |
  Potential HTML Smuggling. 
  This rule inspects HTML attachments that contain a single link and leveraging an HTML body onload event. The linked domain must be in the URLhaus trusted repoters list, or have a suspicious TLD. 
type: "rule"
severity: "high"
source: |
  type.inbound
  and any(attachments,
          (
            .file_extension in~ ("html", "htm", "shtml", "dhtml", "xhtml")
            or (
              .file_extension is null
              and .file_type == "unknown"
              and .content_type == "application/octet-stream"
            )
            or .file_extension in~ $file_extensions_common_archives
            or .file_type == "html"
            or .content_type == "text/html"
          )
          and any(file.explode(.),
                  not length(.scan.url.invalid_urls) > 0
                  and length(.scan.url.urls) == 1
                  and any(.scan.strings.strings,
                          strings.ilike(., "*body onload*")
                  )
                  and (
                    any(.scan.url.urls,
                        .domain.root_domain in $abuse_ch_urlhaus_domains_trusted_reporters
  
                        // To-do uncomment below when list is created
                        // or .domain.root_domain in $suspicious_root_domains
                        or .domain.tld in $suspicious_tlds
                    )
                  )
          )
  )
attack_types:
  - "Credential Phishing"
  - "Malware/Ransomware"
tactics_and_techniques:
  - "Evasion"
  - "HTML smuggling"
  - "Scripting"
detection_methods:
  - "Archive analysis"
  - "Content analysis"
  - "File analysis"
  - "HTML analysis"
  - "URL analysis"
id: "c1e2beed-e71e-58d2-b922-9601337645b2"