Skip to contentSkip to conversation

help me

DISCUSSION bash 4 participants 9 messages Mar 29, 2006 – Mar 30, 2006

lore
Share & tools
lore

bash

author
#0 lore raw

Hello All,

I wanna dynamically block some ip's that load my router with --state NEW packets (usually it's generated by very aggressive NetLook win program). But there is a problem -m limit will block all my router's user, and I wanna block just one ip :/

Signature · 1 line
Biomechanica Artificial Sabotage Humanoid
#1 lore raw
Quoted 6 lines · bash

Hello All,

I wanna dynamically block some ip's that load my router with --state NEW packets (usually it's generated by very aggressive NetLook win program). But there is a problem -m limit will block all my router's user, and I wanna block just one ip :/

I'm not entirely sure of what you want to do. Why can you not match source? If you want, match the one IP and send all traffic for that IP to a user defined chain, e.g., :
iptables -A FORWARD -s 10.1.1.100 -j SpecialChain
iptables -A SpecialChain -j DOWHATEVERYOUWANT

If it is that you want to exempt certain addresses, send all the packets to a user defined chain and return the exemptions, e.g.,

iptables -A FORWARD -j LimitChain
iptables -A LimitChain -m iprange --src-range 10.1.1.70-10.1.1.223 -j RETURN
iptables -A LimitChain -j LOG, DROP, LIMIT, WHATEVERYOUWANTTODO

Signature · 8 lines
John A. Sullivan III
Open Source Development Corporation
+1 207-985-7880
[email protected]

If you would like to participate in the development of an open source
enterprise class network security management system, please visit
http://iscs.sourceforge.net
author
#2 lore raw
Quoted 13 lines · On Tue, 28 Mar 2006 20:50:51 -0500 "John A. Sullivan III"…
Quoted 6 lines · bash

Hello All,

I wanna dynamically block some ip's that load my router with --state NEW packets (usually it's generated by very aggressive NetLook win program). But there is a problem -m limit will block all my router's user, and I wanna block just one ip :/

I'm not entirely sure of what you want to do. Why can you not match source? If you want, match the one IP and send all traffic for that IP to a user defined chain, e.g., :
iptables -A FORWARD -s 10.1.1.100 -j SpecialChain
iptables -A SpecialChain -j DOWHATEVERYOUWANT

Quoted 7 lines

If it is that you want to exempt certain addresses, send all the packets to a user defined chain and return the exemptions, e.g.,

iptables -A FORWARD -j LimitChain
iptables -A LimitChain -m iprange --src-range 10.1.1.70-10.1.1.223 -j RETURN
iptables -A LimitChain -j LOG, DROP, LIMIT, WHATEVERYOUWANTTODO

The problem is that I don't know IP of this machine.... And anyone in my net can run NetLook program... So i want that - if some-one in my net exceed limit then iptables will block this ip dynamically....

Signature · 1 line
Biomechanica Artificial Sabotage Humanoid
#3 lore raw

Re: help me (nfcan: addressed to exclusive sender for this address)

Quoted 19 lines · On 2006.03.28 22:29, bash - [email protected] wrote:
Quoted 16 lines · On Tue, 28 Mar 2006 20:50:51 -0500 "John A. Sullivan III"…
Quoted 6 lines · bash

Hello All,

I wanna dynamically block some ip's that load my router with --state NEW packets (usually it's generated by very aggressive NetLook win program). But there is a problem -m limit will block all my router's user, and I wanna block just one ip :/

I'm not entirely sure of what you want to do. Why can you not match source? If you want, match the one IP and send all traffic for that IP to a user defined chain, e.g., :
iptables -A FORWARD -s 10.1.1.100 -j SpecialChain
iptables -A SpecialChain -j DOWHATEVERYOUWANT

If it is that you want to exempt certain addresses, send all the packets to a user defined chain and return the exemptions, e.g.,

Quoted 8 lines
Quoted 4 lines

iptables -A FORWARD -j LimitChain
iptables -A LimitChain -m iprange --src-range 10.1.1.70-10.1.1.223 -j RETURN
iptables -A LimitChain -j LOG, DROP, LIMIT, WHATEVERYOUWANTTODO

The problem is that I don't know IP of this machine.... And anyone in my net can run NetLook program... So i want that - if some-one in my net exceed limit then iptables will block this ip dynamically....

I am not an expert on this,
but for what it is worth:

Perhaps the rules used to detect
and limit brute force ssh attacks
could be adapted to your need.

Does NetLook have a predictable pattern?

You can find out about the ssh blocking rules
if you search the archives for 'brute force'.

Hope that helps.

Signature · 4 lines
Jim Laurino
[email protected]
Please reply to the list.
Only mail from the listserver reaches this address.
author
#4 lore raw

Re: help me (nfcan: addressed to exclusive sender for this address)

Quoted 6 lines · On Tue, 28 Mar 2006 23:22:26 -0500 Jim Laurino <[email protected]> wrote:

I am not an expert on this,
but for what it is worth:

Perhaps the rules used to detect
and limit brute force ssh attacks could be adapted to your need.

You are talking about "recent" module... I don't know how I can use it in my situation....

Quoted 1 line

Does NetLook have a predictable pattern?

Forget about NetLook...

My criteria for blocking is:
if rate of SYN packages from ONE source IP is greater then 3packets/sec => then block this IP

And i can't add rule "-m limit" per all source IP in my net, because my net is big (~255^3)....

Quoted 4 lines

You can find out about the ssh blocking rules if you search the archives for 'brute force'.

Hope that helps.

Signature · 1 line
Biomechanica Artificial Sabotage Humanoid
#5 lore raw

RE: help me (nfcan: addressed to exclusive sender for this address)

Quoted 12 lines
Quoted 6 lines

I am not an expert on this,
but for what it is worth:

Perhaps the rules used to detect
and limit brute force ssh attacks
could be adapted to your need.

You are talking about "recent" module... I don't know how I can use it in my situation....

Quoted 1 line

Does NetLook have a predictable pattern?

Quoted 8 lines

Forget about NetLook...

My criteria for blocking is:
if rate of SYN packages from ONE source IP is greater then 3packets/sec => then block this IP

And i can't add rule "-m limit" per all source IP in my net, because my net is big (~255^3)....

Wouldn't that look something like :

$ipt -A [INPUT|FORWARD] -i $IF_LAN -m state --state NEW -s $LAN_NET \
-p tcp --syn -m limit --limit 3/sec -j ACCEPT

This would match NEW packets on your LAN interface with SYN set, coming from any of your LAN IP's and not allowing more than 3 of these per second. Of course, you'd also need a rule like this to allow the complete connection :

$ipt -A [INPUT|FORWARD] -m state --state RELATED,ESTABLISHED -j ACCEPT

Or am I missing something ?

Gr,
Rob

author
#6 lore raw

Re: help me (nfcan: addressed to exclusive sender for this address)

Quoted 18 lines · On Wed, 29 Mar 2006 20:28:53 +0200 "Rob Sterenborg" <[email protected]> wrote:
Quoted 18 lines
Quoted 6 lines

I am not an expert on this,
but for what it is worth:

Perhaps the rules used to detect
and limit brute force ssh attacks
could be adapted to your need.

You are talking about "recent" module... I don't know how I can use it in my situation....

Quoted 1 line

Does NetLook have a predictable pattern?

Forget about NetLook...

My criteria for blocking is:
if rate of SYN packages from ONE source IP is greater then 3packets/sec => then block this IP

Quoted 7 lines
Quoted 2 lines

And i can't add rule "-m limit" per all source IP in my net, because my net is big (~255^3)....

Wouldn't that look something like :

$ipt -A [INPUT|FORWARD] -i $IF_LAN -m state --state NEW -s $LAN_NET \
-p tcp --syn -m limit --limit 3/sec -j ACCEPT

If just ONE host from my $LAN_NET will exceed this limit, then ALL hosts in $LAN_NET will not able to start new session... and this is bad. I want to limit 3/sec per host, not for all net....

Quoted 14 lines

This would match NEW packets on your LAN interface with SYN set, coming from any of your LAN IP's and not allowing more than 3 of these per second. Of course, you'd also need a rule like this to allow the complete connection :

$ipt -A [INPUT|FORWARD] -m state --state RELATED,ESTABLISHED -j ACCEPT

Or am I missing something ?

Gr,
Rob

Signature · 1 line
Biomechanica Artificial Sabotage Humanoid
#7 lore raw

RE: help me (nfcan: addressed to exclusive sender for this address)

Quoted 6 lines
Quoted 2 lines

$ipt -A [INPUT|FORWARD] -i $IF_LAN -m state --state NEW -s $LAN_NET \
-p tcp --syn -m limit --limit 3/sec -j ACCEPT

If just ONE host from my $LAN_NET will exceed this limit, then ALL hosts in $LAN_NET will not able to start new session... and this is bad. I want to limit 3/sec per host, not for all net....

Yes.. :-\
Maybe this post is of help then.
http://www.linux-noob.com/forums/index.php?showtopic=1829

Gr,
Rob

author
#8 lore raw

Re: help me (nfcan: addressed to exclusive sender for this address)

Quoted 10 lines · On Thu, 30 Mar 2006 07:45:01 +0200 "Rob Sterenborg" <[email protected]> wrote:
Quoted 6 lines
Quoted 2 lines

$ipt -A [INPUT|FORWARD] -i $IF_LAN -m state --state NEW -s $LAN_NET \
-p tcp --syn -m limit --limit 3/sec -j ACCEPT

If just ONE host from my $LAN_NET will exceed this limit, then ALL hosts in $LAN_NET will not able to start new session... and this is bad. I want to limit 3/sec per host, not for all net....

Yes.. :-\
Maybe this post is of help then.
http://www.linux-noob.com/forums/index.php?showtopic=1829

I saw it... "-m recent" has only 1 second sampling... i cant handle situaton of 3/sec and etc.....

I found "-m dstlimit" module which is handy, *but* for my situation i wanna the same but with limit the packet rate on a per SOURCE ip.... inverted dstlimit :)

Any ideads? :/

Signature · 1 line
Biomechanica Artificial Sabotage Humanoid