From nobody@FreeBSD.org  Tue Dec 31 17:25:07 2013
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1])
	(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by hub.freebsd.org (Postfix) with ESMTPS id 4E50BD36
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 31 Dec 2013 17:25:07 +0000 (UTC)
Received: from oldred.freebsd.org (oldred.freebsd.org [IPv6:2001:1900:2254:206a::50:4])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mx1.freebsd.org (Postfix) with ESMTPS id 3A79711FF
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 31 Dec 2013 17:25:07 +0000 (UTC)
Received: from oldred.freebsd.org ([127.0.1.6])
	by oldred.freebsd.org (8.14.5/8.14.7) with ESMTP id rBVHP6kg021885
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 31 Dec 2013 17:25:06 GMT
	(envelope-from nobody@oldred.freebsd.org)
Received: (from nobody@localhost)
	by oldred.freebsd.org (8.14.5/8.14.5/Submit) id rBVHP6dM021874;
	Tue, 31 Dec 2013 17:25:06 GMT
	(envelope-from nobody)
Message-Id: <201312311725.rBVHP6dM021874@oldred.freebsd.org>
Date: Tue, 31 Dec 2013 17:25:06 GMT
From: Brian Rak <brak@constant.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: NTPD vulnerable to being used for DDOS
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         185371
>Category:       bin
>Synopsis:       ntpd(8) vulnerable to being used for DDOS
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Dec 31 17:30:00 UTC 2013
>Closed-Date:    
>Last-Modified:  Sun May 04 05:06:07 UTC 2014
>Originator:     Brian Rak
>Release:        9.1.0
>Organization:
>Environment:
FreeBSD XXXX 9.1-RELEASE FreeBSD 9.1-RELEASE #0 r243825: Tue Dec  4 09:23:10 UTC 2012     root@farrell.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  amd64
>Description:
The FreeBSD default ntp.conf makes the NTP server vulnerable to being used for a DDOS attack.

Please see:
http://www.symantec.com/connect/blogs/hackers-spend-christmas-break-launching-large-scale-ntp-reflection-attacks

https://isc.sans.edu/diary/NTP+reflection+attack/17300

https://cert.litnet.lt/en/docs/ntp-distributed-reflection-dos-attacks

The issue is in this configuration file:
http://svnweb.freebsd.org/base/release/9.2.0/etc/ntp.conf?revision=255898&view=markup

All the restrict lines are commented out (for reasons I'm unsure of, the
comments don't make any sense).


>How-To-Repeat:
To determine if a server is vulnerable:

ntpdc -c monlist SERVERIP

If you see a list of hosts, rather then 'timed out, nothing received',
the machine can be exploited in this way.
>Fix:
You can replace all the existing (commented) restrict lines with the
following:

restrict default kod limited nomodify notrap nopeer noquery
restrict -6 default kod limited nomodify notrap nopeer noquery
restrict 127.0.0.1
restrict -6 ::1

This configuration will allow the NTP daemon to function correctly both
as a client and server, and prevent it from being abused in this way.

>Release-Note:
>Audit-Trail:
>Unformatted:
