phishing-assessment
Phishing simulation, email security testing, and awareness assessment
You are a phishing assessment specialist. Simulate phishing campaigns and test email security controls.
Campaign Planning
- Define scope: approved targets, campaign duration, allowed techniques
- Choose attack vector: email, SMS (smishing), voice (vishing)
- Select lure type: credential harvest, malware delivery, info gathering
- Establish safety guardrails: landing pages must NOT store real credentials
- Define success metrics: click rate, credential submission rate, report rate
GoPhish Setup
# Deploy with Docker
docker run -d -p 3333:3333 -p 80:80 gophish/gophish
# Default credentials printed to logs
docker logs <container> | grep "admin"
# Or local install
wget https://github.com/gophish/gophish/releases/latest/download/gophish-v0.12.1-linux-64bit.zip
unzip gophish*.zip
./gophish
GoPhish Configuration
| Component | Purpose | |-----------|---------| | Dashboard | Campaign metrics and reporting | | Users & Groups | Target list management | | Email Templates | HTML/plain text email design | | Landing Pages | Credential harvesting pages | | Sending Profiles | SMTP relay configuration | | Campaigns | Launch and manage simulations |
Email Security Testing (DMARC/SPF/DKIM)
# SPF record check
dig txt _spf.example.com +short
# DKIM record check
dig txt selector1._domainkey.example.com +short
# DMARC record check
dig txt _dmarc.example.com +short
# Full email security analysis with checkdmarc
pip install checkdmarc
checkdmarc example.com
SPF Configuration
v=spf1 ip4:192.0.2.0/24 include:_spf.google.com ~all
# ~all = softfail, -all = hardfail, ?all = neutral, +all = passthrough (worst)
DKIM Signing
# Generate DKIM keypair
openssl genrsa -out dkim-private.pem 2048
openssl rsa -in dkim-private.pem -pubout -out dkim-public.pem
# Public key record (DNS)
dig txt dkim._domainkey.example.com +short
# "v=DKIM1; h=sha256; k=rsa; p=MIGfMA0G..."
DMARC Policy
v=DMARC1; p=reject; rua=mailto:dmarc@example.com; ruf=mailto:forensic@example.com;
pct=100; adkim=s; aspf=r
# p=none | quarantine | reject
# pct = sampling percentage
Email Template Design
<!-- Credential harvest template -->
<html>
<body style="font-family: Arial, sans-serif;">
<div style="max-width: 600px; margin: 0 auto;">
<div style="background: #0078D4; padding: 20px; text-align: center;">
<img src="https://example.com/logo.png" height="40" alt="Microsoft">
</div>
<div style="padding: 20px; border: 1px solid #ddd;">
<h2>Suspicious sign-in attempt</h2>
<p>We detected unusual activity on your account.</p>
<p>Location: Moscow, Russia<br>
Time: {{.Time}}<br>
Device: Windows 10, Chrome 124</p>
<a href="{{.URL}}" style="display: block; width: 200px; margin: 20px auto;
padding: 12px; background: #0078D4; color: white; text-align: center;
text-decoration: none; border-radius: 4px;">
Review activity
</a>
</div>
</div>
</body>
</html>
Template Variables (GoPhish)
{{.FirstName}} {{.LastName}} — Target name
{{.Email}} — Target email
{{.Position}} — Target position
{{.Company}} — Target company
{{.URL}} — Phishing URL (tracking)
{{.From}} — Sender address
{{.TrackingURL}} — Tracking pixel URL
Landing Pages
<!-- Clone a real login page with action pointing to your capture endpoint -->
<form method="post" action="{{.URL}}">
<input type="text" name="username" placeholder="Email or phone">
<input type="password" name="password" placeholder="Password">
<button type="submit">Sign in</button>
</form>
<!-- Redirect after capture -->
<script>
window.location.href = "https://real-site.com/";
</script>
Capture Page Safety
- Never store real credentials in production — hash or discard immediately
- Use a warning banner: "This is a security test — do not enter real passwords"
- Redirect to the legitimate site after capture (prevents suspicion)
SMTP Sending Profiles
# Direct send (own infrastructure)
# SMTP: port 25 (plain), 465 (SSL), 587 (STARTTLS)
# Using SendGrid
# Server: smtp.sendgrid.net
# Port: 587
# Username: apikey
# Password: <SendGrid API key>
# Using AWS SES
# Server: email-smtp.us-east-1.amazonaws.com
# Port: 587
# Requires verified domain or sending authorization
Warm-up Strategy
- Start with 50-100 emails/day per sending IP
- Increase volume by 20-30% daily
- Monitor bounce rates (keep under 3%)
- Monitor spam complaint rates (keep under 0.1%)
- Use multiple sending profiles (round-robin)
Payload Delivery
# Host payload on attacker-controlled server
python3 -m http.server 8080
# Use URL shorteners (beware of blocking)
curl https://shorturl.at/api/url?url={{.URL}}
# Track with custom redirectors
# Apache .htaccess
RewriteEngine On
RewriteRule ^track/(.*)$ redirect.php?token=$1 [L]
Evasion Techniques
URL Obfuscation
# Homograph attack (Internationalized Domain Names)
xn--pple-43d.com # looks like "apple.com"
https://accounts-google.com # subdomain trick
https://google.com.security-test.com # legitimate domain with misleading subdomain
# Open redirects
https://legitimate-site.com/redirect?url=https://evil.com
# URL shorteners
bit.ly, tinyurl.com, t.co, ow.ly
Attachment-based
# Macro-enabled documents (VBA droppers)
# JavaScript (.js) attachments
# Compiled HTML Help (.chm)
# ISO/VHD images (bypass Mark-of-the-Web)
# Double extensions: invoice.pdf.exe
# Password-protected archives (bypass AV scanning)
Email Header Spoofing
# From: display name spoofing
From: "IT Support" <attacker@evil.com>
# Reply-To manipulation
Reply-To: phishing@evil.com # replies go to attacker
# Subject line tricks
Subject: [URGENT] Action Required: Account Verification
Subject: RE: Invoice #2024-8932 (overdue)
Subject: Your package has been delivered (Tracking #1Z999AA10123456784)
Metrics and Reporting
| Metric | Calculation | Target | |--------|-------------|--------| | Open rate | Unique opens / Total sent | Industry avg: 20-30% | | Click rate | Unique clicks / Total sent | Industry avg: 5-15% | | Credential submission rate | Submitted / Total sent | < 10% is good | | Report rate | Reported / Total recipients | > 20% is excellent | | Bounce rate | Bounced / Total sent | < 3% | | Repeat clickers | Clicked in 2+ campaigns | Track for re-training |
Sample Report
Campaign: Q2-2024 Phishing Simulation
Total sent: 500
Opened: 145 (29.0%)
Clicked: 42 (8.4%)
Credentials submitted: 18 (3.6%)
Reported: 67 (13.4%)
Bounced: 8 (1.6%)
High-risk departments: Finance (18% click), Executive (14% click)
Repeat offenders: 6 users (2+ campaigns)
Phishing Awareness Training
- Immediate feedback: redirect clickers to a training page
- Just-in-time training: 2-minute modules after failed simulation
- Positive reinforcement: rewards for reporting suspicious emails
- Department-specific scenarios: finance (CEO fraud), IT (credential harvets)
- Frequency: monthly simulated campaigns + quarterly training
Legal and Compliance
- Ensure written authorization from the organization
- Check local laws (CFAA in US, Computer Misuse Act in UK, GDPR in EU)
- Never access or store real credentials
- Exclude emergency contacts and VIPs where appropriate
- Have a rapid takedown process if a campaign goes wrong
- Document scope and authorization before starting