Gentoo Archives: gentoo-security

From: Mans Matulewicz <cybermans@××××××.nl>
To: gentoo-security@l.g.o
Subject: Re: [gentoo-security] blocking SSH probes
Date: Mon, 09 Aug 2004 07:44:30
Message-Id: 10725.62.58.7.66.1092037447.squirrel@webmail.xs4all.nl
In Reply to: [gentoo-security] blocking SSH probes by Andrew Gaffney
1 since iptables 1.2.9 release there is an option to use rules at specific
2 times:
3
4 # iptables -A INPUT -m time --timestart 8:00 --timestop 18:00 --days
5 Mon,Tue,Wed,Thu,Fri -j ACCEPT
6
7 # iptables --list
8 Chain INPUT (policy ACCEPT)
9 target prot opt source destination
10 ACCEPT all -- anywhere anywhere TIME from 8:0 to 18:0
11 on Mon,Tue,Wed,Thu,Fri
12
13
14 http://www.netfilter.org/documentation/HOWTO//netfilter-extensions-HOWTO-3.html#ss3.19
15
16 Maybe you can deny access from unknown ip's during non business hours
17 (local).
18
19
20
21 > I'm getting really annoyed with these SSH probes. While I don't have any
22 > weak
23 > accounts, I still want to cover myself. I want to add an iptables DROP
24 > rule for
25 > 1 minute for any IP that has a failed login through SSH. I already have
26 > metalog
27 > set to run a script which emails me whenever there is a failed login
28 > attempt
29 > (I've had this for a while). Can I just add:
30 >
31 > iptables -A INPUT -s $IP_OF_PROBE -j DROP # to make their scans slower
32 > sleep 60s
33 > iptables -D INPUT -s $IP_OF_PROBE -j DROP
34 >
35 > to the end of my script? I want it at one minute in case I'm logging in
36 > via SSH
37 > from a computer where I don't have keys setup and I accidentally type the
38 > wrong
39 > password ;) Is there a problem with this idea?
40 >
41 > --
42 > Andrew Gaffney
43 > Network Administrator
44 > Skyline Aeronautics, LLC.
45 > 636-357-1548
46 >
47 >
48 > --
49 > gentoo-security@g.o mailing list
50 >
51 >
52
53
54 --
55 gentoo-security@g.o mailing list

Replies

Subject Author
Re: [gentoo-security] blocking SSH probes Andreas Waschbuesch <awaschb@××××.de>