1
mirror of https://github.com/rapid7/metasploit-payloads synced 2025-05-06 16:09:38 +02:00

Set the system language from $LANG when available

This commit is contained in:
Spencer McIntyre 2017-02-09 19:19:11 -05:00
parent abca5ee347
commit a79ef8d1f4

@ -839,6 +839,9 @@ def stdapi_sys_config_sysinfo(request, response):
response += tlv_pack(TLV_TYPE_COMPUTER_NAME, uname_info[1]) response += tlv_pack(TLV_TYPE_COMPUTER_NAME, uname_info[1])
arch = uname_info[4] arch = uname_info[4]
os_name = uname_info[0] + ' ' + uname_info[2] + ' ' + uname_info[3] os_name = uname_info[0] + ' ' + uname_info[2] + ' ' + uname_info[3]
lang = None
if 'LANG' in os.environ:
lang = os.environ['LANG'].split('.', 1)[0]
if has_windll: if has_windll:
arch = windll_GetNativeSystemInfo() arch = windll_GetNativeSystemInfo()
if arch == PROCESS_ARCH_IA64: if arch == PROCESS_ARCH_IA64:
@ -850,7 +853,7 @@ def stdapi_sys_config_sysinfo(request, response):
else: else:
arch = uname_info[4] arch = uname_info[4]
os_name = get_windll_os_name() or os_name os_name = get_windll_os_name() or os_name
lang = get_windll_lang() lang = (get_windll_lang() or lang)
if lang: if lang:
response += tlv_pack(TLV_TYPE_LANG_SYSTEM, lang) response += tlv_pack(TLV_TYPE_LANG_SYSTEM, lang)
response += tlv_pack(TLV_TYPE_OS_NAME, os_name) response += tlv_pack(TLV_TYPE_OS_NAME, os_name)