hosted by liquidweb


Go Back   Web Hosting Talk : Web Hosting Main Forums : Hosting Security and Technology : iptables - block empty user agents
Reply

Hosting Security and Technology Configuring and optimizing web hosting servers and operating systems, developing administration scripts, building servers, protecting against hackers, and general security (SSL certificates, etc.)
Forum Jump

iptables - block empty user agents

Reply Post New Thread In Hosting Security and Technology Subscription
 
Send news tip View All Posts Thread Tools Search this Thread Display Modes
  #1  
Old 09-09-2009, 03:59 PM
SysTeam SysTeam is offline
Junior Guru Wannabe
 
Join Date: May 2007
Posts: 66

iptables - block empty user agents


How to block requests with empty user agents using iptables firewall?

Reply With Quote


Sponsored Links
  #2  
Old 09-09-2009, 04:42 PM
nomankhn nomankhn is offline
Aspiring Evangelist
 
Join Date: Sep 2007
Posts: 361
*

Quote:
Originally Posted by SysTeam View Post
How to block requests with empty user agents using iptables firewall?
iptables is not use for that purpose, use modsecurity or block via apache,

here is example to block via apache with modrewrite.


<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP_USER_AGENT} [regex to match user agent]
RewriteRule ^/.* - [F]
</IfModule>

Just keep in mind that user agents can always be spoofed, so there's nothing keeping the "attacker" from pretending to be Googlebot, Firefox, MSIE, or any other browser or "good" bot. For that matter, blocking by IP only works so long as the "attacker" is using the same IP; if an attack comes from a botnet with thousands of zombie hosts, there's not a lot you can do about that.

__________________
Thanks,
Noman
noman@linuxonsupport.com
O Canada, we stand on guard for thee

Reply With Quote
  #3  
Old 09-09-2009, 05:04 PM
SysTeam SysTeam is offline
Junior Guru Wannabe
 
Join Date: May 2007
Posts: 66
I successfully block DDoS attack (10000+ bots) using only user agent filters in iptables. Now, my webserver (nginx) still handle requests from bots (without user agents). Nginx block this requests, but would be much more effective to block using iptables.

Reply With Quote
Sponsored Links
  #4  
Old 09-09-2009, 05:09 PM
khunj khunj is offline
Web Hosting Guru
 
Join Date: Mar 2009
Location: /home/khunj
Posts: 313
Quote:
Originally Posted by SysTeam View Post
How to block requests with empty user agents using iptables firewall?
You can't because if there's none, there's nothing to do; iptables won't find it.
You can use mod_Security as mentionned above.

__________________
NinTechNet : IT Security, Virus & Hacking Recovery, Monitoring

Reply With Quote
  #5  
Old 09-09-2009, 05:13 PM
nomankhn nomankhn is offline
Aspiring Evangelist
 
Join Date: Sep 2007
Posts: 361
*

Quote:
Originally Posted by SysTeam View Post
I successfully block DDoS attack (10000+ bots) using only user agent filters in iptables.

Please describe bit more.

__________________
Thanks,
Noman
noman@linuxonsupport.com
O Canada, we stand on guard for thee

Reply With Quote
Reply

Similar Threads
Thread Thread Starter Forum Replies Last Post
CSF enabled but Iptables empty! sOliver Hosting Security and Technology 10 02-20-2008 02:20 AM
modsecurity, empty referer, empty user agent P Lao Hosting Security and Technology 2 06-23-2006 08:33 PM
iptables cant block ip Dmitry85 Hosting Security and Technology 6 06-15-2006 07:33 AM
block bad spiders/bots/agents torwill Hosting Security and Technology 3 06-17-2005 03:26 PM
iptables block ssh for certain ips and allow for others nightduke Hosting Security and Technology 6 06-03-2005 01:41 PM

Related posts from TheWhir.com
Title Type Date Posted
Mozilla Firefox 23 Will Block Mix SSL Content by Default Web Hosting News 2013-04-12 11:39:07
Liquid Web Updates Block Storage, Adding Scale, Cross Mounting Web Hosting News 2012-12-14 16:17:44
Liquid Web Block Storage Offering Provides Flexible, Affordable Storage Option Web Hosting News 2012-11-20 15:03:47
Rackspace Launches OpenStack-Powered Cloud Block Storage Solution Web Hosting News 2012-10-23 10:16:40
Cloud Startup Nutanix Launches New Storage Cluster Software Web Hosting News 2011-08-16 16:43:04


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes
Postbit Selector

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

Forum Jump
Login:
Log in with your username and password
Username:
Password:



Forgot Password?
Advertisement:
Web Hosting News:



 

X

Welcome to WebHostingTalk.com

Create your username to jump into the discussion!

WebHostingTalk.com is the largest, most influentual web hosting community on the Internet. Join us by filling in the form below.


(4 digit year)

Already a member?