File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
lib/msf/core/post/windows Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -49,9 +49,6 @@ def parse_profiles(hives)
49
49
#
50
50
def parse_profile ( hive )
51
51
profile = { }
52
- sidinf = resolve_sid ( hive [ 'SID' ] . to_s )
53
- profile [ 'UserName' ] = sidinf [ :name ]
54
- profile [ 'Domain' ] = sidinf [ :domain ]
55
52
profile [ 'SID' ] = hive [ 'SID' ]
56
53
profile [ 'ProfileDir' ] = hive [ 'PROF' ]
57
54
profile [ 'AppData' ] = registry_getvaldata ( "#{ hive [ 'HKU' ] } \\ Software\\ Microsoft\\ Windows\\ CurrentVersion\\ Explorer\\ Shell Folders" , 'AppData' )
@@ -65,6 +62,12 @@ def parse_profile(hive)
65
62
profile [ 'Temp' ] = registry_getvaldata ( "#{ hive [ 'HKU' ] } \\ Environment" , 'TEMP' ) . to_s . sub ( '%USERPROFILE%' , profile [ 'ProfileDir' ] )
66
63
profile [ 'Path' ] = registry_getvaldata ( "#{ hive [ 'HKU' ] } \\ Environment" , 'PATH' )
67
64
65
+ sidinf = resolve_sid ( hive [ 'SID' ] . to_s )
66
+ if sidinf
67
+ profile [ 'UserName' ] = sidinf [ :name ]
68
+ profile [ 'Domain' ] = sidinf [ :domain ]
69
+ end
70
+
68
71
return profile
69
72
end
70
73
You can’t perform that action at this time.
0 commit comments