Last active
September 8, 2015 07:05
-
-
Save jsyeo/60079ea42c4c682129f8 to your computer and use it in GitHub Desktop.
Dot Class Reflection
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); | |
} | |
} | |
class A { | |
public static void vulnerableMethod() { | |
System.out.println("pwned"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment