Offensive Security · Fundamentals

Red Team Introduction

Recon, enumeration, and light Wi-Fi attacks on WPA2 

Instructor, A. Yahiaoui Track, Offensive Security Format, Lecture + 3 Labs
MODULE 01 / 05

Methodology & Ground Rules

Before we touch a single tool, we need a shared map of the engagement, and the boundaries we never cross.

Pentest phasesRed / Blue / PurpleRules of engagement
Guide Roadmap

What we're covering today

Five modules, three hands-on labs: from methodology to a real WPA2 handshake capture.

01

Methodology

Pentest phases, red/blue/purple context, and rules of engagement.

02

Recon & OSINT

Passive vs active recon, and a practical OSINT toolkit.

03

Wi-Fi & WPA2

802.11 basics, scanning, the 4-way handshake, wordlists.

04

Enumeration

Nmap fundamentals and web content discovery with dirsearch.

05

Labs

Wi-Fi scan · OSINT challenge · Nmap + dirsearch.

+

Takeaways

What to practice next.

Context

Where "red team" fits

Three lenses on the same system: the vocabulary you'll hear throughout this guide.

🔴 Red Team

Simulates real attackers to test detection and defenses: recon, exploitation, evasion. Today's focus.

🔵 Blue Team

Defends, monitors, and responds: logs, SIEM alerts, incident response.

🟣 Purple Team

Red and blue collaborating deliberately, so findings turn into detections.

ℹ

Pentesting vs. red teaming: a pentest is scoped and breadth-first ("find as many holes as possible"); a red team engagement is objective-driven and stealthy ("reach this goal without being caught"). Today's techniques apply to both.

Framework

The pentest methodology

Every engagement: CTF or client-facing: moves through the same five phases.

1

Reconnaissance

Passive & active info gathering. No exploitation yet.

2

Scanning & Enum

Map live hosts, open ports, running services, versions.

3

Exploitation

Turn a weakness into initial access.

4

Post-Exploitation

Privilege escalation, lateral movement, persistence.

5

Reporting

Findings, evidence, and remediation guidance.

★

Today

Deep on phases 1-2, plus a guided taste of WPA2 exploitation.

Non-negotiable

Rules of engagement

Every tool in this deck is legal to learn and illegal to point at something you don't own or aren't authorized to test.

  • Written authorization first. No scan, no capture, no scrape without a signed scope document, even "just looking."
  • Defined scope. Explicit in-scope IPs/domains/SSIDs, and explicit out-of-scope systems.
  • Rate & time limits. Aggressive scans can degrade production systems, that's a self-inflicted incident.
  • Stop conditions. Know who to call and when to stop if something breaks.
⚠

Today's labs run only against your own equipment or an authorized lab environment. Scanning or attacking networks you don't own or lack explicit permission to test is illegal in effectively every jurisdiction, see the GRC & cyber-law guide for the details that apply here.

MODULE 02 / 05

Reconnaissance & OSINT

Everything an attacker learns before they ever send a packet at your infrastructure.

Passive vs activeOSINT toolkitMetadata & breach awareness
Reconnaissance

Passive vs. active recon

The line that decides whether the target ever sees you coming.

Passive

  • No direct interaction with the target
  • WHOIS, DNS records, search engines
  • Social media, job postings, cached pages
  • Near-zero detection risk

Active

  • Direct probing of the target
  • Port scans, banner grabbing
  • Zone transfer attempts, live crawling
  • Shows up in logs, assume you're seen
OSINT

Open Source Intelligence: what & why

OSINT is intelligence built entirely from publicly available sources, no exploitation, no credentials, just careful looking.

Attack surface

Domains, subdomains, IP ranges, cloud assets.

People

Employee names, roles, email conventions, usernames.

Tech & footprint

Tech stack, physical locations, third-party vendors.

✓

Everything you gather here feeds later phases: pretexts, password guesses, and the list of live targets you'll scan.

OSINT

The OSINT toolkit

A handful of tools cover most of an initial recon pass.

WHOIS

Domain registrant, nameservers, registration dates.

dig / nslookup

DNS records: A, MX, TXT, NS: and zone insight.

crt.sh

Certificate Transparency logs reveal subdomains fast.

theHarvester

Automated email & subdomain harvesting from search engines.

Shodan / Censys

Internet-wide search for exposed devices and services.

Google dorking

site: filetype: intitle: inurl: operators.

OSINT

OSINT in practice

  • Metadata: exiftool on public PDFs/images can leak usernames, software versions, even GPS coordinates.
  • People & naming conventions: LinkedIn org charts often reveal a predictable first.last@domain pattern.
  • Breach awareness: checking org emails against Have I Been Pwned tells you credential-reuse risk, for defensive awareness, not for using leaked creds.
  • Document everything. Your recon notes become the first section of your report.
MODULE 03 / 05

Wi-Fi Fundamentals & Light WPA2

Why proximity alone is enough for wireless to become the softest part of a network.

802.11 basicsairodump-ng4-way handshakeWordlists
Wireless

Wi-Fi as an attack surface

No cable, no badge, no VPN, just range. That's what makes wireless worth its own module.

What we typically find

Weak or reused PSKs, WPS left enabled, rogue/unmanaged APs, guest networks that bleed into internal VLANs.

Why it matters

Wireless sits in both recon (mapping the physical/wireless footprint) and, with authorization, hands-on testing.

Wireless

802.11 refresher

SSID vs BSSID

SSID is the human-readable network name; BSSID is the AP radio's MAC address: what you actually target.

Bands & channels

2.4GHz and 5GHz, split into channels. Channel + BSSID together pin down exactly one AP to watch.

Managed mode

Normal adapter behavior: connects to one network, ignores everyone else's traffic.

Monitor mode

Adapter captures every frame in range, on a channel, without associating. Required for Wi-Fi pentesting.

Wireless

Scanning with airodump-ng

Put the adapter in monitor mode, then just listen.

zsh, recon
$ airmon-ng start wlan0          # enable monitor mode → wlan0mon
$ airodump-ng wlan0mon              # list every AP + client in range
$ airodump-ng -c 6 --bssid AA:BB:CC:DD:EE:FF -w capture wlan0mon
Record: BSSIDChannelEncryptionESSIDConnected clients
Wireless

The WPA2 4-way handshake

  • WPA2-Personal derives a PMK from the passphrase, then a 4-way handshake derives session keys (PTK/GTK), that exchange is what we capture.
  • Management frames aren't encrypted, so a deauth frame can force a connected client to reconnect, giving you a fresh handshake to capture. This gap is exactly why WPA3 mandates Protected Management Frames.
  • The captured handshake enables an offline attack, no more interaction with the AP needed.
✓

The real lesson: WPA2-Personal's security is only as strong as the passphrase. That's the whole reason we're about to talk about wordlists.

Wireless

Wordlists & cracking concepts

rockyou.txt

14M leaked, real-world passwords. Ships with Kali: the default training dataset.

SecLists

Curated lists for passwords, usernames, and web content: reused constantly across today's labs.

crunch / cewl

crunch generates by pattern; cewl scrapes a site for target-specific candidate words.

zsh, crack
$ aircrack-ng -w rockyou.txt -b AA:BB:CC:DD:EE:FF capture-01.cap
# GPU alternative:
$ hashcat -m 22000 capture.hc22000 rockyou.txt
MODULE 04 / 05

Enumeration: Nmap & Web

Turning a list of live hosts into a list of actual opportunities.

Nmap scan typesNSE scriptsdirsearch
Enumeration

From recon to enumeration

Recon

What's out there? Maps the attack surface: domains, IPs, wireless footprint.

Enumeration

What's actually running on it? Digs into live targets: ports, services, versions, exposed paths.

Enumeration is where a list of IPs turns into a list of opportunities.

Enumeration

Nmap fundamentals

zsh, nmap
$ nmap -sn TARGET_RANGE       # host discovery / ping sweep
$ nmap -sS -p- TARGET_IP        # full TCP SYN port scan
$ nmap -sV -sC TARGET_IP        # service/version + default scripts
$ nmap -sU --top-ports 20 TARGET_IP
ℹ

SYN scans need raw-socket privileges, that's why nmap usually runs with sudo.

Enumeration

Nmap in practice

  • Read the state column first, open, closed, or filtered, before anything else.
  • NSE (Nmap Scripting Engine) extends scans: --script=vuln, --script=http-title, and categories like auth, discovery, and safe.
  • Save everything: -oA scan_results writes normal, XML, and grepable output together.
  • Workflow tip: go broad first (-sn or top ports), then narrow -p- to hosts you know are live.
Enumeration

Web enumeration: dirsearch

Every web server hides paths nobody linked to.

zsh, web
$ dirsearch -u http://TARGET_IP -e php,html,txt,js \
  -w /usr/share/wordlists/dirb/common.txt

200

Found: inspect it.

301 / 403

Redirect or forbidden: it still exists.

500

Server error: sometimes leaks a stack trace.

Similar toolsgobusterffufferoxbuster
MODULE 05 / 05

Hands-On Labs

Three guided labs, run only against your own gear or an authorized lab range.

Lab 1, Wi-Fi ScanLab 2, OSINT ChallengeLab 3, Nmap + dirsearch
Lab 01
~30 min

Wi-Fi scan

Map the wireless environment around the lab AP, then capture one handshake, from the designated target only.

airmon-ngairodump-ngaircrack-ngMonitor-mode adapter
  1. Enable monitor mode on your adapter.
  2. Run airodump-ng and log every visible AP.
  3. Identify the lab's authorized target AP by BSSID.
  4. Lock the scan to its channel + BSSID; start writing a capture file.
  5. Wait for (or, if authorized, trigger) a client reconnect.
  6. Confirm the "WPA handshake:" banner in airodump-ng's output.
Deliverable

A table of ≥5 nearby APs (BSSID, channel, encryption, signal) plus one captured handshake from the designated lab AP.

Lab 02
~30 min

OSINT challenge

Build a recon dossier on the provided target persona using passive OSINT only, flags are hidden in what you find.

WHOIScrt.shtheHarvesterGoogle dorksexiftool
  1. Run WHOIS and DNS lookups on the target domain.
  2. Enumerate subdomains via crt.sh and theHarvester.
  3. Harvest employee names/emails; infer the naming convention.
  4. Google-dork for exposed documents; pull their metadata.
  5. Cross-check a harvested email against Have I Been Pwned (awareness only).
  6. Compile it all into a short recon writeup.
Deliverable

A 1-page recon dossier, domains/subdomains, key personnel, tech stack, notable exposed files, plus any flags you uncovered.

Lab 03
~30 min

Nmap + dirsearch

Enumerate a lab target end-to-end: from open ports to a hidden web path.

nmapdirsearchSecLists
  1. Host discovery, then a full TCP port scan of the lab target.
  2. Run -sV -sC on open ports; note every service and version.
  3. If HTTP(S) turns up, browse it manually first.
  4. Run dirsearch with an appropriate wordlist and extensions.
  5. Investigate any 200s and 403s by hand.
  6. Document the full chain: port → service → path → finding.
Deliverable

An enumeration writeup, ports/services table, discovered web paths, and one flag or artifact found via a hidden path.

Wrap-Up

Key takeaways

  • ✓Recon before scanning, passive before active, every escalation should be deliberate.
  • ✓OSINT builds your target map before you send a single active packet.
  • ✓WPA2-Personal is only as strong as its passphrase, that's the entire attack.
  • ✓Enumeration is where you find what's actually exploitable, go broad, then narrow.
  • ✓None of this leaves the authorized scope. Ever.
Keep Practicing

Where we go from here

Phases 1-2 are now yours. Next, we build on this enumeration to move toward exploitation.

Practice ranges

TryHackMe, HackTheBox, and our own MCTF: all built for exactly this.

References

SecLists repo, aircrack-ng docs, Nmap reference guide.

Habit to build

Run OSINT + nmap against your own lab machines weekly. Muscle memory matters.

A. Yahiaoui, Security Offensive Security, Fundamentals