LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 02-19-2014, 10:09 PM   #1
tomlaino
LQ Newbie
 
Registered: Nov 2012
Posts: 8

Rep: Reputation: Disabled
Stopping NTP Amplification


I am getting slammed by an NTP amplification. I have tried adding noquery to the restrict default line in ntp.conf but no luck. So I added a few lines to IPtables and here is what they look like

# iptables -A INPUT -i eth0 -p udp -m udp --dport 123 -m recent --set --name NTPTRAFFIC --rsource
# iptables -A INPUT -i eth0 -p udp -m udp --dport 123 -m recent --update --seconds 60 --hitcount 7 --name NTPTRAFFIC --rsource -j DROP

But that is still not working. Does anyone have any ideas on what I can do to put an end to this? I am running CentOS 6.4
 
Old 02-20-2014, 01:24 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by tomlaino View Post
I am getting slammed by an NTP amplification. I have tried adding noquery to the restrict default line in ntp.conf but no luck. So I added a few lines to IPtables and here is what they look like

# iptables -A INPUT -i eth0 -p udp -m udp --dport 123 -m recent --set --name NTPTRAFFIC --rsource
# iptables -A INPUT -i eth0 -p udp -m udp --dport 123 -m recent --update --seconds 60 --hitcount 7 --name NTPTRAFFIC --rsource -j DROP

But that is still not working. Does anyone have any ideas on what I can do to put an end to this? I am running CentOS 6.4
I think you're confusing things.
0) if you think you're a participant in a NTP DDoS attack then you should first ask yourself why you didn't respond earlier (same goes for systems maintenance as your OS is lagging one Update), ask yourself if you should provide NTP publicly (most do not) and then restrict access to your NTP service using your router, firewall rule set and ntp.conf
Code:
restrict default kod nomodify notrap nopeer noquery
restrict -6 default kod nomodify notrap nopeer noquery
(see https://www.us-cert.gov/ncas/alerts/TA14-013A) and BTW notice it's "AND", not "or".
1) if you think you're a victim then, as goes for all types of DDoS attacks, know there's only so much you can achieve as an end point. The source address (and port) are or can be faked so unless you're actually seeing ingress traffic to your NTP port UDP/123 these rules make no sense. Next to applying the right firewall rules based on traffic you actually see, block access at the router (if any) and ask your provider to take measures. It's way easier (filter and resource-wise) for them to block traffic at their edge routers.

If unsure post an excerpt from actual traffic you see.
 
2 members found this post helpful.
Old 02-20-2014, 07:10 AM   #3
tomlaino
LQ Newbie
 
Registered: Nov 2012
Posts: 8

Original Poster
Rep: Reputation: Disabled
Here is the snapshot from my pcap. I have entered the lines into ntp.conf and still no luck.
Attached Thumbnails
Click image for larger version

Name:	ntp.png
Views:	24
Size:	130.6 KB
ID:	14787  
 
Old 02-20-2014, 03:18 PM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
AFAIK #0 applies here. Get on it.
 
Old 02-20-2014, 05:27 PM   #5
gotfw
Member
 
Registered: Jan 2007
Posts: 416

Rep: Reputation: 70
In case not clear, if possible, block this at your 1) border/gateway router, AND 2) the external IP address you're nat'ing that 192.x address to. Howsomever, _if_ you're dealing with a low end router provided for free by your ISP, it may not have the horsepower to keep up with the deluge, so in that case just block at #2.

Peace
 
Old 03-03-2014, 03:53 PM   #6
tomlaino
LQ Newbie
 
Registered: Nov 2012
Posts: 8

Original Poster
Rep: Reputation: Disabled
After entering the lines into the ntp.conf the server required a restart and after that the problems ceased. Thank you for all the help
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
US Cert: TA14-013A: NTP Amplification Attacks Using CVE-2013-5211 tronayne Slackware 7 01-15-2014 12:35 PM
US Cert: TA14-013A: NTP Amplification Attacks Using CVE-2013-5211 tronayne Linux - Security 0 01-15-2014 03:44 AM
Help in stopping DNS requests (DNS Amplification) accessthecloud Linux - Server 2 02-18-2013 03:43 PM
ntp server repeatedly stopping/starting Curtor Linux - Software 1 07-20-2009 09:56 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 08:52 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration