Security and Cryptography
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsSystem AdministrationSecurity and Cryptography

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old September 7th, 2012, 04:18 AM
mapg mapg is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 198 mapg User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 20 h 56 sec
Reputation Power: 10
Red face IPTables to Drop HTTP POST traffic

Hi,

I hope that somebody might help me with this.

I would like to know some iptables rule to drop all external traffic coming to port 80 in my domain (IP) using the HTTP header POST.

.. namely, droping the connection for any kind of post done by people in a specific website, and using IPtables instead of doing it with Apache.

Seems there is a "string" command in IPTables to regex this, so I think it's possible.

In summary, a translation of the following to the firewall language ...
Code:
<Limit POST>
order deny,allow
deny from all
</Limit>
Is this possible?

Thank you very much in advance.

Mapg

Last edited by mapg : September 7th, 2012 at 04:23 AM.

Reply With Quote
  #2  
Old September 7th, 2012, 10:42 AM
OmegaZero OmegaZero is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: May 2007
Posts: 737 OmegaZero User rank is General (90000 - 100000 Reputation Level)OmegaZero User rank is General (90000 - 100000 Reputation Level)OmegaZero User rank is General (90000 - 100000 Reputation Level)OmegaZero User rank is General (90000 - 100000 Reputation Level)OmegaZero User rank is General (90000 - 100000 Reputation Level)OmegaZero User rank is General (90000 - 100000 Reputation Level)OmegaZero User rank is General (90000 - 100000 Reputation Level)OmegaZero User rank is General (90000 - 100000 Reputation Level)OmegaZero User rank is General (90000 - 100000 Reputation Level)OmegaZero User rank is General (90000 - 100000 Reputation Level)OmegaZero User rank is General (90000 - 100000 Reputation Level)OmegaZero User rank is General (90000 - 100000 Reputation Level)OmegaZero User rank is General (90000 - 100000 Reputation Level)OmegaZero User rank is General (90000 - 100000 Reputation Level)OmegaZero User rank is General (90000 - 100000 Reputation Level)OmegaZero User rank is General (90000 - 100000 Reputation Level) 
Time spent in forums: 3 Weeks 5 Days 1 m 12 sec
Reputation Power: 928
Where are you stuck?

If you're looking for the documentation, search for "--string" in the iptables man page. If your system doesn't have the man pages installed, searching for "man iptables" finds several copies on line.

If you've tried a rule that isn't working, what command did you try? What errors/or unexpected behavior are you seeing?


Any particular reason why you're doing this in the firewall? The webserver should have better controls to disallow requests and I'd be worried about adding a "HEADER.PNG" to a page and send things crashing down.
__________________
sub{*{$::{$_}}{CODE}==$_[0]&& print for(%:: )}->(\&Meh);

Reply With Quote
  #3  
Old September 7th, 2012, 12:23 PM
mapg mapg is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 198 mapg User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 20 h 56 sec
Reputation Power: 10
Thank you OmegaZero. It's a long story.

Is this rule correct?

iptables -I INPUT -d my_server_ip -p tcp --dport 80 -m string --string 'POST /' --algo bm -j DROP

Thank you!

Mapg

Reply With Quote
  #4  
Old September 8th, 2012, 05:18 PM
OmegaZero OmegaZero is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: May 2007
Posts: 737 OmegaZero User rank is General (90000 - 100000 Reputation Level)OmegaZero User rank is General (90000 - 100000 Reputation Level)OmegaZero User rank is General (90000 - 100000 Reputation Level)OmegaZero User rank is General (90000 - 100000 Reputation Level)OmegaZero User rank is General (90000 - 100000 Reputation Level)OmegaZero User rank is General (90000 - 100000 Reputation Level)OmegaZero User rank is General (90000 - 100000 Reputation Level)OmegaZero User rank is General (90000 - 100000 Reputation Level)OmegaZero User rank is General (90000 - 100000 Reputation Level)OmegaZero User rank is General (90000 - 100000 Reputation Level)OmegaZero User rank is General (90000 - 100000 Reputation Level)OmegaZero User rank is General (90000 - 100000 Reputation Level)OmegaZero User rank is General (90000 - 100000 Reputation Level)OmegaZero User rank is General (90000 - 100000 Reputation Level)OmegaZero User rank is General (90000 - 100000 Reputation Level)OmegaZero User rank is General (90000 - 100000 Reputation Level) 
Time spent in forums: 3 Weeks 5 Days 1 m 12 sec
Reputation Power: 928
It looks fine to me, but that's not saying anything. Run it against a *nix box and test it to know for sure.

Reply With Quote
  #5  
Old September 9th, 2012, 03:33 AM
mapg mapg is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 198 mapg User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 20 h 56 sec
Reputation Power: 10
Thank you OmegaZero for your help.

Cheers!

Mapg

Reply With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationSecurity and Cryptography > IPTables to Drop HTTP POST traffic

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap