SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Enthusiast
    Join Date
    Jul 2004
    Location
    Florida
    Posts
    51
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question 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

  2. #2
    Hosting Team Leader silver trophybronze trophy
    cpradio's Avatar
    Join Date
    Jun 2002
    Location
    Ohio
    Posts
    5,058
    Mentioned
    152 Post(s)
    Tagged
    0 Thread(s)
    This may help you http://spamcleaner.org/en/misc/w00tw00t.html, change GET to POST and I think it would apply to your situation
    Be sure to congratulate Patche on earning July's Member of the Month
    Go ahead and blame me, I still won't lose any sleep over it
    My Blog | My Technical Notes

  3. #3
    SitePoint Enthusiast
    Join Date
    Jul 2004
    Location
    Florida
    Posts
    51
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you cpradio!

    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

  4. #4
    Hosting Team Leader silver trophybronze trophy
    cpradio's Avatar
    Join Date
    Jun 2002
    Location
    Ohio
    Posts
    5,058
    Mentioned
    152 Post(s)
    Tagged
    0 Thread(s)
    That rule looks like it would be valid.

    In all honesty, I'm not the best iptables person in the world, so if someone else out there is decent at it, please add your thoughts.
    Be sure to congratulate Patche on earning July's Member of the Month
    Go ahead and blame me, I still won't lose any sleep over it
    My Blog | My Technical Notes

  5. #5
    SitePoint Enthusiast
    Join Date
    Jul 2004
    Location
    Florida
    Posts
    51
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Thumbs up

    Thank you CPRadio for your help.

    Cheers!

    Mapg


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •