mirror of
https://github.com/RayzsYT/ProAntiTab.git
synced 2026-11-13 12:41:58 -05:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b53678764a | ||
|
|
1f7743d089 | ||
|
|
a60b6896f7 | ||
|
|
34c33df136 | ||
|
|
ef63674b0c | ||
|
|
130af1547d | ||
|
|
cdb17c1ea8 | ||
|
|
8f4f4b6438 | ||
|
|
3a0fc6e579 |
No files matched your search
@@ -6,7 +6,7 @@
|
||||
|
||||
<groupId>de.rayzs.pat</groupId>
|
||||
<artifactId>ProAntiTab</artifactId>
|
||||
<version>2.5.0</version>
|
||||
<version>2.5.1</version>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>17</maven.compiler.source>
|
||||
|
||||
@@ -339,6 +339,7 @@ public class Storage {
|
||||
public static final BlockNamespaceCommandsSection BLOCK_NAMESPACE_COMMANDS = new BlockNamespaceCommandsSection();
|
||||
public static final HandleThroughProxySection HANDLE_THROUGH_PROXY = new HandleThroughProxySection();
|
||||
public static final HidePluginChannelsSection HIDE_PLUGIN_CHANNELS = new HidePluginChannelsSection();
|
||||
public static final TabCompletionForNotExistingCommandsSection TAB_COMPLETION_FOR_NOT_EXISTING_COMMANDS = new TabCompletionForNotExistingCommandsSection();
|
||||
public static final InjectionFailedSection INJECTION_FAILED = new InjectionFailedSection();
|
||||
public static final PatchExploitSection PATCH_EXPLOITS = new PatchExploitSection();
|
||||
public static final CustomBrandSection CUSTOM_BRAND = new CustomBrandSection();
|
||||
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
package de.rayzs.pat.api.storage.config.settings;
|
||||
|
||||
import de.rayzs.pat.api.storage.storages.ConfigStorage;
|
||||
import de.rayzs.pat.utils.Reflection;
|
||||
import de.rayzs.pat.utils.configuration.helper.ConfigSectionHelper;
|
||||
|
||||
public class TabCompletionForNotExistingCommandsSection extends ConfigStorage {
|
||||
|
||||
public boolean ENABLED;
|
||||
|
||||
public TabCompletionForNotExistingCommandsSection() {
|
||||
super("tab-completion-for-not-existing-commands");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void load() {
|
||||
super.load();
|
||||
if (!Reflection.isProxyServer()) return;
|
||||
|
||||
ENABLED = new ConfigSectionHelper<Boolean>(this, null, false).getOrSet();
|
||||
}
|
||||
}
|
||||
@@ -42,7 +42,7 @@ import java.util.*;
|
||||
|
||||
@Plugin(name = "ProAntiTab",
|
||||
id = "proantitab",
|
||||
version = "2.5.0",
|
||||
version = "2.5.1",
|
||||
authors = "Rayzs_YT",
|
||||
description = "Hides more than just your plugins.",
|
||||
url = "https://www.rayzs.de/products/proantitab/page",
|
||||
|
||||
+18
-1
@@ -3,9 +3,11 @@ package de.rayzs.pat.plugin.listeners.velocity;
|
||||
import com.velocitypowered.api.event.Subscribe;
|
||||
import com.velocitypowered.api.event.command.CommandExecuteEvent;
|
||||
import com.velocitypowered.api.command.CommandSource;
|
||||
import de.rayzs.pat.plugin.logger.Logger;
|
||||
import de.rayzs.pat.plugin.system.communication.Communicator;
|
||||
import de.rayzs.pat.api.event.events.ExecuteCommandEvent;
|
||||
import de.rayzs.pat.plugin.system.subargument.SubArgument;
|
||||
import de.rayzs.pat.plugin.system.subargument.argument.Arguments;
|
||||
import de.rayzs.pat.utils.group.Group;
|
||||
import de.rayzs.pat.utils.group.GroupManager;
|
||||
import de.rayzs.pat.utils.message.MessageTranslator;
|
||||
@@ -139,7 +141,6 @@ public class VelocityBlockCommandListener {
|
||||
|
||||
|
||||
if (!allowed) {
|
||||
|
||||
ExecuteCommandEvent executeCommandEvent = PATEventHandler.callExecuteCommandEvents(
|
||||
sender,
|
||||
event.getCommand(),
|
||||
@@ -190,6 +191,22 @@ public class VelocityBlockCommandListener {
|
||||
);
|
||||
|
||||
if (executeCommandEvent.isBlocked()) {
|
||||
|
||||
/*
|
||||
if (event.getCommand().toLowerCase().contains("discord")) {
|
||||
Logger.info("Blocked for " + player.getUsername() + " (" + command + " -> " + event.getCommand() + ")");
|
||||
Logger.info("Groups: " + (groups.isEmpty() ? "None" : String.join(", ", groups.stream().map(Group::getGroupName).toList())));
|
||||
Logger.info("Server: " + serverName + " (" + sender.getServerName() + ")");
|
||||
Arguments argument = SubArgument.get().getPlayerArgument(sender);
|
||||
|
||||
if (argument != null) {
|
||||
Logger.info("Chat Arguments: " + String.join(", ", argument.CHAT_ARGUMENTS.getAllInputs()));
|
||||
Logger.info("Tab Arguments: " + String.join(", ", argument.TAB_ARGUMENTS.getAllInputs()));
|
||||
} else Logger.info("Arguments: /");
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
event.setResult(CommandExecuteEvent.CommandResult.denied());
|
||||
|
||||
MessageTranslator.send(
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package de.rayzs.pat.plugin.packetanalyzer.bukkit;
|
||||
|
||||
import com.mojang.datafixers.kinds.Const;
|
||||
import de.rayzs.pat.plugin.logger.Logger;
|
||||
import de.rayzs.pat.plugin.packetanalyzer.bukkit.handlers.LegacyPacketHandler;
|
||||
import de.rayzs.pat.plugin.packetanalyzer.bukkit.handlers.ModernCommandsNodeHandler;
|
||||
@@ -87,6 +86,11 @@ public class BukkitPacketAnalyzer {
|
||||
return success;
|
||||
|
||||
} catch (NoSuchFieldException noSuchFieldException) {
|
||||
|
||||
if (!Storage.ConfigSections.Settings.INJECTION_FAILED.ENABLED) {
|
||||
return true;
|
||||
}
|
||||
|
||||
Logger.warning("Failed to inject into " + player.getName() + " and kicked the player as result, to avoid any security risks.");
|
||||
Logger.warning("You can read more about it here: https://www.rayzs.de/products/proantitab/pkafi");
|
||||
Logger.warning("Error details: " + noSuchFieldException.getMessage());
|
||||
@@ -281,7 +285,14 @@ public class BukkitPacketAnalyzer {
|
||||
payloadField.setAccessible(true);
|
||||
|
||||
final Object payloadObj = payloadField.get(packet);
|
||||
final Field channelField = payloadObj.getClass().getDeclaredField("id");
|
||||
Field channelField;
|
||||
|
||||
try {
|
||||
channelField = payloadObj.getClass().getDeclaredField("id");
|
||||
} catch (NoSuchFieldException noSuchFieldException) {
|
||||
return packet;
|
||||
}
|
||||
|
||||
channelField.setAccessible(true);
|
||||
|
||||
final Object channelIdObj = channelField.get(payloadObj);
|
||||
|
||||
@@ -23,8 +23,6 @@ import de.rayzs.pat.utils.node.ProxyCommandNodeHelper;
|
||||
import de.rayzs.pat.utils.Reflection;
|
||||
import de.rayzs.pat.utils.permission.PermissionUtil;
|
||||
import de.rayzs.pat.utils.sender.CommandSender;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.buffer.Unpooled;
|
||||
import io.netty.channel.Channel;
|
||||
import io.netty.channel.ChannelHandlerContext;
|
||||
import io.netty.channel.ChannelPipeline;
|
||||
@@ -150,16 +148,17 @@ public class BungeePacketAnalyzer {
|
||||
|
||||
final boolean ignore = PermissionUtil.hasBypassPermission(sender, false) || Storage.Blacklist.isDisabledServer(serverName);
|
||||
|
||||
ProxyCommandNodeHelper helper = new ProxyCommandNodeHelper<CommandNode>(commands.getRoot());
|
||||
|
||||
List<String> commandsAsString = new ArrayList<>(PROXY_COMMANDS);
|
||||
final ProxyCommandNodeHelper helper = new ProxyCommandNodeHelper<CommandNode>(commands.getRoot());
|
||||
final List<String> commandsAsString = new ArrayList<>(PROXY_COMMANDS);
|
||||
commandsAsString.addAll(helper.getChildrenNames());
|
||||
|
||||
final List<Group> groups = ignore
|
||||
? Collections.emptyList()
|
||||
: GroupManager.getPlayerGroups(sender, false);
|
||||
|
||||
HashSet<String> playerCommands = new HashSet<>();
|
||||
|
||||
if (!ignore) {
|
||||
final List<Group> groups = GroupManager.getPlayerGroups(sender, false);
|
||||
|
||||
final Map<String, CommandsCache> cache = Storage.getLoader().getPerServerCommandsCacheMap();
|
||||
if (!cache.containsKey(serverName)) {
|
||||
cache.put(serverName, new CommandsCache());
|
||||
@@ -220,6 +219,14 @@ public class BungeePacketAnalyzer {
|
||||
}
|
||||
}
|
||||
|
||||
if (Storage.ConfigSections.Settings.TAB_COMPLETION_FOR_NOT_EXISTING_COMMANDS.ENABLED) {
|
||||
for (Group group : groups) {
|
||||
for (String groupCommands : group.getAllCommands(serverName)) {
|
||||
helper.add(groupCommands, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!ignore) {
|
||||
SubArgument.get().getCommandNodeHandler().handleCommandNode(helper, SubArgument.get().getPlayerArgument(sender));
|
||||
}
|
||||
|
||||
@@ -207,6 +207,18 @@ public class VelocityPacketAnalyzer {
|
||||
return !playerCommands.contains(str);
|
||||
});
|
||||
|
||||
if (Storage.ConfigSections.Settings.TAB_COMPLETION_FOR_NOT_EXISTING_COMMANDS.ENABLED) {
|
||||
for (Group group : groups) {
|
||||
for (String groupServerName : group.getBlacklistServerNames(serverName)) {
|
||||
if (Storage.isServer(groupServerName, serverName)) {
|
||||
for (String groupCommands : group.getAllCommands(groupServerName)) {
|
||||
helper.add(groupCommands, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (Storage.ConfigSections.Settings.CUSTOM_VERSION.ALWAYS_TAB_COMPLETABLE) {
|
||||
Storage.ConfigSections.Settings.CUSTOM_VERSION.COMMANDS.getLines().forEach(input -> helper.add(input, false));
|
||||
}
|
||||
|
||||
+2
@@ -98,6 +98,8 @@ public class CommandNodeHandler extends SubArgumentHandler {
|
||||
break;
|
||||
}
|
||||
|
||||
if (input == null) continue;
|
||||
|
||||
final Storage.Blacklist.BlockType type = Storage.Blacklist.BlockTypeFetcher.getType(input);
|
||||
if (type == Storage.Blacklist.BlockType.CHAT) {
|
||||
continue;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package de.rayzs.pat.plugin.system.subargument.handler.impl;
|
||||
|
||||
import de.rayzs.pat.api.storage.Storage;
|
||||
import de.rayzs.pat.plugin.logger.Logger;
|
||||
import de.rayzs.pat.plugin.system.subargument.handler.SubArgumentHandler;
|
||||
import de.rayzs.pat.plugin.system.subargument.SubArgument;
|
||||
import de.rayzs.pat.utils.StringUtils;
|
||||
@@ -67,6 +68,16 @@ public class ExecuteHandler extends SubArgumentHandler {
|
||||
listed = !turn;
|
||||
}
|
||||
|
||||
/*
|
||||
final boolean blocked = turn != listed;
|
||||
if (blocked && command.contains("discord")) {
|
||||
Logger.info("Yes, sub-argument was blocked! (" + sender.getName() + ", " + command + ")");
|
||||
Logger.info("-> " + turn + ", " + listed + ", " + negated);
|
||||
}
|
||||
|
||||
return blocked;
|
||||
*/
|
||||
|
||||
return turn != listed;
|
||||
}
|
||||
|
||||
|
||||
@@ -116,7 +116,7 @@ public class CommandsCache {
|
||||
String command = filteredCommands.get(i);
|
||||
localFilteredCommands.add(command);
|
||||
} catch (IndexOutOfBoundsException indexOutOfBoundsException) {
|
||||
Logger.warning("Array is out of bounds " + i + "/" + max + "! " + indexOutOfBoundsException.getMessage());
|
||||
//Logger.warning("Array is out of bounds " + i + "/" + max + "! " + indexOutOfBoundsException.getMessage());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -209,8 +209,9 @@ public class LuckPermsHook {
|
||||
private static boolean isRelevantPermission(Node node) {
|
||||
final String key = node.getKey();
|
||||
|
||||
return key.startsWith("group.")
|
||||
return key.equals("*")
|
||||
|| key.startsWith("group.")
|
||||
|| key.startsWith("proantitab.")
|
||||
|| key.equals("*");
|
||||
|| key.startsWith("-proantitab.");
|
||||
}
|
||||
}
|
||||
@@ -92,12 +92,29 @@ public class PermissionUtil {
|
||||
}
|
||||
|
||||
public static void setPermission(UUID uuid, String permission, boolean permitted) {
|
||||
PermissionMap permissionMap;
|
||||
PermissionMap permissionMap = MAP.get(uuid);
|
||||
|
||||
if(!MAP.containsKey(uuid)) {
|
||||
if(permissionMap == null) {
|
||||
permissionMap = new PermissionMap(uuid);
|
||||
MAP.put(uuid, permissionMap);
|
||||
} else permissionMap = MAP.get(uuid);
|
||||
}
|
||||
|
||||
|
||||
final boolean isNegatedPermission = permission.charAt(0) == '-';
|
||||
|
||||
// Ignore because set permission is negated.
|
||||
if (!isNegatedPermission && permissionMap.isPermitted("-" + permission)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (isNegatedPermission) {
|
||||
final String nonNegatedPermission = permission.substring(1);
|
||||
|
||||
if (permissionMap.isPermitted(nonNegatedPermission)) {
|
||||
permissionMap.setState(nonNegatedPermission, false);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
permissionMap.setState(permission, permitted);
|
||||
}
|
||||
@@ -169,7 +186,9 @@ public class PermissionUtil {
|
||||
}
|
||||
}
|
||||
|
||||
return permissionMap.isPermitted("*") || permissionMap.isPermitted("proantitab.*") || permissionMap.isPermitted("proantitab." + permission);
|
||||
return permissionMap.isPermitted("*")
|
||||
|| permissionMap.isPermitted("proantitab.*")
|
||||
|| permissionMap.isPermitted("proantitab." + permission);
|
||||
}
|
||||
|
||||
public static boolean hasBypassPermission(Object targetObj, final boolean isOperator) {
|
||||
|
||||
@@ -3,7 +3,7 @@ description: Hides more than just your plugins.
|
||||
website: https://www.rayzs.de/products/proantitab/page
|
||||
|
||||
author: Rayzs_YT
|
||||
version: 2.5.0
|
||||
version: 2.5.1
|
||||
main: de.rayzs.pat.plugin.BungeeLoader
|
||||
|
||||
softDepends: [LuckPerms, PAPIProxyBridge]
|
||||
@@ -64,6 +64,11 @@ allow-group-overruling: false
|
||||
# lpv (...) permission set proantitab.group.<group> server=<server>
|
||||
update-groups-per-server: false
|
||||
|
||||
# If you whitelist a command using PAT that does not exist, it would still
|
||||
# make the command tab-completable, even though it doesn't exist.
|
||||
# (!) WARNING: Only works with PAT groups!
|
||||
tab-completion-for-not-existing-commands: false
|
||||
|
||||
# Enabling this forwards the notification message to the backend
|
||||
# server so it will be displayed there as well. (Only in console)
|
||||
forward-console-notification-alerts: false
|
||||
|
||||
@@ -3,7 +3,7 @@ description: Hides more than just your plugins.
|
||||
website: https://www.rayzs.de/products/proantitab/page
|
||||
|
||||
author: Rayzs_YT
|
||||
version: 2.5.0
|
||||
version: 2.5.1
|
||||
api-version: 1.13
|
||||
folia-supported: true
|
||||
main: de.rayzs.pat.plugin.BukkitLoader
|
||||
|
||||
Reference in new issue
Block a user