6.5 KiB
6.5 KiB
OpenAntiSpoof-FullOpsec
by notme_ssa
How it works
1. Startup & Wiring
AntiSpoofPluginloadsconfig.ymlandbrands-and-channels.ymlviaConfigManager, initializes per-player storage/logging (PlayerStorageManager,PlayerLogManager),SurgeGuardManager, and exposes theAntiSpoofAPIbridge (ApiLifecycle+EventBus).- Starts the embedded NanoHTTPD resource-pack server (
ProbeHttpServer) whenkey-spoof-probe,identity-linker, orasset-probeis enabled, optionally initializes the Pcap4J TCP/OS sniffer (OsFingerprintManager), registers Bukkit + PacketEvents listeners, binds/antispoof, and hooksPlaceholderAPIwhen 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_SETTINGSlocale, 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.<rand8>), hex nonces, and vanilla baselines (fallback: "⟦%3$s|%2$s|%1$s⟧"), plus auto-closing AnvilNAME_ITEMprobes (\t<nonce>). - 3-Phase Key-Spoof RP Probe Lab (
KeySpoofRpProbeManager):- Phase 1: 1.20.6 vanilla edge keys (
item.minecraft.mace) + nested modtranslate/keybindinsidechat.type.textwitharguments. - 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.
- Phase 1: 1.20.6 vanilla edge keys (
- Differential Bitmap Font Asset Probe (
AssetProbeListener&AssetProbeLabManager):- Config-driven
TEXTURES,FONT, andCORRUPTIONresource-pack rules (asset-probe.rules) with automatic A/B control pack verification (FAILED_RELOADon guaranteed missing asset vsSUCCESSFULLY_LOADEDon real mod texture paths likemeteor-client:meteor.png). - Works directly through
FontManager/ResourceManager, detecting modded clients even when OpSec Key Spoof is active.
- Config-driven
- Command-Book Verification Probe (
CommandBookProbeManager): declares a synthetic command node (/asverify_<nonce>) viaWrapperPlayServerDeclareCommandsand opens a verification Written Book withClickEvent(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-commandsregex) until verification probes finish or the safety timeout expires. - Discord Webhook Alerts (
DiscordWebhookNotifier): async rate-limited JSON embed webhook notifier (strictly opt-in viadiscord.enabled+discord.webhook-url). - Additional Subsystems:
IdentityLinkerManager(HTTP cache alt-linking),ResourcePackIntegrityListener(ACCEPTED -> SUCCESSFULLY_LOADED < 5mstiming anomaly check),ProxyDetectionManager(RTT delta heuristic),OsDetectorService/OsFingerprintManager(passive TCP/OS fingerprinting),ActiveReconScanner, andClientApiHookManager(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).
- Flags missing brands (
- 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).
- 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 (
- 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.
- Evaluates ping samples against handshake RTT (
4. Violation, Alert & Punishment Pipeline
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, 29 subcommands):/antispoof <gui|alerts|guard|channels|brand|host|os|mods|translate|keybind|keyspoof|assetlab|check|proxy|runcheck|runmods|runbook|stopmods|verify|search|client|logs|listchannels|listbrands|reload|config|help>. - Staff GUI:
MainMenuGui,ConfigGui,ClientBrandsGui,PlayerListGui,PlayerInfoGui, andLogSnapshotGuifor 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:
.\gradlew.bat clean build --no-daemon
Output JAR: build/libs/AntiSpoof-1.5.0.jar



