simply add TCN to both sides, tud you take over the Loader side now
All checks were successful
/ Build BaseBand DSM & Broadway (push) Successful in 8m23s

This commit is contained in:
Jess H 2024-06-08 12:51:35 +01:00
parent 2da8f41d97
commit 1e45ddcd20
2 changed files with 12 additions and 15 deletions

View file

@ -1,6 +1,7 @@
package org.baseband.launcher;
import de.tudbut.net.ws.Client;
import de.tudbut.parsing.TCN;
import de.tudbut.tools.Hasher;
import de.tudbut.tools.encryption.Key;
import org.baseband.launcher.classloader.CustomClassLoader;
@ -12,6 +13,8 @@ import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.lang.reflect.Method;
import java.security.SecureRandom;
import java.util.Base64;
public class Loader implements Util {
@ -29,9 +32,7 @@ public class Loader implements Util {
client.send(rsaKey.rsaEnc(key.toString()));
client.send(key.encryptString(getUserData()));
client.send(key.encryptString(getToken()));
client.send(key.encryptObject(getData()));
classLoader = new CustomClassLoader(key.decryptObject(client.receive()));
@ -44,22 +45,19 @@ public class Loader implements Util {
}
private static String getUserData() throws Exception {
private static TCN getData() throws Exception {
File file = new File("baseband.login");
TCN tcn = new TCN();
if (file.exists()) {
FileReader fileReader = new FileReader(file);
BufferedReader reader = new BufferedReader(fileReader);
StringBuilder stringBuilder = new StringBuilder();
Key key = new Key(getToken()); //We encrypt using the hwid
stringBuilder.append(key.decryptString(reader.readLine())); //Username
stringBuilder.append(key.decryptString(reader.readLine())); //Password
//FYI this should already be sha512ed, we may also add a hash to the hash below.
return Hasher.sha512hex(stringBuilder.toString());
tcn.set("Username", key.decryptString(reader.readLine()));
tcn.set("Password", key.decryptString(reader.readLine()));
tcn.set("Hardware-ID", getToken());
return tcn;
}
exit();

View file

@ -2,6 +2,7 @@ package dev.baseband.server;
import de.tudbut.net.ws.Connection;
import de.tudbut.net.ws.ConnectionHandler;
import de.tudbut.parsing.TCN;
import de.tudbut.tools.encryption.Key;
import java.io.IOException;
@ -17,9 +18,7 @@ public class LoaderHandler implements ConnectionHandler {
Key key = new Key(Main.rsaKey.rsaDec(connection.receive()));
String userData = key.decryptString(connection.receive());
String hwidKey = key.decryptString(connection.receive());
TCN userData = key.decryptObject(connection.receive());
Map<String, byte[]> classes = new HashMap<>();