Add config-driven AssetProbe (TEXTURES/FONT/CORRUPTION), ProbeFreezeManager, and DiscordWebhookNotifier

This commit is contained in:
notme_ssa committed 2026-11-29 20:51:11 +07:00
1 parent d66f60533e
commit ca21fe1a5d
11 files changed
+673 -37

No files matched your search

+6 -3
View File
@@ -29,10 +29,12 @@
- **Phase 1**: 1.20.6 vanilla edge keys (`item.minecraft.mace`) + nested mod `translate`/`keybind` inside `chat.type.text` `with` arguments.
- **Phase 2**: pushes a temporary server resource pack overriding mod keys (`key.meteor-client.open-gui`, `category.meteor-client`) and placing custom keys inside mod namespaces (`assets/meteor-client/lang/`, `assets/opsec/lang/`).
- **Phase 3**: calls `removeResourcePack`, waits 80 ticks (4s) for clean client reload, and verifies cache eviction.
- **Differential Bitmap Font Asset Probe (`AssetProbeLabManager`)**:
- Runs an A/B control pack (`0_CONTROL_MISSING_BITMAP` pointing at a guaranteed missing PNG -> `FAILED_RELOAD`) against real mod texture paths (e.g. `meteor-client:meteor.png` -> `assets/meteor-client/textures/meteor.png`).
- On Vanilla, missing mod textures return `FAILED_RELOAD`; on modded clients (even with OpSec Key Spoof active), existing mod JAR textures load cleanly and return `SUCCESSFULLY_LOADED`.
- **Differential Bitmap Font Asset Probe (`AssetProbeListener` & `AssetProbeLabManager`)**:
- Config-driven `TEXTURES`, `FONT`, and `CORRUPTION` resource-pack rules (`asset-probe.rules`) with automatic A/B control pack verification (`FAILED_RELOAD` on guaranteed missing asset vs `SUCCESSFULLY_LOADED` on real mod texture paths like `meteor-client:meteor.png`).
- Works directly through `FontManager` / `ResourceManager`, detecting modded clients even when OpSec Key Spoof is active.
- **Command-Book Verification Probe (`CommandBookProbeManager`)**: declares a synthetic command node (`/asverify_<nonce>`) via `WrapperPlayServerDeclareCommands` and opens a verification Written Book with `ClickEvent(RUN_COMMAND)` to test for client-side command-book blockers.
- **Probe Freeze (`ProbeFreezeManager`)**: optionally freezes movement, block/entity actions, and non-whitelisted commands (`probe-freeze.allowed-commands` regex) until verification probes finish or the safety timeout expires.
- **Discord Webhook Alerts (`DiscordWebhookNotifier`)**: async rate-limited JSON embed webhook notifier (strictly opt-in via `discord.enabled` + `discord.webhook-url`).
- **Additional Subsystems**: `IdentityLinkerManager` (HTTP cache alt-linking), `ResourcePackIntegrityListener` (`ACCEPTED -> SUCCESSFULLY_LOADED < 5ms` timing anomaly check), `ProxyDetectionManager` (RTT delta heuristic), `OsDetectorService` / `OsFingerprintManager` (passive TCP/OS fingerprinting), `ActiveReconScanner`, and `ClientApiHookManager` (Lunar, Badlion, Feather, LabyMod, Bedrock/Geyser).
### 3. Detection Logic
@@ -50,6 +52,7 @@ AntiSpoofPlugin.flagPlayer(player, violationType, reason)
├─ Record violation on PlayerProfile & increment weighted threat level
├─ PlayerLogManager -> append structured FLAG entry + JSON snapshot
├─ notifyStaff -> broadcast formatted alert to online staff (antispoof.alerts)
├─ DiscordWebhookNotifier -> async rate-limited JSON embed (if discord.enabled)
├─ EventBus -> AntiSpoofAPI dispatches ViolationReportedEvent
└─ If PunishmentRule.isPunish() && !commands.isEmpty():
├─ Dispatch AntiSpoofPrePunishmentEvent (cancellable)