Move security manager checks.

This commit is contained in:
Andy Nguyen 2021-11-04 18:04:31 +01:00
parent fab3db6d51
commit 1d8fab5dd3
3 changed files with 3 additions and 4 deletions

View File

@ -29,8 +29,7 @@ class Exploit implements Runnable {
for (int i = 0; i < exploits.length; i++) {
try {
exploits[i].trigger();
if (System.getSecurityManager() == null) {
if (exploits[i].trigger()) {
break;
}
} catch (Exception e) {

View File

@ -57,6 +57,6 @@ public class ExploitServiceProxyImpl implements ExploitSandboxInterface {
Class payloadClass = urlClassLoader.loadClass(PAYLOAD_CLASS_NAME);
payloadClass.newInstance();
return true;
return System.getSecurityManager() == null;
}
}

View File

@ -44,7 +44,7 @@ public class ExploitUserPrefsImpl implements ExploitSandboxInterface {
// Instantiate the payload class.
PayloadClassLoader.getInstance().newPayload();
return true;
return System.getSecurityManager() == null;
}
} finally {
// Restore userprefs file.