Skip to content
Visual explainer 2h 30m to learn 4 steps

Phishing & social engineering

Analyse a phishing email's headers and links and recommend controls.

By Invicly Tech, , in Cyber Security Fundamentals. About 11 minutes to read.

Topic 29 of 49

In short

Social engineering targets people rather than software, and phishing is its most common form. Defenders analyse email headers and authentication results (SPF, DKIM, DMARC), inspect links safely, and build easy reporting so users become sensors.

Explained simply

Social engineering means tricking people instead of hacking machines. It is often easier to ask an employee for a password than to break the login system. Attackers play on normal human feelings: fear, hurry, helpfulness, curiosity and respect for the boss.

Phishing is social engineering by message. Email is most common, but there are variants: smishing (text messages), vishing (voice calls) and quishing (a QR code that leads to a fake login page). Spear phishing is a phishing message written for one specific person, using details found online.

Email was designed in a trusting time, so anyone can write any name in the From line. Three DNS-based checks help a mail server spot fakes. SPF lists which servers may send for a domain. DKIM adds a digital signature to each message. DMARC tells receivers what to do when those checks fail.

Technology cannot stop everything, so people are the last filter. A good programme makes reporting easy (one button), thanks people who report, and never shames anyone who clicked. Fast reports let the security team remove the same email from every inbox before more people fall for it.

Press Play on a diagram to walk through it one step at a time.

FlowAnalysing a suspect email
  1. Step 1
    Spot red flags

    Urgency, mismatch, odd sender.

  2. Step 2
    Check headers

    SPF, DKIM, DMARC results.

  3. Step 3
    Inspect links

    Hover and expand, do not click.

  4. Step 4
    Report

    Use the reporting process.

MapSocial engineering channels
Social engineering
  • Email
    • Mass phishing
    • Spear phishing
    • Business email compromise
  • Phone and text
    • Vishing
    • Smishing
    • MFA fatigue push spam
  • Web
    • Fake login pages
    • Malicious ads
    • Fake browser updates
  • In person
    • Tailgating
    • Dropped USB sticks
    • Fake technician
  • QR codes
    • Quishing posters and emails

In depth

Reading email headers in the right order

Every mail server that handles a message adds a Received line at the top of the header. So you read Received lines from the bottom up: the lowest one is closest to the real sender, and the top one is your own mail server. Only the lines added by your own servers can be fully trusted; anything below them could be forged by the sender.

Three addresses can differ. The From header is what the user sees. The Return-Path (envelope sender) is where bounces go, and SPF checks this domain. The Reply-To decides where replies go, and a Reply-To pointing to a free webmail address is a classic sign of business email compromise (BEC) fraud.

Your own mail server writes an Authentication-Results header summarising the checks, for example spf=pass, dkim=pass header.d=example.com and dmarc=pass header.from=example.com. Start your analysis there.

  • Look for: display name says CEO but address is a random Gmail
  • Look-alike domains: rn instead of m, or extra words like example-support.com
  • Message-ID domain that does not match the sending service can be a hint

SPF, DKIM and DMARC: what each really checks

SPF is a TXT record such as v=spf1 include:_spf.google.com -all. The receiver checks whether the connecting server's IP is allowed to send for the Return-Path domain. SPF breaks when mail is forwarded, and it allows at most 10 DNS lookups.

DKIM signs chosen headers and the body with a private key. The receiver fetches the public key from DNS at selector._domainkey.domain and verifies the signature, so it proves the message was not changed and was signed by that domain (the d= tag). It survives forwarding.

Neither checks the visible From address by itself. DMARC adds alignment: SPF or DKIM must pass for a domain that matches the From domain. The policy p=none only reports, p=quarantine sends failures to spam, and p=reject refuses them. Since 2024, Google and Yahoo require bulk senders to publish DMARC. Aim for p=reject once your reports show all legitimate senders pass.

SequenceHow a receiving server checks one email
Sending server
Receiving server
Sender's DNS
  1. 1Delivers mail, MAIL FROM bounce@ex.com
    Sending server to Receiving server: Delivers mail, MAIL FROM bounce@ex.com
  2. 2Get SPF record for ex.com
    Receiving server to Sender's DNS: Get SPF record for ex.com
  3. 3Get DKIM key for selector s1
    Receiving server to Sender's DNS: Get DKIM key for selector s1
  4. 4Get DMARC policy for From domain
    Receiving server to Sender's DNS: Get DMARC policy for From domain
  5. 5Policy p=reject, report address
    Sender's DNS to Receiving server: Policy p=reject, report address
  6. 6Aligned pass: accept; fail: apply policy
    Receiving server to Sending server: Aligned pass: accept; fail: apply policy

Inspecting links and attachments safely

Never click a suspicious link on your work machine. First, copy it as text and defang it (hxxps://evil[.]com) so it cannot be clicked by accident in a ticket or chat. Look at the real domain, which is the part just before the first single slash. In https://login.microsoft.com.secure-check.net/ the real domain is secure-check.net.

Then use tools that visit it for you, such as urlscan.io, which records the page, redirects and screenshot. For attachments, compute the hash (sha256sum on Linux, Get-FileHash in PowerShell) and look it up on VirusTotal. Be careful: uploading a file to a public service shares it with other users, so never upload documents that may contain company data. Use an internal or private sandbox for those.

Modern phishing often uses adversary-in-the-middle kits that proxy the real login page and steal the session cookie, defeating SMS and app-push MFA. Passkeys and FIDO2 keys resist this because they are bound to the real domain.

Designing awareness and reporting that work

Annual slide shows change little. What works is short, frequent training tied to real attacks, plus simulated phishing used to teach rather than to punish. Track the report rate, not only the click rate: a programme where 60 percent of people report a test email is healthier than one with few clicks and few reports.

Make reporting one click, with a Report button in the mail client that sends the full original message (with headers) to the security mailbox. Reply quickly to every report, even with an automated thank you, so people keep doing it.

Add process controls for the costliest scams. For payment changes, require a call-back to a known phone number, never the number in the email. For help desk password resets, verify identity strongly, because attackers now phone help desks pretending to be employees to get MFA reset.

  • Measure: report rate, time to first report, repeat clickers
  • Tag external email with a banner
  • Call-back rule for any change of bank details

Learn it in 4 short steps

About 40m each. Track them with a timer in your plan.

  1. 1
    Recognise phishing red flags~40m
  2. 2
    Read email headers and SPF, DKIM, DMARC~40m
  3. 3
    Safely inspect links and attachments~40m
  4. 4
    Design awareness and reporting~40m

Key points

  • Phishing exploits trust, urgency and authority.
  • SPF, DKIM and DMARC help verify sender legitimacy.
  • Inspect links and attachments without opening them live.
  • Easy reporting turns users into an early warning system.

Key terms

Tap a card to flip it. 0/4 known

Examples

Analyse a fake invoice email

The email comes from billing@contoso-invoices.com, shown as Accounts, and asks you to pay an overdue invoice today. Step 1: red flags are urgency, an unexpected invoice and a domain that is not the supplier's real one. Step 2: in the headers, Authentication-Results shows spf=pass for contoso-invoices.com and dmarc=pass. That only proves the attacker owns that look-alike domain, not that it is the real supplier. Step 3: the link text says View invoice, but the URL goes to a newly registered domain. Step 4: check the domain age with whois and the page in urlscan.io. Step 5: report it, then search the mail gateway for the same sender and purge all copies.

text
Return-Path: <bounce@contoso-invoices.com>
Authentication-Results: mx.example.org;
  spf=pass smtp.mailfrom=contoso-invoices.com;
  dkim=pass header.d=contoso-invoices.com;
  dmarc=pass header.from=contoso-invoices.com
From: Accounts <billing@contoso-invoices.com>
Reply-To: payments.contoso@outlook.com
Subject: URGENT: overdue invoice 4471

Check a domain's email protection

Your manager asks whether attackers could spoof your company domain. Step 1: query the SPF record and check it ends in -all or ~all. Step 2: query the DMARC record at _dmarc.yourdomain. Step 3: if the policy is p=none, spoofed mail is only reported, not blocked. Step 4: read the aggregate reports (sent to the rua address) for a few weeks to find every real sender, fix them, then move to p=quarantine and finally p=reject.

bash
dig +short TXT example.com | grep spf1
# "v=spf1 include:_spf.google.com ~all"
dig +short TXT _dmarc.example.com
# "v=DMARC1; p=none; rua=mailto:dmarc@example.com"
dig +short TXT google._domainkey.example.com
# DKIM public key for selector "google"

Quick reference

  • Read Received headers from the bottom up; trust only lines your own servers added
  • SPF checks the Return-Path domain, not the From address users see
  • DMARC needs SPF or DKIM to pass for a domain aligned with the From domain
  • DMARC policies: p=none (report), p=quarantine (spam), p=reject (refuse)
  • Defang IOCs before sharing: hxxps://bad[.]example
  • Real domain is the part just before the first single slash in a URL
  • Never upload internal documents to public sandboxes; hashes are safe to look up
  • Bank detail change by email? Call back on a known number, never the one in the email

Quick quiz

Pick an answer to see if you're right and why.

Question 1

1An email shows spf=pass, dkim=pass and dmarc=pass. What does that prove?

Question 2

2Which header does SPF evaluate?

Question 3

3What does a DMARC policy of p=none do with messages that fail?

Question 4

4Which MFA type best resists phishing kits that proxy the real login page?

Question 5

5Which metric best shows a healthy phishing awareness programme?

0/5 answered

Practice exercises

Try each one yourself first. Use the hint if you get stuck, then compare with the solution.

  1. Exercise 1easy

    Find the real domain in each URL: (a) https://paypal.com.account-verify.co/login (b) https://accounts.google.com/signin (c) https://microsoft-365.support/reset (d) https://www.amazon.com@evil.example/

  2. Exercise 2medium

    Check the SPF and DMARC records of three domains you use (for example your university, a bank and a small shop). For each, say whether spoofing the From address would likely be blocked.

  3. Exercise 3hard

    Write a phishing triage checklist for a SOC analyst that goes from a user report to closing the case, including how to find and remove other copies.

Check yourself

Answer in your head, reveal, then be honest with yourself.

Feel confident about this topic?

Frequently asked questions

How can I see the full headers of an email?
In Gmail, open the message, click the three-dot menu and choose Show original. In Outlook, open the message and use View message source or the message properties. Many tools also let you download the .eml file.
What is business email compromise?
BEC is fraud where attackers pose as a boss, supplier or partner by email, often with no malware at all, to get a payment or data sent to them. It causes larger financial losses than most other cybercrime types.
I clicked a phishing link. What should I do?
Report it right away, even if you think nothing happened. If you typed a password, change it and tell the security team so they can revoke your sessions and watch your account.
Is SPF alone enough to stop spoofing?
No. SPF does not check the From address that users see. You need DMARC with an enforcing policy, backed by SPF and DKIM, to stop direct spoofing of your domain.

Go deeper

ShareXLinkedInWhatsApp