On Thu, 09 Mar 2006 02:19:20 GMT, Robby Workman <(E-Mail Removed)> wrote:
>On 2006-03-08, Steven Jones <(E-Mail Removed)> wrote:
>> I am looking for iptables rules to do the following:
>> If, on the other hand, the connection attempt succeeds, then that IP
>> address is free to start as many (successful) SSH connections within the
>> next 60 seconds (and beyond, in fact).
To OP:
So, once you're cracked you're screwed, that's how you want it?
>> Is this possible? I am aware of numerous iptables rules that can do
>> something similar. The catch is that they can't tell whether or not a
>> connection attempt was unsuccessful.
A shell script may directly load --recent's named tables with IP addresses
as a feedback mechanism:
grant@deltree:~$ for x in /proc/net/ipt_recent/*; do echo $(basename $x); cat $x; done
calm
src=68.200.42.52 ttl: 109 last_seen: 31731944 oldest_pkt: 1 last_pkts: 31731944
src=83.247.32.72 ttl: 43 last_seen: 32150622 oldest_pkt: 1 last_pkts: 32150622
deny
src=68.142.251.128 ttl: 52 last_seen: 31027663 oldest_pkt: 0 last_pkts: 28973057, 31027663
src=68.142.250.77 ttl: 52 last_seen: 28973092 oldest_pkt: 1 last_pkts: 28973092
src=72.30.111.140 ttl: 51 last_seen: 35948801 oldest_pkt: 0 last_pkts: 29281661, 35948801
....
233 lines
>Hmmm... I'm not taking into account the possible cpu overhead related
>to doing this, but you can likely work up something the the recent
>match:
grant@deltree:~$ uptime
15:31:04 up 4 days, 7:39, 4 users, load average: 0.00, 0.00, 0.00
This on a Pentium classic/233 with 128MB RAM, but I'm on a small
connection, I've not noticed --recent loading CPU too much
One may adjust how many visits per IP are stored, I use 400 x 2
(entries x visits) per named table (for data collection by class),
eg:
Classify junk:
66 drop MSFT exploit port, repeat
52 reject MSFT exploit port, new
10 drop probe from privileged port, new
8 drop deny access from ban list, repeat
7 reject deny access from ban list, new
6 drop probe from privileged port, repeat
6 reject random port, new
2 drop random port, repeat
1 pong ping touch
Grant.
--
Cats are smarter than dogs. You can't make eight cats pull
a sled through the snow.