I'm trying to create an exploit, I want to load a class from outside the netbeans project from a subclass of the cash register that was supposed to be final.
I can load the LegitClass tone from the source package badclassloaderusing:
claz = "badclassloader.LegitClass"
loadClass = this.getClass().getClassLoader().loadClass(claz);
(LegitClass)loadClass.newInstance();
Now I want to download MalClass, which lives in another project and package "Mal Package"
- How do I get
Mal.MalClassin the way for a method LoadClass()to search?
I tried the following:
private void loadLibrary() {
if (library != null) {
AccessController.doPrivileged(new PrivilegedAction() {
@Override
public Object run() {
System.loadLibrary("Path/to/Project/mal.jar");
return null;
}
});
}
}
but firstly, I received Directory separator should not appear in library name. So this is clearly not the case, I'm sure that I have something significant here.
source
share