OpenAntiSpoof-FullOpsec
by notme_ssa

---

jak hack deobf2 deobf

--- ## How it works ### 1. Startup & Wiring - `AntiSpoofPlugin` loads `config.yml` and `brands-and-channels.yml` via `ConfigManager`, initializes per-player storage/logging (`PlayerStorageManager`, `PlayerLogManager`), `SurgeGuardManager`, and exposes the `AntiSpoofAPI` bridge (`ApiLifecycle` + `EventBus`). - Starts the embedded NanoHTTPD resource-pack server (`ProbeHttpServer`) when `key-spoof-probe`, `identity-linker`, or `asset-probe` is enabled, optionally initializes the Pcap4J TCP/OS sniffer (`OsFingerprintManager`), registers Bukkit + PacketEvents listeners, binds `/antispoof`, and hooks `PlaceholderAPI` when present. ### 2. Player Join & Signal Collection - **Configuration & Handshake Trace (`BrandChannelListener`)**: intercepts Handshake virtual host, Configuration/Play plugin messages (`minecraft:brand`, `minecraft:register`, client API channels), `CLIENT_SETTINGS` locale, and 1.20.5+ `SELECT_KNOWN_PACKS` (`[ConfigTrace]`). - **Sign & Anvil Translation/Keybind Probes (`TranslationProbeManager`)**: dispatches 4-line Sign double-probes with randomized canary keys (`key.antispoof.`), hex nonces, and vanilla baselines (`fallback: "⟦%3$s|%2$s|%1$s⟧"`), plus auto-closing Anvil `NAME_ITEM` probes (`\t`). - **3-Phase Key-Spoof RP Probe Lab (`KeySpoofRpProbeManager`)**: - **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. - **4-Layer Resource-Pack Spoofer Detector (`ResourcePackSpoofDetector`)**: - Catches server resource-pack bypass/spoofer mods (Meteor `ServerSpoof`, Wurst/LiquidBounce `ResourcePackSpoof`, `NoServerPack`, fake-accept & download-and-discard mods): 1. **Bad-SHA1 Honeypot Pack**: sends a tiny pack with inverted SHA-1 (Vanilla rejects with `FAILED_DOWNLOAD` and zero reload screen; spoofers blindly reply `SUCCESSFULLY_LOADED`). 2. **Zero-Fetch HTTP Verification**: flags clients claiming `DOWNLOADED`/`SUCCESSFULLY_LOADED` on a `no-store` one-time URL without ever hitting `ProbeHttpServer`. 3. **State-Machine & Timing Verification**: validates `ACCEPTED -> DOWNLOADED -> SUCCESSFULLY_LOADED` order (1.20.3+) and flags instantaneous `<15ms` reloads. 4. **Cryptographic Proof-of-Apply Sign Probe**: verifies via one-time secret translation key embedded in the pack that the client actually loaded it into `LanguageManager`. - **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_`) 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 - **Brand, Channel & Virtual Host Checks** (`BrandChannelListener`): - Flags missing brands (`NO_BRAND`), unknown brands (`UNKNOWN_BRAND`), blocked virtual hosts (`BLOCKED_VIRTUAL_HOST`), blocked channels (`BLOCKED_CHANNEL`), missing required channels (`MISSING_REQUIRED_CHANNELS`), and vanilla-brand + modded-channel mismatches (`VANILLA_WITH_CHANNELS`). - **Translation, Keybind & Asset Probes** (`TranslationProbeManager`, `KeySpoofRpProbeManager`, `AssetProbeLabManager`, `CommandBookProbeManager`): - Detects unspoofed mod keys via Sign/Anvil translation & keybind probes, detects spoofed fallback/canary mismatches, detects OpSec-protected clients via Bitmap Font A/B Asset Probe (`ASSET_DETECTED`), and flags blocked verification books (`COMMAND_BOOK_BLOCKED`). - **Proxy & OS Analysis** (`ProxyDetectionManager`, `OsFingerprintManager`): - Evaluates ping samples against handshake RTT (`POSSIBLE_PROXY`, `SUSPECTED_PROXY`) and fingerprints client OS via TCP SYN signatures when Pcap4J is enabled. ### 4. Violation, Alert & Punishment Pipeline ```text AntiSpoofPlugin.flagPlayer(player, violationType, reason) ├─ isBypassed(uuid) || player.hasPermission("antispoof.bypass") -> skip ├─ 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) └─ If not cancelled -> execute configured console punishment commands ``` ### 5. Commands, GUI & Placeholders - **Commands** (`AntiSpoofCommand`, 30 subcommands): `/antispoof `. - **Staff GUI**: `MainMenuGui`, `ConfigGui`, `ClientBrandsGui`, `PlayerListGui`, `PlayerInfoGui`, and `LogSnapshotGui` for live inspection and live config toggling. - **PlaceholderAPI** (`AntiSpoofPlaceholderExpansion`): `%antispoof_brand%`, `%antispoof_version%`, `%antispoof_locale%`, `%antispoof_os%`, `%antispoof_proxy%`, `%antispoof_threat%`, `%antispoof_mods%`, `%antispoof_channels%`, `%antispoof_bedrock%`, `%antispoof_flagged%`. --- ## How to build ### Prerequisites - **Java Development Kit**: JDK 21+ (compiled with `--release 21`) - **Paper / Folia 1.20.6** + **PacketEvents 2.7.0+** --- ### Building OpenAntiSpoof-FullOpsec Run from this folder: ```powershell .\gradlew.bat clean build --no-daemon ``` Output JAR: `build/libs/AntiSpoof-1.5.0.jar`