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++) { for (int i = 0; i < exploits.length; i++) {
try { try {
exploits[i].trigger(); if (exploits[i].trigger()) {
if (System.getSecurityManager() == null) {
break; break;
} }
} catch (Exception e) { } catch (Exception e) {

View File

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

View File

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