mirror of
https://github.com/nmap/nmap.git
synced 2026-08-04 14:49:29 +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:
parent
12290c86cd
commit
c3ac9337cc
1 changed files with 5 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue