mirror of
https://github.com/nmap/nmap.git
synced 2026-01-08 07:29:03 +00:00
Fixed a bug in the smb session enumeration where users wouldn't get added to the list if we couldn't look up the users' timestamps (which happens with guest accounts for sure)
This commit is contained in:
@@ -144,6 +144,7 @@ local function winreg_enum_rids(host)
|
||||
element['sid'] = msrpc.string_to_sid(enumkey_result['name'])
|
||||
|
||||
-- To get the time the user logged in, we check the 'Volatile Environment' key
|
||||
-- This can fail with the 'guest' account due to access restrictions
|
||||
status, openkey_result = msrpc.winreg_openkey(smbstate, openhku_result['handle'], element['name'] .. "\\Volatile Environment")
|
||||
if(status ~= false) then
|
||||
local queryinfokey_result, closekey_result
|
||||
@@ -162,8 +163,11 @@ local function winreg_enum_rids(host)
|
||||
end
|
||||
|
||||
element['changed_date'] = queryinfokey_result['last_changed_date']
|
||||
elements[#elements + 1] = element
|
||||
else
|
||||
-- Getting extra details failed, but we can still handle this
|
||||
element['changed_date'] = "<unknown>"
|
||||
end
|
||||
elements[#elements + 1] = element
|
||||
end
|
||||
|
||||
i = i + 1
|
||||
|
||||
Reference in New Issue
Block a user