Email Spoofing Lab

Detection, Analysis & Prevention Tool (Node.js Edition)

Educational Project | Server: rilzacosmetics.com (185.73.8.3)

Send Test Email (Spoofing Demo)

Sends with custom From headers via nodemailer's sendmail transport (equivalent to PHP's /sbin/sendmail -t). Emails originate from this server (rilzacosmetics.com).

Quick Test Presets

Click to auto-fill the form with test data:


How It Works:
Legitimate Email from own domain → SPF/DKIM pass → Inbox
Spoofed Fake From header → SPF/DKIM fail → Spam + Warning
Blocked Strict DMARC domain → p=reject → Email rejected

Email Header Analyzer (Spoofing Detector)

Paste raw email headers from Gmail ("Show Original") or any email client to analyze for spoofing indicators.

Terminal Test Results Comparison

These emails were sent from the server (rilzacosmetics.com / 185.73.8.3) using /sbin/sendmail. Each test demonstrates a different spoofing scenario and how email authentication handles it.

TestFrom (Header)Actual ServerSPFDKIMDMARCResult
1. Legitimateinfo@rilzacosmetics.comrilzacosmetics.comPASSPASSPASSInbox
2. Spoofedhasan@cresttower.comrilzacosmetics.comFAILFAILFAILSpam + Warning
3. Blockedsecurity@hbl.comrilzacosmetics.comFAILFAILREJECTBlocked
4. Blockedinfo@uspto.govrilzacosmetics.comFAILFAILREJECTBlocked
Why Legitimate Email Passed
  • SPF Pass: Server IP (185.73.8.3) is in rilzacosmetics.com's SPF record
  • DKIM Pass: Email signed with rilzacosmetics.com's private key
  • DMARC Pass: From domain aligns with SPF and DKIM domains
  • Result: Gmail trusts this email → delivered to Inbox
Why Spoofed Emails Failed
  • SPF Fail: Server IP (185.73.8.3) is NOT in cresttower.com/hbl.com/uspto.gov SPF
  • DKIM Fail: Email not signed with target domain's private key
  • DMARC: Weak policy (p=none) → Spam. Strict policy (p=reject) → Blocked
  • "via" tag: Gmail shows actual sending server (zrotoxic.com)
Key Findings
No DMARC (p=none)

Spoofed email gets delivered but goes to Spam with warning. Domain owner gets no rejection enforcement. Example: cresttower.com

Quarantine (p=quarantine)

Spoofed email is quarantined (usually Spam folder). Receiver gets a warning. Better than none, but not fully protected.

Reject (p=reject)

Spoofed email is completely rejected. Never delivered. Maximum protection. Example: hbl.com, uspto.gov

What is Email Spoofing?

Email spoofing is the creation of email messages with a forged sender address. Because core email protocols (SMTP) do not have a built-in authentication mechanism, it is possible to send an email that appears to come from any address.

How Spoofing Works:
Attacker's Server (rilzacosmetics.com / 185.73.8.3)
    |
    |  SMTP Connection to Gmail
    |  MAIL FROM: <info@rilzacosmetics.com>    ← Envelope (hidden from user)
    |
    |  Headers in email:
    |  From: USPTO <info@uspto.gov>            ← FAKE! (what user sees)
    |  Subject: Important Notice
    |
    v
Gmail Server (mx.google.com)
    |
    |  Checks SPF: Is 185.73.8.3 authorized for uspto.gov? NO → FAIL
    |  Checks DKIM: Is email signed by uspto.gov?           NO → FAIL
    |  Checks DMARC: What is uspto.gov's policy?            p=reject → BLOCK
    |
    v
EMAIL REJECTED - Never delivered to user
Common Uses of Email Spoofing:
  • Phishing: Fake emails from banks/companies to steal credentials
  • Business Email Compromise (BEC): Impersonating CEO to authorize wire transfers
  • Malware Delivery: Fake attachments appearing from trusted sources
  • Reputation Damage: Sending offensive emails from someone's address

SPF - Sender Policy Framework

SPF allows domain owners to specify which mail servers are authorized to send emails on behalf of their domain.

Step 1: Domain owner publishes a DNS TXT record listing authorized IPs.
rilzacosmetics.com TXT "v=spf1 ip4:185.73.8.3 include:spf.hostns.io +a +mx -all"
Step 2: When an email arrives, the receiver checks: "Is the sending server's IP in the SPF record?"
Step 3: If IP matches → SPF PASS. If not → SPF FAIL.
SPF Record Breakdown:
v=spf1SPF version 1
ip4:185.73.8.3Allow this specific IP to send mail
include:spf.hostns.ioAlso allow IPs listed by hosting provider
+aAllow IPs in A record
+mxAllow IPs in MX record
-allReject all others (strict)

DKIM - DomainKeys Identified Mail

DKIM adds a digital signature to outgoing emails. The receiver verifies this signature using the sender's public key published in DNS.

Step 1: Sending server has a private key (kept secret) and publishes a public key in DNS.
default._domainkey.rilzacosmetics.com TXT "v=DKIM1; k=rsa; p=MIIBIjAN..."
Step 2: When sending an email, the server signs the message headers and body using the private key.
Step 3: Receiver fetches the public key from DNS and verifies the signature.
Step 4: If signature valid → DKIM PASS. If tampered → DKIM FAIL.
Why spoofing fails DKIM: You cannot sign an email as "uspto.gov" because you don't have their private key. Only the legitimate domain owner has the private key. The public key in DNS is only for verification, not for signing.

DMARC - Domain-based Message Authentication

DMARC ties SPF and DKIM together and tells receivers what to do when authentication fails.

Step 1: Domain owner publishes a DMARC policy in DNS.
_dmarc.rilzacosmetics.com TXT "v=DMARC1; p=none; rua=mailto:info@rilzacosmetics.com"
Step 2: When an email arrives, receiver checks if SPF or DKIM passes AND aligns with the From domain.
Step 3: If alignment fails, receiver follows the DMARC policy.
DMARC Policies Comparison:
PolicyActionProtection Level
p=noneMonitor only - no action takenLow (spoofed emails still delivered)
p=quarantineSend to Spam/Junk folderMedium (spoofed emails in spam)
p=rejectReject/Block completelyHigh (spoofed emails never delivered)
Real-World Examples:
DomainDMARC PolicyEffect on Spoofing
rilzacosmetics.comp=noneSpoofed emails monitored but delivered
cresttower.comp=none (or absent)Spoofed emails land in Spam with warning
hbl.comp=rejectSpoofed emails completely blocked
uspto.govp=rejectSpoofed emails completely blocked + reported to DHS

Prevention Best Practices

For Domain Owners:
  1. Implement SPF: List all authorized sending IPs in your SPF record
  2. Enable DKIM: Sign all outgoing emails with DKIM
  3. Set DMARC to p=reject: Start with p=none to monitor, then upgrade to p=reject
  4. Monitor DMARC reports: Review aggregate reports (rua) for unauthorized senders
  5. Use BIMI: Brand Indicators for Message Identification - display your logo in email clients
For Email Recipients:
  1. Check the sender address: Not just the display name, but the actual email address
  2. Look for "via" tags: Gmail shows "via otherdomain.com" when the sending server differs
  3. Check authentication: Use "Show Original" in Gmail to see SPF/DKIM/DMARC results
  4. Be suspicious of urgency: Phishing emails often create false urgency
  5. Never click links in suspicious emails: Manually type the URL instead

Email Spoofing Attack Flow

ATTACKER                          EMAIL SERVER                     VICTIM
   |                                    |                                |
   |  1. Connects to SMTP server        |                                |
   |  2. Sets MAIL FROM (envelope)      |                                |
   |  3. Sets fake From: header         |                                |
   |  4. Sends email                    |                                |
   |----------------------------------->|                                |
   |                                    |  5. Checks SPF                 |
   |                                    |     IP authorized? NO         |
   |                                    |  6. Checks DKIM                |
   |                                    |     Valid signature? NO       |
   |                                    |  7. Checks DMARC               |
   |                                    |     Policy?                    |
   |                                    |                                |
   |                     IF p=none:     |  8a. Deliver to Spam           |
   |                                    |------------------------------->| Warning shown
   |                                    |                                |
   |                     IF p=reject:   |  8b. REJECT - Email blocked   |
   |                                    |----X                           | Protected!
   |                                    |                                |
   |                     IF legitimate: |  8c. Deliver to Inbox          |
   |                                    |------------------------------->| Clean email

Email Spoofing Lab (Node.js Edition) — Educational Project
Server: rilzacosmetics.com | IP: 185.73.8.3
Built for cybersecurity education purposes only.