Use list of exploit classes and instantiate them later.

This commit is contained in:
Andy Nguyen 2021-11-05 18:28:47 +01:00
parent 036746d7da
commit 8f0fc0d578
1 changed files with 14 additions and 11 deletions

View File

@ -20,19 +20,23 @@ import java.net.ServerSocket;
import java.net.Socket;
class Exploit implements Runnable {
private static final Class[] sandboxExploits =
new Class[] {
ExploitDefaultImpl.class, ExploitUserPrefsImpl.class, ExploitServiceProxyImpl.class
};
private static final Class[] kernelExploits = new Class[] {};
static void init() {
Screen.println("[+] bd-jb by theflow");
Screen.println("[*] Escaping Java Sandbox...");
ExploitSandboxInterface[] exploits =
new ExploitSandboxInterface[] {
new ExploitDefaultImpl(), new ExploitUserPrefsImpl(), new ExploitServiceProxyImpl()
};
for (int i = 0; i < exploits.length; i++) {
for (int i = 0; i < sandboxExploits.length; i++) {
try {
if (exploits[i].trigger()) {
ExploitSandboxInterface exploit =
(ExploitSandboxInterface) sandboxExploits[i].newInstance();
if (exploit.trigger()) {
break;
}
} catch (Exception e) {
@ -56,11 +60,10 @@ class Exploit implements Runnable {
Screen.println("[*] Exploiting kernel...");
ExploitKernelInterface[] exploits = new ExploitKernelInterface[] {};
for (int i = 0; i < exploits.length; i++) {
for (int i = 0; i < kernelExploits.length; i++) {
try {
if (exploits[i].trigger()) {
ExploitKernelInterface exploit = (ExploitKernelInterface) kernelExploits[i].newInstance();
if (exploit.trigger()) {
break;
}
} catch (Exception e) {