Gentoo Archives: gentoo-user

From: Brian Parish <brian@×××××××××××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Need a script that will add pwdfail IPs to shorewall blacklist
Date: Sun, 18 Sep 2005 04:15:29
Message-Id: 200509181410.59833.brian@univexsystems.com
In Reply to: [gentoo-user] Need a script that will add pwdfail IPs to shorewall blacklist by Daevid Vincent
1 On Sunday 18 September 2005 13:36, Daevid Vincent wrote:
2 > I was poking around my system today and noticed a log that I never knew
3 > existed.
4 >
5 > /var/log/pwdfail/*
6 >
7 > Much to my surprise, I see all these entries (hundreds) from some 'blankety
8 > blank blank' trying to hack my server!!
9 >
10 > daevid pwdfail # cat current
11 > Sep 17 13:00:25 [sshd(pam_unix)] authentication failure; logname= uid=0
12 > euid=0 tty=ssh ruser= rhost=61.103.229.40
13 > Sep 17 13:00:27 [sshd] Failed password for invalid user webmaster from
14 > 61.103.229.40 port 49431 ssh2
15 > Sep 17 13:00:29 [sshd(pam_unix)] authentication failure; logname= uid=0
16 > euid=0 tty=ssh ruser= rhost=61.103.229.40
17 > Sep 17 13:00:31 [sshd] Failed password for invalid user oracle from
18 > 61.103.229.40 port 49556 ssh2
19 > Sep 17 13:00:33 [sshd(pam_unix)] authentication failure; logname= uid=0
20 > euid=0 tty=ssh ruser= rhost=61.103.229.40
21 > Sep 17 13:00:35 [sshd] Failed password for mysql from 61.103.229.40 port
22 > 49660 ssh2
23 > Sep 17 13:00:37 [sshd(pam_unix)] authentication failure; logname= uid=0
24 > euid=0 tty=ssh ruser= rhost=61.103.229.40 user=root
25 > Sep 17 13:00:39 [sshd] Failed password for root from 61.103.229.40 port
26 > 49769 ssh2
27 > Sep 17 13:00:41 [sshd(pam_unix)] authentication failure; logname= uid=0
28 > euid=0 tty=ssh ruser= rhost=61.103.229.40 user=root
29 > Sep 17 13:00:43 [sshd] Failed password for root from 61.103.229.40 port
30 > 49879 ssh2
31 >
32 > I figure there should be a script someone has written that will parse this
33 > and automatically add these unique IP addresses (sans redundant ones) to my
34 > /etc/shorewall/blacklist
35 >
36 > Google for "shorewall pwdfail" doesn't have very many results though, and
37 > the ones there are in german or something.
38
39 Yes, I see that on all our servers. Not much more than an annoyance unless
40 you have stupidly obvious passwords, but annoying for sure. On customer
41 servers that don't require access from the everywhere and anywhere I just
42 configure hosts.allow and hosts.deny to drop traffic from all but known
43 addresses, but this is of course not an option for a webserver or whatever.
44
45 There have been lots of discussions on various lists about handling these
46 brute force ssh scripts, with various strategies for having iptables rules
47 limit login attempts after three unsuccessful attempts, but I've seen as many
48 "it didn't work for me" posts as "do it this way" and not being a firewall
49 guru, I've sat on the fence so far.
50
51 I think the problem with just blacklisting IPs is that the list will just grow
52 and grow as these cretins move around all the time.
53
54 Oh for a small incendiary device that could be targeted by IP address! ;-)
55
56 --
57 best regards
58 Brian
59 ------------
60 Brian Parish
61 Managing Director
62 Univex Systems Pty Ltd
63 Phone: 1300 73 64 54
64 --
65 gentoo-user@g.o mailing list

Replies