Skip to content

Commit e1f1077

Browse files
committed
Use create_cracked_credential
1 parent d564a85 commit e1f1077

File tree

1 file changed

+10
-16
lines changed

1 file changed

+10
-16
lines changed

modules/auxiliary/scanner/ipmi/ipmi_dumphashes.rb

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ def run_host(ip)
180180

181181
# Write the rakp hash to the database
182182
hash = "#{rhost} #{username}:$rakp$#{sha1_salt}$#{sha1_hash}"
183-
report_hash(username, hash)
183+
core_id = report_hash(username, hash)
184184
# Write the vulnerability to the database
185185
unless reported_vuln
186186
report_vuln(
@@ -205,7 +205,7 @@ def run_host(ip)
205205
print_good("#{rhost}:#{rport} - IPMI - Hash for user '#{username}' matches password '#{pass}'")
206206

207207
# Report the clear-text credential to the database
208-
report_cracked_cred(username, pass)
208+
report_cracked_cred(username, pass, core_id)
209209
break
210210
end
211211
end
@@ -269,24 +269,18 @@ def report_hash(user, hash)
269269
status: Metasploit::Model::Login::Status::UNTRIED
270270
}.merge(service_data)
271271

272-
create_credential_login(login_data)
272+
cl = create_credential_login(login_data)
273+
cl.core_id
273274
end
274275

275-
def report_cracked_cred(user, password)
276-
credential_data = {
277-
module_fullname: self.fullname,
278-
origin_type: :service,
279-
private_data: password,
280-
private_type: :password,
276+
def report_cracked_cred(user, password, core_id)
277+
cred_data = {
278+
core_id: core_id,
281279
username: user,
282-
}.merge(service_data)
283-
284-
login_data = {
285-
core: create_credential(credential_data),
286-
status: Metasploit::Model::Login::Status::UNTRIED
287-
}.merge(service_data)
280+
password: password
281+
}
288282

289-
create_credential_login(login_data)
283+
create_cracked_credential(cred_data)
290284
end
291285

292286
#

0 commit comments

Comments
 (0)