Skip to content
SOC Analyst Prep
  • Loading index…

↑↓ navigate · ↵ open · Esc close

en

Module 04 / 05

Phishing Email Analysis

Reported phishing is one of the highest-volume queues in most SOCs, and phishing scenarios appear in nearly every L1 interview. This module walks through how to read a header, what email authentication actually proves, how to analyse links and attachments safely, and what a complete response looks like.

Beginner22 min read5 topicsUpdated 2026-11-23

Topic 1

Reading Raw Email Headers

Concept

A raw header is a stack of fields added by each server the message passed through. Received headers are prepended by each hop, so the bottom-most Received header is the earliest hop (closest to the sender) and the top one is your own mail gateway. Read them bottom-up to trace the path. Only the headers added by your own servers are fully trustworthy; anything below can be forged by the sender.

Three sender fields matter and are often different. From is the display address the user sees and is trivially spoofed. Return-Path (the envelope sender, MAIL FROM) is where bounces go, and it is what SPF checks. Reply-To is where replies go; a From of a trusted vendor with a Reply-To at a free webmail address is a classic business email compromise pattern.

Message-ID is generated by the sending system and usually contains its domain. A Message-ID domain that matches neither the From domain nor the sending infrastructure is worth noting. Also read Authentication-Results, added by your gateway, which summarises SPF, DKIM and DMARC outcomes.

  • Read Received headers bottom-up; trust only those added by your own infrastructure.
  • From = what the user sees. Return-Path = envelope sender, checked by SPF. Reply-To = where replies go.
  • Mismatched From / Reply-To / Return-Path domains are a common phishing and BEC signal.
  • Check Authentication-Results for spf=, dkim=, dmarc= outcomes.
  • Note the originating IP from the earliest trustworthy Received line and look it up.

Real log example

Header excerpt: spoofed invoice to Northwind accounts payable
Received: from mx1.northwind-logistics.com (10.10.5.10) by exch01.northwind-logistics.com; Wed, 18 Nov 2026 08:41:12 +0000
Received: from mail.northwlnd-logistics.com (mail.northwlnd-logistics.com [203.0.113.88]) by mx1.northwind-logistics.com with ESMTPS; Wed, 18 Nov 2026 08:41:10 +0000
Authentication-Results: mx1.northwind-logistics.com; spf=pass smtp.mailfrom=northwlnd-logistics.com; dkim=pass header.d=northwlnd-logistics.com; dmarc=pass header.from=northwlnd-logistics.com
Return-Path: <billing@northwlnd-logistics.com>
From: "Northwind Accounts" <accounts@northwlnd-logistics.com>
Reply-To: northwind.accounts.team@freemail.example
To: ap@northwind-logistics.com
Subject: URGENT: Updated bank details - Invoice INV-88231
Message-ID: <20261118084109.4F2A1@mail.northwlnd-logistics.com>

Everything passes, but the domain is northwlnd (lowercase L instead of i): a lookalike the attacker owns. The Reply-To sends responses to Gmail. Passing authentication only proves the mail really came from the lookalike domain.

Interview question

“How do you analyse the headers of a suspected phishing email?”

What the interviewer is testing: Whether you know the header order, the different sender fields, and which parts can be forged.

Weak answer

I check the From address and see if it looks real, and then check the IP on VirusTotal.

Why it loses points: The From address is the easiest field to forge, and it skips Received order, Reply-To and authentication results.

Strong answer sketch

I get the raw headers, not the rendered view, and read the Received chain from the bottom up to find where the message entered, trusting only the hops added by our own gateway. Then I compare From, Return-Path and Reply-To: if they belong to different domains, or the Reply-To is a free webmail address, that is a strong signal. I read Authentication-Results for SPF, DKIM and DMARC, but I also look closely at the domain itself for lookalikes. Finally I note the sending IP, the Message-ID domain and any URLs or attachments, then search our mail logs for other recipients of the same sender or subject.

Common mistakes

  • Reading Received headers top-down as if the top were the origin.
  • Trusting the From field.
  • Ignoring Reply-To, which is where BEC attacks hide.
  • Missing lookalike domains (rn vs m, l vs i, extra hyphens).

Topic 2

SPF, DKIM and DMARC

Concept

SPF (Sender Policy Framework) is a DNS TXT record listing which servers may send mail for a domain. The receiver checks the connecting IP against the SPF record of the envelope sender (Return-Path / MAIL FROM) domain, not the visible From. A pass proves only that this server is authorised to send for that envelope domain.

DKIM (DomainKeys Identified Mail) adds a cryptographic signature in the DKIM-Signature header, using a private key whose public half is published in DNS at selector._domainkey.domain. A pass proves the signed headers and body were not altered in transit and that the domain in d= signed it. The d= domain can be any domain the sender controls.

DMARC ties these to the visible From. It passes only if SPF or DKIM passes and the passing domain aligns with the From header domain (exact match for strict, same organisational domain for relaxed). The domain owner publishes a policy: p=none (monitor only), p=quarantine or p=reject, plus reporting addresses.

The key interview point: authentication proves who sent it, not whether it is legitimate. An attacker who registers a lookalike domain can set up perfect SPF, DKIM and DMARC and pass all three. Conversely, legitimate mail can fail SPF when it is forwarded. Authentication results are evidence, not a verdict.

  • SPF: is this IP allowed to send for the Return-Path domain? Breaks on forwarding.
  • DKIM: was the message signed by the d= domain and left unaltered? Survives forwarding if not modified.
  • DMARC: did SPF or DKIM pass and align with the From domain? Policy none/quarantine/reject.
  • SPF/DKIM/DMARC pass on a lookalike domain proves nothing about legitimacy.
  • A domain with p=none can be spoofed in the From header and mail is still delivered (only reported).

Real log example

DNS records and an alignment failure
northwind-logistics.com.            TXT "v=spf1 include:spf.protection.outlook.com -all"
selector1._domainkey.northwind-logistics.com. CNAME selector1-northwind-logistics-com._domainkey.northwindlogistics.onmicrosoft.com.
_dmarc.northwind-logistics.com.     TXT "v=DMARC1; p=reject; rua=mailto:dmarc@northwind-logistics.com"

Authentication-Results: mx1.northwind-logistics.com;
  spf=pass smtp.mailfrom=bounce.mailer-example.net;
  dkim=pass header.d=mailer-example.net;
  dmarc=fail action=reject header.from=northwind-logistics.com

SPF and DKIM both pass, but for mailer-example.net. Neither aligns with the From domain northwind-logistics.com, so DMARC fails, and because Northwind publishes p=reject, the gateway rejects it: a direct spoof of our own domain.

Interview question

“An email passed SPF, DKIM and DMARC. Does that mean it is safe?”

What the interviewer is testing: Whether you understand what email authentication actually proves and the lookalike-domain blind spot.

Weak answer

Yes, if all three pass then the email is authenticated and it is not spoofed, so it is safe.

Why it loses points: Authentication proves the sending domain, not intent; attackers routinely pass all three on domains they own.

Strong answer sketch

No. SPF passing means the sending IP is authorised for the envelope sender domain, DKIM passing means the message was signed by the d= domain and not altered, and DMARC passing means one of those aligns with the From domain. Together they prove the mail really came from that domain, but not that the domain is trustworthy. An attacker can register a lookalike like northwlnd-logistics.com, set up all three records and pass cleanly. So I would still check the domain's age and spelling, the Reply-To, the links and attachments, and whether the request itself, like changing bank details, is unusual.

Common mistakes

  • Saying SPF checks the From address; it checks the envelope sender.
  • Treating "all pass" as "safe".
  • Forgetting that DMARC requires alignment, not just an SPF or DKIM pass.
  • Not knowing that p=none does not block anything.

Topic 3

Safe URL Triage

Concept

Never click a suspicious link from your own workstation, and never open it in a normal browser on the corporate network. Even a visit can trigger a drive-by exploit, confirm to the attacker that the address is monitored, or burn a one-time token that proves the user clicked.

Defang URLs and IPs in tickets and chat so nobody clicks them by accident: hxxps://login-northwind[.]example[.]com/o365, 198.51.100[.]23. Then extract and analyse: decode safe-link wrappers (Microsoft Safe Links, Proofpoint URL Defense) to get the original URL, expand shorteners with an expander service or a headless request rather than a browser, and check domain age, registrar and hosting.

To see what the page does, use a sandbox or scanner such as urlscan.io, a sandbox like ANY.RUN or Joe Sandbox, or an isolated analysis VM behind a separate egress. Be aware that public scans can be visible to others, and that phishing kits often cloak: they show a harmless page to scanners, data-centre IPs or non-matching user agents, and the real credential-harvesting page only to the target. A clean scan does not always mean a clean link.

  • Never click from your workstation; use a sandbox, urlscan-style scanner or isolated VM.
  • Defang: hxxp://, [.] in domains and IPs.
  • Unwrap Safe Links / URL Defense wrappers; expand shorteners without a browser.
  • Check domain age, hosting, certificate, redirect chain and final landing page.
  • Phishing kits cloak; a clean scan is not proof. Check proxy logs for who actually clicked.

Real log example

Proxy log: who clicked, and who submitted
2026-11-18T08:52:03Z user=ap.clerk1 src=10.10.40.21 method=GET url=hxxps://login-northwind-portal[.]example[.]com/o365/?e=ap@northwind-logistics.com status=200 bytes_in=18342
2026-11-18T08:52:41Z user=ap.clerk1 src=10.10.40.21 method=POST url=hxxps://login-northwind-portal[.]example[.]com/o365/next.php status=302 bytes_out=412
2026-11-18T08:58:10Z user=ap.clerk2 src=10.10.40.33 method=GET url=hxxps://login-northwind-portal[.]example[.]com/o365/?e=ap@northwind-logistics.com status=200 bytes_in=18342

ap.clerk1 loaded the page and then POSTed to it: treat their credentials as compromised. ap.clerk2 only loaded it (GET), which still needs a check but is lower risk. The response differs, so scope by POST, not just by visits.

Interview question

“A user reports a suspicious link. How do you analyse it safely?”

What the interviewer is testing: Operational safety, tooling knowledge, and whether you go beyond the URL to check user impact.

Weak answer

I would open the link in incognito mode to see if it is a phishing page.

Why it loses points: Incognito offers no isolation; it still runs on the corporate workstation and network.

Strong answer sketch

I would not open it on my machine. I pull the URL from the raw email, unwrap any Safe Links rewriting, defang it in the ticket, and submit it to a sandbox or urlscan-style scanner, or open it in an isolated analysis VM. I look at the redirect chain, final landing page, domain age and hosting, and whether it imitates our Microsoft 365 login. I keep in mind kits can cloak, so a benign-looking scan is not final. Most importantly I search proxy and DNS logs for anyone who visited it, and especially anyone who sent a POST, because that suggests credentials were submitted and needs a password reset and session revocation.

Common mistakes

  • Opening the URL in a normal or incognito browser.
  • Pasting live, undefanged URLs into tickets or chat.
  • Treating a clean scan as final without considering cloaking.
  • Not checking proxy logs for who clicked.

Topic 4

Attachment Triage

Concept

Start with what you can learn without opening the file. Compute the hash (SHA-256) and look it up in threat intel; note the true file type (magic bytes, not the extension), size and name. Many malicious attachments are fresh builds with no reputation, so a 'no matches' lookup is not proof of safety.

Then detonate in a sandbox to observe behaviour: processes spawned, network connections, files dropped, registry changes. Static tools help too: oleid / olevba (oletools) show whether an Office file contains macros and what they do.

Know the common delivery formats. Macro documents (.docm, .xlsm, older .doc/.xls) are less common since Microsoft started blocking macros in files from the internet by default (Mark of the Web). Attackers responded with ISO/IMG/VHD containers (which historically did not pass Mark of the Web to files inside), LNK shortcuts, OneNote files, password-protected ZIPs (password in the email body to evade scanning), and HTML smuggling, where an .html attachment uses JavaScript to build and download the payload inside the browser so the gateway never sees the binary.

  • Hash it (SHA-256), check reputation, verify the true file type.
  • Detonate in a sandbox; review child processes, network, dropped files.
  • olevba / oleid for Office macros.
  • Know the formats: macro docs, ISO/IMG/VHD, LNK, OneNote, password ZIP, HTML smuggling.
  • Unknown hash is not clean; look at behaviour and context.

Real log example

Sandbox summary: HTML smuggling attachment
File:      Remittance_Advice_88231.html   (attached, 412 KB)
SHA256:    3B7F0C2A9D61E8F4A5C0B1D29E7F3A44C9D0E15A6B78F2C3D4E5F60718293A4B   (no prior reputation)
Static:    <script> builds Blob from large base64 string; calls msSaveOrOpenBlob / a.download="Remittance_88231.iso"
Dynamic:   browser writes C:\Users\<user>\Downloads\Remittance_88231.iso
           ISO mounted -> Remittance_88231.lnk -> cmd.exe /c rundll32.exe payload.dll,DllRegisterServer
Network:   rundll32.exe -> 198.51.100.23:443 (TLS, self-signed cert)
Verdict:   Malicious (HTML smuggling -> ISO -> LNK -> DLL loader)

The email gateway only saw an HTML file; the ISO was assembled in the browser. The hash had no reputation, so behaviour was what proved it malicious.

Interview question

“How would you analyse a suspicious email attachment?”

What the interviewer is testing: A safe, layered method and awareness of current delivery techniques beyond macros.

Weak answer

I would upload it to VirusTotal and if no engines detect it then it is safe.

Why it loses points: New samples often have zero detections, and uploading can tip off attackers or leak sensitive documents.

Strong answer sketch

I would never open it on my workstation. I get the SHA-256 and check our threat intel and public reputation, being careful about uploading files that might contain company data. I check the real file type, since an .html or .iso attachment from an unknown sender is suspicious by itself. Then I detonate it in our sandbox and look at the child processes, network connections and dropped files; for Office files I would also run olevba to see macro code. If it is malicious I take the hash, C2 domain and IP, search EDR and mail logs for other recipients and any host where it executed, and escalate.

Common mistakes

  • Treating zero VirusTotal detections as clean.
  • Uploading internal documents to public services without considering data exposure.
  • Only thinking about macros and missing ISO, LNK and HTML smuggling.

Topic 5

Phishing Response Actions

Concept

A phishing response has two parts: scope and contain. Scope first: search the mail logs (e.g. Microsoft 365 message trace or Defender Explorer) for every recipient of the same sender, subject, URL or attachment hash, and check proxy, DNS and EDR logs for anyone who clicked, submitted credentials or executed the attachment.

Containment depends on what happened. Delivered only: purge the message from all mailboxes (e.g. a Defender for Office 365 soft/hard delete or a compliance search purge), and block the sender, domain, URL and hash at the gateway and proxy. Clicked but did not submit: check the endpoint and proxy for downloads. Credentials submitted: reset the password, revoke active sessions and refresh tokens, check MFA methods for attacker-added devices, and review sign-in logs and inbox rules for the window since the click. Attachment executed: isolate the host through EDR and escalate.

Finally, tell the reporting user it was handled (it encourages reporting), and record IOCs, scope and actions in the ticket. If it was a BEC attempt to change bank details, finance needs to verify through a known phone number, not by replying.

  • Scope: all recipients, all clickers, all submitters, all executions.
  • Purge from every mailbox, not just the reporter's.
  • Block sender, domain, URL, IP and hash at mail gateway, proxy and EDR.
  • Credentials submitted: reset password, revoke sessions, review MFA methods, inbox rules and sign-ins.
  • Attachment executed: isolate the host and escalate.

Real log example

Scoping with Microsoft Defender advanced hunting (KQL)
EmailEvents
| where Timestamp > ago(2d)
| where SenderFromDomain == "northwlnd-logistics.com" or Subject has "INV-88231"
| project Timestamp, RecipientEmailAddress, SenderFromAddress, Subject, DeliveryAction, DeliveryLocation, NetworkMessageId
| join kind=leftouter (UrlClickEvents | project NetworkMessageId, AccountUpn, ActionType, Url) on NetworkMessageId

Lists every recipient of the campaign and whether they clicked (UrlClickEvents ActionType such as ClickAllowed). NetworkMessageId is what you feed into the purge action.

Interview question

“A user clicked a phishing link and entered their password. What do you do?”

What the interviewer is testing: Whether you understand that a password reset alone is not containment, and whether you scope the campaign.

Weak answer

I would tell the user to change their password and block the URL.

Why it loses points: The attacker may already have an active session or token, MFA changes, or inbox rules that survive a password change.

Strong answer sketch

I treat the account as compromised. I would reset the password and revoke all sessions and refresh tokens, because a reset alone does not kill a stolen session cookie. Then I review sign-in logs since the click for logons from new IPs, countries or devices, check for newly registered MFA methods, and look for inbox rules or forwarding the attacker may have created. In parallel I scope the campaign: find all recipients, purge the email from every mailbox, block the domain and URL, and check proxy logs for anyone else who POSTed to the page. I document everything and escalate if there is evidence of attacker sign-in.

Common mistakes

  • Only resetting the password without revoking sessions.
  • Deleting the email from the reporter's mailbox only.
  • Not checking for inbox rules, forwarding or new MFA devices.
  • Forgetting to close the loop with the user who reported it.

More interview questions on this topic

Practise answers out loud in the drill

Knowledge check · Phishing Email Analysis

0 / 5 answered
  1. 1.An email shows From ceo@yourcompany.com, Return-Path bounce@mailer.sendgrid.net and Reply-To ceo.yourcompany@freemail.example. Which detail is the strongest red flag?
  2. 2.An email from billing@micros0ft-support.com shows spf=pass dkim=pass dmarc=pass. What does that tell you?
  3. 3.An attachment's SHA256 returns 0 detections on VirusTotal. What should you conclude?
  4. 4.A user reports a link to https://login.microsoftonline.com.secure-verify.xyz/auth. What is the registered domain the browser will actually contact?
  5. 5.A confirmed credential-phishing email reached 40 mailboxes. Two users clicked and one entered their password. Which response is most complete?

Finished this module?

Mark it complete to update your progress (saved in this browser only), then prove it in the simulator.

Frequently asked questions

What is the difference between SPF, DKIM and DMARC?

SPF checks whether the sending IP is authorised for the envelope sender domain. DKIM verifies a cryptographic signature proving the message was signed by a domain and not altered. DMARC requires SPF or DKIM to pass and align with the visible From domain, and publishes a policy of none, quarantine or reject.

Can a phishing email pass SPF, DKIM and DMARC?

Yes. If an attacker registers their own lookalike domain and configures it correctly, their mail can pass all three. Authentication proves which domain sent the mail, not whether that domain is trustworthy.

How do you read email headers in the right order?

Read the Received headers from the bottom up. Each server adds its Received line at the top, so the bottom one is the earliest hop. Only trust the lines added by your own mail infrastructure.

What is the difference between Return-Path and Reply-To?

Return-Path is the envelope sender, where bounces go, and it is the domain SPF checks. Reply-To is where replies from the user will be sent. Attackers often set Reply-To to an address they control while the From looks legitimate.

What is HTML smuggling?

HTML smuggling is a technique where an HTML attachment or page contains encoded data and JavaScript that builds the malicious file inside the browser and saves it to disk, so the email gateway only ever scans an HTML file.