Print console's IP address on screen.

This commit is contained in:
Andy Nguyen 2021-10-25 09:47:12 +02:00
parent fd9d1ce342
commit d48b3df31c

View File

@ -10,6 +10,7 @@ package com.bdjb;
import java.io.FileOutputStream; import java.io.FileOutputStream;
import java.io.InputStream; import java.io.InputStream;
import java.io.OutputStream; import java.io.OutputStream;
import java.net.InetAddress;
import java.net.Socket; import java.net.Socket;
import java.net.ServerSocket; import java.net.ServerSocket;
@ -54,7 +55,10 @@ class Exploit implements Runnable {
Screen.println("[*] Enabling JIT..."); Screen.println("[*] Enabling JIT...");
JIT jit = JIT.getInstance(); JIT jit = JIT.getInstance();
Screen.println("[*] Waiting for payload..."); Screen.println(
"[*] Listening for payload on "
+ InetAddress.getLocalHost().getHostAddress()
+ ":1337...");
ServerSocket serverSocket = new ServerSocket(1337); ServerSocket serverSocket = new ServerSocket(1337);
Socket socket = serverSocket.accept(); Socket socket = serverSocket.accept();
@ -76,10 +80,9 @@ class Exploit implements Runnable {
socket.close(); socket.close();
Screen.println("[*] Executing payload..."); Screen.println("[*] Executing payload...");
long sceKernelDlsym = api.dlsym(API.LIBKERNEL_MODULE_HANDLE, "sceKernelDlsym");
long payload = jit.mapPayload("/OS/HDD/download0/mnt_ada/payload.bin"); long payload = jit.mapPayload("/OS/HDD/download0/mnt_ada/payload.bin");
int ret = (int) api.call(payload, sceKernelDlsym); int ret = (int) api.call(payload, api.dlsym(API.LIBKERNEL_MODULE_HANDLE, "sceKernelDlsym"));
Screen.println("[+] Result: " + Integer.toHexString(ret)); Screen.println("[+] Result: " + ret);
} catch (Exception e) { } catch (Exception e) {
Screen.println("[-] Error: " + e.getCause()); Screen.println("[-] Error: " + e.getCause());
} }