Land #4781, handle resolve_sid failure enumerating user profiles

This commit is contained in:
sinn3r 2015-02-17 14:58:07 -06:00
commit 59c413637a
No known key found for this signature in database
GPG Key ID: 2384DB4EF06F730B
1 changed files with 6 additions and 3 deletions

View File

@ -49,9 +49,6 @@ module UserProfiles
#
def parse_profile(hive)
profile={}
sidinf = resolve_sid(hive['SID'].to_s)
profile['UserName'] = sidinf[:name]
profile['Domain'] = sidinf[:domain]
profile['SID'] = hive['SID']
profile['ProfileDir'] = hive['PROF']
profile['AppData'] = registry_getvaldata("#{hive['HKU']}\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders", 'AppData')
@ -65,6 +62,12 @@ module UserProfiles
profile['Temp'] = registry_getvaldata("#{hive['HKU']}\\Environment", 'TEMP').to_s.sub('%USERPROFILE%',profile['ProfileDir'])
profile['Path'] = registry_getvaldata("#{hive['HKU']}\\Environment", 'PATH')
sidinf = resolve_sid(hive['SID'].to_s)
if sidinf
profile['UserName'] = sidinf[:name]
profile['Domain'] = sidinf[:domain]
end
return profile
end