mirror of
https://github.com/rapid7/metasploit-payloads
synced 2024-12-02 20:36:40 +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
|
||||
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())
|
||||
if not token:
|
||||
return ERROR_FAILURE, response
|
||||
|
Loading…
Reference in New Issue
Block a user