Red Team
Adopt attacker mindset to identify security vulnerabilities, penetration vectors, and systemic weaknesses through adversarial thinking, simulated attacks, and offensive security testing.
When to use me
Use this skill when:
- Conducting security assessments or penetration tests
- Designing security-sensitive systems or features
- Preparing for security audits or compliance reviews
- Responding to security incidents or breaches
- Training defensive teams (blue team) through exercises
- Evaluating security controls and detection capabilities
- Testing incident response procedures
- Validating security architecture decisions
- Assessing third-party systems or integrations
- Building security awareness and attacker empathy
What I do
1. Attacker Mindset Adoption
2. Vulnerability Discovery
- Identify attack surfaces and entry points
- Map trust boundaries and privilege transitions
- Discover security misconfigurations
- Find logic flaws and business logic vulnerabilities
- Identify weak authentication and authorization
- Spot insecure data handling and storage
- Find missing security controls
3. Exploitation Simulation
- Chain vulnerabilities for maximum impact
- Bypass security controls through creative methods
- Exploit trust relationships between components
- Use social engineering techniques (where appropriate)
- Test physical security (for comprehensive assessments)
- Simulate advanced persistent threats (APT tactics)
4. Impact Assessment
- Evaluate exploit consequences (data loss, system compromise)
- Assess business impact (financial, reputational, operational)
- Measure detection capabilities (how long would attack go unnoticed?)
- Test response effectiveness (incident response, recovery)
- Quantify risk levels based on likelihood and impact
Red Team Techniques
Reconnaissance & Information Gathering:
- Open source intelligence (OSINT) collection
- Network scanning and service enumeration
- Application fingerprinting and technology detection
- Social media profiling (for social engineering)
- DNS reconnaissance and subdomain discovery
Vulnerability Identification:
- Automated scanning with tools (Nessus, OpenVAS, etc.)
- Manual testing for logic flaws and business logic vulnerabilities
- Code review for security weaknesses
- Configuration review for security misconfigurations
- Architecture analysis for design flaws
Exploitation Methods:
- Web application attacks (SQLi, XSS, CSRF, SSRF, etc.)
- Network attacks (man-in-the-middle, replay, spoofing)
- Authentication bypass (password cracking, session hijacking)
- Privilege escalation (horizontal and vertical)
- Persistence mechanisms (backdoors, scheduled tasks, etc.)
Social Engineering:
- Phishing simulation (email, phone, in-person)
- Pretext development (convincing stories and personas)
- Baiting (malicious USB drops, etc.)
- Quid pro quo (something for something)
- Tailgating (physical access following)
Examples
# Conduct reconnaissance on target system
npm run redteam:recon -- --target example.com --scope external
# Perform vulnerability assessment
npm run redteam:vulnerability-scan -- --target 192.168.1.0/24 --intensity aggressive
# Simulate web application attacks
npm run redteam:web-attack -- --url https://app.example.com --techniques "sql-injection,xss,csrf"
# Test social engineering resilience
npm run redteam:phishing-test -- --targets employees.csv --template "password-reset"
# Full red team engagement
npm run redteam:full-engagement -- --target organization --duration 2weeks --rules-of-engagement approved
Output format
Red Team Engagement Report
──────────────────────────────
Target: E-commerce Platform (shop.example.com)
Engagement Duration: 72 hours
Rules of Engagement: Approved scope, no production impact
Red Team Lead: Synthetic Attacker #7
Executive Summary:
- Critical Vulnerabilities: 3
- High Severity Vulnerabilities: 7
- Medium Severity Vulnerabilities: 12
- Detection Rate: 42% (58% went undetected)
- Mean Time to Detection: 8.5 hours
- Business Impact Score: 8.2/10 (Severe)
Critical Findings:
1. Vulnerability: SQL Injection in Product Search
CVE Equivalent: CWE-89
Severity: Critical
Attack Path:
- Reconnaissance identified search functionality
- Fuzzing revealed parameter vulnerable to SQL injection
- Exploitation allowed database schema extraction
- Privilege escalation to database administrator
- Data exfiltration possible: 2.3M customer records
Proof of Concept:
GET /search?q=' UNION SELECT username,password FROM users--
Response: admin | 5f4dcc3b5aa765d61d8327deb882cf99
Impact:
- Complete database compromise
- Customer PII exposure (names, emails, addresses)
- Payment information potentially accessible
- Regulatory violations (GDPR, CCPA, PCI-DSS)
Business Consequences:
- Estimated fine: $4.2M (GDPR violation)
- Customer notification costs: $850K
- Reputational damage: 35% customer churn likely
- Legal liability: Class action lawsuits probable
Recommendation:
- Immediate: WAF rule blocking injection patterns
- Short-term: Parameterized queries implementation
- Long-term: Secure coding training, code review process
2. Vulnerability: Authentication Bypass via JWT Tampering
CVE Equivalent: CWE-287
Severity: High
Attack Path:
- Captured JWT token from legitimate user
- Analyzed token structure (header.payload.signature)
- Modified "role" claim from "user" to "admin"
- None signature verification detected
- Full administrative access achieved
Technical Details:
- JWT uses "none" algorithm vulnerability
- No signature validation on server side
- Role-based access control depends solely on token claims
Impact:
- Complete administrative control
- Order manipulation, pricing changes, user data access
- Financial fraud capability
- Platform compromise
Detection Metrics:
- Attack duration before detection: 14 hours
- Detection method: Manual log review (not automated)
- Alert quality: Low (generic "unusual activity")
Recommendation:
- Immediate: Reject "none" algorithm JWTs
- Short-term: Implement proper JWT validation
- Long-term: Add anomaly detection for admin actions
3. Vulnerability: Server-Side Request Forgery (SSRF)
CVE Equivalent: CWE-918
Severity: High
Attack Path:
- Image upload functionality accepts URLs
- SSRF to internal metadata service (169.254.169.254)
- AWS credentials retrieval
- Cloud environment compromise
Impact:
- Complete AWS account compromise
- Data exfiltration from S3 buckets
- Resource hijacking (crypto mining, botnet)
- Infrastructure destruction capability
Business Consequences:
- Cloud resource costs: $50K+/month potential
- Data breach: All cloud-stored data
- Service disruption: Complete outage possible
- Recovery time: Weeks to rebuild infrastructure
Recommendation:
- Immediate: Block metadata service access
- Short-term: Implement URL validation and allowlisting
- Long-term: Network segmentation, outbound proxy
Detection & Response Assessment:
- Security Monitoring Coverage: 65%
- Alert Quality Score: 4.2/10 (High false positives, low true positives)
- Mean Time to Respond: 3.5 hours (excluding undetected incidents)
- Incident Response Effectiveness: 6.1/10
- Forensic Capability: Basic (log review only)
Attack Simulation Metrics:
- Initial Compromise Time: 2.3 hours
- Privilege Escalation Time: 1.1 hours
- Lateral Movement Effectiveness: 8.7/10
- Persistence Established: 5 locations
- Data Exfiltration Simulation: 2.1GB in 4.5 hours
Red Team Observations:
1. Defense-in-depth lacking (single points of failure)
2. Detection focused on perimeter, blind to internal movement
3. Incident response reactive, not proactive
4. Security controls inconsistent across services
5. Developers lack security training (vulnerability density high)
Strategic Recommendations:
1. IMMEDIATE (Next 24 hours):
- Apply WAF rules for SQL injection protection
- Disable "none" algorithm for JWT
- Block metadata service access from applications
2. SHORT-TERM (Next 2 weeks):
- Implement parameterized queries globally
- Add JWT signature validation
- Deploy SSRF protection middleware
- Enhance monitoring for authentication anomalies
3. MEDIUM-TERM (Next 2 months):
- Conduct secure coding training for developers
- Implement automated security testing in CI/CD
- Enhance incident response playbooks
- Deploy endpoint detection and response (EDR)
4. LONG-TERM (Next 6 months):
- Establish security champion program
- Implement threat modeling process
- Deploy deception technology (honeypots, canaries)
- Conduct regular red team exercises (quarterly)
Lessons Learned:
- The most critical vulnerabilities were in business logic, not typical OWASP Top 10
- Detection failed for sophisticated attacks (58% undetected)
- Response was slow even for detected incidents
- Security debt accumulated from rapid feature development
- Attacker mindset revealed blind spots in defensive thinking
Engagement Value:
- Prevented potential breach: High confidence (>90%)
- Cost savings: Estimated $8.4M (fines + breach costs)
- Risk reduction: Significant (addressed critical vulnerabilities)
- Organizational learning: High (attacker perspective gained)
- Security maturity improvement: Foundation for growth
Notes
- Red teaming requires proper authorization and rules of engagement
- Focus on improving security, not blaming individuals or teams
- Balance thorough testing with business operational needs
- Document findings clearly with actionable recommendations
- Share lessons learned across the organization
- Use red team findings to improve blue team capabilities
- Regular red teaming prevents security stagnation
- The best red teams think creatively, not just run tools
- Measure improvement over time, not just vulnerability counts
- Red teaming builds security culture through shared understanding
1---2name: redteam3description: Think and act like an attacker to identify security vulnerabilities, weaknesses, and penetration vectors through adversarial security testing4license: MIT5compatibility: opencode6metadata:7 audience: security professionals, developers, operations teams8 category: security9---1011# Red Team1213Adopt attacker mindset to identify security vulnerabilities, penetration vectors, and systemic weaknesses through adversarial thinking, simulated attacks, and offensive security testing.1415## When to use me1617Use this skill when:18- Conducting security assessments or penetration tests19- Designing security-sensitive systems or features20- Preparing for security audits or compliance reviews21- Responding to security incidents or breaches22- Training defensive teams (blue team) through exercises23- Evaluating security controls and detection capabilities24- Testing incident response procedures25- Validating security architecture decisions26- Assessing third-party systems or integrations27- Building security awareness and attacker empathy2829## What I do3031### 1. Attacker Mindset Adoption32- **Think like different attacker types**:33 - Script kiddies (automated tools, low sophistication)34 - Organized crime (financial motivation, moderate sophistication)35 - Nation states (unlimited resources, high sophistication)36 - Insider threats (knowledge, access, motivation)37 - Hacktivists (ideological motivation, publicity seeking)38 39- **Adopt attack methodologies**:40 - Reconnaissance (information gathering, footprinting)41 - Scanning (vulnerability discovery, enumeration)42 - Exploitation (vulnerability weaponization)43 - Privilege escalation (expanding access)44 - Persistence (maintaining access)45 - Exfiltration (data theft, extraction)4647### 2. Vulnerability Discovery48- **Identify attack surfaces** and entry points49- **Map trust boundaries** and privilege transitions50- **Discover security misconfigurations**51- **Find logic flaws** and business logic vulnerabilities52- **Identify weak authentication and authorization**53- **Spot insecure data handling** and storage54- **Find missing security controls**5556### 3. Exploitation Simulation57- **Chain vulnerabilities** for maximum impact58- **Bypass security controls** through creative methods59- **Exploit trust relationships** between components60- **Use social engineering** techniques (where appropriate)61- **Test physical security** (for comprehensive assessments)62- **Simulate advanced persistent threats** (APT tactics)6364### 4. Impact Assessment65- **Evaluate exploit consequences** (data loss, system compromise)66- **Assess business impact** (financial, reputational, operational)67- **Measure detection capabilities** (how long would attack go unnoticed?)68- **Test response effectiveness** (incident response, recovery)69- **Quantify risk levels** based on likelihood and impact7071## Red Team Techniques7273### Reconnaissance & Information Gathering:74- **Open source intelligence (OSINT)** collection75- **Network scanning** and service enumeration76- **Application fingerprinting** and technology detection77- **Social media profiling** (for social engineering)78- **DNS reconnaissance** and subdomain discovery7980### Vulnerability Identification:81- **Automated scanning** with tools (Nessus, OpenVAS, etc.)82- **Manual testing** for logic flaws and business logic vulnerabilities83- **Code review** for security weaknesses84- **Configuration review** for security misconfigurations85- **Architecture analysis** for design flaws8687### Exploitation Methods:88- **Web application attacks** (SQLi, XSS, CSRF, SSRF, etc.)89- **Network attacks** (man-in-the-middle, replay, spoofing)90- **Authentication bypass** (password cracking, session hijacking)91- **Privilege escalation** (horizontal and vertical)92- **Persistence mechanisms** (backdoors, scheduled tasks, etc.)9394### Social Engineering:95- **Phishing simulation** (email, phone, in-person)96- **Pretext development** (convincing stories and personas)97- **Baiting** (malicious USB drops, etc.)98- **Quid pro quo** (something for something)99- **Tailgating** (physical access following)100101## Examples102103```bash104# Conduct reconnaissance on target system105npm run redteam:recon -- --target example.com --scope external106107# Perform vulnerability assessment108npm run redteam:vulnerability-scan -- --target 192.168.1.0/24 --intensity aggressive109110# Simulate web application attacks111npm run redteam:web-attack -- --url https://app.example.com --techniques "sql-injection,xss,csrf"112113# Test social engineering resilience114npm run redteam:phishing-test -- --targets employees.csv --template "password-reset"115116# Full red team engagement117npm run redteam:full-engagement -- --target organization --duration 2weeks --rules-of-engagement approved118```119120## Output format121122```123Red Team Engagement Report124──────────────────────────────125Target: E-commerce Platform (shop.example.com)126Engagement Duration: 72 hours127Rules of Engagement: Approved scope, no production impact128Red Team Lead: Synthetic Attacker #7129130Executive Summary:131- Critical Vulnerabilities: 3132- High Severity Vulnerabilities: 7133- Medium Severity Vulnerabilities: 12134- Detection Rate: 42% (58% went undetected)135- Mean Time to Detection: 8.5 hours136- Business Impact Score: 8.2/10 (Severe)137138Critical Findings:1391401. Vulnerability: SQL Injection in Product Search141 CVE Equivalent: CWE-89142 Severity: Critical143 144 Attack Path:145 - Reconnaissance identified search functionality146 - Fuzzing revealed parameter vulnerable to SQL injection147 - Exploitation allowed database schema extraction148 - Privilege escalation to database administrator149 - Data exfiltration possible: 2.3M customer records150 151 Proof of Concept:152 ```153 GET /search?q=' UNION SELECT username,password FROM users--154 Response: admin | 5f4dcc3b5aa765d61d8327deb882cf99155 ```156 157 Impact:158 - Complete database compromise159 - Customer PII exposure (names, emails, addresses)160 - Payment information potentially accessible161 - Regulatory violations (GDPR, CCPA, PCI-DSS)162 163 Business Consequences:164 - Estimated fine: $4.2M (GDPR violation)165 - Customer notification costs: $850K166 - Reputational damage: 35% customer churn likely167 - Legal liability: Class action lawsuits probable168 169 Recommendation:170 - Immediate: WAF rule blocking injection patterns171 - Short-term: Parameterized queries implementation172 - Long-term: Secure coding training, code review process1731742. Vulnerability: Authentication Bypass via JWT Tampering175 CVE Equivalent: CWE-287176 Severity: High177 178 Attack Path:179 - Captured JWT token from legitimate user180 - Analyzed token structure (header.payload.signature)181 - Modified "role" claim from "user" to "admin"182 - None signature verification detected183 - Full administrative access achieved184 185 Technical Details:186 - JWT uses "none" algorithm vulnerability187 - No signature validation on server side188 - Role-based access control depends solely on token claims189 190 Impact:191 - Complete administrative control192 - Order manipulation, pricing changes, user data access193 - Financial fraud capability194 - Platform compromise195 196 Detection Metrics:197 - Attack duration before detection: 14 hours198 - Detection method: Manual log review (not automated)199 - Alert quality: Low (generic "unusual activity")200 201 Recommendation:202 - Immediate: Reject "none" algorithm JWTs203 - Short-term: Implement proper JWT validation204 - Long-term: Add anomaly detection for admin actions2052063. Vulnerability: Server-Side Request Forgery (SSRF)207 CVE Equivalent: CWE-918208 Severity: High209 210 Attack Path:211 - Image upload functionality accepts URLs212 - SSRF to internal metadata service (169.254.169.254)213 - AWS credentials retrieval214 - Cloud environment compromise215 216 Impact:217 - Complete AWS account compromise218 - Data exfiltration from S3 buckets219 - Resource hijacking (crypto mining, botnet)220 - Infrastructure destruction capability221 222 Business Consequences:223 - Cloud resource costs: $50K+/month potential224 - Data breach: All cloud-stored data225 - Service disruption: Complete outage possible226 - Recovery time: Weeks to rebuild infrastructure227 228 Recommendation:229 - Immediate: Block metadata service access230 - Short-term: Implement URL validation and allowlisting231 - Long-term: Network segmentation, outbound proxy232233Detection & Response Assessment:234- Security Monitoring Coverage: 65%235- Alert Quality Score: 4.2/10 (High false positives, low true positives)236- Mean Time to Respond: 3.5 hours (excluding undetected incidents)237- Incident Response Effectiveness: 6.1/10238- Forensic Capability: Basic (log review only)239240Attack Simulation Metrics:241- Initial Compromise Time: 2.3 hours242- Privilege Escalation Time: 1.1 hours243- Lateral Movement Effectiveness: 8.7/10244- Persistence Established: 5 locations245- Data Exfiltration Simulation: 2.1GB in 4.5 hours246247Red Team Observations:2481. Defense-in-depth lacking (single points of failure)2492. Detection focused on perimeter, blind to internal movement2503. Incident response reactive, not proactive2514. Security controls inconsistent across services2525. Developers lack security training (vulnerability density high)253254Strategic Recommendations:2551. IMMEDIATE (Next 24 hours):256 - Apply WAF rules for SQL injection protection257 - Disable "none" algorithm for JWT258 - Block metadata service access from applications2592602. SHORT-TERM (Next 2 weeks):261 - Implement parameterized queries globally262 - Add JWT signature validation263 - Deploy SSRF protection middleware264 - Enhance monitoring for authentication anomalies2652663. MEDIUM-TERM (Next 2 months):267 - Conduct secure coding training for developers268 - Implement automated security testing in CI/CD269 - Enhance incident response playbooks270 - Deploy endpoint detection and response (EDR)2712724. LONG-TERM (Next 6 months):273 - Establish security champion program274 - Implement threat modeling process275 - Deploy deception technology (honeypots, canaries)276 - Conduct regular red team exercises (quarterly)277278Lessons Learned:279- The most critical vulnerabilities were in business logic, not typical OWASP Top 10280- Detection failed for sophisticated attacks (58% undetected)281- Response was slow even for detected incidents282- Security debt accumulated from rapid feature development283- Attacker mindset revealed blind spots in defensive thinking284285Engagement Value:286- Prevented potential breach: High confidence (>90%)287- Cost savings: Estimated $8.4M (fines + breach costs)288- Risk reduction: Significant (addressed critical vulnerabilities)289- Organizational learning: High (attacker perspective gained)290- Security maturity improvement: Foundation for growth291```292293## Notes294295- Red teaming requires proper authorization and rules of engagement296- Focus on improving security, not blaming individuals or teams297- Balance thorough testing with business operational needs298- Document findings clearly with actionable recommendations299- Share lessons learned across the organization300- Use red team findings to improve blue team capabilities301- Regular red teaming prevents security stagnation302- The best red teams think creatively, not just run tools303- Measure improvement over time, not just vulnerability counts304- Red teaming builds security culture through shared understanding