All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steven M Campbell <Netfilter@SCampbell.net>
To: "Taylor, Grant" <gtaylor@riverviewtech.net>
Cc: iptables <netfilter@lists.netfilter.org>
Subject: Re: SSH Brute force attacks - Script version 1.0
Date: Mon, 25 Jul 2005 15:41:33 -0400	[thread overview]
Message-ID: <42E5406D.9080406@SCampbell.net> (raw)
In-Reply-To: <429F4F47.8050301@riverviewtech.net>

Taylor, Grant wrote:
># NetFilter MailList SSH_Brute_Force Chain version 1.0.
>iptables -A INPUT -p tcp --dport 22 -m state --state NEW -m recent --name SSH --set --rsource -j SSH_Brute_Force
>iptables -A SSH_Brute_Force -s $My_Home_Firewall_IP -j RETURN
>iptables -A SSH_Brute_Force -s $My_Office_Firewall_IP -j RETURN
>iptables -A SSH_Brute_Force -s $My_Girlfriends_Firewall_IP list -j RETURN
>iptables -A SSH_Brute_Force -m recent ! --rcheck --seconds 60 --hitcount 3 --name SSH --rsource -j RETURN 
>iptables -A SSH_Brute_Force -j LOG --log-prefix "SSH Brute Force Attempt:  "
>iptables -A SSH_Brute_Force -p tcp -j TARPIT
>
>  
Thanks, that is most informative.  Here's an (hopefully) interesting 
twist on that:

-A INPUT -p tcp -m tcp --dport 22 -m state --state NEW -m recent --set 
--name SSH --rsource -j SSH
-A SSH -m recent --rcheck --seconds 300 --hitcount 7 --name SSH 
--rsource -j DROP
-A SSH -m recent --rcheck --seconds 30 --hitcount 4 --name SSH --rsource 
-j RETURN
-A SSH -j DROP

Now we must make 3 failed attempts to connect within 30 seconds then the 
4'th through 7'th attempts will be allowed.  Further attempts will not 
be allowed until 5 minutes of idle time.   Port scanners should blow 
right past this thinking "the port is closed", you can still get in by 
doing multiple attempts and anyone who does figure it out still can only 
issue 4 brute attempts every 5 minutes.




  reply	other threads:[~2005-07-25 19:41 UTC|newest]

Thread overview: 83+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-06 15:57 SSH Brute force attacks Brent Clark
2005-05-06 16:40 ` Mogens Valentin
2005-05-06 19:29 ` R. DuFresne
2005-05-07  5:14 ` Taylor, Grant
2005-05-10 14:01   ` Eric Wood
2005-05-11 12:35   ` Brent Clark
2005-05-11 18:21     ` Taylor, Grant
2005-05-11 19:04       ` Pete Toscano
2005-05-11 19:15         ` Taylor, Grant
2005-05-11 19:30           ` Pete Toscano
2005-05-11 20:34             ` Jason Opperisano
2005-05-13 21:31               ` okay, I admit confusion here; R. DuFresne
2005-05-13 21:55                 ` Jason Opperisano
2005-05-16 17:40                   ` R. DuFresne
2005-05-16 20:55                     ` Taylor, Grant
2005-05-16 21:05                 ` Taylor, Grant
2005-05-14  7:02               ` SSH Brute force attacks Georgi Alexandrov
2005-05-14 15:47                 ` Jason Opperisano
2005-05-15 20:12                 ` Patrick Nelson
2005-05-17  0:49                   ` Charlie Brady
2005-05-14  9:08       ` Łukasz Hejnak
2005-05-14 19:08         ` Taylor, Grant
2005-05-16  8:16           ` Łukasz Hejnak
2005-05-17  1:05             ` Charlie Brady
2005-05-17  5:00               ` Łukasz Hejnak
2005-05-17  5:19                 ` Łukasz Hejnak
     [not found]                   ` <42898402.10507@eccotours.dyndns.org>
2005-05-17 12:44                     ` Łukasz Hejnak
2005-05-17 13:20                       ` Brent Clark
2005-05-17 13:36                         ` Sadus .
2005-05-17 16:06                           ` Łukasz Hejnak
2005-05-17 15:21                         ` Taylor, Grant
2005-05-18 12:39                       ` Brent Clark
2005-05-19  4:55                         ` Taylor, Grant
2005-05-19  9:05                           ` Brent Clark
2005-05-19 14:39                             ` Taylor, Grant
2005-05-20 13:01                               ` Brent Clark
2005-05-20 14:53                                 ` Taylor, Grant
2005-05-23 16:31                                   ` Brent Clark
2005-06-02 16:13                                     ` Sadus .
2005-06-02 16:43                                       ` Taylor, Grant
2005-06-02 19:18                                         ` Sadus .
2005-06-13 14:39                                           ` Taylor, Grant
2005-06-13 16:17                                             ` Patrick Nelson
2005-06-13 16:27                                             ` /dev/rob0
2005-06-13 19:00                                             ` R. DuFresne
2005-05-18 16:54                       ` Jim Miller
2005-05-18 17:51                         ` Łukasz Hejnak
2005-05-19  2:09                         ` Taylor, Grant
2005-05-21  8:00                       ` Пётр Волков Александрович
2005-05-21 22:37                         ` Taylor, Grant
2005-05-22  7:11                           ` Пётр Волков Александрович
2005-05-22 10:09                           ` Marius Mertens
2005-05-22 10:57                             ` Łukasz Hejnak
2005-05-23 16:14                               ` Taylor, Grant
2005-05-17  6:55               ` Taylor, Grant
     [not found]                 ` <1116333615.24331.4.camel@debianbox>
2005-05-17 15:25                   ` Taylor, Grant
2005-05-23 16:53               ` Taylor, Grant
2005-05-24 16:19                 ` Marius Mertens
2005-05-25  5:35                 ` Brent Clark
2005-05-25  8:48                   ` Marius Mertens
2005-05-25 18:10                   ` Taylor, Grant
2005-05-26 11:17                     ` Brent Clark
2005-05-31  4:12                       ` Taylor, Grant
2005-05-31 10:06                         ` Brent Clark
2005-05-31 14:17                           ` Taylor, Grant
2005-05-28 23:24                 ` Sebastian Siewior
2005-05-29  1:01                   ` Taylor, Grant
2005-05-07  5:32 ` Taylor, Grant
2005-05-08 15:20   ` Alistair Tonner
2005-05-08 18:51     ` Dwayne Hottinger
2005-05-08 22:57       ` Alexander Samad
2005-05-09  5:41         ` Taylor, Grant
2005-05-09  5:46     ` Taylor, Grant
2005-06-02 18:26 ` SSH Brute force attacks - Script version 1.0 Taylor, Grant
2005-07-25 19:41   ` Steven M Campbell [this message]
2005-07-26  6:18     ` Jan Engelhardt
  -- strict thread matches above, loose matches on Subject: below --
2005-06-25 18:58 curby .
2005-06-25 23:54 ` Marius Mertens
2005-06-26 20:46   ` Jan Engelhardt
2005-06-27  8:18     ` Marius Mertens
2005-06-27 15:53       ` curby .
2005-06-27 16:09         ` Stephen Frost
2005-06-27  6:24   ` curby .

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=42E5406D.9080406@SCampbell.net \
    --to=netfilter@scampbell.net \
    --cc=gtaylor@riverviewtech.net \
    --cc=netfilter@lists.netfilter.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.