sshd: lock password intruders

This is a discussion on sshd: lock password intruders within the Linux Security forums, part of the System Security and Security Related category; is there a way to block a certain ip address for some minutes, if someone tries out several wrong passwords ...


Go Back   Usenet Forums > System Security and Security Related > Linux Security

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 08-25-2004
Stephan Goeldi
 
Posts: n/a
Default sshd: lock password intruders

is there a way to block a certain ip address for some minutes, if someone
tries out several wrong passwords or users?

I have a lot of failed logins and illegal users which I would like to
block for some minutes.
Reply With Quote
  #2 (permalink)  
Old 08-25-2004
NeoSadist
 
Posts: n/a
Default Re: sshd: lock password intruders

Stephan Goeldi wrote:

> is there a way to block a certain ip address for some minutes, if someone
> tries out several wrong passwords or users?
>
> I have a lot of failed logins and illegal users which I would like to
> block for some minutes.


Is IPTables logging them? You could start logging the IPs it's coming from
and, comparing log times, find out who.

--
Miksch's Law:
If a string has one end, then it has another end.

Reply With Quote
  #3 (permalink)  
Old 08-25-2004
Ray Ingles
 
Posts: n/a
Default Re: sshd: lock password intruders

In article <pan.2004.08.25.14.57.19.756716@usable.ch>, Stephan Goeldi wrote:
> is there a way to block a certain ip address for some minutes, if someone
> tries out several wrong passwords or users?
>
> I have a lot of failed logins and illegal users which I would like to
> block for some minutes.


Well, you could have a process that watches the syslogs for sshd errors
(which generally include the IP address), and block them. One way would
be to update the firewall using iptables, or you could use /etc/hosts.deny
if your sshd is compiled with TCP Wrappers support. Should be only a
moderately complicated Perl script.

Personally, I don't let anyone ssh in from the net by default. I have
another program that people need to authenticate to, then it allows that
specific IP address to connect to ssh for a limited time. (If anyone's
curious: "http://ingles.homeunix.org/software/ost/").

--
Sincerely,

Ray Ingles (313) 227-2317

Isn't it funny how Jerry Falwell and Pat Robertson blame the
actions of fanatical religious zealots on 'secular' groups?
Reply With Quote
  #4 (permalink)  
Old 08-25-2004
Mark A. Odell
 
Posts: n/a
Default Re: sshd: lock password intruders

Stephan Goeldi <expires.1.9.04@usable.ch> wrote in
news:pan.2004.08.25.14.57.19.756716@usable.ch:

> is there a way to block a certain ip address for some minutes, if
> someone tries out several wrong passwords or users?


Elsethread I learned to set hosts.deny to ALL: ALL
then set hosts.allow

to

ALL: LOCAL
ALL: 1.2.3. a.b.c.

etc.

--
- Mark ->
--
Reply With Quote
  #5 (permalink)  
Old 08-27-2004
Denver Prophit
 
Posts: n/a
Default Re: lock password intruders

http://www.rfxnetworks.org/bfd.php

Along with their APF firewall blocks and bans brute force attacks ...
password guessers


Reply With Quote
  #6 (permalink)  
Old 08-29-2004
jayjwa
 
Posts: n/a
Default Re: sshd: lock password intruders

On 2004-08-25, Mark A. Odell <odellmark@hotmail.com> wrote:
> Stephan Goeldi <expires.1.9.04@usable.ch> wrote in
> news:pan.2004.08.25.14.57.19.756716@usable.ch:
>
>> is there a way to block a certain ip address for some minutes, if
>> someone tries out several wrong passwords or users?

>
> Elsethread I learned to set hosts.deny to ALL: ALL
> then set hosts.allow
>
> to
>
> ALL: LOCAL
> ALL: 1.2.3. a.b.c.


If you don't want to be quite that restrictive, I've found that

hosts.deny
sshd: UNKNOWN

cuts down alot of them, and also banning all domains you're sure
you're never going to login from

sshd: .cn, .jp, .mil <and so on>

since I don't think I'll be in those places any time soon. All the ssh
scripts that do this I've seen have port 22 hard coded into them, so
moving the SSH port would help alot too, since the people that do this
tend to be idiots that just scan large netblocks looking for a
response from port 22 and nothing else. The tool makes a list of
listening IP's and then they return later to blast away. Most of the
passwords in the files were 8 chars. or under and 99% where dictionary
words. You can protect your sshd with inetd/xinetd, even if it's not
got tcpwrappers support compiled in, because tcpd or xinetd will do
the checking. xinetd also supports access times & rate limits, as well
as auto-bans for anyone hitting a port configured with its SENSOR
option. http://www.xinetd.org/

Make sure to report attacking hosts, it does help. I got a couple of
good responses from admins that I contacted because their host was
attempting bruteforce. Try 'whois' and 'dig' to find IPs, hostnames,
and emails.




--
--- SIGSEGV (Segmentation fault) @ 0 (0) ---
+++ killed by SIGSEGV +++
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 01:48 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0