原创

通过反射攻击单例

import java.lang.reflect.Constructor;

public class Test {
public static void main(String[] args) {
try {
Class<Runtime> clazz = Runtime.class;
Constructor<Runtime> constructor = clazz.getDeclaredConstructor();
constructor.setAccessible(true);
constructor.newInstance();
}catch (Exception e){
e.printStackTrace();
}
}
}


正文到此结束
本文目录