Detection rules › Sublime MQL

SPF temp error

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

Attackers can spoof domains that have no MX/SPF records, resulting in a DNS timeout. In O365 this fails closed (goes to spam), but in Gmail this fails open (lands in the inbox) and shows a red padlock Reproduce on Ubuntu 18.04: echo "test" | mail -s "Test" user@gmail.com -a"From: Support support@nomxdomain.com" Example headers: Received-SPF: temperror (google.com: error in processing during lookup of support@ltbit.com: DNS error) client-ip=<>; Authentication-Results: mx.google.com; spf=temperror (google.com: error in processing during lookup of support@nomxdomain.com: DNS error) smtp.mailfrom=support@nomxdomain.com

Threat classification

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

CategoryValues
Tactics and techniquesSpoofing

Event coverage

Rule body MQL

type.inbound
and any(headers.hops,
        any(.fields,
            strings.ilike(.name, "Received-SPF")
            and strings.ilike(.value, "*spf=temperror*")
        )
)

Detection logic

Scope: inbound message.

Attackers can spoof domains that have no MX/SPF records, resulting in a DNS timeout. In O365 this fails closed (goes to spam), but in Gmail this fails open (lands in the inbox) and shows a red padlock Reproduce on Ubuntu 18.04: echo "test" | mail -s "Test" user@gmail.com -a"From: Support support@nomxdomain.com" Example headers: Received-SPF: temperror (google.com: error in processing during lookup of support@ltbit.com: DNS error) client-ip=<>; Authentication-Results: mx.google.com; spf=temperror (google.com: error in processing during lookup of support@nomxdomain.com: DNS error) smtp.mailfrom=support@nomxdomain.com

  1. inbound message
  2. any of headers.hops where:
    • any of .fields where all hold:
      • .name matches 'Received-SPF'
      • .value matches '*spf=temperror*'

Inspects: headers.hops, headers.hops[].fields, headers.hops[].fields[].name, headers.hops[].fields[].value, type.inbound. Sensors: strings.ilike.

Indicators matched (2)

FieldMatchValue
strings.ilikesubstringReceived-SPF
strings.ilikesubstring*spf=temperror*