mirror of
https://github.com/rapid7/metasploit-payloads
synced 2025-02-28 06:13:03 +01:00
Prefer the pwd module for getuid when available
This commit is contained in:
parent
b5b1c9f832
commit
f4bd471ee4
@ -698,7 +698,9 @@ def stdapi_sys_config_getsid(request, response):
|
|||||||
|
|
||||||
@meterpreter.register_function
|
@meterpreter.register_function
|
||||||
def stdapi_sys_config_getuid(request, response):
|
def stdapi_sys_config_getuid(request, response):
|
||||||
if has_windll:
|
if has_pwd:
|
||||||
|
username = pwd.getpwuid(os.getuid()).pw_name
|
||||||
|
elif has_windll:
|
||||||
token = get_token_user(ctypes.windll.kernel32.GetCurrentProcess())
|
token = get_token_user(ctypes.windll.kernel32.GetCurrentProcess())
|
||||||
if not token:
|
if not token:
|
||||||
return ERROR_FAILURE, response
|
return ERROR_FAILURE, response
|
||||||
|
Loading…
x
Reference in New Issue
Block a user