Created
September 3, 2015 00:57
-
-
Save jsyeo/68e02c22f8036737257a to your computer and use it in GitHub Desktop.
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 Reflection { | |
public static void vulnerableMethod() { | |
} | |
public void reflectVulnerableMethod() throws ClassNotFoundException, NoSuchMethodException, SecurityException, | |
IllegalAccessException, IllegalArgumentException, InvocationTargetException { | |
Class<?> klazz = Class.forName("Reflection"); | |
Method m = klazz.getMethod("vulnerableMethod"); | |
m.invoke(null); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment