On Wed, 22 Feb 2006 18:50:39 +0000, Smythe de Winter wrote:
> On Wed, 22 Feb 2006 16:35:02 +0000, Paul Black wrote:
>> Smythe de Winter wrote:
>>> On Wed, 22 Feb 2006 15:53:17 +0000, Paul Black wrote:
>>>> Smythe de Winter wrote:
>>>>> I am using the following IPTables rules in order to foil dictionary
>>>>> attacks on my SSH server:
>>>> You might try solving the problem in a slightly different way:
>>>> http://www.denyhosts.net/
>>>
>>> Thanks for your suggestion. It is not clear to me that this will solve
>>> my problem.
Well, actually i would think none off the suggestions i have read sofar
(with the exeption of pubkey auth) would really "solve" dictionary cq
brute-force attacks. Using the S/Key (such as the pam_opie module) would
probably be better still. Rather then SSH into some box directly tough,
something like a OpenVPN gateway could be preferable as frontent as well.
>>> In addition, I find this solution too big, inelegant,
>>> intrusive and significantly less performant than an IPTables one like
>>> the above. Yes, I am not all that impressed by it.
Maybe have a look at the OpenSSH Timelox instead then:
http://wwwx.cs.unc.edu/~hays/dev/timelox_and_TheHand/
>> Why too big? It's a single script that reads a log file and adds
>> entries to /etc/hosts.deny for TCP Wrappers to use.
>>
>> Why inelegant?
>> Why intrusive?
>> Why less performance?
>>
>> Don't see where you get these issues from.
>
> I don't want to start a controversy here, especially bearing in mind
> that your intention was to help, for which I am grateful to you.
>
> I find the DenyHosts solution inelegant because of its requirements:
> Python (big and slow) and SSH with tcp_wrappers support (which I don't
> have);
Why not? It takes next to *no* resorces if hosts.{allow,deny} are empty...
> intrusive, because of its automatic modifications of
> /etc/hosts.deny; less performant, because of its use of tcp_wrappers
> (which, nice as they are, in my experience tend to slow things down),
The _only_ thing they might slowdown is the initial connection stage. And
more often then not, it's either reverse-dns-lookup or an ident-query that
makes one wait.
For the latter, either have clients return what's expected (RST?), or
disable the - default 5sec - delay with like: spawn ( /bin/true & )
For the former: the hosts file + local DNS cache probably does the trick:
http://groups.google.nl/group/alt.os...e0326ffefab0a5
Ofter that stage is done with, firewall-rules (such as the iptables you
posted) will still "slow things down" to some extend - sinse of every
packet atleast the headers are inspected still (however unnoticeable on
modern PC hardware) - not so with libwrap ACLs...
[snip]
--
-Menno.