host is always an Mdm::Host, don't look it up again
parent
466ef4349e
commit
3b8d70b567
|
@ -76,10 +76,10 @@ module Msf::DBManager::ExploitAttempt
|
|||
:username => username || "unknown",
|
||||
}
|
||||
|
||||
# Report a vuln_attempt if we found a match
|
||||
# We have match, lets create a vuln_attempt record
|
||||
if vuln
|
||||
vuln.vuln_attempts.create(attempt_info)
|
||||
attempt_info[:vuln_id] = vuln.id
|
||||
vuln.vuln_attempts.create(attempt_info)
|
||||
end
|
||||
|
||||
# Report an exploit attempt all the same
|
||||
|
@ -99,8 +99,8 @@ module Msf::DBManager::ExploitAttempt
|
|||
end
|
||||
|
||||
def report_exploit_success(opts)
|
||||
::ActiveRecord::Base.connection_pool.with_connection {
|
||||
|
||||
::ActiveRecord::Base.connection_pool.with_connection {
|
||||
wspace = opts.delete(:workspace) || workspace
|
||||
mrefs = opts.delete(:refs) || return
|
||||
host = opts.delete(:host)
|
||||
|
@ -113,14 +113,7 @@ module Msf::DBManager::ExploitAttempt
|
|||
username = opts.delete(:username)
|
||||
mname = opts.delete(:module)
|
||||
|
||||
# Look up or generate the host as appropriate
|
||||
if not (host and host.kind_of? ::Mdm::Host)
|
||||
if svc.kind_of? ::Mdm::Service
|
||||
host = svc.host
|
||||
else
|
||||
host = report_host(:workspace => wspace, :address => host )
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
# Bail if we dont have a host object
|
||||
return if not host
|
||||
|
@ -150,13 +143,13 @@ module Msf::DBManager::ExploitAttempt
|
|||
:module => mname,
|
||||
:username => username || "unknown",
|
||||
}
|
||||
|
||||
attempt_info[:session_id] = opts[:session_id] if opts[:session_id]
|
||||
attempt_info[:loot_id] = opts[:loot_id] if opts[:loot_id]
|
||||
|
||||
# We have match, lets create a vuln_attempt record
|
||||
if vuln
|
||||
attempt_info[:vuln_id] = vuln.id,
|
||||
|
||||
vuln.vuln_attempts.create(attempt_info)
|
||||
|
||||
# Correct the vuln's associated service if necessary
|
||||
|
|
Loading…
Reference in New Issue