All of lore.kernel.org
 help / color / mirror / Atom feed
From: "J. Bakshi" <joydeep@infoservices.in>
To: Richard Horton <arimus.uk@googlemail.com>
Cc: Jan Engelhardt <jengelh@medozas.de>, netfilter@vger.kernel.org
Subject: Re: ssh overflow blacklisting not working properly
Date: Tue, 30 Mar 2010 13:12:07 +0530	[thread overview]
Message-ID: <4BB1AB4F.4060200@infoservices.in> (raw)
In-Reply-To: <56378e321003290454k3e39a5afo525579d7138c1f40@mail.gmail.com>

On 03/29/2010 05:24 PM, Richard Horton wrote:
>> Could you kindly enlighten me in that direction with possibly little
>> examples.
>>
>>     
> # Generated by iptables-save v1.4.5 on Mon Mar 29 12:04:05 2010
> *filter
> :INPUT ACCEPT [1:68]
> :FORWARD ACCEPT [0:0]
> :OUTPUT ACCEPT [1:68]
> -A INPUT -p tcp -m hashlimit --hashlimit-above 3/min --hashlimit-burst
> 1 --hashlimit-name hashlimit -m state --state NEW -m tcp --dport 22 -j
> MARK --set-xmark 0x1/0xffffffff
> -A INPUT -m recent --rcheck --seconds 600 --name DEFAULT --rsource -j DROP
> -A INPUT -m mark --mark 0x1 -m recent --set --name DEFAULT --rsource -j DROP
> COMMIT
> # Completed on Mon Mar 29 12:04:05 2010
>
> Should do what you're looking for...
>
> Rule 1: Check the hashlimit and if more than 3/min then mark the packets.
>
> Rule 2: Check the recent table to see if the address is in it and has
> been seen in the last 10 mins and drop if it has
>
> Rule 3: If the packet has been marked by rule 1 (actually could be
> combined with rule one just gets to a long line and a mess to explain)
> add the source address (the --set option of recent) and drop.
>
>   

Unfortunately the rules are not working with default DROP iptables :-(



-- 
জয়দীপ বক্সী


  parent reply	other threads:[~2010-03-30  7:42 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-29  7:31 ssh overflow blacklisting not working properly J. Bakshi
2010-03-29  8:18 ` Richard Horton
2010-03-29 10:51   ` J. Bakshi
2010-03-29 11:05     ` Jan Engelhardt
2010-03-29 11:22       ` J. Bakshi
2010-03-29 11:22       ` J. Bakshi
2010-03-29 11:54         ` Richard Horton
2010-03-29 15:10           ` J. Bakshi
2010-03-30  7:42           ` J. Bakshi [this message]
2010-03-30  8:23             ` Richard Horton
2010-03-30  8:52               ` J. Bakshi

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=4BB1AB4F.4060200@infoservices.in \
    --to=joydeep@infoservices.in \
    --cc=arimus.uk@googlemail.com \
    --cc=jengelh@medozas.de \
    --cc=netfilter@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.