NTP Service Usable for Amplification

The NTP service answers management queries such as monlist from any address, so it can be used to amplify denial of service attacks and discloses details of its clients.

SeverityMedium
CVSS 3.15.8 CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:N/A:L Open in the calculator
CVSS 4.06.9 CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:N/SC:N/SI:N/SA:L Open in the calculator
CWECWE-406: Insufficient Control of Network Message Volume (Network Amplification)
MITRE ATT&CKT1498.002 Reflection Amplification
CategorySecurity Misconfiguration

Description

The NTP service, usually the reference ntpd implementation, answers mode 7 (ntpdc) or mode 6 (ntpq) management queries from any address, in addition to normal time requests. The best known case is the monlist command, which returns the addresses of up to the last 600 hosts that contacted the server, so a single small request produces many large response packets. It was abused in large reflection attacks from late 2013, is tracked as CVE-2013-5211, and was removed from ntpd in version 4.2.7p26. Mode 6 queries such as readvar give a smaller but still useful amplification.

With forged requests, an attacker can use the server to direct large volumes of traffic at a third party, contributing to denial of service attacks that are traced back to the organisation's network. This consumes bandwidth and server capacity, and can lead to the organisation's addresses being placed on block lists or to complaints from upstream providers. The same queries also disclose information: the monlist response gives the addresses of the server's recent clients, which can reveal internal hosts and network layout, and the mode 6 variables reveal the software version and system details. The time service itself is not compromised.

The issue is confirmed from outside the trusted network with ntpdc -n -c monlist or ntpq -c rv against the server, or with the Nmap ntp-monlist and ntp-info scripts. It is found on servers and network devices that run older ntpd releases, or that have no restrict rules limiting who may send management queries.

Remediation

Restrict NTP to time service for untrusted clients:

  • Upgrade ntpd to a current supported release, which no longer offers monlist, and apply vendor firmware updates on network devices that run NTP.
  • Add restrict rules that allow time service but refuse management queries from everyone except the local host, as below. The noquery flag blocks mode 6 and mode 7 queries without affecting time synchronisation. Where the configuration uses pool lines, also add restrict source nomodify notrap noquery, because on current ntpd releases nopeer otherwise stops the pool servers being used.
  • On older releases that still support monlist, also add disable monitor, which turns off the feature it reports on.
  • Where the server does not need to serve time to the internet, block inbound UDP port 123 from the internet, and on network devices use NTP access groups to limit which hosts may query.
restrict default kod nomodify notrap nopeer noquery restrict -6 default kod nomodify notrap nopeer noquery restrict 127.0.0.1 restrict -6 ::1 disable monitor

Confirm the fix by repeating the monlist and readvar queries from an untrusted network and checking that they receive no response, while time requests still succeed.

References


Add This Finding to Your Library

In Pental this write-up is in Settings, Library. Add to my library copies it into your own, rated in your firm's CVSS version, ready to put in your own words.

Free trial  ·  No card required

Only need the reporting? Our reporting tool is free and open source, with the same library.


More Network Services Findings

Every Network Services finding