@@ -124,30 +124,30 @@ def enum_users(host)
124
124
# For each entry returned, get domain and name of logged in user
125
125
begin
126
126
count . times { |i |
127
- temp = { }
128
- userptr = mem [ ( base + 0 ) , 4 ] . unpack ( "V*" ) [ 0 ]
129
- temp [ :user ] = client . railgun . memread ( userptr , 255 ) . split ( "\0 \0 " ) [ 0 ] . split ( "\0 " ) . join
130
- nameptr = mem [ ( base + 4 ) , 4 ] . unpack ( "V*" ) [ 0 ]
131
- temp [ :domain ] = client . railgun . memread ( nameptr , 255 ) . split ( "\0 \0 " ) [ 0 ] . split ( "\0 " ) . join
132
-
133
- # Ignore if empty or machine account
134
- unless temp [ :user ] . empty? or temp [ :user ] [ -1 , 1 ] == "$"
135
-
136
- # Check if enumerated user's domain matches supplied domain, if there was
137
- # an error, or if option disabled
138
- data = ""
139
- if datastore [ 'DOMAIN' ] . upcase == temp [ :domain ] . upcase and not @dc_error and datastore [ 'ENUM_GROUPS' ]
140
- data << " - Groups: #{ enum_groups ( temp [ :user ] ) . chomp ( ", " ) } "
141
- end
142
- line = "\t Logged in user:\t #{ temp [ :domain ] } \\ #{ temp [ :user ] } #{ data } \n "
143
-
144
- # Write user and groups to notes database
145
- db_note ( host , "#{ temp [ :domain ] } \\ #{ temp [ :user ] } #{ data } " , "localadmin.user.loggedin" )
146
- userlist << line unless userlist . include? line
147
-
127
+ temp = { }
128
+ userptr = mem [ ( base + 0 ) , 4 ] . unpack ( "V*" ) [ 0 ]
129
+ temp [ :user ] = client . railgun . memread ( userptr , 255 ) . split ( "\0 \0 " ) [ 0 ] . split ( "\0 " ) . join
130
+ nameptr = mem [ ( base + 4 ) , 4 ] . unpack ( "V*" ) [ 0 ]
131
+ temp [ :domain ] = client . railgun . memread ( nameptr , 255 ) . split ( "\0 \0 " ) [ 0 ] . split ( "\0 " ) . join
132
+
133
+ # Ignore if empty or machine account
134
+ unless temp [ :user ] . empty? or temp [ :user ] [ -1 , 1 ] == "$"
135
+
136
+ # Check if enumerated user's domain matches supplied domain, if there was
137
+ # an error, or if option disabled
138
+ data = ""
139
+ if datastore [ 'DOMAIN' ] . upcase == temp [ :domain ] . upcase and not @dc_error and datastore [ 'ENUM_GROUPS' ]
140
+ data << " - Groups: #{ enum_groups ( temp [ :user ] ) . chomp ( ", " ) } "
148
141
end
142
+ line = "\t Logged in user:\t #{ temp [ :domain ] } \\ #{ temp [ :user ] } #{ data } \n "
143
+
144
+ # Write user and groups to notes database
145
+ db_note ( host , "#{ temp [ :domain ] } \\ #{ temp [ :user ] } #{ data } " , "localadmin.user.loggedin" )
146
+ userlist << line unless userlist . include? line
147
+
148
+ end
149
149
150
- base = base + 8
150
+ base = base + 8
151
151
}
152
152
rescue ::Exception => e
153
153
print_error ( "Issue enumerating users on #{ host } " )
0 commit comments