Fix: auto-revoke forged license passcodes and stop auth log flooding
A trial user's serial was alternating between the built-in trial passcode (authorized) and a forged 50-year/1000-host passcode (rejected) on every heartbeat. ShouldLogAuth keyed its throttle on the serial alone and logged every status flip, so the rate limit was defeated and the master log filled with alternating success/failure lines. ShouldLogAuth now tracks the success and failure states independently per serial and source IP: each logs on first sight and then at most once per hour, with a bounded cache. Keying only by serial would collapse the many normal trial users that share one serial into a single line. AutoRevokeForgedAuth handles the offending connection itself. Integrity failures (V1 codes 2/3, V2 code 4) are counted per connection context, and three within 60 seconds send the same days=0 CMD_AUTHORIZATION as the manual "revoke authorization" menu, with a 10-minute cooldown. It acts only when the same serial also had a successful auth in the last two minutes, which is the observed abuse pattern; a batch of failures after a password rotation or a client pointed at another master has no success event and is left alone. Expired and already-revoked licences never trigger it. Without a configured super password it only warns. Translations added. Debug x64 server builds; not runtime-tested. Co-Authored-By: deepseek-flash
This commit is contained in:
1 parent
e265527610
commit
a32219f05c
5 files changed
+186
-20
No files matched your search
@@ -1580,6 +1580,8 @@ IP %s DLL
|
||||
V1 授权失败: = V1 authorization failed:
|
||||
V2 授权成功: = V2 authorized:
|
||||
V2 授权失败: = V2 authorization failed:
|
||||
使用伪造口令,已自动撤销授权=Forged passcode; authorization auto-revoked
|
||||
检测到伪造口令,但未配置超管密码,无法自动撤销=Forged passcode detected, but super password is not configured; cannot auto-revoke
|
||||
|
||||
监听端口和文件下载服务端口冲突!=Listen port is conflict with file server port!
|
||||
|
||||
|
||||
Reference in new issue
Block a user