Skip to content

Instantly share code, notes, and snippets.

@jsyeo
Created September 9, 2015 06:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jsyeo/34c73c6d456e3ca83c1b to your computer and use it in GitHub Desktop.
Save jsyeo/34c73c6d456e3ca83c1b to your computer and use it in GitHub Desktop.
Reflection with Method Param
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);
}
}
class A {
public static void vulnerableMethod(int i) {
System.out.println("pwned with param " + i);
}
}
@domonz-dev
Copy link

it maybe in python?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment