Chapter 31: Phishing, Social Engineering, and Business Email Compromise
"Amateurs hack systems. Professionals hack people." — Bruce Schneier
The Email That Cost $37 Million
In 2019, a European subsidiary of Toyota Boshoku Corporation lost $37 million to a single business email compromise attack. The attacker convinced a finance executive to change wire transfer banking details. One email. One phone call. Thirty-seven million dollars gone.
That is not a technical exploit. It is social engineering — and it is the most effective attack vector in cybersecurity. The FBI's Internet Crime Complaint Center estimates BEC losses exceeded $2.7 billion in 2022, and cumulative BEC losses since 2013 have surpassed $50 billion globally. Phishing and social engineering do not break through your firewall --- they walk through the front door because someone held it open.
The Phishing Taxonomy
Phishing is not a single technique. It is a family of attack methods that exploit human trust, urgency, authority, and curiosity. Each variant targets a different communication channel and presses a different psychological lever.
graph TD
A["Phishing Family"] --> B["Email-Based"]
A --> C["Voice-Based"]
A --> D["Message-Based"]
A --> E["Physical/Visual"]
B --> B1["Mass Phishing<br/>Thousands of generic emails<br/>Shotgun approach"]
B --> B2["Spear Phishing<br/>Targeted at specific individuals<br/>Researched, personalized"]
B --> B3["Whaling<br/>Targeting C-suite executives<br/>Weeks of reconnaissance"]
B --> B4["Clone Phishing<br/>Duplicates a legitimate email<br/>Swaps link or attachment"]
B --> B5["BEC<br/>Business Email Compromise<br/>CEO fraud, invoice manipulation"]
C --> C1["Vishing<br/>Voice phishing via phone<br/>Impersonates IT, bank, IRS"]
C --> C2["AI Voice Cloning<br/>Deepfake voice calls<br/>Clones from seconds of audio"]
D --> D1["Smishing<br/>SMS-based text messages<br/>90%+ open rate"]
D --> D2["Social Media Phishing<br/>DMs on LinkedIn, Twitter<br/>Fake connection requests"]
E --> E1["Quishing<br/>QR code phishing<br/>Opaque URL destination"]
E --> E2["USB Drops<br/>Malicious USB left in parking lot<br/>Curiosity-driven execution"]
style A fill:#e74c3c,color:#fff
style B fill:#3498db,color:#fff
style C fill:#2ecc71,color:#fff
style D fill:#f39c12,color:#fff
style E fill:#9b59b6,color:#fff
Mass Phishing Campaigns
The most common form. Attackers send hundreds of thousands or millions of emails impersonating legitimate organizations --- banks, cloud providers, shipping companies, social media platforms. The goal is volume: if you send a million emails, even a 0.1% success rate yields a thousand victims.
A typical mass phishing email contains:
- A spoofed or look-alike sender address (e.g.,
support@paypa1.comusing the digit1instead of the letterl) - Urgency language: "Your account will be suspended in 24 hours"
- A link to a credential-harvesting page that pixel-perfectly mimics the real login portal
- Sometimes a malicious attachment: PDF with embedded JavaScript, Office document with macros, or an HTML file that renders a fake login page locally
Real example headers from a mass phishing campaign:
Return-Path: <bounce-7291@secure-bankofamerica-verify.com>
From: "Bank of America Security" <security@bankofamerica-alert.com>
Reply-To: support@bankofamerica-alert.com
Subject: [URGENT] Unusual Activity Detected - Action Required
X-Mailer: PHPMailer 6.5.0
Authentication-Results: spf=fail; dkim=none; dmarc=fail
Notice the telltale signs: the Return-Path domain does not match the From domain, there is no DKIM signature, SPF fails, and the X-Mailer reveals PHPMailer --- a bulk sending library that legitimate banks do not use.
Spear Phishing: The Sniper Rifle
Spear phishing targets specific individuals with carefully researched, personalized messages. The attacker studies the target's LinkedIn profile, company website, recent social media posts, conference presentations, published papers, even their writing style and the names of their colleagues.
How do attackers gather all that intelligence? OSINT --- Open Source Intelligence. Understanding the attacker's reconnaissance process is the first step to defending against it.
OSINT Reconnaissance for Spear Phishing
# Step 1: Identify targets from LinkedIn
# Attackers search for "VP Finance" OR "Controller" at target company
# LinkedIn Premium gives InMail access and full profile visibility
# Step 2: Harvest email format from public sources
$ curl -s "https://hunter.io/v2/domain-search?domain=targetcorp.com" \
| jq '.data.emails[].value'
# Returns: john.smith@targetcorp.com, jane.doe@targetcorp.com
# Pattern identified: first.last@targetcorp.com
# Step 3: Check for data breach credentials
# theHarvester aggregates emails from multiple sources
$ theHarvester -d targetcorp.com -b all -l 500
# Returns email addresses, subdomains, and sometimes leaked credentials
# Step 4: Mine social media for personal details
# Attacker notes: target attended AWS re:Invent, follows @kubernetes,
# recently promoted, uses iPhone, daughter started college
# Step 5: Identify vendor relationships from press releases, job postings
# Job posting mentions: "Experience with Workday, Salesforce, and NetSuite"
# Press release: "TargetCorp partners with AcmeVendor for supply chain"
The resulting spear phishing email uses all of this intelligence:
From: michael.chen@acmevendor.com (spoofed)
Subject: Re: Q3 Partnership Agreement - Updated Terms
Hi there,
Great seeing you at re:Invent last week. As discussed, I've updated
the partnership terms based on your feedback about the Kubernetes
migration timeline.
Please review the attached agreement and let me know if the revised
SLA works for your team. Sarah in procurement said you'd want to
see the updated pricing table before Thursday's board meeting.
[Q3_Partnership_Agreement_v2.docx] <-- Macro-enabled malware
Best,
Michael
That email references a real conference, a real vendor relationship, a real colleague's name, and a plausible business context. Most people would not catch it on instinct alone. That is exactly why technical controls matter so much.
Whaling
Whaling targets the biggest fish: CEOs, CFOs, board members, general counsel. These attacks are meticulously crafted and often involve weeks of reconnaissance. The payoff justifies the effort --- a CEO's credentials open doors to everything, and a CFO's authorization can move millions.
Whaling emails often impersonate board members, legal counsel with "urgent litigation" notices, government regulators with "compliance requirements," or fellow executives at partner companies. The attacker may register a look-alike domain weeks in advance and build a complete email history to appear legitimate.
Vishing (Voice Phishing)
Phone-based social engineering is remarkably effective because it adds emotional pressure, urgency, and the human tendency to be polite and helpful. The attacker calls pretending to be IT support, a bank fraud department, or a government agency.
A penetration tester called a company's help desk, claimed to be the CFO's executive assistant, and got a password reset done in under four minutes. She sounded stressed, mentioned the CFO by name, referenced a board meeting happening "right now," and the help desk technician --- trying to be helpful --- bypassed every verification step. The technician even apologized for the inconvenience. Helpfulness is a vulnerability. Every help desk should have a verification procedure that cannot be bypassed by emotional pressure, regardless of who claims to be calling.
Smishing (SMS Phishing)
Text messages have an open rate above 90%, compared to roughly 20% for email. Smishing exploits this with short, urgent messages:
USPS: Your package cannot be delivered. Update your
delivery address: https://usps-redelivery.info/track
IRS: You have an unclaimed tax refund of $1,247.00.
Claim now: https://irs-refund-portal.com/claim
[Your Bank]: Unusual sign-in detected. If this wasn't
you, secure your account: https://yourbank-secure.co/verify
The shortened URL and mobile interface make it harder to inspect the link destination. On a phone screen, there is no hover-to-preview, no visible URL bar in many apps, and the small screen hides the full domain. The .info, .co, and other non-standard TLDs are easy to miss on mobile.
Quishing (QR Code Phishing)
A newer vector that exploded after the pandemic normalized QR codes. Attackers place malicious QR codes on physical posters, in emails, on tampered restaurant menus, or on fake parking meter stickers. Scanning the code takes the victim to a credential-harvesting page. QR codes are opaque --- you cannot visually inspect them to determine the URL before scanning. In 2023, a massive quishing campaign targeted Microsoft 365 users with QR codes embedded in PDF attachments, bypassing traditional URL scanning that does not parse images.
The Psychology of Social Engineering
Phishing does not target your knowledge. It targets your emotions. Robert Cialdini's six principles of persuasion, published in his 1984 book Influence, form the psychological backbone of virtually every social engineering attack. Understanding these principles is not just academic --- it is the foundation for building defenses that actually work.
graph LR
subgraph "Cialdini's 6 Principles in Phishing"
A["Authority<br/>Impersonate CEO,<br/>IT, legal, government"] --> T["Target<br/>clicks, complies,<br/>transfers money"]
B["Urgency / Scarcity<br/>'Act now or lose access'<br/>'24 hours remaining'"] --> T
C["Social Proof<br/>'Your team already<br/>completed this'"] --> T
D["Reciprocity<br/>Offer help first,<br/>then request access"] --> T
E["Liking<br/>Build rapport,<br/>shared interests"] --> T
F["Consistency<br/>Small asks escalating<br/>to sensitive requests"] --> T
end
style A fill:#e74c3c,color:#fff
style B fill:#e67e22,color:#fff
style C fill:#f1c40f,color:#333
style D fill:#2ecc71,color:#fff
style E fill:#3498db,color:#fff
style F fill:#9b59b6,color:#fff
style T fill:#2c3e50,color:#fff
1. Authority
People comply with requests from perceived authority figures. An email that appears to come from the CEO, a government agency, or the security team triggers automatic compliance. In Milgram's famous obedience experiments, 65% of participants administered what they believed were dangerous electric shocks simply because an authority figure told them to.
Attack example: "This is the IT Security team. We have detected unauthorized access on your account. Click here to reset your password immediately or your account will be locked."
Why it works: The "IT Security team" is an authority figure within the organization. The recipient assumes the security team has legitimate access to their account information and would not send a false alert.
2. Urgency (Scarcity)
When something is scarce or time-limited, people act quickly without thinking. The amygdala's fight-or-flight response overrides the prefrontal cortex's rational analysis. Nearly every phishing email creates artificial urgency.
Attack example: "Your account will be permanently deleted in 2 hours unless you verify your identity."
Why it works: The time pressure short-circuits careful evaluation. The recipient thinks "I cannot afford to lose my account" and clicks without verifying.
3. Social Proof
People follow the crowd. If "everyone else" is doing something, it must be safe and appropriate. This is deeply ingrained --- in evolutionary terms, following the group's behavior kept you alive.
Attack example: "Your colleagues Sarah, Mike, and James have already completed the mandatory security survey. Please complete yours by end of day."
Why it works: Using real colleague names (harvested from LinkedIn) makes the message feel legitimate. The implication that "everyone has already done this" makes non-compliance feel awkward.
4. Reciprocity
When someone does something for you, you feel obligated to return the favor. This is one of the most powerful social norms across cultures.
Attack example: An attacker provides "helpful" technical information in a forum or Slack channel over several days, building credibility and goodwill. Then they privately message the target asking for VPN credentials to "test a fix" for an issue the target reported.
5. Liking
People comply with requests from people they like or who seem similar to them. Attackers build rapport before making their request, referencing shared interests, alma maters, or mutual connections found through social media.
6. Commitment and Consistency
Once someone takes a small step, they are likely to continue in that direction to remain consistent with their self-image. This is the "foot-in-the-door" technique.
Attack example: An attacker calls claiming to be from IT and first asks for non-sensitive information ("Can you confirm the office address?"), then escalates ("And the Wi-Fi network name?"), then further ("What is the VPN gateway address?"), and finally ("I need to verify your credentials to complete the audit").
Effective security awareness training needs to teach these psychological principles, not just "do not click links."
Business Email Compromise (BEC)
Business Email Compromise is not spray-and-pray phishing. It is a targeted, patient, well-researched attack that specifically aims to redirect money or steal sensitive data through impersonation of trusted business contacts. The FBI's IC3 reported that BEC caused over $2.7 billion in losses in 2022 alone --- more than any other cybercrime category. Cumulative BEC losses from 2013 to 2023 exceeded $50 billion.
The BEC Attack Lifecycle
sequenceDiagram
participant Attacker
participant Email as Email System
participant Target as Finance Executive
participant Bank as Target's Bank
Note over Attacker: Phase 1: Reconnaissance (2-4 weeks)
Attacker->>Attacker: Study org chart via LinkedIn
Attacker->>Attacker: Identify CEO, CFO, vendors
Attacker->>Attacker: Monitor SEC filings, press releases
Attacker->>Attacker: Harvest email format from Hunter.io
Note over Attacker: Phase 2: Infrastructure Setup
Attacker->>Attacker: Register look-alike domain<br/>(acmecorp.com → acrnecorp.com)
Attacker->>Attacker: Configure SPF/DKIM for spoofed domain
Attacker->>Attacker: Set up email forwarding rules
Note over Attacker: Phase 3: Initial Contact
Attacker->>Email: Send email as "CEO" to CFO<br/>"Confidential acquisition in progress"
Email->>Target: Delivers to inbox
Note over Attacker: Phase 4: The Ask
Attacker->>Target: "Process urgent wire transfer<br/>$480,000 to finalize deal<br/>Do not discuss with anyone"
Target->>Target: Sees CEO name, urgent language,<br/>confidentiality request
Note over Attacker: Phase 5: Money Movement
Target->>Bank: Initiates wire transfer
Bank->>Attacker: Funds arrive in attacker-controlled account
Attacker->>Attacker: Move through 4+ intermediary accounts
Attacker->>Attacker: Convert to cryptocurrency
Note over Target: Phase 6: Discovery (days to weeks later)
Target->>Target: CEO asks "What wire transfer?"
Target->>Target: Realizes fraud, contacts bank
Note over Bank: Funds are long gone
BEC Variant: CEO Fraud
The attacker impersonates the CEO and emails the CFO or a finance controller:
From: james.wilson@cornpany.com (note: 'rn' looks like 'm')
To: patricia.chen@company.com
Subject: Confidential - Urgent Wire Transfer
Hi Patricia,
I need you to process an urgent wire transfer of $480,000
to finalize an acquisition we've been working on. This is
highly confidential -- please don't discuss with anyone else
on the team until the deal closes.
I'm in meetings all day but need this processed before 3 PM.
I'll send the banking details in a follow-up email.
Thanks,
James
Note the psychological levers: authority (CEO), urgency (before 3 PM), scarcity (confidential, special access), and consistency (the "deal" implies prior commitment).
BEC Variant: Invoice Manipulation
The attacker compromises or impersonates a vendor's email and sends a legitimate-looking invoice with modified banking details:
From: accounts@trusted-vendor.com (compromised)
To: ap@targetcompany.com
Subject: Updated Banking Information for Invoice #4892
Dear Accounts Payable Team,
Please note that we have changed our banking provider effective
immediately. All future payments should be directed to:
Bank: First National Bank
Account: 847291036
Routing: 021000089
The attached invoice #4892 for $156,000 reflects our standard
quarterly service fees. Please process at your earliest convenience.
Regards,
Vendor Finance Team
When the vendor's email is actually compromised, the email comes from the real address, passes all authentication checks, and references real invoice numbers with correct amounts. The only defense is out-of-band verification --- calling the vendor on a known phone number from your contract files, not one from the email, to confirm banking changes.
Never verify banking changes using contact information provided in the email requesting the change. Always use independently sourced contact information --- a phone number from your contract files, your vendor management system, or a previous verified communication. This single control would have prevented billions of dollars in BEC losses.
BEC Variant: Payroll Diversion
A growing BEC variant targets HR and payroll departments. The attacker impersonates an employee and requests a change to their direct deposit information. The next paycheck goes to the attacker's account.
Real BEC Case Studies
| Victim | Year | Loss | Method |
|---|---|---|---|
| Facebook and Google | 2013-2015 | $100M+ | Lithuanian man impersonated hardware vendor Quanta Computer with fake invoices over 2 years |
| Ubiquiti Networks | 2015 | $46.7M | Attacker impersonated employees, targeted Hong Kong subsidiary. Recovered $14.9M |
| Toyota Boshoku | 2019 | $37M | BEC targeting European subsidiary, changed wire transfer banking details |
| Nikkei | 2019 | $29M | Employee in US subsidiary transferred funds based on fraudulent management instructions |
| Puerto Rico government | 2020 | $2.6M | Three government agencies targeted simultaneously through vendor impersonation |
A BEC incident at a mid-size law firm revealed how patient and thorough these attackers can be. The attacker had compromised a partner's email account --- not through phishing, but through credential stuffing from a data breach. They sat in the mailbox for three weeks, reading emails, learning the communication style, understanding ongoing deals and case numbers. They set up a mailbox rule to forward any email containing "wire" or "transfer" to an external address, and another rule to auto-delete any replies from the client about payment details.
Then they sent a single email to a client directing them to wire $2.3 million in escrow funds to a "new trust account." The email was perfect --- same writing style, same email signature, referencing real case numbers and the correct escrow amount. The client wired the money. It was gone within hours, split across accounts in four countries.
The firm's malpractice insurance had to cover the loss. The partner whose account was compromised had used the same password across three services. No MFA was enabled on the email account. A $12/year MFA token would have prevented a $2.3 million loss.
AI-Generated Phishing and Deepfakes
AI is changing the phishing landscape dramatically, and it is terrifying in three specific ways.
1. AI-Generated Phishing Text
Large language models can generate grammatically perfect, contextually appropriate phishing emails at scale. The traditional advice of "look for spelling errors" is completely obsolete. AI can:
- Generate phishing emails in any language without grammatical errors
- Adapt writing style to match a specific person's communication patterns (trained on their public writings, social media posts, or leaked emails)
- Create unique variants of the same message to evade pattern-based detection
- Generate convincing pretexts based on publicly available information about the target
- Translate attacks into any language instantly, enabling campaigns against previously safe non-English-speaking populations
2. Deepfake Voice (Vishing 2.0)
In 2019, criminals used AI-generated voice deepfakes to impersonate the CEO of a UK energy company's German parent company. The CEO of the UK subsidiary believed he was speaking to his boss and transferred $243,000 to the attackers' account. The AI mimicked the German accent and speech patterns convincingly.
Voice cloning technology has become dramatically more accessible since then. Services can clone a voice from just a few seconds of audio --- audio easily obtained from conference talks, YouTube videos, earnings calls, or podcast appearances.
3. Deepfake Video
Real-time video deepfakes can now be used in video conference calls. In February 2024, a Hong Kong finance worker was tricked into transferring $25 million after a video conference call with what appeared to be the company's CFO and other colleagues --- all deepfakes generated in real time.
graph LR
subgraph "AI-Enhanced Attack Evolution"
A["2015<br/>Manual phishing<br/>Typos, poor grammar<br/>Detection: Spelling checks"] --> B["2018<br/>Template-based<br/>Better crafted<br/>Detection: Pattern matching"]
B --> C["2021<br/>AI-generated text<br/>Unique per target<br/>Detection: Behavioral analysis"]
C --> D["2023<br/>AI voice cloning<br/>Real-time phone calls<br/>Detection: Code words"]
D --> E["2024+<br/>Real-time video deepfakes<br/>Full impersonation<br/>Detection: Process controls"]
end
style A fill:#27ae60,color:#fff
style B fill:#f39c12,color:#fff
style C fill:#e67e22,color:#fff
style D fill:#e74c3c,color:#fff
style E fill:#8e44ad,color:#fff
When an attacker can perfectly impersonate someone's voice, face, and writing style, the answer is not better human detection --- it is better processes and technical controls that do not rely on human judgment at all.
Technical Defenses Against Phishing
Email Authentication: SPF, DKIM, and DMARC
These three protocols work together to prevent email spoofing. We covered them in depth in Chapter 17 on email security, but here is the critical defensive view. If you configure nothing else for anti-phishing, configure these.
SPF (Sender Policy Framework) specifies which mail servers are authorized to send email for your domain:
$ dig TXT example.com +short
"v=spf1 include:_spf.google.com include:amazonses.com -all"
This record says: only Google Workspace servers and Amazon SES are allowed to send email as @example.com. The -all means hard fail --- reject everything else. Common mistake: using ~all (soft fail) which logs but does not reject.
DKIM (DomainKeys Identified Mail) adds a cryptographic signature to every outbound email:
$ dig TXT google._domainkey.example.com +short
"v=DKIM1; k=rsa; p=MIIBIjANBgkqhkiG9w..."
DKIM proves the email was sent by an authorized server and was not modified in transit. It is the digital signature (Chapter 4) applied to email.
DMARC (Domain-based Message Authentication, Reporting, and Conformance) ties SPF and DKIM together:
$ dig TXT _dmarc.example.com +short
"v=DMARC1; p=reject; rua=mailto:dmarc-reports@example.com;
ruf=mailto:dmarc-forensic@example.com; adkim=s; aspf=s"
The p=reject policy instructs receiving servers to reject emails that fail both SPF and DKIM alignment. This is the strongest setting.
flowchart TD
A["Incoming Email"] --> B{"SPF Check:<br/>Is sending IP<br/>authorized?"}
B -->|FAIL| F["Apply DMARC Policy"]
B -->|PASS| C{"DKIM Check:<br/>Does signature<br/>verify?"}
C -->|FAIL| F
C -->|PASS| D{"DMARC Alignment:<br/>Do SPF/DKIM domains<br/>align with From: header?"}
D -->|FAIL| F
D -->|PASS| E["Delivered to Inbox"]
F --> G{"DMARC Policy?"}
G -->|p=reject| H["Rejected"]
G -->|p=quarantine| I["Spam/Junk Folder"]
G -->|p=none| J["Delivered but<br/>logged in report"]
style A fill:#3498db,color:#fff
style E fill:#27ae60,color:#fff
style H fill:#e74c3c,color:#fff
style I fill:#f39c12,color:#fff
Check your own domain's email authentication configuration right now:
$ dig TXT yourdomain.com | grep spf
$ dig TXT _dmarc.yourdomain.com
$ dig TXT google._domainkey.yourdomain.com
If you do not see SPF, DKIM, and DMARC records with a `p=reject` or `p=quarantine` policy, your domain can be spoofed. Fix it today.
Bonus: Use dmarcian.com or mxtoolbox.com to analyze your DMARC reports and see who is sending email as your domain.
Link Analysis and URL Sandboxing
Modern email security gateways inspect URLs in emails before delivery:
- URL reputation checking --- comparing against known malicious URL databases (Google Safe Browsing, PhishTank, VirusTotal)
- URL rewriting --- replacing links with a proxy URL that checks the destination at click time, catching delayed-activation attacks
- Sandboxed browsing --- automatically visiting the URL in an isolated browser environment to detect credential-harvesting pages, drive-by downloads, or exploit kits
- Homograph detection --- identifying domains that use look-alike characters (e.g.,
paypaI.comwith a capital I, or internationalized domain names using Cyrillic characters wherea= Latin vs.a= Cyrillic)
You can manually inspect suspicious URLs:
# Follow redirects and show the final URL without loading content
$ curl -sI -L -o /dev/null -w '%{url_effective}\n' \
'https://bit.ly/suspicious-link'
https://evil-phishing-site.com/harvest-creds.php
# Check domain registration age (newly registered = suspicious)
$ whois suspicious-domain.com | grep -E 'Creation|Registrar'
Creation Date: 2026-03-10T12:00:00Z # Registered 2 days ago!
Registrar: NameCheap
# Resolve the domain and check IP reputation
$ dig A suspicious-domain.com +short
185.234.72.19
$ curl -s "https://api.abuseipdb.com/api/v2/check?ipAddress=185.234.72.19" \
-H "Key: YOUR_API_KEY" | jq '.data.abuseConfidenceScore'
92 # High abuse confidence score
Attachment Sandboxing
Email security solutions detonate attachments in isolated sandbox environments. Office documents are opened to check for macro execution. PDFs are rendered to detect exploit attempts. Executables are run in sandboxed VMs to observe behavior. Archives are extracted and each file analyzed individually.
Modern sandbox evasion techniques are sophisticated. Malware checks for sandbox indicators: low memory (<4GB), no mouse movement history, specific MAC address prefixes associated with VMs (00:0C:29 for VMware, 08:00:27 for VirtualBox), fast time progression (time jumps suggest acceleration), minimal installed software, and no browser history. Some malware sleeps for hours before activating, hoping to outlast the analysis window. Others check for recently opened Word documents, printer configurations, or Outlook profile data --- things present on real workstations but absent in sandboxes.
Leading sandbox solutions now simulate realistic user behavior --- mouse movements along natural bezier curves, keyboard input with human-like timing, application switching, and file access patterns. The sandbox evasion arms race continues to escalate.
BIMI (Brand Indicators for Message Identification)
BIMI allows organizations with properly configured DMARC (p=reject or p=quarantine) to display their verified logo next to emails in supporting email clients. This gives recipients a visual indicator that the email is legitimately from that brand. BIMI requires a Verified Mark Certificate (VMC) from a certificate authority and full DMARC compliance --- making it a carrot for implementing email authentication properly.
Investigating a Phishing Email
Here is how to analyze a suspicious email that has been reported by an employee. This is a technique you can use today.
Step 1: Examine the Headers
Every email contains headers that reveal its journey. Most email clients hide them, but you can access them (in Gmail: three dots > "Show original"; in Outlook: File > Properties > Internet Headers).
# Key headers to examine:
Return-Path: <bounces@suspicious-domain.com>
Received: from mail.suspicious-domain.com (192.168.1.100)
by mx.google.com with ESMTPS id abc123
for <victim@company.com>;
Wed, 11 Mar 2026 14:23:07 -0800 (PST)
Authentication-Results: mx.google.com;
spf=fail (sender IP is 192.168.1.100) smtp.mailfrom=suspicious-domain.com;
dkim=none;
dmarc=fail (p=NONE sp=NONE)
X-Mailer: PHPMailer 6.5.0
Reply-To: ceo@company-support.com # Different from From: address!
Red flags to look for:
- Return-Path mismatch with From: address
- Received headers showing unexpected origin servers or IP addresses
- Authentication-Results showing SPF/DKIM/DMARC failures
- Reply-To different from the From: address (classic BEC indicator --- responses go to attacker)
- X-Mailer indicating bulk sending tools (PHPMailer, SendGrid for non-newsletter emails)
- Received chain showing the email traversed unexpected countries
Step 2: Analyze URLs Without Clicking
# Decode URL-encoded strings
$ python3 -c "import urllib.parse; print(urllib.parse.unquote(
'https%3A%2F%2Fevil.com%2Flogin%3Fredirect%3Dhttps%3A%2F%2Freal-bank.com'))"
https://evil.com/login?redirect=https://real-bank.com
# Safely screenshot a URL without visiting it in your browser
# Use urlscan.io API
$ curl -s -X POST "https://urlscan.io/api/v1/scan/" \
-H "API-Key: YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"url":"https://suspicious-domain.com/login","visibility":"private"}'
# Check if the URL or domain appears in threat intelligence
$ curl -s "https://www.virustotal.com/api/v3/domains/suspicious-domain.com" \
-H "x-apikey: YOUR_KEY" | jq '.data.attributes.last_analysis_stats'
Step 3: Analyze Attachments Safely
# Check file type (don't trust the extension)
$ file suspicious_invoice.pdf
suspicious_invoice.pdf: Microsoft Word 2007+ (.docx)
# It's actually a Word doc disguised as a PDF!
# Compute hash and check VirusTotal
$ sha256sum suspicious_invoice.pdf
a1b2c3d4... suspicious_invoice.pdf
$ curl -s "https://www.virustotal.com/api/v3/files/a1b2c3d4..." \
-H "x-apikey: YOUR_KEY" | jq '.data.attributes.last_analysis_stats'
# For Office documents, check for macros
$ python3 -m oletools.olevba suspicious_invoice.docx
VBA MACRO found: AutoOpen
VBA MACRO found: Document_Open
SUSPICIOUS: Shell command execution detected
SUSPICIOUS: PowerShell keyword found
SUSPICIOUS: Base64-encoded string found
IOC: URL found: https://c2-server.evil/payload.exe
Set up a phishing analysis workflow before you need it:
1. Create a dedicated VM or use a cloud sandbox (ANY.RUN, Joe Sandbox, Hybrid Analysis) for analyzing suspicious attachments
2. Never open suspicious attachments on your production machine
3. Use VirusTotal to check file hashes: `sha256sum suspicious_file.pdf`
4. Use urlscan.io to safely screenshot suspicious URLs
5. Use oletools (`pip install oletools`) to analyze Office documents for macros
6. Document everything --- your analysis may become evidence in legal proceedings
7. Set up a shared "phishing inbox" where employees can forward suspicious emails with one click
Human Defenses: Security Awareness That Actually Works
Most organizations fail spectacularly at security awareness. They run annual training --- a 45-minute video followed by a quiz --- and call it done. Then they wonder why people still click phishing links.
Why Traditional Training Fails
-
Frequency: Annual training means 364 days of no reinforcement. Behavioral science shows that spaced repetition is far more effective than one-time exposure. The Ebbinghaus forgetting curve means 70% of training content is forgotten within 24 hours.
-
Passive format: Watching a video is passive. People retain roughly 10% of what they hear and 90% of what they do. Lecture-format training does not build the reflexive pattern recognition needed to spot phishing.
-
Punitive culture: Organizations that shame or punish employees who fail phishing simulations create a culture of fear, not awareness. Employees stop reporting suspicious emails because they are afraid of punishment. This is exactly the opposite of what you want.
-
Unrealistic scenarios: Training phishing emails are often laughably obvious --- Nigerian prince quality. Employees learn to spot the training emails but remain vulnerable to sophisticated, targeted attacks.
-
No reporting mechanism: If there is no easy "report phishing" button, even employees who spot phishing have no actionable path forward.
What Actually Works
Continuous simulated phishing with escalating difficulty. Monthly or bi-weekly simulations that match real-world sophistication. Start with easy-to-spot campaigns and gradually increase difficulty over quarters.
Positive reinforcement. Reward employees who report phishing --- even if it turns out to be legitimate. A "thank you" from the security team costs nothing and reinforces the behavior you want. Some organizations gamify it with leaderboards and small prizes.
Just-in-time training. When someone clicks a simulated phishing link, show them an immediate, brief (60-second) explanation of what they missed. Not a 45-minute video. Not a formal reprimand. A teaching moment while the experience is fresh.
Departmental targeting. Finance teams need BEC-specific training with wire transfer scenarios. Executives need whaling awareness with board-level communication examples. IT staff need credential-phishing training with fake SSO portals. Customer support needs pretexting awareness. One-size-fits-all training fits no one.
Process-based controls. Do not rely on humans to be perfect. Create processes that make fraud difficult regardless of whether someone falls for phishing:
- Require verbal confirmation for wire transfers over a threshold ($10K, $25K --- whatever fits your business)
- Mandate dual authorization for payment changes
- Establish code words for verifying high-value requests over phone or video
- Create a dedicated phone number for verifying executive requests
- Implement a mandatory 24-hour cooling-off period for new vendor banking changes
Never use the phrase "you failed the phishing test" with employees. The goal is behavior change, not punishment. Organizations that punish phishing failures see reduced reporting rates --- the opposite of what you want. You want every employee to feel comfortable saying "I think I clicked something bad" without fear of consequences. The employee who reports in 30 seconds is worth ten who silently hope nothing happened.
Building a Phishing-Resistant Culture: Metrics That Matter
The goal is not zero clicks --- that is unrealistic. The goal is fast reporting. You will never achieve a zero-click rate across a large organization. Your real metrics should be:
- Report rate: What percentage of simulated phishing emails are reported? Aim for 70%+ over time.
- Time to report: How quickly after delivery do employees report suspicious emails? Minutes matter --- a phishing email reported in 2 minutes can be pulled from all inboxes before most employees see it.
- Click-to-report ratio: For every employee who clicks, how many report? You want this ratio heavily skewed toward reporting.
- Resilience rate: What percentage of employees who previously clicked now report instead? This measures actual behavior change.
graph TD
A["Level 1: No Defenses<br/>No training, no technical controls<br/>Wide open to attack"] --> B["Level 2: Checkbox Compliance<br/>Annual training + basic email filtering<br/>Still highly vulnerable"]
B --> C["Level 3: Reasonable Baseline<br/>SPF/DKIM/DMARC + regular simulations<br/>+ phishing report button"]
C --> D["Level 4: Strong Defense<br/>Continuous training + advanced gateway<br/>+ positive culture + threat intel"]
D --> E["Level 5: Mature Program<br/>All of Level 4 + process controls<br/>for financial transactions + BEC<br/>verification + automated response"]
style A fill:#e74c3c,color:#fff
style B fill:#e67e22,color:#fff
style C fill:#f1c40f,color:#333
style D fill:#2ecc71,color:#fff
style E fill:#27ae60,color:#fff
Defending Against BEC Specifically
BEC requires specific defenses beyond general anti-phishing measures because the emails often pass technical authentication checks (especially when sent from compromised legitimate accounts).
Financial Controls
- Dual authorization for all wire transfers above a defined threshold
- Verbal verification via a known phone number for any banking detail changes
- Mandatory waiting period (24-48 hours) for new payment instructions
- Pre-approved vendor list with locked banking details in your ERP system
- Separation of duties --- the person who requests a payment should never be the person who approves it
- Callback verification for any payment exceeding $10,000, using a phone number from the original contract, not from the email
Email-Specific BEC Detection
- Flag external emails that display internal display names (e.g., "From: James Wilson james@external-domain.com" where James Wilson is your CEO)
- Alert on emails from newly registered domains (< 30 days old)
- Detect look-alike domains using Levenshtein distance algorithms
- Monitor for email forwarding rule creation (a sign of account compromise --- attackers often create rules to intercept replies)
- Alert on login from unusual locations on executive accounts
- Flag emails containing keywords like "wire transfer," "banking details changed," or "do not discuss" combined with urgency markers
# Example: Check if a domain is a look-alike
$ python3 -c "
from Levenshtein import distance
target = 'company.com'
suspect = 'cornpany.com' # 'rn' looks like 'm'
d = distance(target, suspect)
print(f'Edit distance: {d}') # Output: 1
print('ALERT: Possible look-alike domain!' if d <= 2 else 'Probably safe')
"
Edit distance: 1
ALERT: Possible look-alike domain!
You should also proactively register common misspellings and look-alikes of your domain. If your company is acmecorp.com, register acrnecorp.com, acmec0rp.com, acmecorp.net, acmecorp.org, and so on. It is cheap insurance. Tools like dnstwist can generate a comprehensive list of potential look-alike domains:
$ dnstwist acmecorp.com --registered
# Shows which look-alike domains are already registered
# Any registered by someone other than you = potential threat
The Future of Phishing Defense
The attacker-defender asymmetry in phishing is getting worse, not better.
AI lowers the cost of crafting convincing phishing emails to near zero. Deepfakes eliminate the trust we place in voice and video. The traditional "verify the sender" advice breaks down when the sender's email is actually compromised or their voice is synthetically generated.
The future of phishing defense lies in:
- Zero-trust communication: Verify every high-stakes request through an independent channel, regardless of who appears to be asking. If the CEO calls and asks for a wire transfer, hang up and call back on a verified number.
- Process-based controls: Make the process fraud-resistant, not the people. Dual authorization, waiting periods, and out-of-band verification are process controls that work regardless of how sophisticated the attack is.
- Cryptographic verification: Digital signatures for financial requests. If every wire transfer request required a PGP-signed email or a FIDO2 hardware token confirmation, BEC would be dramatically harder.
- Behavioral AI: Detecting anomalies in communication patterns, not just content. If an executive who normally sends 10 emails per day suddenly sends 50, or starts emailing the finance team at 3 AM from a new IP, that pattern change is detectable.
- Shared code words: Pre-arranged verbal codes for verifying high-value requests over phone or video. These are low-tech but effective against deepfakes --- the attacker would need to know a code word that was never communicated digitally.
What You've Learned
In this chapter, you explored the full spectrum of phishing and social engineering:
-
Phishing taxonomy: Mass phishing, spear phishing, whaling, vishing, smishing, quishing, and BEC each target different channels and use different techniques, but all exploit human psychology. The OSINT reconnaissance behind spear phishing makes these attacks devastatingly personalized.
-
Cialdini's principles: Authority, urgency, social proof, reciprocity, liking, and consistency are the psychological levers that make social engineering effective. Security awareness must teach these principles, not just "do not click links."
-
Business Email Compromise: BEC is the most financially damaging form of cybercrime, with cumulative losses exceeding $50 billion. Real cases --- Facebook/Google ($100M), Toyota ($37M), and countless mid-market companies --- demonstrate that BEC targets organizations of every size.
-
AI-enhanced attacks: LLMs, voice cloning, and real-time video deepfakes are making phishing attacks that cannot be detected through human judgment alone. The $25 million Hong Kong deepfake video call proves the threat is real and current.
-
Email authentication: SPF, DKIM, and DMARC form the technical foundation for preventing email spoofing (cross-reference Chapter 17). Configure them with
p=reject. BIMI provides visual verification for compliant senders. -
Investigation techniques: Analyzing email headers, URLs, and attachments with command-line tools (curl, whois, oletools, VirusTotal) is a critical skill. Every security practitioner should have a phishing analysis workflow ready before an incident.
-
Human defenses: Effective security awareness requires continuous training, positive reinforcement, realistic simulations, and easy reporting mechanisms. Punitive cultures reduce reporting rates. Measure report rate and time-to-report, not just click rate.
-
BEC-specific controls: Dual authorization, verbal verification through independently sourced phone numbers, mandatory waiting periods, and separation of duties protect against financial fraud regardless of whether someone falls for a phishing email. Process controls are the ultimate defense.
The goal is not to make people perfect. It is to make the organization resilient. Technical controls catch what humans miss. Processes prevent damage when both fail. And culture ensures people report instead of hide. Defense in depth applies to the human layer just as much as the network layer.