Detection rules › Sublime MQL

Brand impersonation: UK government Home Office

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

Detects messages impersonating UK government agencies (Home Office, UK Visas and Immigration, gov.uk) that contain links not leading to legitimate gov.uk domains or show credential theft language, from senders not authenticated as official government domains.

Threat classification

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

CategoryValues
Attack typesBEC/Fraud, Credential Phishing
Tactics and techniquesImpersonation: Brand, Social engineering, Lookalike domain

Event coverage

Rule body MQL

type.inbound

// UK government agencies in display name or subject with homograph protection
and (
  any([
        strings.replace_confusables(sender.display_name),
        strings.replace_confusables(subject.subject)
      ],
      strings.ilike(.,
                    "*sponsorship management system*",
                    "*Sponsor Management System*"
      )
      // exact match of high confidence
      or . in~ ("Home Office", "uk home office", "UK Visas and Immigration")
  )
  // image is srced from the actual home office URL
  or strings.icontains(body.html.raw,
                       '"https://www.points.homeoffice.gov.uk/gui-sms-jsf/images/'
  )
  // observed footers in messages
  or 2 of (
    strings.icontains(body.current_thread.text, '© Crown Copyright '),
    strings.icontains(body.current_thread.text, '© 2025 Home Office'),
    strings.icontains(body.current_thread.text, '© UK Visas and Immigration'),
    regex.icontains(body.current_thread.text, ' [||–-—] Home Office'),
    regex.icontains(body.current_thread.text,
                    ' [|–-—] UK Visas and Immigration'
    ),
    strings.icontains(body.current_thread.text,
                      'This is an automated message from UK Visas and Immigration.'
    ),
    strings.icontains(body.current_thread.text,
                      'This is an automated notification from the Home Office'
    ),
    regex.icontains(body.current_thread.text,
                    'You(?: are|''re) receiving this notification as a registered SMS user'
    ),
    regex.icontains(body.current_thread.text,
                    'If you are not the designated.{0,50}SMS user'
    ),
  )
)

//  Not from legitimate UK government domains
and not (
  sender.email.domain.tld == "gov.uk" and headers.auth_summary.dmarc.pass
)

// 
and (
  // there are links that do not link to "gov.uk"
  not all(body.links, .href_url.domain.tld == "gov.uk")
  // OR credential theft intent detected  
  or any(ml.nlu_classifier(body.current_thread.text).intents,
         .name == "cred_theft" and .confidence in ("medium", "high")
  )
  // link based indicators
  or any(body.links,
         // suspicious display text
         (
           .display_text in (
             "Access SMS",
             "Login to SMS",
             "Log in to SMS",
             "Access UKVI Account"
           )
           and .href_url.domain.tld != "gov.uk"
         )
         // there are mismatched links
         or (
           .display_url.domain.tld == "gov.uk"
           and .href_url.domain.tld != "gov.uk"
           and .mismatched
         )

         // the path refers to the uk stuff
         or (
           .href_url.domain.tld != "gov.uk"
           and strings.icontains(.href_url.path, 'gov.uk')
         )
  )
)

// no previous threads
and not (length(headers.references) > 0 or length(body.previous_threads) > 0)
// negate a high amount of links or newsletters
and not (
  length(body.links) > 20
  or any(ml.nlu_classifier(body.html.display_text).topics,
         .name == "Newsletters and Digests"
  )
)
//  High-trust domain exclusion
and (
  (
    sender.email.domain.root_domain in $high_trust_sender_root_domains
    and not headers.auth_summary.dmarc.pass
  )
  or sender.email.domain.root_domain not in $high_trust_sender_root_domains
)

Detection logic

Scope: inbound message.

Detects messages impersonating UK government agencies (Home Office, UK Visas and Immigration, gov.uk) that contain links not leading to legitimate gov.uk domains or show credential theft language, from senders not authenticated as official government domains.

  1. inbound message
  2. any of:
    • any of [strings.replace_confusables(sender.display_name), strings.replace_confusables(subject.subject)] where any holds:
      • . matches any of 2 patterns
        • *sponsorship management system*
        • *Sponsor Management System*
      • . in ('Home Office', 'uk home office', 'UK Visas and Immigration')
    • body.html.raw contains '"https://www.points.homeoffice.gov.uk/gui-sms-jsf/images/'
    • at least 2 of:
      • body.current_thread.text contains '© Crown Copyright '
      • body.current_thread.text contains '© 2025 Home Office'
      • body.current_thread.text contains '© UK Visas and Immigration'
      • body.current_thread.text matches ' [||–-—] Home Office'
      • body.current_thread.text matches ' [|–-—] UK Visas and Immigration'
      • body.current_thread.text contains 'This is an automated message from UK Visas and Immigration.'
      • body.current_thread.text contains 'This is an automated notification from the Home Office'
      • body.current_thread.text matches "You(?: are|'re) receiving this notification as a registered SMS user"
      • body.current_thread.text matches 'If you are not the designated.{0,50}SMS user'
  3. not:
    • all of:
      • sender.email.domain.tld is 'gov.uk'
      • headers.auth_summary.dmarc.pass
  4. any of:
    • not:
      • all of body.links where:
        • .href_url.domain.tld is 'gov.uk'
    • any of ml.nlu_classifier(body.current_thread.text).intents where all hold:
      • .name is 'cred_theft'
      • .confidence in ('medium', 'high')
    • any of body.links where any holds:
      • all of:
        • .display_text in ('Access SMS', 'Login to SMS', 'Log in to SMS', 'Access UKVI Account')
        • .href_url.domain.tld is not 'gov.uk'
      • all of:
        • .display_url.domain.tld is 'gov.uk'
        • .href_url.domain.tld is not 'gov.uk'
        • .mismatched
      • all of:
        • .href_url.domain.tld is not 'gov.uk'
        • .href_url.path contains 'gov.uk'
  5. none of:
    • length(headers.references) > 0
    • length(body.previous_threads) > 0
  6. none of:
    • length(body.links) > 20
    • any of ml.nlu_classifier(body.html.display_text).topics where:
      • .name is 'Newsletters and Digests'
  7. any of:
    • all of:
      • sender.email.domain.root_domain in $high_trust_sender_root_domains
      • not:
        • headers.auth_summary.dmarc.pass
    • sender.email.domain.root_domain not in $high_trust_sender_root_domains

Inspects: body.current_thread.text, body.html.display_text, body.html.raw, body.links, body.links[].display_text, body.links[].display_url.domain.tld, body.links[].href_url.domain.tld, body.links[].href_url.path, body.links[].mismatched, body.previous_threads, headers.auth_summary.dmarc.pass, headers.references, sender.display_name, sender.email.domain.root_domain, sender.email.domain.tld, subject.subject, type.inbound. Sensors: ml.nlu_classifier, regex.icontains, strings.icontains, strings.ilike, strings.replace_confusables. Reference lists: $high_trust_sender_root_domains.

Indicators matched (27)

FieldMatchValue
strings.ilikesubstring*sponsorship management system*
strings.ilikesubstring*Sponsor Management System*
[strings.replace_confusables(sender.display_name), strings.replace_confusables(subject.subject)][]memberHome Office
[strings.replace_confusables(sender.display_name), strings.replace_confusables(subject.subject)][]memberuk home office
[strings.replace_confusables(sender.display_name), strings.replace_confusables(subject.subject)][]memberUK Visas and Immigration
strings.icontainssubstring"https://www.points.homeoffice.gov.uk/gui-sms-jsf/images/
strings.icontainssubstring© Crown Copyright
strings.icontainssubstring© 2025 Home Office
strings.icontainssubstring© UK Visas and Immigration
regex.icontainsregex [||–-—] Home Office
regex.icontainsregex [|–-—] UK Visas and Immigration
strings.icontainssubstringThis is an automated message from UK Visas and Immigration.
15 more
strings.icontainssubstringThis is an automated notification from the Home Office
regex.icontainsregexYou(?: are|'re) receiving this notification as a registered SMS user
regex.icontainsregexIf you are not the designated.{0,50}SMS user
sender.email.domain.tldequalsgov.uk
body.links[].href_url.domain.tldequalsgov.uk
ml.nlu_classifier(body.current_thread.text).intents[].nameequalscred_theft
ml.nlu_classifier(body.current_thread.text).intents[].confidencemembermedium
ml.nlu_classifier(body.current_thread.text).intents[].confidencememberhigh
body.links[].display_textmemberAccess SMS
body.links[].display_textmemberLogin to SMS
body.links[].display_textmemberLog in to SMS
body.links[].display_textmemberAccess UKVI Account
body.links[].display_url.domain.tldequalsgov.uk
strings.icontainssubstringgov.uk
ml.nlu_classifier(body.html.display_text).topics[].nameequalsNewsletters and Digests