File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
modules/post/windows/gather/credentials Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ def decrypt(hash)
52
52
password = cipher . update encrypted
53
53
password << cipher . final
54
54
55
- password = password . encode ( 'UTF-8' )
55
+ password = :: Rex :: Text . to_utf8 ( password )
56
56
57
57
credentials = password . split ( "\u0001 " )
58
58
print_good ( "Decrypted Username #{ credentials [ 0 ] } Password: #{ credentials [ 1 ] } " )
@@ -91,7 +91,7 @@ def run
91
91
contents = config . read
92
92
93
93
# look for lines containing string 'password'
94
- password = contents . split ( "\n " ) . grep ( /password/ )
94
+ password = contents . split ( "\n " ) . grep ( /password/ )
95
95
if password . nil?
96
96
# file doesn't contain a password
97
97
print_status ( "#{ file } does not contain any saved passwords" )
@@ -101,7 +101,8 @@ def run
101
101
end
102
102
103
103
# store the hash close the file
104
- hash = password [ 1 ] . split ( "password" ) . join . chomp
104
+ password = password . delete_if { |e | e !~ /password.+=.+=\r / }
105
+ hash = password [ 0 ] . split ( "password" ) . join . chomp
105
106
print_status ( "Spark password hash: #{ hash } " ) if datastore [ 'VERBOSE' ]
106
107
config . close
107
108
You can’t perform that action at this time.
0 commit comments