This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Main { | |
public static void main(String[] args) { | |
a().evaluate(); | |
} | |
public static Expression a() { | |
final Expression e = SimpleExpression.builder(); | |
return new Expression() { | |
@Override |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
deb http://mirrors.digitalocean.com/ubuntu precise main restricted universe multiverse | |
deb http://mirrors.digitalocean.com/ubuntu precise-updates main restricted universe multiverse | |
deb http://mirrors.digitalocean.com/ubuntu precise-backports main restricted universe multiverse | |
deb http://mirrors.digitalocean.com/ubuntu precise-security main restricted universe multiverse |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Arrays; | |
import java.util.stream.Collectors; | |
public class Main { | |
public static void main(String[] args) { | |
// write your code here | |
System.out.println(Arrays.asList(1, 2, 3).stream().map(x -> x * x).collect(Collectors.toList())); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.lang.reflect.InvocationTargetException; | |
import java.lang.reflect.Method; | |
public class Main { | |
public static void main(String[] args) throws ClassNotFoundException, NoSuchMethodException, InvocationTargetException, IllegalAccessException { | |
// write your code here | |
Class a = A.class; | |
Method m = a.getMethod("vulnerableMethod", int.class); | |
m.invoke(null, 5); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Main { | |
public static void main(String[] args) throws ClassNotFoundException { | |
// write your code here | |
Class a = Class.forName("A"); | |
Class b = Class.forName("java.util.concurrent.Future"); | |
} | |
static void vulnerableMethod() { | |
System.out.println("pwned"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* ยฉ Copyright 2015 - SourceClear Inc | |
*/ | |
import com.codepoetics.protonpack.StreamUtils; | |
import org.objectweb.asm.ClassReader; | |
import org.objectweb.asm.Opcodes; | |
import org.objectweb.asm.Type; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* ยฉ Copyright 2015 - SourceClear Inc | |
*/ | |
import com.codepoetics.protonpack.StreamUtils; | |
import org.objectweb.asm.ClassReader; | |
import org.objectweb.asm.Opcodes; | |
import java.io.IOException; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.lang.reflect.InvocationTargetException; | |
import java.lang.reflect.Method; | |
public class Main { | |
public static void main(String[] args) throws ClassNotFoundException, NoSuchMethodException, InvocationTargetException, IllegalAccessException { | |
// write your code here | |
Class a = A.class; | |
Method m = a.getMethod("vulnerableMethod"); | |
m.invoke(null); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.concurrent.Callable; | |
import java.util.concurrent.ExecutionException; | |
import java.util.concurrent.ExecutorService; | |
import java.util.concurrent.Executors; | |
import java.util.concurrent.Future; | |
public class Main { | |
public static void main(String[] args) throws ExecutionException, InterruptedException { | |
// write your code here |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.concurrent.LinkedBlockingDeque; | |
import java.util.concurrent.ThreadPoolExecutor; | |
import java.util.concurrent.TimeUnit; | |
public class Main { | |
static class MyRunnable implements Runnable { | |
public void run() { | |
vulnerableMethod(); | |
} |