User:Opt/Drafts/Filtering: Difference between revisions
Create draft |
m Move introduction paragraph in Rules section to the main section |
||
| Line 2: | Line 2: | ||
Depending on the enabled enforcement types and implementation quality, filter activation can result in server lag and as such it is recommended to use efficient [[Kick exploits|kick exploit]] where possible or no kick exploits at all, especially when filtering spambots. | Depending on the enabled enforcement types and implementation quality, filter activation can result in server lag and as such it is recommended to use efficient [[Kick exploits|kick exploit]] where possible or no kick exploits at all, especially when filtering spambots. | ||
Filtering is extremely useful when the server is spambotted and the spambots contain predictable characteristics which can be expressed in one or more rule type. | |||
=Rules= | =Rules= | ||
Filtering based on arbitrary strings, like chat messages or commands, is commonly implemented via versatile [[Wikipedia:Regular expression|regular expressions]]. | Filtering based on arbitrary strings, like chat messages or commands, is commonly implemented via versatile [[Wikipedia:Regular expression|regular expressions]]. | ||
Revision as of 03:00, 4 August 2026
Filtering is the act of automatically restricting a player's access to the server based on rules. For example, one may decide to create a IP address filter rule to restrict a player, even if they were to change their username.
Depending on the enabled enforcement types and implementation quality, filter activation can result in server lag and as such it is recommended to use efficient kick exploit where possible or no kick exploits at all, especially when filtering spambots.
Filtering is extremely useful when the server is spambotted and the spambots contain predictable characteristics which can be expressed in one or more rule type.
Rules
Filtering based on arbitrary strings, like chat messages or commands, is commonly implemented via versatile regular expressions.
IP address
IP address rules are commonly used in lieu of exact username filters as evasion requires the use of proxies (often provided by VPN services).
Due to most clones using IP masking, it is impossible to filter subnets or ASNs as one would expect from a firewall.
Usernames
Username filter rules are often the first to be implemented when a bot or client developer is implementing a filter system. Due to most Kaboom clones being offline mode, it is also the easiest to bypass as players can just join under a different username.
However, in combination with regular expressions, username filters can be used to mitigate spambots that use fixed username lengths or a predictable username format. Luckily, most easily available or paid spambot services use a predictable username format, so this remains one of the most important filter types to implement.
Commands
Command rules can be effective to combat general command abuse as well as spambots which spam a certain command. For example, command rules have been used in the past to filter Skynet.
In the past, bots like mewo have filtered iControlU command invocations in an attempt to prevent itself from being locked. Large scope blocks are discouraged unless you have a very good reason, as they have a noticeable impact on the Kaboom experience.
Chat messages
Chat message rules are also effective during spambot attacks, and have been used in the past to implement general content filters instead of just mitigating spambot attempts. For example, KCB would clear the chat if it detected a Discord invite in chat. Other bots have filtered chat messages for things like swear words or slurs in the past.
Enforcement
Enforcement of filter rules is often achieved by repeatedly deopping players, changing their gamemode to something that isn't creative, and clearing their inventories.
Implementation details
In the interest of server performance and bandwidth usage, it is recommended that extensive use of target selector predicates are made (with the exception of the NBT predicate as that requires exporting the entity to NBT which is an expensive operation).
For example, filtered players should be added to teams and selected via @a[team=example].
Furthermore, team names should be randomized, players should be added and removed from them based on the Update Teams packet. It's also a good idea to change the name of the team if it is removed, to prevent easy filter bypass.