NTP Reflection/Amplification DDoS in the wild
-
There is a DDoS going around that uses the NTP "monlist" command as a vector for a reflection/amplification type attack. An attacker can send a small query (ntpdc –n –c monlist x.x.x.x) and get back a ton of data. Spoof the source, and voila, people flood your target for you. We have received reports from customers that automated scans have been running and sending e-mails notifying administrators they have vulnerable NTP daemons.
More info here:
https://isc.sans.edu/forums/diary/NTP+reflection+attack/17300
https://www.us-cert.gov/ncas/alerts/TA14-013A
http://www.symantec.com/connect/blogs/hackers-spend-christmas-break-launching-large-scale-ntp-reflection-attacksIf you have appropriate WAN rules to stop the Internet from reaching your firewall's NTP server, then good news, you have nothing to do. However, if you have opened your NTP service up on purpose or if you have overly permissive rules (e.g. "allow all on WAN") and you don't want to change them, you can apply the following fix to change the behavior of the NTP daemon so it will no longer respond to the monlist command:
https://github.com/pfsense/pfsense/commit/706ba0e4b1ccf498dbfa3a99073d249045b1a7b8
That change may be applied using the System Patches package.
-
Great info thanks!!
So I would think people that participate in pool.ntp could be really open to this.. Now I run my ntp on a box behind pfsense that is member of pool vs using my pfsense. Well for one pfsense is a VM.. and doesn't keep the greatest of time ;)
But this info still very useful so thanks!!
So example before got this
C:\NTP>ntpdc -n -c monlist 192.168.1.40
remote address port local address count m ver rstr avgint lstint144.76.20.62 123 192.168.1.40 43 3 4 190 205 7
64.71.163.18 123 192.168.1.40 2456 3 4 190 131 19
74.100.31.146 1024 192.168.1.40 117 3 4 190 68 29
<snipped>LONG LIST!!! LONG!!!now get this
C:\NTP>ntpdc -n -c monlist 192.168.1.40
***Server reports data not foundAfter editing my ntp.conf with
disable monitorBut then wait - I want to be able to see this.. So I just modified my default restrict to prevent ntpdc queries from internet, just added noquery – internet has no need to query my ntp.. But from my local network I do.. That should of been in there from get go.. just lazy ;)
Now get from outside my network
ntpdc -n -c monlist publicIP
publicIP: timed out, nothing received
***Request timed outSo thanks for bringing to attention - have googled ntp monitor and yup seeing lots of good reading info ;)</snipped>
-
I decided to look into this after reading this article:
http://www.itnews.com.au/News/372033,worlds-largest-ddos-strikes-us-europe.aspxFor those of us using pfSense and probably shouldn't be (i.e. it is way over our heads).
- log into your PFSense box.
- select "Diagnostics/Edit File"
- Browse to "etc/inc/system.inc"
- find the line:
$ntpcfg .= "enable monitor\n"; - change to:
$ntpcfg .= "disable monitor\n"; - save
- Diagnostics/reboot
-
Is there a solution to this? I edited the system.inc and added the disable monitor to the ntp.conf and that does seem to fix this issue
C:\Windows\system32>ntpdc -n -c monlist a.b.c.d
a.b.c.d: timed out, nothing received
***Request timed outbut this still gets a response
C:\Windows\system32>ntpq -c rv a.b.c.d
associd=0 status=c011 leap_alarm, sync_unspec, 1 event, freq_not_set,
version="ntpd 4.2.6p5@1.2349-o Wed Jul 24 14:36:48 UTC 2013 (1)",
processor="i386", system="FreeBSD/8.3-RELEASE-p11", leap=11, stratum=16,
precision=-20, rootdelay=0.000, rootdisp=0.075, refid=INIT,
reftime=00000000.00000000 Thu, Feb 7 2036 1:28:16.000,
clock=d6a6d2fc.07b21e61 Thu, Feb 13 2014 0:13:32.030, peer=0, tc=3,
mintc=3, offset=0.000, frequency=0.000, sys_jitter=0.000,
clk_jitter=0.001, clk_wander=0.000which according to http://openntpproject.org/ means my pfsense NTP server can be used in an attack… so what gives? I do run a public NTP server
-
I would suggest you just edit to not allow query from the internet, and only allow it via your localhost or local network via your restrict command. This is better than no monitor, since if your running a public server you might want to check that list out ;)
So just set noquery in your ntp conf
noquery – "Do not allow this host/subnet to query your ntpd status." The ntpd status query features provided by ntpq/ntpdc will reveal some information about the system running ntpd (e.g. OS version, ntpd version) that you many not wish others to know. You need to decide if concealing this information is more important than the possible benefits of allowing your clients to see synchronization information about your ntpd.
-
reading this
http://support.ntp.org/bin/view/Support/AccessRestrictions
gave me some suggestions… so I tried adding this... so lets see how this goes...
$ntpcfg .= "disable monitor\n";
$ntpcfg .= "discard minimum 10\n";
$ntpcfg .= "restrict default kod nomodify notrap nopeer noquery\n";
$ntpcfg .= "restrict -6 default kod nomodify notrap nopeer noquery\n";
$ntpcfg .= "restrict 127.0.0.1\n";
$ntpcfg .= "restrict -6 ::1\n";