SPF
— Sender Policy FrameworkSPF lets a domain owner publish the mail servers that are allowed to send mail for that domain. The receiving mail server checks the SMTP envelope sender against the published policy and uses the result to reject, flag, or accept the message.
Interactive Session: How SPF Works
Step through the packet exchange sequence between nodes.
Interactive Execution Sandbox
Interact with a live or clearly-labelled simulated instance of SPF.
Threat Model & Attack Simulation
How this protocol is attacked in practice, what defenders can see, and which control stops it.
Threat model & attack simulation
SimulatedDefensive education. Every step runs in this page; no traffic is generated or sent.
SPF misconfiguration abuse
SpoofingA neutral all-qualifier or missing record lets anyone send mail claiming to be the domain.
Check the policy
The attacker reads the domain SPF record and finds ~all or no record.
Domains without an enforcing SPF policy.
Phishing with the organisation domain.
Defences that matter
- End SPF with -all
- Align SPF with DMARC
- Monitor authentication results
This is a conceptual model for defenders, not an exploit toolkit. It contains no payloads, tooling or instructions for attacking systems you do not own.
Protocol Specification & Architecture
Key characteristics, real-world deployment patterns, and trade-offs.
Core Technical Features
- Policy published as a single DNS TXT record beginning with v=spf1
- Mechanisms such as ip4, ip6, a, mx, include, and exists
- Qualifiers +, -, ~, and ? that set pass, fail, softfail, and neutral results
- Evaluation limited to 10 DNS lookups to bound resolver work
Real-World Use Cases
- Reducing forged sender addresses in inbound mail filtering
- Aligning authorized sending services such as newsletters and CRMs
- Combining with DKIM and DMARC for domain-level mail policy
Advantages & Strengths
- Simple to publish and cheap to evaluate at the receiving gateway
- Directly blocks many spoofed envelope senders before content filtering
Limitations & Vulnerabilities
- Breaks when mail is forwarded, because the envelope sender no longer matches the sending host
- Does not protect the visible From header and is ineffective without DMARC alignment