LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 12-01-2014, 04:49 PM   #1
jonjetjon
LQ Newbie
 
Registered: Nov 2014
Posts: 6

Rep: Reputation: Disabled
Question is there a way to block ips based on apache2 errors?


my webserver has been under attack for quite some time now, it is a basic http attack looking for a forums link(which no longer exists) that generates an apache error starting with "GET /forums/showthread.php?" is there a way i can write a shell script to auto add ips that generate this error to iptables as a blocked ip? that way the lag will be greatly reduced.
 
Old 12-01-2014, 05:57 PM   #2
bowenmark
LQ Newbie
 
Registered: Jan 2006
Posts: 3

Rep: Reputation: 0
You can use htaccess for this, more info at the Apache web site

Additionally, using iptables you can limit the number of pings per minute, more here.

Also, you can use OSSEC
 
Old 12-01-2014, 09:41 PM   #3
jonjetjon
LQ Newbie
 
Registered: Nov 2014
Posts: 6

Original Poster
Rep: Reputation: Disabled
since it's an attack specifically designed to take up bandwidth and processing power(which i believe letting it get to apache would still use) i would like to add all these ip's to a complete blocklist in the iptables, the problem is, there are about 100 and i want to add them to iptables automatically when they try and access that file.
 
Old 12-02-2014, 03:49 AM   #4
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Quote:
Originally Posted by jonjetjon View Post
since it's an attack specifically designed to take up bandwidth and processing power(which i believe letting it get to apache would still use) i would like to add all these ip's to a complete blocklist in the iptables, the problem is, there are about 100 and i want to add them to iptables automatically when they try and access that file.
You can use fail2ban for this

Regards
 
Old 12-02-2014, 04:38 PM   #5
jonjetjon
LQ Newbie
 
Registered: Nov 2014
Posts: 6

Original Poster
Rep: Reputation: Disabled
thank you so much! fail2ban is exactly what i was looking for!
 
  


Reply



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
Allow internal ips block external ips Jz87 Linux - Security 10 07-19-2010 09:42 PM
how to block https for some ips Winanjaya Linux - Security 2 11-30-2009 11:13 PM
want to block some prots on some IPs......? shahg_shahg Linux - Networking 1 07-01-2005 12:38 PM
How to block specific IPs? cranium2004 Linux - Networking 3 04-01-2005 09:02 AM
block all IPs except one how in my setup?? cranium2004 Linux - Networking 3 03-20-2005 03:24 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:31 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