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: Mon, 29 Mar 2010 20:40:23 +0530 [thread overview]
Message-ID: <20100329204023.1a142628@shiva.selfip.org> (raw)
In-Reply-To: <56378e321003290454k3e39a5afo525579d7138c1f40@mail.gmail.com>
On Mon, 29 Mar 2010 12:54:53 +0100
Richard Horton <arimus.uk@googlemail.com> 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.
many many thanks for the example and clarification. I must give it a try, though my firewall is default DROP, but I am eager to see the result.
with regards
next prev parent reply other threads:[~2010-03-29 15:10 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 [this message]
2010-03-30 7:42 ` J. Bakshi
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=20100329204023.1a142628@shiva.selfip.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox