Skip to content

Instantly share code, notes, and snippets.

@jsyeo
Created September 3, 2015 00:57
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jsyeo/68e02c22f8036737257a to your computer and use it in GitHub Desktop.
Save jsyeo/68e02c22f8036737257a to your computer and use it in GitHub Desktop.
Reflection
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