1
mirror of https://github.com/rapid7/metasploit-payloads synced 2025-02-16 00:24:29 +01:00

add stdapi_sys_process_getpid on Android

This commit is contained in:
Tim W 2022-01-17 10:13:55 +00:00
parent c14e1e7bfe
commit 56627ea5db
2 changed files with 20 additions and 0 deletions

View File

@ -134,6 +134,7 @@ public class AndroidMeterpreter extends Meterpreter {
mgr.registerCommand(CommandId.STDAPI_SYS_PROCESS_EXECUTE, stdapi_sys_process_execute_V1_3.class);
mgr.registerCommand(CommandId.STDAPI_SYS_PROCESS_CLOSE, stdapi_sys_process_close.class);
mgr.registerCommand(CommandId.STDAPI_SYS_PROCESS_GET_PROCESSES, stdapi_sys_process_get_processes_android.class);
mgr.registerCommand(CommandId.STDAPI_SYS_PROCESS_GETPID, stdapi_sys_process_getpid_android.class);
mgr.registerCommand(CommandId.STDAPI_UI_DESKTOP_SCREENSHOT, stdapi_ui_desktop_screenshot.class);
if (context != null) {
mgr.registerCommand(CommandId.APPAPI_APP_LIST, appapi_app_list.class);

View File

@ -0,0 +1,19 @@
package com.metasploit.meterpreter.android;
import android.os.Process;
import com.metasploit.meterpreter.Meterpreter;
import com.metasploit.meterpreter.TLVPacket;
import com.metasploit.meterpreter.TLVType;
import com.metasploit.meterpreter.command.Command;
import com.metasploit.meterpreter.stdapi.stdapi_sys_process_getpid;
public class stdapi_sys_process_getpid_android extends stdapi_sys_process_getpid implements Command {
public int execute(Meterpreter meterpreter, TLVPacket request, TLVPacket response) throws Exception {
int pid = Process.myPid();
response.add(TLVType.TLV_TYPE_PID, pid);
return ERROR_SUCCESS;
}
}