Page 1 of 1

Banning a range of ips

Posted: 18 Mar 2015, 08:12
by MajBoredom
A recent troublemaker inspired me to investigate netmask banning in SPADS.

Fortunately, I did not have to write a patch for this as there is some existing functionality. It is not well documented so I am posting about it here. You can ban an inclusive range of ips with the following syntax:

!ban ip=aa.bb.cc.dd-ww.xx.yy.zz

Note the hyphen to indicate a range.

Using this command you can ban entire subnets. This is useful if an offensive person uses DHCP to reacquire a new IP after being banned. Use with caution, as you can ban very wide subnets (or even the entire internet) with this command.

-MajorB

Re: Banning a range of ips

Posted: 18 Mar 2015, 08:20
by PicassoCT
Svedes always were to good(eh) - had to go - its nothing (i)personal advocate, but sometimes the ranged measures justify the cause. I had no complains of svedes about this on my server.

Thank you.

Re: Banning a range of ips

Posted: 18 Mar 2015, 14:28
by bibim
As shown in the !ban command examples, you can indeed use the "-" character to specify a range of values instead of a single value (for any integer or IP address value).

But if you use this to ban IP ranges, I recommend to combine it with rank based filters. That way you only ban new accounts coming from this range. So if there are existing legitimate users using same IP range, they won't be banned.
You can combine filters by using the ";" character to separate them (it will use a AND logic to combine them, cf !ban command examples).

So for example, let's say you want to ban "BadUser" who is using dynamic IP from range 10.20.30.0 - 10.20.30.255.
First you ban his main account:

Code: Select all

!ban BadUser
But this is not enough, because he keeps coming back with new accounts. So you need to ban his entire IP range(s), without banning other existing users from same IP range(s):

Code: Select all

!ban ip=10.20.30.0-10.20.30.255;rank=0
Of course you will still need to add exceptions for any legitimate new users (rank=0) coming from this IP range.