Detection rules › Sublime MQL

Mass campaign: Cross Site Scripting (XSS) attempt

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

Message subject or body contains Cross Site Scripting (XSS) indicators, and was sent to multiple unknown senders. Known spam technique.

Threat classification

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

CategoryValues
Attack typesMalware/Ransomware, Spam
Tactics and techniquesExploit, Free email provider, Scripting, Social engineering

Event coverage

Rule body MQL

type.inbound
and (
  length(recipients.to) > 10
  and length(filter(recipients.to,
                    .email.domain.domain not in $org_domains
                    and .email.email not in $recipient_emails
                    and (
                      .email.domain.valid
                      or strings.icontains(.display_name, "undisclosed")
                    )
             )
  ) >= 10
)
and (
  strings.ilike(subject.subject,
                '*<*script*>*',
                '*xss.report*',
                '*eval(atob*',
                '*<*onload*>*',
                '*<*onerror*>*'
  )
  or strings.ilike(body.current_thread.text,
                   '*<*script*>*',
                   '*xss.report*',
                   '*eval(atob*',
                   '*<*onload*>*',
                   '*<*onerror*>*'
  )
)
and (
  length(body.links) == 0
  or (
    length(body.links) == 1
    and all(body.links, .href_url.domain.domain == "this.id")
  )
)
and profile.by_sender().prevalence != "common"
and not profile.by_sender().solicited
and not profile.by_sender().any_messages_benign

// negate highly trusted sender domains unless they fail DMARC authentication
and (
  (
    sender.email.domain.root_domain in $high_trust_sender_root_domains
    and (
      any(distinct(headers.hops, .authentication_results.dmarc is not null),
          strings.ilike(.authentication_results.dmarc, "*fail")
      )
    )
  )
  or sender.email.domain.root_domain not in $high_trust_sender_root_domains
)

Detection logic

Scope: inbound message.

Message subject or body contains Cross Site Scripting (XSS) indicators, and was sent to multiple unknown senders. Known spam technique.

  1. inbound message
  2. all of:
    • length(recipients.to) > 10
    • length(filter(recipients.to, .email.domain.domain not in $org_domains and .email.email not in $recipient_emails and .email.domain.valid or strings.icontains(.display_name, 'undisclosed'))) ≥ 10
  3. any of:
    • subject.subject matches any of 5 patterns
      • *<*script*>*
      • *xss.report*
      • *eval(atob*
      • *<*onload*>*
      • *<*onerror*>*
    • body.current_thread.text matches any of 5 patterns
      • *<*script*>*
      • *xss.report*
      • *eval(atob*
      • *<*onload*>*
      • *<*onerror*>*
  4. any of:
    • length(body.links) is 0
    • all of:
      • length(body.links) is 1
      • all of body.links where:
        • .href_url.domain.domain is 'this.id'
  5. profile.by_sender().prevalence is not 'common'
  6. not:
    • profile.by_sender().solicited
  7. not:
    • profile.by_sender().any_messages_benign
  8. any of:
    • all of:
      • sender.email.domain.root_domain in $high_trust_sender_root_domains
      • any of distinct(headers.hops) where:
        • .authentication_results.dmarc matches '*fail'
    • sender.email.domain.root_domain not in $high_trust_sender_root_domains

Inspects: body.current_thread.text, body.links, body.links[].href_url.domain.domain, headers.hops, headers.hops[].authentication_results.dmarc, recipients.to, recipients.to[].display_name, recipients.to[].email.domain.domain, recipients.to[].email.domain.valid, recipients.to[].email.email, sender.email.domain.root_domain, subject.subject, type.inbound. Sensors: profile.by_sender, strings.icontains, strings.ilike. Reference lists: $high_trust_sender_root_domains, $org_domains, $recipient_emails.

Indicators matched (8)

FieldMatchValue
strings.icontainssubstringundisclosed
strings.ilikesubstring*<*script*>*
strings.ilikesubstring*xss.report*
strings.ilikesubstring*eval(atob*
strings.ilikesubstring*<*onload*>*
strings.ilikesubstring*<*onerror*>*
body.links[].href_url.domain.domainequalsthis.id
strings.ilikesubstring*fail