mirror of
https://github.com/rapid7/metasploit-payloads
synced 2025-01-14 17:37:27 +01:00
reuse the classExists function in process_getpid
This commit is contained in:
parent
328a43bccf
commit
023382aa9c
@ -7,8 +7,9 @@ import com.metasploit.meterpreter.command.Command;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
public class stdapi_sys_process_getpid_V1_5 implements Command {
|
||||
private static boolean classExists(String className) {
|
||||
public class stdapi_sys_process_getpid_V1_5 extends stdapi_sys_process_getpid implements Command {
|
||||
|
||||
protected static boolean classExists(String className) {
|
||||
try {
|
||||
Class.forName(className);
|
||||
return true;
|
||||
|
@ -7,15 +7,7 @@ import com.metasploit.meterpreter.command.Command;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
public class stdapi_sys_process_getpid_V1_9 implements Command {
|
||||
private static boolean classExists(String className) {
|
||||
try {
|
||||
Class.forName(className);
|
||||
return true;
|
||||
} catch (ClassNotFoundException e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
public class stdapi_sys_process_getpid_V1_9 extends stdapi_sys_process_getpid_V1_5 implements Command {
|
||||
|
||||
public int execute(Meterpreter meterpreter, TLVPacket request, TLVPacket response) throws Exception {
|
||||
if (classExists("java.lang.ProcessHandle"))
|
||||
|
Loading…
Reference in New Issue
Block a user