123 - Ntp
💡 学习提示: 本文档介绍 Ntp 的渗透测试方法,适合信息安全初学者和从业人员参考。
⚠️ 法律声明: 本文档仅供学习和授权测试使用。未经授权的系统测试可能违反法律法规。
Advanced Attacks
1. NTP Amplification / Reflection
The legacy Mode-7 monlist query returns up to 600 host addresses and is still present on thousands of Internet hosts. Because the reply (428-468 bytes/entry) is ~ 200× larger than the 8-byte request, an attacker can reach triple-digit amplification factors. Mitigations:
- Upgrade to ntp 4.2.8p15+ and add
disable monitor. - Rate-limit UDP/123 on the edge or enable sessions-required on 分布式拒绝服务 appliances.
- Enable BCP 38 egress filtering to block source spoofing.
See Cloudflare’s learning-center article for a step-by-step breakdown.
2. Time-Shift / Delay attacks (Khronos / Chronos research)
Even with authentication, an on-path attacker can silently shift the client clock by dropping/delaying packets. The IETF Khronos (formerly Chronos) draft proposes querying a diverse set of servers in the background and sanity-checking the result to detect a shift > 𝚡 ms. Modern chrony (4.4+) already implements a similar sanity filter (maxdistance / maxjitter).
3. NTS abuse & 4460/tcp exposure
NTS moves the heavy crypto to a separate TLS 1.3 channel on 4460/tcp (ntske/1). Poor implementations (see CVE-2023-33192) crash when parsing cookies or allow weak ciphers. Pentesters should:
Look for self-signed or expired certificates and weak cipher-suites (non-AEAD). Reference: RFC 8915 §4.
Hardening / Best-Current-Practice (BCP-233 / RFC 8633)
Operators SHOULD:
- Use ≥ 4 independent, diverse time sources (public pools, GPS, PTP-bridges) to avoid single-source poisoning.
- Enable
kodandlimited/nomodifyrestrictions so abusive clients receive Kiss-o’-Death rate-limit packets instead of full responses. - Monitor daemon logs for panic events or step adjustments > 1000 s. (Signatures of attack per RFC 8633 §5.3.)
- Consider leap-smear to avoid leap-second outages, but ensure all downstream clients use the same smear window.
- Keep polling ≤24 h so leap-second flags are not missed.
See RFC 8633 for a comprehensive checklist.
Shodan / Censys Dorks
Useful Tools
| Tool | Purpose | 示例 |
|---|---|---|
ntpwn |
Script-kiddie wrapper to spray monlist & peers queries | python ntpwn.py --monlist targets.txt |
| zgrab2 ntp | Mass scanning / JSON output including monlist flag | See command above |
chronyd with allow |
Run rogue NTP server in pentest lab | chronyd -q 'server 127.127.1.0 iburst' |
BetterCap |
Inject NTP packets for time-shift 中间人攻击 on Wi-Fi | set arp.spoof.targets <victim>; set ntp.time.delta 30s; arp.spoof on |