mirror of
https://github.com/rapid7/metasploit-payloads
synced 2025-01-20 20:37:27 +01:00
add domain and loggedonusers to sysinfo
added the domain name and logged on user counts to the sysinfo command MSP-12715
This commit is contained in:
parent
e158093b38
commit
30a1ecbbcb
9
c/meterpreter/source/extensions/stdapi/server/sys/config/config.c
Normal file → Executable file
9
c/meterpreter/source/extensions/stdapi/server/sys/config/config.c
Normal file → Executable file
@ -5,6 +5,9 @@
|
||||
#else
|
||||
#include <sys/utsname.h>
|
||||
#endif
|
||||
#include <Lm.h>
|
||||
|
||||
#pragma comment(lib, "netapi32.lib")
|
||||
|
||||
/*!
|
||||
* @brief Add an environment variable / value pair to a response packet.
|
||||
@ -644,6 +647,12 @@ DWORD request_sys_config_sysinfo(Remote *remote, Packet *packet)
|
||||
} while(0);
|
||||
|
||||
#endif
|
||||
LPWKSTA_INFO_102 localSysinfo = NULL;
|
||||
if (NetWkstaGetInfo(NULL, 102, (LPBYTE *)&localSysinfo) == NERR_Success){
|
||||
char *domainName = wchar_to_utf8(localSysinfo->wki102_langroup);
|
||||
packet_add_tlv_string(response, TLV_TYPE_DOMAIN, (LPCSTR)domainName);
|
||||
packet_add_tlv_uint(response, TLV_TYPE_LOGGED_ON_USER_COUNT, localSysinfo->wki102_logged_on_users);
|
||||
}
|
||||
// Transmit the response
|
||||
packet_transmit_response(res, remote, response);
|
||||
|
||||
|
2
c/meterpreter/source/extensions/stdapi/stdapi.h
Normal file → Executable file
2
c/meterpreter/source/extensions/stdapi/stdapi.h
Normal file → Executable file
@ -99,6 +99,8 @@
|
||||
#define TLV_TYPE_ARCHITECTURE MAKE_CUSTOM_TLV( TLV_META_TYPE_STRING, TLV_TYPE_EXTENSION_STDAPI, 1043 )
|
||||
#define TLV_TYPE_LANG_SYSTEM MAKE_CUSTOM_TLV( TLV_META_TYPE_STRING, TLV_TYPE_EXTENSION_STDAPI, 1044 )
|
||||
#define TLV_TYPE_SID MAKE_CUSTOM_TLV( TLV_META_TYPE_STRING, TLV_TYPE_EXTENSION_STDAPI, 1045 )
|
||||
#define TLV_TYPE_DOMAIN MAKE_CUSTOM_TLV( TLV_META_TYPE_STRING, TLV_TYPE_EXTENSION_STDAPI, 1046 )
|
||||
#define TLV_TYPE_LOGGED_ON_USER_COUNT MAKE_CUSTOM_TLV( TLV_META_TYPE_UINT, TLV_TYPE_EXTENSION_STDAPI, 1047 )
|
||||
|
||||
// Environment stuff
|
||||
#define TLV_TYPE_ENV_VARIABLE MAKE_CUSTOM_TLV( TLV_META_TYPE_STRING, TLV_TYPE_EXTENSION_STDAPI, 1100 )
|
||||
|
Loading…
Reference in New Issue
Block a user