Conducting Spearphishing Simulation Campaign
Legal Notice: This skill is for authorized security testing and educational purposes only. Unauthorized use against systems you do not own or have written permission to test is illegal and may violate computer fraud laws.
Overview
Spearphishing simulation is a targeted social engineering attack vector used by red teams to gain initial access. Unlike broad phishing campaigns, spearphishing uses OSINT-derived intelligence to craft highly personalized messages targeting specific individuals. This skill covers developing pretexts, building payloads, setting up email infrastructure, executing the campaign, and tracking results.
When to Use
Trigger phrases:
"conducting spearphishing simulation campaign"
"Spearphishing simulation is a targeted social engineering attack vector used by "
When conducting security assessments that involve conducting spearphishing simulation campaign
When following incident response procedures for related security events
When performing scheduled security testing or auditing activities
When validating security controls through hands-on testing
Prerequisites
- Familiarity with red teaming concepts and tools
- Access to a test or lab environment for safe execution
- Python 3.8+ with required dependencies installed
- Appropriate authorization for any testing activities
Objectives
- Develop convincing pretexts tailored to specific target personnel
- Create weaponized payloads that bypass email security controls
- Set up email delivery infrastructure with proper SPF/DKIM/DMARC configuration
- Execute phishing campaigns with real-time tracking and metrics
- Document results for engagement reporting and security awareness improvement
MITRE ATT&CK Mapping
- T1566.001 - Phishing: Spearphishing Attachment
- T1566.002 - Phishing: Spearphishing Link
- T1566.003 - Phishing: Spearphishing via Service
- T1598.003 - Phishing for Information: Spearphishing Link
- T1204.001 - User Execution: Malicious Link
- T1204.002 - User Execution: Malicious File
- T1608.001 - Stage Capabilities: Upload Malware
- T1608.005 - Stage Capabilities: Link Target
- T1583.001 - Acquire Infrastructure: Domains
- T1585.002 - Establish Accounts: Email Accounts
Workflow
# Example: IOC detection
import re
IOC_PATTERNS = {
"ip": r"\b(?:\d{1,3}\.){3}\d{1,3}\b",
"domain": r"\b[a-z0-9-]+\.[a-z]{2,}\b",
"hash_md5": r"\b[a-f0-9]{32}\b",
"hash_sha256": r"\b[a-f0-9]{64}\b",
}
def extract_iocs(text: str) -> dict:
return {k: re.findall(v, text) for k, v in IOC_PATTERNS.items()}
- Scope and authorize — confirm written authorization and define target boundaries
- Reconnaissance — enumerate targets, services, and potential attack surfaces
- Exploitation — attempt exploitation of identified vulnerabilities within scope
- Post-exploitation — document access level, lateral movement, and data exposure
- Report and remediate — compile findings with reproduction steps and fix recommendations
Phase 1: Pretext Development
- Review OSINT findings for target personnel profiles
- Identify current organizational events (mergers, projects, new hires)
- Select pretext theme (IT helpdesk, HR benefits, vendor communication, executive request)
- Craft email templates with appropriate urgency and authority cues
- Create landing pages that mirror target organization's branding
Phase 2: Payload Development
- Select payload type based on target security controls:
- HTML smuggling for email gateway bypass
- Macro-enabled documents (if macros not blocked)
- ISO/IMG files containing LNK payloads
- OneNote files with embedded scripts
- QR codes linking to credential harvesting pages
- Test payload against target's known security stack
- Implement payload obfuscation techniques
- Configure callback to C2 infrastructure
Phase 3: Infrastructure Setup
- Register convincing look-alike domain
- Age domain and build reputation (minimum 2 weeks recommended)
- Configure SPF, DKIM, and DMARC records
- Set up SMTP relay with GoPhish or custom mail server
- Deploy credential harvesting pages with SSL certificates
- Configure tracking pixels and click tracking
Phase 4: Campaign Execution
- Send test emails to verify delivery and rendering
- Launch campaign in waves (avoid mass sending)
- Monitor email delivery rates and opens in real-time
- Track link clicks and credential submissions
- Deploy payloads to users who interact with phishing emails
- Capture screenshots and evidence for reporting
Phase 5: Post-Campaign Analysis
- Calculate campaign metrics (delivery rate, open rate, click rate, credential capture rate)
- Identify users who reported phishing to SOC
- Document bypass of email security controls
- Map successful compromises to MITRE ATT&CK
- Compile findings for engagement report
When NOT to Use
- You don't have authorization for the assessment
- Task is about implementing findings (use implementing-* skills)
- You need to analyze results (use analyzing-* skills)
- Task is about building assessment tools (use building-* skills)
- Target is out of scope
- Task requires compliance certification (use auditing-* skills)
Red Flags
- Performing actions without explicit written authorization from the asset owner
- Testing against production systems without a defined scope and rules of engagement
- Exceeding the authorized scope of the engagement
- Leaving persistent access mechanisms without explicit approval
- Causing denial-of-service on production systems during testing
Verification
- All steps executed successfully against a test environment before production use
- Output documented with screenshots or logs demonstrating expected behavior
- All exploited vulnerabilities documented with reproduction steps
- Scope boundaries confirmed — only authorized targets were tested
- Remediation recommendations included for every finding
Tools and Resources
| Tool |
Purpose |
License |
| GoPhish |
Phishing campaign management |
Open Source |
| Evilginx2 |
Real-time credential harvesting with MFA bypass |
Open Source |
| King Phisher |
Phishing campaign toolkit |
Open Source |
| SET (Social Engineering Toolkit) |
Multi-vector social engineering |
Open Source |
| Modlishka |
Reverse proxy phishing |
Open Source |
| CredSniper |
Credential harvesting framework |
Open Source |
| Fierce Phish |
Phishing framework |
Open Source |
Validation Criteria
Process
- Analyze the task requirements
- Apply domain expertise
- Verify output quality
Anti-Rationalization Table
| Rationalization |
Reality |
| "We are too small to be targeted" |
Automated attacks target everyone. Size does not matter. |
| "Security slows us down" |
A breach slows you down 100x more. Build security in from the start. |
| "We will fix it after launch" |
Vulnerabilities in production are exploited within hours. Fix before deploy. |
1---2name: conducting-spearphishing-simulation-campaign3description: Use when spearphishing simulation is a targeted social engineering attack vector used by red teams to gain initial access. Unlike broad phishing campaigns, spearphishing uses OSINT-derived intelligence to craf. Use when working with conducting spearphishing simulation campaign.4license: Apache-2.05---67# Conducting Spearphishing Simulation Campaign8910> **Legal Notice:** This skill is for authorized security testing and educational purposes only. Unauthorized use against systems you do not own or have written permission to test is illegal and may violate computer fraud laws.1112## Overview1314Spearphishing simulation is a targeted social engineering attack vector used by red teams to gain initial access. Unlike broad phishing campaigns, spearphishing uses OSINT-derived intelligence to craft highly personalized messages targeting specific individuals. This skill covers developing pretexts, building payloads, setting up email infrastructure, executing the campaign, and tracking results.151617## When to Use18**Trigger phrases:**19- "conducting spearphishing simulation campaign"20- "Spearphishing simulation is a targeted social engineering attack vector used by "212223- When conducting security assessments that involve conducting spearphishing simulation campaign24- When following incident response procedures for related security events25- When performing scheduled security testing or auditing activities26- When validating security controls through hands-on testing2728## Prerequisites2930- Familiarity with red teaming concepts and tools31- Access to a test or lab environment for safe execution32- Python 3.8+ with required dependencies installed33- Appropriate authorization for any testing activities3435## Objectives3637- Develop convincing pretexts tailored to specific target personnel38- Create weaponized payloads that bypass email security controls39- Set up email delivery infrastructure with proper SPF/DKIM/DMARC configuration40- Execute phishing campaigns with real-time tracking and metrics41- Document results for engagement reporting and security awareness improvement4243## MITRE ATT&CK Mapping4445- **T1566.001** - Phishing: Spearphishing Attachment46- **T1566.002** - Phishing: Spearphishing Link47- **T1566.003** - Phishing: Spearphishing via Service48- **T1598.003** - Phishing for Information: Spearphishing Link49- **T1204.001** - User Execution: Malicious Link50- **T1204.002** - User Execution: Malicious File51- **T1608.001** - Stage Capabilities: Upload Malware52- **T1608.005** - Stage Capabilities: Link Target53- **T1583.001** - Acquire Infrastructure: Domains54- **T1585.002** - Establish Accounts: Email Accounts5556## Workflow5758```python59# Example: IOC detection60import re6162IOC_PATTERNS = {63 "ip": r"\b(?:\d{1,3}\.){3}\d{1,3}\b",64 "domain": r"\b[a-z0-9-]+\.[a-z]{2,}\b",65 "hash_md5": r"\b[a-f0-9]{32}\b",66 "hash_sha256": r"\b[a-f0-9]{64}\b",67}6869def extract_iocs(text: str) -> dict:70 return {k: re.findall(v, text) for k, v in IOC_PATTERNS.items()}71```72731. **Scope and authorize** — confirm written authorization and define target boundaries742. **Reconnaissance** — enumerate targets, services, and potential attack surfaces753. **Exploitation** — attempt exploitation of identified vulnerabilities within scope764. **Post-exploitation** — document access level, lateral movement, and data exposure775. **Report and remediate** — compile findings with reproduction steps and fix recommendations78### Phase 1: Pretext Development791. Review OSINT findings for target personnel profiles802. Identify current organizational events (mergers, projects, new hires)813. Select pretext theme (IT helpdesk, HR benefits, vendor communication, executive request)824. Craft email templates with appropriate urgency and authority cues835. Create landing pages that mirror target organization's branding8485### Phase 2: Payload Development861. Select payload type based on target security controls:87 - HTML smuggling for email gateway bypass88 - Macro-enabled documents (if macros not blocked)89 - ISO/IMG files containing LNK payloads90 - OneNote files with embedded scripts91 - QR codes linking to credential harvesting pages922. Test payload against target's known security stack933. Implement payload obfuscation techniques944. Configure callback to C2 infrastructure9596### Phase 3: Infrastructure Setup971. Register convincing look-alike domain982. Age domain and build reputation (minimum 2 weeks recommended)993. Configure SPF, DKIM, and DMARC records1004. Set up SMTP relay with GoPhish or custom mail server1015. Deploy credential harvesting pages with SSL certificates1026. Configure tracking pixels and click tracking103104### Phase 4: Campaign Execution1051. Send test emails to verify delivery and rendering1062. Launch campaign in waves (avoid mass sending)1073. Monitor email delivery rates and opens in real-time1084. Track link clicks and credential submissions1095. Deploy payloads to users who interact with phishing emails1106. Capture screenshots and evidence for reporting111112### Phase 5: Post-Campaign Analysis1131. Calculate campaign metrics (delivery rate, open rate, click rate, credential capture rate)1142. Identify users who reported phishing to SOC1153. Document bypass of email security controls1164. Map successful compromises to MITRE ATT&CK1175. Compile findings for engagement report118119## When NOT to Use120121- You don't have authorization for the assessment122- Task is about implementing findings (use implementing-* skills)123- You need to analyze results (use analyzing-* skills)124- Task is about building assessment tools (use building-* skills)125- Target is out of scope126- Task requires compliance certification (use auditing-* skills)127128129## Red Flags130131- Performing actions without explicit written authorization from the asset owner132- Testing against production systems without a defined scope and rules of engagement133- Exceeding the authorized scope of the engagement134- Leaving persistent access mechanisms without explicit approval135- Causing denial-of-service on production systems during testing136137## Verification138139- All steps executed successfully against a test environment before production use140- Output documented with screenshots or logs demonstrating expected behavior141- All exploited vulnerabilities documented with reproduction steps142- Scope boundaries confirmed — only authorized targets were tested143- Remediation recommendations included for every finding144145## Tools and Resources146147| Tool | Purpose | License |148|------|---------|---------|149| GoPhish | Phishing campaign management | Open Source |150| Evilginx2 | Real-time credential harvesting with MFA bypass | Open Source |151| King Phisher | Phishing campaign toolkit | Open Source |152| SET (Social Engineering Toolkit) | Multi-vector social engineering | Open Source |153| Modlishka | Reverse proxy phishing | Open Source |154| CredSniper | Credential harvesting framework | Open Source |155| Fierce Phish | Phishing framework | Open Source |156157## Validation Criteria158159- [ ] Pretext tailored to specific targets with OSINT data160- [ ] Payload tested against email security controls161- [ ] Infrastructure configured with proper email authentication162- [ ] Campaign tracked with delivery and interaction metrics163- [ ] Evidence collected for engagement report164- [ ] Cleanup performed on infrastructure post-campaign165166## Process1671681. Analyze the task requirements1692. Apply domain expertise1703. Verify output quality171172## Anti-Rationalization Table173174| Rationalization | Reality |175|---|---|176| "We are too small to be targeted" | Automated attacks target everyone. Size does not matter. |177| "Security slows us down" | A breach slows you down 100x more. Build security in from the start. |178| "We will fix it after launch" | Vulnerabilities in production are exploited within hours. Fix before deploy. |