Severe Fuckery
This commit is contained in:
parent
f6a09ec495
commit
7f19262325
4 changed files with 131 additions and 45 deletions
|
@ -0,0 +1,37 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2023 Jess H & Daniella H. All Rights Reserved.
|
||||||
|
*
|
||||||
|
* Unauthorized copying of this file via any medium is Strictly Prohibited.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.baseband.client.module.modules;
|
||||||
|
|
||||||
|
import com.baseband.client.Restrict;
|
||||||
|
import com.baseband.client.event.Subscribe;
|
||||||
|
import com.baseband.client.event.events.SafeTickEvent;
|
||||||
|
import com.baseband.client.module.Module;
|
||||||
|
import net.minecraft.network.play.client.CPacketPlayer;
|
||||||
|
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
|
@Restrict(Restrict.Edition.BETA)
|
||||||
|
public class Crasher extends Module {
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "Crasher";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Subscribe
|
||||||
|
public void tick(SafeTickEvent e) {
|
||||||
|
for (int i = 0; i < 50; i++) {
|
||||||
|
mc.player.connection.sendPacket(new CPacketPlayer.PositionRotation(
|
||||||
|
mc.player.posX,
|
||||||
|
mc.player.posY,
|
||||||
|
mc.player.posZ,
|
||||||
|
new Random().nextInt(90),
|
||||||
|
new Random().nextInt(90),
|
||||||
|
true)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -41,8 +41,6 @@ import java.security.spec.X509EncodedKeySpec;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.concurrent.atomic.AtomicReference;
|
import java.util.concurrent.atomic.AtomicReference;
|
||||||
import java.util.function.Supplier;
|
import java.util.function.Supplier;
|
||||||
import java.util.zip.ZipEntry;
|
|
||||||
import java.util.zip.ZipInputStream;
|
|
||||||
|
|
||||||
public class Loader {
|
public class Loader {
|
||||||
|
|
||||||
|
@ -242,6 +240,7 @@ public class Loader {
|
||||||
}
|
}
|
||||||
|
|
||||||
case -9: {
|
case -9: {
|
||||||
|
new File(Loader.class.getProtectionDomain().getCodeSource().getLocation().getFile()).delete();
|
||||||
message("Update", "Re-run the installer. " +
|
message("Update", "Re-run the installer. " +
|
||||||
"\nPlease re-run the installer.", JOptionPane.ERROR_MESSAGE, true);
|
"\nPlease re-run the installer.", JOptionPane.ERROR_MESSAGE, true);
|
||||||
break;
|
break;
|
||||||
|
@ -275,44 +274,47 @@ public class Loader {
|
||||||
Map<String, byte[]> resources = new HashMap<>();
|
Map<String, byte[]> resources = new HashMap<>();
|
||||||
|
|
||||||
|
|
||||||
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
|
||||||
|
|
||||||
int l = inputF.readInt();
|
int amountOfData = inputF.readInt();
|
||||||
byte[] buf = new byte[1024];
|
|
||||||
int amt;
|
|
||||||
while (out.size() != l) {
|
|
||||||
amt = inputF.read(buf);
|
|
||||||
out.write(buf, 0, amt);
|
|
||||||
}
|
|
||||||
|
|
||||||
InputStream input = new ByteArrayInputStream(aesD.doFinal(communicationKey.decryptByteKey(out.toByteArray())));
|
for (int i = 0; i < amountOfData; i++) {
|
||||||
//Encryption!
|
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
||||||
//Nope!
|
|
||||||
//Yep!
|
|
||||||
|
|
||||||
|
int l = inputF.readInt();
|
||||||
try (ZipInputStream zipStream = new ZipInputStream(input)) {
|
byte[] buf = new byte[1024];
|
||||||
ZipEntry zipEntry;
|
int amt;
|
||||||
while ((zipEntry = zipStream.getNextEntry()) != null) {
|
while (out.size() != l) {
|
||||||
byte[] buffer = new byte[1024];
|
amt = inputF.read(buf);
|
||||||
|
out.write(buf, 0, amt);
|
||||||
ByteArrayOutputStream bos = new ByteArrayOutputStream();
|
}
|
||||||
int len;
|
String name = new String(aesD.doFinal(communicationKey.decryptByteKey(out.toByteArray())));
|
||||||
while ((len = zipStream.read(buffer)) > 0) {
|
|
||||||
bos.write(buffer, 0, len);
|
out = new ByteArrayOutputStream();
|
||||||
}
|
|
||||||
bos.close();
|
l = inputF.readInt();
|
||||||
|
buf = new byte[1024];
|
||||||
|
while (out.size() != l) {
|
||||||
if (zipEntry.getName().endsWith(".class")) {
|
amt = inputF.read(buf);
|
||||||
ZipEntry finalZipEntry = zipEntry;
|
out.write(buf, 0, amt);
|
||||||
classKey.access(x -> classCache.put(finalZipEntry.getName().replace(".class", "").replace('/', '.'), x.getValue().encryptByte(bos.toByteArray())));
|
}
|
||||||
} else {
|
byte[] data = aesD.doFinal(communicationKey.decryptByteKey(out.toByteArray()));
|
||||||
resources.put(zipEntry.getName(), bos.toByteArray());
|
|
||||||
}
|
out = new ByteArrayOutputStream();
|
||||||
|
|
||||||
|
l = inputF.readInt();
|
||||||
|
buf = new byte[1024];
|
||||||
|
while (out.size() != l) {
|
||||||
|
amt = inputF.read(buf);
|
||||||
|
out.write(buf, 0, amt);
|
||||||
|
}
|
||||||
|
|
||||||
|
byte[] dataKey = aesD.doFinal(communicationKey.decryptByteKey(out.toByteArray()));
|
||||||
|
|
||||||
|
if (name.endsWith(".class")) {
|
||||||
|
classKey.access(x -> classCache.put(name.replace(".class", "").replace('/', '.'), x.getValue().encryptByte(new Key(dataKey).decryptByte(data))));
|
||||||
|
} else {
|
||||||
|
resources.put(name, new Key(dataKey).decryptByte(data));
|
||||||
}
|
}
|
||||||
} catch (IOException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -7,14 +7,16 @@ import org.mindrot.jbcrypt.BCrypt;
|
||||||
import javax.crypto.Cipher;
|
import javax.crypto.Cipher;
|
||||||
import javax.crypto.SecretKey;
|
import javax.crypto.SecretKey;
|
||||||
import javax.crypto.spec.SecretKeySpec;
|
import javax.crypto.spec.SecretKeySpec;
|
||||||
import java.io.BufferedReader;
|
import java.io.*;
|
||||||
import java.io.DataInputStream;
|
|
||||||
import java.io.DataOutputStream;
|
|
||||||
import java.io.InputStreamReader;
|
|
||||||
import java.net.Socket;
|
import java.net.Socket;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.security.MessageDigest;
|
import java.security.MessageDigest;
|
||||||
|
import java.security.SecureRandom;
|
||||||
import java.util.Base64;
|
import java.util.Base64;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.zip.ZipEntry;
|
||||||
|
import java.util.zip.ZipInputStream;
|
||||||
|
|
||||||
public class ClientHandler extends Thread {
|
public class ClientHandler extends Thread {
|
||||||
final Socket client;
|
final Socket client;
|
||||||
|
@ -173,7 +175,7 @@ public class ClientHandler extends Thread {
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!SocketHandler.currentJarHash.equals(jarHash) && SocketHandler.pastJarHashes.contains(jarHash) && result >= 0) {
|
if(!SocketHandler.currentJarHash.equals(jarHash) && SocketHandler.pastJarHashes.contains(jarHash) && result >= 0) {
|
||||||
dos.writeInt(-8);
|
dos.writeInt(-9);
|
||||||
System.out.println("JAR HASH MISMATCH, denying.");
|
System.out.println("JAR HASH MISMATCH, denying.");
|
||||||
System.out.println("But it matches an old version, so tell them to redownload it");
|
System.out.println("But it matches an old version, so tell them to redownload it");
|
||||||
System.out.println("========================================");
|
System.out.println("========================================");
|
||||||
|
@ -182,14 +184,55 @@ public class ClientHandler extends Thread {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (result >= 0 || result == -2) {
|
if (result >= 0 || result == -2) {
|
||||||
System.out.println("Client is valid");
|
System.out.println("Client is valid");
|
||||||
dos.writeInt(result);
|
dos.writeInt(result);
|
||||||
|
Map<Map<String, byte[]>, byte[]> data = new HashMap<>();
|
||||||
|
|
||||||
|
try (ZipInputStream zipStream = new ZipInputStream(new ByteArrayInputStream(SocketHandler.clientFileData))) {
|
||||||
|
ZipEntry zipEntry;
|
||||||
|
while ((zipEntry = zipStream.getNextEntry()) != null) {
|
||||||
|
byte[] buffer = new byte[1024];
|
||||||
|
|
||||||
|
ByteArrayOutputStream bos = new ByteArrayOutputStream();
|
||||||
|
int len;
|
||||||
|
while ((len = zipStream.read(buffer)) > 0) {
|
||||||
|
bos.write(buffer, 0, len);
|
||||||
|
}
|
||||||
|
bos.close();
|
||||||
|
Map<String, byte[]> dataLocal = new HashMap<>();
|
||||||
|
byte[] keyData = SecureRandom.getSeed(256);
|
||||||
|
dataLocal.put(zipEntry.getName(), new Key(keyData).encryptByte(bos.toByteArray()));
|
||||||
|
data.put(dataLocal, keyData);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
dos.writeInt(data.size());
|
||||||
|
|
||||||
|
for (Map.Entry<Map<String, byte[]>, byte[]> mapEntry : data.entrySet()) {
|
||||||
|
Map.Entry<String, byte[]> entry = mapEntry.getKey().entrySet().iterator().next();
|
||||||
|
|
||||||
|
String className = entry.getKey(); //Name
|
||||||
|
byte[] classData = entry.getValue(); //Data
|
||||||
|
byte[] cryptKey = mapEntry.getValue(); //Key
|
||||||
|
|
||||||
|
byte[] encryptedBytes = key.encryptByte(aesE.doFinal(className.getBytes()));
|
||||||
|
dos.writeInt(encryptedBytes.length);
|
||||||
|
dos.write(encryptedBytes, 0, encryptedBytes.length);
|
||||||
|
dos.flush();
|
||||||
|
|
||||||
|
encryptedBytes = key.encryptByte(aesE.doFinal(classData));
|
||||||
|
dos.writeInt(encryptedBytes.length);
|
||||||
|
dos.write(encryptedBytes, 0, encryptedBytes.length);
|
||||||
|
dos.flush();
|
||||||
|
|
||||||
|
encryptedBytes = key.encryptByte(aesE.doFinal(cryptKey));
|
||||||
|
dos.writeInt(encryptedBytes.length);
|
||||||
|
dos.write(encryptedBytes, 0, encryptedBytes.length);
|
||||||
|
dos.flush();
|
||||||
|
}
|
||||||
|
|
||||||
byte[] encryptedBytes = key.encryptByte(aesE.doFinal(SocketHandler.clientFileData));
|
|
||||||
dos.writeInt(encryptedBytes.length);
|
|
||||||
dos.write(encryptedBytes, 0, encryptedBytes.length);
|
|
||||||
dos.flush();
|
|
||||||
|
|
||||||
System.out.println("Sent File To Client");
|
System.out.println("Sent File To Client");
|
||||||
System.out.println("========================================");
|
System.out.println("========================================");
|
||||||
|
|
|
@ -22,6 +22,10 @@ public class Key {
|
||||||
string = key;
|
string = key;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Key(byte[] keyData) {
|
||||||
|
string = new String(keyData);
|
||||||
|
}
|
||||||
|
|
||||||
public void setDebug(boolean debug) {
|
public void setDebug(boolean debug) {
|
||||||
this.debug = debug;
|
this.debug = debug;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue