You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The **Network Time Protocol (NTP)** ensures computers and network devices across variable-latency networks sync their clocks accurately. It's vital for maintaining precise timekeeping in IT operations, security, and logging. NTP's accuracy is essential, but it also poses security risks if not properly managed.
7
+
The **Network Time Protocol (NTP)** ensures computers and network devices across variable-latency networks sync their clocks accurately. It's vital for maintaining precise timekeeping in IT operations, security, and logging. Because time is used in nearly every authentication, crypto-protocol and forensic process, **an attacker that can influence NTP can often bypass security controls or make attacks harder to investigate.**
8
8
9
-
### Summary & Security Tips:
9
+
### Summary & Security Tips
10
10
11
11
-**Purpose**: Syncs device clocks over networks.
12
-
-**Importance**: Critical for security, logging, and operations.
12
+
-**Importance**: Critical for security, logging, crypto-protocols and distributed systems.
13
13
-**Security Measures**:
14
-
- Use trusted NTP sources with authentication.
15
-
- Limit NTP server network access.
16
-
- Monitor synchronization for signs of tampering.
14
+
- Use trusted NTP or NTS (Network Time Security) sources with authentication.
15
+
- Restrict who can query/command the daemon (``restrict default noquery``, ``kod`` etc.).
16
+
- Disable legacy Mode-6/7 control queries (``monlist``, ``ntpdc``) or rate-limit them.
17
+
- Monitor synchronization drift/leap-second state for tampering.
18
+
- Keep the daemon updated (see recent CVEs below).
17
19
18
-
**Default port:** 123/udp
20
+
**Default ports**
21
+
22
+
```
23
+
123/udp NTP (data + legacy control)
24
+
4460/tcp NTS-KE (RFC 8915) – TLS key-establishment for NTP
25
+
```
19
26
20
27
```
21
28
PORT STATE SERVICE REASON
22
29
123/udp open ntp udp-response
23
30
```
24
31
32
+
---
25
33
## Enumeration
26
34
35
+
### Classic ntpd / ntpq / ntpdc
36
+
37
+
```bash
38
+
# Information & variables
39
+
ntpq -c rv <IP>
40
+
ntpq -c readvar <IP>
41
+
ntpq -c peers <IP>
42
+
ntpq -c associations <IP>
43
+
44
+
# Legacy mode-7 (often disabled >=4.2.8p9)
45
+
ntpdc -c monlist <IP>
46
+
ntpdc -c listpeers <IP>
47
+
ntpdc -c sysinfo <IP>
48
+
```
49
+
50
+
### chrony / chronyc (in most modern Linux distros)
51
+
52
+
Only a handful of monitoring commands are accepted from remote IPs when ``cmdallow`` is enabled:
53
+
27
54
```bash
28
-
ntpq -c readlist <IP_ADDRESS>
29
-
ntpq -c readvar <IP_ADDRESS>
30
-
ntpq -c peers <IP_ADDRESS>
31
-
ntpq -c associations <IP_ADDRESS>
32
-
ntpdc -c monlist <IP_ADDRESS>
33
-
ntpdc -c listpeers <IP_ADDRESS>
34
-
ntpdc -c sysinfo <IP_ADDRESS>
55
+
chronyc -a -n tracking -h <IP>
56
+
chronyc -a -n sources -v -h <IP>
57
+
chronyc -a -n sourcestats -h <IP>
35
58
```
36
59
60
+
See the chronyc man page for the meaning of the **M/S** flags and other fields (stratum, reach, jitter, etc.).
61
+
62
+
### Nmap
63
+
37
64
```bash
65
+
# Safe discovery & vuln detection
38
66
nmap -sU -sV --script "ntp* and (discovery or vuln) and not (dos or brute)" -p 123 <IP>
Pay special attention to ``restrict`` lines, ``kod`` (Kiss-o'-Death) settings, ``disable monitor``/``includefile /etc/ntp/crypto`` and whether *NTS* is enabled (``nts enable``).
87
+
88
+
---
89
+
## Recent Vulnerabilities (2023-2025)
90
+
91
+
| Year | CVE | Component | Impact |
92
+
|------|-----|-----------|--------|
93
+
| 2023 |**CVE-2023-26551→26555**| ntp 4.2.8p15 (libntp *mstolfp*, *praecis_parse*) | Multiple out-of-bounds writes reachable via **ntpq** responses. Patch in **4.2.8p16** 🡒 upgrade or back-port fixes. citeturn1search1turn1search2turn1search0|
94
+
| 2023 |**CVE-2023-33192**|**ntpd-rs** (Rust implementation) | Malformed **NTS** cookie causes remote **DoS** prior to v0.3.3 – affects port 123 even when NTS **disabled**. citeturn4view0|
| 2024 | Record DDoS | Cloudflare reports a **5.6 Tbps UDP reflection** attack (NTP among protocols used). Keep *monitor* & *monlist* disabled on Internet-facing hosts. citeturn5search0|
97
+
98
+
> **Exploit kits**: Proof-of-concept payloads for the 2023 ntpq OOB-write series are on GitHub (see Meinberg write-up) and can be weaponised for client-side phishing of sysadmins. citeturn1search4
The **NTP protocol**, using UDP, allows for operation without the need for handshake procedures, unlike TCP. This characteristic is exploited in **NTP DDoS amplification attacks**. Here, attackers create packets with a fake source IP, making it seem as if the attack requests come from the victim. These packets, initially small, prompt the NTP server to respond with much larger data volumes, amplifying the attack.
105
+
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:
50
106
51
-
The _**MONLIST**_ command, despite its rare use, can report the last 600 clients connected to the NTP service. While the command itself is simple, its misuse in such attacks highlights critical security vulnerabilities.
107
+
- Upgrade to ntp 4.2.8p15+ and **add**``disable monitor``.
108
+
- Rate-limit UDP/123 on the edge or enable *sessions-required* on DDoS appliances.
109
+
- Enable *BCP 38* egress filtering to block source spoofing.
110
+
111
+
See Cloudflare’s learning-center article for a step-by-step breakdown. citeturn5search1
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``). citeturn9search1
116
+
117
+
### 3. NTS abuse & 4460/tcp exposure
118
+
119
+
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:
0 commit comments