Linux Netfilter discussions
 help / color / mirror / Atom feed
From: "J. Bakshi" <joydeep@infoservices.in>
To: Oskar Berggren <oskar.berggren@gmail.com>
Cc: netfilter@vger.kernel.org
Subject: Re:[possible solution]  really need your help about iptables
Date: Wed, 26 Aug 2009 18:06:25 +0530	[thread overview]
Message-ID: <4A952C49.3010206@infoservices.in> (raw)
In-Reply-To: <4A952739.9030605@infoservices.in>

J. Bakshi wrote:
> Oskar Berggren wrote:
>   
>> Use a higher limit for SYN packets to those services. IIRC your
>> ruleset from before.
>>
>> /Oskar
>>   
>>     
>
> Hello,
>
> Thanks for your hint. I have  googled based on your hint and found a lot
> of solution for rate limit incoming connection. one  ruleset  valid for
> me are
>
> ````````````````````````
>  iptables -I INPUT -p tcp --dport 995 -i eth0 -m state --state NEW -m
> recent \
>   --set
>
> iptables -I INPUT -p tcp --dport 995 -i eth0 -m state --state NEW -m
> recent \
>   --update --seconds 60 --hitcount 4 -j DROP
>  
>  iptables -I INPUT -p tcp --dport 995 -i eth0 -j ACCEPT
> `````````````````````````````````
>
> But the problem with my iptables is default policy--> drop.  I have also
> tested with
>
> ````````````
> iptables -A INPUT -i eth0 -m state --state NEW -p tcp --dport 995 -m
> limit --limit 1/minute --limit-burst 2 -j ACCEPT
> ``````````
> This works fine and limiting the connection 1/min but  a brute force
> attack ( like nmap scan) make the port  not useable any more.
>
> What can be the solution for such an iptables ?
>
> Thanks
>
>   

One possible solution might be for a default *dropped* firewall; placing
the incoming rate limit rules before syn flood protection and port
scanner protection rules. Like

````````````````````
rules set to make default polict drop

## limiting incoming pop3s connection
iptables -A INPUT -i eth0 -m state --state NEW -p tcp --dport 995 -m
limit --limit 10/minute --limit-burst 2 -j ACCEPT

 limiting other incoming connection

ruleset for syn-flood  prevention

ruleset to delayed nmap scan etc...

````````````````````````

Please suggest if my approach is right.

Thanks


>   
>> 2009/8/25 J. Bakshi <joydeep@infoservices.in>:
>>   
>>     
>>> Dear list,
>>>
>>> I really really need your help to configure iptables to cope with
>>> "connection time out problem"  Here what actually the situation is.
>>>
>>> I have configured iptables to drop nmap and other port scanning
>>> techniques ( collected from internet, like XMAS scan, FIN scan etc...).
>>> If I run nmap against the server ( like nmap -P0 <myserver> or nmap -P0
>>> -sT <myserver> ) then the firewall successfully dropping the scan
>>> packets and  make the nmap scan  to wait for *looooong* .  Good.  But on
>>> the other hand  the  http and mail server running on the  server
>>> providing "time out error" hence it is not possible to connect the mail
>>> /apache and other services running on that  server during port scanning
>>> against it. Could any one kindly suggest how to cope with this situiation ?
>>>
>>> Thanks for your time.
>>> --
>>> To unsubscribe from this list: send the line "unsubscribe netfilter" in
>>> the body of a message to majordomo@vger.kernel.org
>>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>>>
>>>     
>>>       
>>   
>>     
>
>
>   


      reply	other threads:[~2009-08-26 12:36 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-25 11:33 really need your help about iptables J. Bakshi
2009-08-25 12:27 ` Problem with statistic module nth mode John Lister
2009-08-25 12:48   ` Patrick McHardy
2009-08-25 12:55     ` John Lister
2009-09-02  9:23     ` Checking line status John Lister
2009-09-02 10:23       ` Gáspár Lajos
2009-09-02 11:21         ` John Lister
2009-09-02 12:47       ` Thomas Jacob
2009-09-02 13:54         ` John Lister
2009-09-02 14:02         ` John Lister
2009-09-02 14:29           ` Pascal Hambourg
2009-09-02 14:42             ` John Lister
2009-09-02 15:16               ` Pascal Hambourg
2009-09-02 16:48                 ` John Lister
2009-09-02 14:30           ` Thomas Jacob
2009-09-02 15:02             ` John Lister
2009-09-02 14:13       ` Tormod Nygård
2009-08-25 14:09 ` really need your help about iptables Oskar Berggren
2009-08-26 12:14   ` J. Bakshi
2009-08-26 12:36     ` J. Bakshi [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A952C49.3010206@infoservices.in \
    --to=joydeep@infoservices.in \
    --cc=netfilter@vger.kernel.org \
    --cc=oskar.berggren@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox