diff --git a/lib/rex/post/meterpreter/extensions/stdapi/sys/config.rb b/lib/rex/post/meterpreter/extensions/stdapi/sys/config.rb index 11c5e9e8de..2fe81a8460 100644 --- a/lib/rex/post/meterpreter/extensions/stdapi/sys/config.rb +++ b/lib/rex/post/meterpreter/extensions/stdapi/sys/config.rb @@ -87,16 +87,19 @@ class Config # def sysinfo request = Packet.create_request('stdapi_sys_config_sysinfo') - response = client.send_request(request) + if @sysinfo.nil? + response = client.send_request(request) - { - 'Computer' => response.get_tlv_value(TLV_TYPE_COMPUTER_NAME), - 'OS' => response.get_tlv_value(TLV_TYPE_OS_NAME), - 'Architecture' => response.get_tlv_value(TLV_TYPE_ARCHITECTURE), - 'System Language' => response.get_tlv_value(TLV_TYPE_LANG_SYSTEM), - 'Domain' => response.get_tlv_value(TLV_TYPE_DOMAIN), - 'Logged On Users' => response.get_tlv_value(TLV_TYPE_LOGGED_ON_USER_COUNT) - } + @sysinfo = { + 'Computer' => response.get_tlv_value(TLV_TYPE_COMPUTER_NAME), + 'OS' => response.get_tlv_value(TLV_TYPE_OS_NAME), + 'Architecture' => response.get_tlv_value(TLV_TYPE_ARCHITECTURE), + 'System Language' => response.get_tlv_value(TLV_TYPE_LANG_SYSTEM), + 'Domain' => response.get_tlv_value(TLV_TYPE_DOMAIN), + 'Logged On Users' => response.get_tlv_value(TLV_TYPE_LOGGED_ON_USER_COUNT) + } + end + @sysinfo end #