Detection rules › Sublime MQL

Brand impersonation: Github

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

Impersonation of Github.

Threat classification

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

CategoryValues
Attack typesCredential Phishing
Tactics and techniquesImpersonation: Brand, Lookalike domain, Social engineering

Event coverage

Rule body MQL

type.inbound
and not strings.ilike(sender.display_name,
                      '*course*',
                      '*bootcamp*',
                      '*training*'
)
and (
  strings.ilike(sender.display_name, '*github*')
  or strings.ilike(sender.email.email, '*github*')
  or strings.ilevenshtein(sender.email.domain.sld, 'github') <= 1
)
// negating listservs
and not (
  any(headers.hops, any(.fields, .name == "List-Unsubscribe"))
  and (
    strings.contains(sender.display_name, "via")
    or strings.icontains(subject.subject, "monitor")
  )
)
and not (
  any(headers.hops, any(.fields, .name == "X-GitHub-Reason"))
  and headers.auth_summary.dmarc.pass
)
and sender.email.domain.root_domain not in (
  'github.com',
  'thegithubshop.com',
  'gitlab.com',
  'itthub.net',
  'githubsupport.com',
  'gtmhub.com',
  'githubstatus.com',
  'githubnext.com',
  'lithub.com',
  'icims.com',
  'bithub.email',
  'goldcast.io',
  'luma-mail.com', // GitHub's event invitation software
  'github.events' // GitHub event newsletters
)

// negate highly trusted sender domains unless they fail DMARC authentication
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
)
and (
  not profile.by_sender().solicited
  or (
    profile.by_sender().any_messages_malicious_or_spam
    and not profile.by_sender().any_messages_benign
  )
)
and not profile.by_sender().any_messages_benign

Detection logic

Scope: inbound message.

Impersonation of Github.

  1. inbound message
  2. not:
    • sender.display_name matches any of 3 patterns
      • *course*
      • *bootcamp*
      • *training*
  3. any of:
    • sender.display_name matches '*github*'
    • sender.email.email matches '*github*'
    • sender.email.domain.sld is similar to 'github'
  4. not:
    • all of:
      • any of headers.hops where:
        • any of .fields where:
          • .name is 'List-Unsubscribe'
      • any of:
        • sender.display_name contains 'via'
        • subject.subject contains 'monitor'
  5. not:
    • all of:
      • any of headers.hops where:
        • any of .fields where:
          • .name is 'X-GitHub-Reason'
      • headers.auth_summary.dmarc.pass
  6. sender.email.domain.root_domain not in ('github.com', 'thegithubshop.com', 'gitlab.com', 'itthub.net', 'githubsupport.com', 'gtmhub.com', 'githubstatus.com', 'githubnext.com', 'lithub.com', 'icims.com', 'bithub.email', 'goldcast.io', 'luma-mail.com', 'github.events')
  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
  8. any of:
    • not:
      • profile.by_sender().solicited
    • all of:
      • profile.by_sender().any_messages_malicious_or_spam
      • not:
        • profile.by_sender().any_messages_benign
  9. not:
    • profile.by_sender().any_messages_benign

Inspects: headers.auth_summary.dmarc.pass, headers.hops, headers.hops[].fields, headers.hops[].fields[].name, sender.display_name, sender.email.domain.root_domain, sender.email.domain.sld, sender.email.email, subject.subject, type.inbound. Sensors: profile.by_sender, strings.contains, strings.icontains, strings.ilevenshtein, strings.ilike. Reference lists: $high_trust_sender_root_domains.

Indicators matched (23)

FieldMatchValue
strings.ilikesubstring*course*
strings.ilikesubstring*bootcamp*
strings.ilikesubstring*training*
strings.ilikesubstring*github*
strings.ilevenshteinfuzzygithub
headers.hops[].fields[].nameequalsList-Unsubscribe
strings.containssubstringvia
strings.icontainssubstringmonitor
headers.hops[].fields[].nameequalsX-GitHub-Reason
sender.email.domain.root_domainmembergithub.com
sender.email.domain.root_domainmemberthegithubshop.com
sender.email.domain.root_domainmembergitlab.com
11 more
sender.email.domain.root_domainmemberitthub.net
sender.email.domain.root_domainmembergithubsupport.com
sender.email.domain.root_domainmembergtmhub.com
sender.email.domain.root_domainmembergithubstatus.com
sender.email.domain.root_domainmembergithubnext.com
sender.email.domain.root_domainmemberlithub.com
sender.email.domain.root_domainmembericims.com
sender.email.domain.root_domainmemberbithub.email
sender.email.domain.root_domainmembergoldcast.io
sender.email.domain.root_domainmemberluma-mail.com
sender.email.domain.root_domainmembergithub.events