[Ntp] Re: NTP DDoS Attacks (Was: Re: NTPv5 Requirements vs. NTPv5 Spec)

Dave Hart <davehart@gmail.com> Thu, 26 June 2025 02:18 UTC

Return-Path: <davehart@gmail.com>
X-Original-To: ntp@mail2.ietf.org
Delivered-To: ntp@mail2.ietf.org
Received: from localhost (localhost [127.0.0.1]) by mail2.ietf.org (Postfix) with ESMTP id 19BFD39953AC for <ntp@mail2.ietf.org>; Wed, 25 Jun 2025 19:18:39 -0700 (PDT)
X-Virus-Scanned: amavisd-new at ietf.org
X-Spam-Flag: NO
X-Spam-Score: -2.098
X-Spam-Level:
X-Spam-Status: No, score=-2.098 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: mail2.ietf.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com
Received: from mail2.ietf.org ([166.84.6.31]) by localhost (mail2.ietf.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 0SbPmIbdRuEH for <ntp@mail2.ietf.org>; Wed, 25 Jun 2025 19:18:36 -0700 (PDT)
Received: from mail-il1-x136.google.com (mail-il1-x136.google.com [IPv6:2607:f8b0:4864:20::136]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (P-256) server-digest SHA256) (No client certificate requested) by mail2.ietf.org (Postfix) with ESMTPS id E6ED039953A2 for <ntp@ietf.org>; Wed, 25 Jun 2025 19:18:36 -0700 (PDT)
Received: by mail-il1-x136.google.com with SMTP id e9e14a558f8ab-3dc9e7d10bdso2016985ab.2 for <ntp@ietf.org>; Wed, 25 Jun 2025 19:18:36 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1750904316; x=1751509116; darn=ietf.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=Lit4HgSWprgGCU8CuXaeSY4QaIgBuHBFHJ84u/2LcxM=; b=ewOIzySlneYaVpFT+m0aQUNGEvL2knoOAd+YvQZ0x6WNGglSw+8s+zpWcYd+sS0ZRV I5w/HK/37TCggG9I+eT1LR/kfS7/p0oruBdO5lpyBSu6fhO1Qew921WftuyJBIF8ePKX BXksn+p0kBVdq4HHukNffjI6aYNnzF9xKxoyGOIvNaShY0qqXWNgzoTLTsofrZc07a8k vL/k5pxyOBHWD/5nrLbyaNh4Au2mouWVZ9LBQUFpZNGV/zEvnJdQFaJU2QyV3gB5OFpC IlgeO9M/rxBbnrh2Ed/uY/oSOYqIT8ji1sAx5BoFtfU3KI4QAzaMf2oge83EdLvGCwtX uCeg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1750904316; x=1751509116; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Lit4HgSWprgGCU8CuXaeSY4QaIgBuHBFHJ84u/2LcxM=; b=SbX4G2EKFodj9Ue8TW/w7uzLScz2M3iaJ8kyP8cN5d4yStiHJN9yoiyPLd+E+F/axG 68ggAujDQVouwgPQkFqTvJ5mYwlE0nazO0SRhKGoBUFYaF1qkoBChlEWy26naFiQIIEH OxWf9vZJDDlqW5NL3os9/QsKr8kEJVUCeQ+DcgX4Yhq3WuPSkDqW2JCLKyHt37izyiqD Mx1mez0tAKcBG/PsDToXPHotCzPEz5GqvEG/fqmMJ01yYvYIwaQ72gbXZWHXK8lcCtsZ rmdLusquFAwxg6S+QXXfLrmjRZHxOnut4K9LXXHdmcGkrLxLW+RAHSR4iudJ/8y24vVH JMhg==
X-Gm-Message-State: AOJu0YzFXyPV0/4T9qIGEOjCwOLYlszAjBFLfKVeM170AQJ61Ev6a21O JqJ8RjeBI8aL9oCsUg19wX71pBiRzo7lJZ1+cE4fjxvdaDzB3FN/dUgBXjMibyyhbeWEQPgGrIn Yl5u4SEQ276lNYgfrGYprklFpuaIclrE=
X-Gm-Gg: ASbGnctYo6wF2DVjrHLZxcDLr5Gu0ftUQgR+ibBXHbsu+n7Eug7k/WgCSVUqDGDfKaS xBpAX0wy9xUHymL6JQr074JPB/gDSIFNzrpzxExBblYHE4Om7C6G4Dj3dKIa0CEKncFzbXd7Uw8 dX+ChG9m61SMa18JbaptDXeE6DZbgrkx5AbOLxVc98xcbWfWpZY0HmZ/qxkRhpths=
X-Google-Smtp-Source: AGHT+IG7ayDX4A3ST2Qzdhkq8437NkysSCuqZlr15lfAbbg0d+tgDX89Tt/MsqXn89695QHmSQ5j3VLsRQ++YIcdmmc=
X-Received: by 2002:a05:6e02:4507:20b0:3df:347f:eb68 with SMTP id e9e14a558f8ab-3df347feec3mr39434525ab.7.1750904316174; Wed, 25 Jun 2025 19:18:36 -0700 (PDT)
MIME-Version: 1.0
References: <CABUE3XnmGz1RBOMN85TsBuHdtNftWa3VmsADbaFobE25HF4HJQ@mail.gmail.com> <06aa16433bb84d7c97b4e7117cb38a6b@ukr.de> <aFFidI8-f7-w09d-@localhost> <61f23369a3c449c48c01368cf8bc3019@ukr.de> <CWLP265MB65960581905B4FA2270AAF4FC17CA@CWLP265MB6596.GBRP265.PROD.OUTLOOK.COM> <aFlVXvD1LCiaO-Gd@localhost> <b51a62e2-ee1b-4460-bddf-6bdf916c5c68@wiktel.com> <0f03fbaa4c3147fb8fd0af78565174f6@ukr.de> <aFpzoSP19T4SxsXE@localhost> <52a08ff0-3443-4d39-859b-4ac618e2885e@wiktel.com> <aFu3zbpBJdHrPv_N@localhost> <60e1b670-93f2-4da6-b821-b5d6aca94978@wiktel.com> <CAMbSiYC2PHTwfExr8E_gfcHg=p9uSs+hQdr++0Zia3=DTMTeJQ@mail.gmail.com> <497e48e1-e967-4d6e-8b1f-80534f399de2@wiktel.com> <CAMbSiYBYSA0vTWMVWhoOuXwjcWmckZ3=UZJaYeXp7rnwTVHrkA@mail.gmail.com> <2ebf3bb3-03c7-44ef-8611-c45e32092dd7@wiktel.com>
In-Reply-To: <2ebf3bb3-03c7-44ef-8611-c45e32092dd7@wiktel.com>
From: Dave Hart <davehart@gmail.com>
Date: Thu, 26 Jun 2025 02:18:25 +0000
X-Gm-Features: Ac12FXzHtIV_1B34_hs6W4rOW0ik9Euxi4l04c98X7FuHcDFsnpvicE-wXvIEjc
Message-ID: <CAMbSiYDeWUynNHbvNgHmR1KS+hwmpRC9LR_Kwwx_icsV0d+0MQ@mail.gmail.com>
To: Richard Laager <rlaager@wiktel.com>
Content-Type: multipart/alternative; boundary="000000000000cd23020638702dac"
Message-ID-Hash: 2SJ3IM7LROXOTO6GGVHPQKV7GP34CK25
X-Message-ID-Hash: 2SJ3IM7LROXOTO6GGVHPQKV7GP34CK25
X-MailFrom: davehart@gmail.com
X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-ntp.ietf.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header
CC: ntp@ietf.org
X-Mailman-Version: 3.3.9rc6
Precedence: list
Subject: [Ntp] Re: NTP DDoS Attacks (Was: Re: NTPv5 Requirements vs. NTPv5 Spec)
List-Id: Network Time Protocol <ntp.ietf.org>
Archived-At: <https://mailarchive.ietf.org/arch/msg/ntp/94-wGw4U1j72HEEd7IYNFLoyQDM>
List-Archive: <https://mailarchive.ietf.org/arch/browse/ntp>
List-Help: <mailto:ntp-request@ietf.org?subject=help>
List-Owner: <mailto:ntp-owner@ietf.org>
List-Post: <mailto:ntp@ietf.org>
List-Subscribe: <mailto:ntp-join@ietf.org>
List-Unsubscribe: <mailto:ntp-leave@ietf.org>

On Thu, Jun 26, 2025 at 1:33 AM Richard Laager <rlaager@wiktel.com> wrote:

> On 2025-06-25 18:53, Dave Hart wrote:
>
>
> From the cloudflare report [1], the megaflood they defended against had
> ~14% of 0.004% classified as NTP reflection attack.  Not exactly the
> low-hanging fruit.
>
> For *this particular* attack. Attack profiles can vary quite a lot. I've
> had large attacks where the vast majority or even ~100% is NTP
> amplification traffic. I've also had (even larger) attacks where ~0% was
> NTP traffic. Additionally, this is a dynamic "game" (in roughly the game
> theory sense) in the sense that your defenses shape the attackers behavior.
>
I don't doubt there have been massive NTP reflection attacks over the last
dozen years.  I do question how many of those involved mode 6 and how many
were recent.

> What I'm asking is to not advocate filtering other people's use of NTP
> mode 6 as inherently useless or dangerous as it crosses a transit network
> they have no control over.
>
> This essentially fairly characterizes my position. My position is that
> it's at least somewhat dangerous and largely useless to legitimate users,
> so together, those factors mean the cost-benefit of blocking it makes sense.
>
If you count me out of legitimate users, sure.  Given the widespread
configuration of ntpd to reject all mode 6 queries from off-host, I'll
admit I'm part of a relatively small minority, but transit networks should
engage in protocol-specifc blocking only where the benefit is
overwhelming.  I don't think you've made a convincing argument that's so
for mode 6 queries, and I think a lot of the confusion comes from
mitigation instructions for older ntpd, where "restrict noquery" was the
easiest way to disable monlist, causing people to assume all mode 6 and
mode 7 queries were equally dangerous.

> Are you sure that mode 6 is not an issue?
>
> I vaguely remember it being a problem (and that's why I blocked both 6 and
> 7), but I don't have any captures to prove it either way.
>
> If I Google it, there are various discussions about mode 6 being an
> amplification vector, including some technical details. For example, here
> are two random results:
>
> https://www.csk.gov.in/csksa/csksa_01.html says "ntpq -c rv IP" will
> result in amplification.
>
>
> https://community.cisco.com/t5/switching/97861-network-time-protocol-ntp-mode-6-scanner-ios-12-2-55-se10/td-p/3751556
> talks about mode 6 being a separate vulnerability from mode 7.
>
I didn't claim there was no amplification possible with mode 6 queries.  I
do suspect the amplification factors possible with mode 6 make it
relatively uninteresting compared to, for example, traditional DNS over UDP
53.  There are huge numbers of well-connected public DNS recursive
resolvers to which to spread the spoofed queries around to help evade
detection.  Cloudflare documented a 50x amplification attack [2] querying
"any isc.org" which no longer offers such a large factor, but there a many
other domains -- I'm guessing it's not terribly hard to figure out similar
or greater UDP DNS amplification factors.  For the same reason it would be
wrong for ISPs to block UDP 53, it's wrong to block mode 6 lacking evidence
it's not just suffering from confusion with mode 7.  Undoubtedly there are
other UDP services that offer amplification as well.

> I just tested an `ntpq -c rv IP` against a server of mine (after changing
> the config). Including Ethernet headers, I sent one 54 byte frame and I got
> back a 522 byte frame and a 90 byte frame. That's 11.3x amplification.
>
I note that according to Cloudflare [1] monlist offered 200x
amplification.  Personally, I'd be fine with changing ntpd and ntpq to
require queries be close to as large as responses, which in practice might
mean every query is padded to 465 bytes, for example.  I believe ntpsec has
taken this approach.  I've suggested as much but the idea was vetoed.  It
does also feel wasteful of resources, but amplification is a real issue.
Another possible approach is to change ntpd/ntpq so that all mode 6 queries
protect against spoofing using a 3-way-handhake-like nonce to ensure
responses actually go to the requester not some innocent bystander.  That
would be a breaking change, meaning old ntpq would be unable to query any
new ntpd, but it may be the best path forward.  However, given the
blowback, perhaps a wiser approach would be to make the nonce-requiring
variants actually different rather than just making a breaking change to
the existing stuff -- so that operators and defaults might choose to allow
nonced queries while rejecting the original mode 6 unauthenticated,
non-nonced queries.

> I have my hand in NTP servers spread across a huge geography, and I find
> it useful to be able to query them, particularly the unauthenticated peers
> billboard (ntpq -p or as I often use, ntpq -clpe for corner-case reasons)
> and readvar/rv, sysstats as well as for the authenticated ifstats and and
> reslist ntpq queries.
>
> Personally, I would use SSH to run ntpq on the NTP server. And I would
> recommend the same to you/others.
>
> Using SSH, or a VPN, or remote desktop, or Anydesk or similar, is quite
heavyweight compared to using ntpq.  For many situations, ssh might be
fine, but for scripting, particularly across multiple servers, one ssh
setup/teardown per ntpq query makes the overall operation orders of
magnitude slower.  I'm not suggesting you change your practice, just that
you not advocate that network operators impose what amounts to firewalling
that people transiting those networks can't opt out of.

> I certainly would encourage you to add "nomrulist" to Debian's "restrict
> default" line, despite it having no effect combined with "noquery".  It
> would raise awareness and provide a backstop for those who find reason for
> removing "noquery" as well as an example they might use in crafting more
> specific subnet-/host-specific restrictions.
>
> I've filed a wishlist bug report: https://bugs.debian.org/1108327
>
> Debian is currently in a hard freeze, so I can't make that change now.
>
Thank you!

[1] https://www.cloudflare.com/learning/ddos/ntp-amplification-ddos-attack/
[2] https://blog.cloudflare.com/deep-inside-a-dns-amplification-ddos-attack/

Cheers,
Dave Hart