GrimAnticheat / Grim

Fully async, multithreaded, predictive, open source, 3.01 reach, 1.005 timer, 0.01% speed, 99.99% antikb, "bypassable" 1.8-1.20 anticheat.
GNU General Public License v3.0
1.07k stars 302 forks source link

LiquidBouncePlus CubeCraft ServerCrasher #796

Closed FallenCrystal closed 1 year ago

FallenCrystal commented 1 year ago

Describe the bug and how to replicate it

  1. Use LiquidBouncePlus join server.
  2. Enable module "ServerCrasher" mode: CubeCraft
  3. Server lagging and timer+sim flag spam

if the server has an "AntiCheatReplay" plugin. it also causes a large number of transfer event errors. configured kick punishments for timer checks can effectively reduce the possibility of the server being killed by a watchdog due to timeouts. but if a group of players use it at the same time, the consequences will be unimaginable.

Grim version

2.3.23

Server version

Purpur-1171 (MC1.16.5)

Plugins

Plugins (114): AAC5, AdvancedBan, AdvancedEnchantments, AdvancedReplay, ajLeaderboards, AncientGates, AnnouncerPlus, AntiAuraML-windows64, AntiCheatAddition, AntiCheatReplay, AntiSeedCracker, Aurora, BanAnnouncer, BestTools, BetterLogStrip, BetterTridents, BloodFading, BlueSlimeCore (SirBlobmanAPI, SirBlobmanCore, XSeries), BowHub, ChatControlRed, ChestCommands, Citizens, ClearLag, CMILib, CombatLogX, CommandSync, CompatNoCheatPlus, ConsoleSpamFix, CoreProtect, CrazyCrates, DecentHolograms, DiscordSRV, Duels, Eggwars, ElytraRacing, Essentials, EssentialsChat, EssentialsProtect, EssentialsSpawn, ExploitFixer, FastAsyncWorldEdit (WorldEdit), floodgate, Freeze, GPS, GrimAC, GSit, HamsterAPI, HeadDatabase, HeadsPlus, HideAndSeek, HubPvPSword, InventoryFullPlus, InventoryRollbackPlus, ItemEdit, ItemJoin, ItemTag, JH_Economy, JoinCommands, KP-PVP, KPCore, Launchpads, LibsDisguises, LightAPI, LiteBans, LiteSignIn, LuckPerms, Maintenance, Matrix, Morphy, MultiInv, Multiverse-Core, NoCheatPlus, OpenInv, Parkour, Pl-Hide-Pro, PlaceholderAPI, PlayerKits, PlayerPoints, PlugManX (PlugMan), PreventPortBypass, ProCosmetics, ProtocolLib, RealisticSeasons, Residence, Sacaddons, ServerSafetyManagement, ServersNPC, ShulkerPackX, Skywars, Slimefun, SoaromaSAC, spark, Spicord, SurvivalGames, TAB, TAB-Bridge, TabTPS, ThePit, TNTRun_reloaded, ToDoList, Treasury, Triton, UltimateStacker, UltimateStatistics, UltimateTimber, Vault, ViaBackwards, ViaRewind, ViaVersion, VoidGen, Vulcan, WorldBorder, WorldGuard, XProtect

FallenCrystal commented 1 year ago

note: i also tested it on the 1.8 server. only ProtocolLib, GrimAC, ViaVersions servers. this also crashes

c0dingnoobi commented 1 year ago

This has nothing to do with grim itself. When u perform a server crasher the server itself is not working as it supposed to. Anticheat fails are kind of expected when this happens. You should look into getting an AntiCrasher either free one or paid one which cancels malicious packets, since this is out of scope of grim.

FallenCrystal commented 1 year ago

this only happens to grim.

FallenCrystal commented 1 year ago

when I only use paper. then would be kicked out for "sending too many packets."

FallenCrystal commented 1 year ago

if the console does not prompt verbose. Then the situation can be alleviated. and I configured the kick for the timer check. them will only take up some of my CPU resources. Then kick out. *i used ConsoleSpamFix to prevent AntiCheatReplay from getting a transfer event error.

c0dingnoobi commented 1 year ago

It is still not a grim issue. Get an anticrasher which makes you proof against crashers. Using ConsoleSpamFix you are not preventing anything. As the name says you are just filtering those error messages.

FallenCrystal commented 1 year ago

my english sucks. i mean paper can kick them

FallenCrystal commented 1 year ago

It is still not a grim issue. Get an anticrasher which makes you proof against crashers. Using ConsoleSpamFix you are not preventing anything. As the name says you are just filtering those error messages.

of course I know. this just avoids causing stuttering on my console

FallenCrystal commented 1 year ago

my solution is still to cfg kick for the timer check. but as far as I know there is no penalty in the default cfg (this is one reason i opened the issue). and grim will still send you a lot of flag spam after the player is kicked out.

c0dingnoobi commented 1 year ago

As said it has nothing to do with grim which also means you should not open an issue about something like this here. What you should look for (to fix those console spams and false alerts) is an anticrasher just like lpx.

FallenCrystal commented 1 year ago

using those plugins does ease it. but it cant be completely solved

c0dingnoobi commented 1 year ago

It can since anticrashers cancel those packets which results in no harm to the server itself which also leads to no errors in console or false alerts of anticheats

FallenCrystal commented 1 year ago

if these can effectively prevent such errors from occurring at all. i wont open the issue here either – my servers have LPX and FlameCord. The bukkit server has an ExploitFixer

FallenCrystal commented 1 year ago

not everyone understands exploit. this bug test only happens on servers with grim. its about how to reduce its impact on grim. Instead of shifting the blame to the non-responsibility of the anti-exploit plugin

FallenCrystal commented 1 year ago

using those plugins does ease it. but it cant be completely solved

.

FallenCrystal commented 1 year ago

they can be reduced to the point where players crash servers with grim. but the high cpu usage still exists. it can still be a blow to some low-performing servers.

MWHunter commented 1 year ago

packet-spam-threshold: 150

This exists in the config for a reason. If the player sends more than this many packets in a second that are cancelled, the player gets kicked.

FallenCrystal commented 1 year ago

its still 150. it kicked too late. so much so that it can cause lagging on the server before the grim kicks it. as a matter of fact. the only way I can patch it is to configure kick for the timer check

MWHunter commented 1 year ago

What is the number in the log for: Disconnecting user for spamming invalid packets, packets cancelled in a second " + { CANCELLED PACKET COUNT }

FallenCrystal commented 1 year ago

image

FallenCrystal commented 1 year ago

this is after I added the timer check kick. because that guy will crash my server directly

MWHunter commented 1 year ago

If it's being called multiple times, the error likely is from how the player's packets are somehow not being cleared from the network buffer after they have been kicked

FallenCrystal commented 1 year ago

i think so too. and grim will continue to spam (and out of order) after the player kicks. For example, x1, x2, x3 may become x2, x3, x1 *will be cleared once. i mean... flag

MWHunter commented 1 year ago

don't know, connection is closed and grim ignores packets from closed connections, so I don't see any bugs. Does the player actually get kicked when they trigger this error? When is the player kicked compared to when is grim giving these logs?

FallenCrystal commented 1 year ago

a lot of cases are servers getting stuck. then grim try to kick out. the player has actually logged out of the server after the connection timed out. because it will bring a lot of spam to my console. so I didnt open print-verbose-console

FallenCrystal commented 1 year ago

under testing without any antiexploit plugin. the server will get stuck for about a minute (there is a probability that the grim kick the player. it may also exit the server due to connection timeout. as mentioned earliery). the server continues to run. Then grim will keep flagging that player. until the server crash

FallenCrystal commented 1 year ago

*crash are always after the player leaved the server

FallenCrystal commented 1 year ago

If it's being called multiple times, the error likely is from how the player's packets are somehow not being cleared from the network buffer after they have been kicked

don't know, connection is closed and grim ignores packets from closed connections, so I don't see any bugs. Does the player actually get kicked when they trigger this error? When is the player kicked compared to when is grim giving these logs?

all in all, it leaves whenever it leave. There is this prompt before and after leaving. whats more important is that the player still flags the player endlessly after leaving the server. until the watchdog kills the server

addendum: leave will cause the grim flag to be zeroed in and start flag again. i think grim should have known that the player left the server

AoElite commented 1 year ago

I don't think the packet limiter was disconnecting them properly. I pushed some changes that may help. Also try lowering the packet-spam-threshold a bit more.

MWHunter commented 1 year ago

The packet limiter could be changed so that every X seconds, it sets the max packets. Every cancelled packet, it decrements the counter. If the counter hits 0, then the player is immediately kicked. You would stay on the netty thread and not have to queue anything that way.

AoElite commented 1 year ago

That would be for the better.

MWHunter commented 1 year ago

my current guess for why this happens is that the disconnect command is put on the netty queue, behind all of the player packets they have spammed. Would likely require a debugger to see what netty is doing.

MWHunter commented 1 year ago

Yeah, it's being thrown on the netty queue based on the netty javadocs saying that it calls an event.

AoElite commented 1 year ago

@AkariDream Check if PR https://github.com/GrimAnticheat/Grim/pull/809 fixes your issue. Here's a build if you don't want to merge & compile it. grimac-2.3.24.zip

FallenCrystal commented 1 year ago

thx. i dont have much time right now. i will test it later

FallenCrystal commented 1 year ago

successful patched

AoElite commented 1 year ago

Alright cool, I've merged it