Add configurable ping-flood speedhack detection (PingFloodMax) - #1589
Add configurable ping-flood speedhack detection (PingFloodMax)#1589canerksk wants to merge 1 commit into
Conversation
Adds a 30-second sliding window detector on packet 0x73 (ping) to catch clients running at abnormal speeds. ClassicUO sends one ping per second (~30/window); exceeding PingFloodMax triggers a warning log and kicks the client. Fixes a unit mismatch from the original port: the old sphere used tick- based time (GetTimeRaw = ticks), while Source-X returns milliseconds, so the 30s window was actually 300 ms. Now uses MSECS_PER_SEC correctly. New sphere.ini option: PingFloodMax=50 (0 = disabled).
|
Interresting feature! It should prevent crappy player of flooding the server. Why you talk about speedhack detection on the comment? Using speedhack send extra ping request? |
Yes, ClassicUO's game loop is built on XNA/FNA. Time.Ticks = (uint)gameTime.TotalGameTime.TotalMilliseconds; Cheat Engine: 2x speed Please also try Default ClassicUO and Sphere-X; |
|
Good to know thx! What I noticed when implemented speedhack detection on sphere was the difficulty to detect speedhack 1.1 or 1.2. the problem is we aleays get false positive when a player have a shitty ping/ingernet connection. By the way I like this new feature because it can permit admin to be more agile. |
|
Critical Vulnerability in Anti-Speedhack Detection (PR #1589) The current implementation has a fundamental flaw that makes it largely ineffective against sophisticated speedhack usage. The Problem: The detection mechanism uses a 30-second sliding window to count ping packets. However, this approach can be easily bypassed through "time compensation attacks":
Example Attack Scenario:
Why This Is Critical: In PvP scenarios, even 2-3 seconds of accelerated movement can determine the outcome of a fight. The current system cannot detect short bursts of speedhacking followed by compensatory slowdowns. Conclusion: This detection method is basically ineffective because:
Recommendation: Implement multi-timescale detection (1s, 5s, 30s windows simultaneously) and monitor sudden rate-of-change spikes, not just total counts. |
This is valid concern, and the sphere.ini setting to change the 30s to prefered value would be good. |
|
This change is not a fundamental security measure, but rather an additional measure to those already in place. It should not be used as a standalone measure; it can be supported by other measures. |
…and gameplay mechanics - Integrated PR Sphereserver#1327: CLOSECONTAINER and CLOSEVENDORMENU client verbs - Integrated PR Sphereserver#1590: CV_NUKE refactor and CV_NUKEITEM command - Integrated PR Sphereserver#1589: PingFloodMax speedhack detection on packet 0x73 - Integrated PR Sphereserver#1587: NAME.PREFIX / NAME.SUFFIX in addItemName - Integrated mtwango/edebaa6: lingering character reconnect handling - Integrated PR Sphereserver#1568: immediate weather, light, and season sync on sector change - Integrated PR Sphereserver#1566: optional bell curve parameter for SKILLCHECK - Integrated PR Sphereserver#1600: safe dynamic_cast container owner check in CanContainerHold - Integrated PR Sphereserver#1497: robust bitmask memory clear preserving MEMORY_IPET/MEMORY_FRIEND - Integrated PR Sphereserver#1523: corpse item count and weight filtering for hair and special flags - Integrated PR Sphereserver#1535: fix NpcLookAroundChance clamping and probability evaluation

Adds a 30-second sliding window detector on packet 0x73 (ping) to catch clients running at abnormal speeds. ClassicUO sends one ping per second (~30/window); exceeding PingFloodMax triggers a warning log and kicks the client.
New sphere.ini option: PingFloodMax=50 (0 = disabled).