allow Msf::Module::SiteRefence to be reported via report_vuln; report module references when creating vulns from a successful exploit

git-svn-id: file:///home/svn/framework3/trunk@8867 4d416f70-5f16-0410-b530-b9f4589650da
unstable
James Lee 2010-03-21 23:12:37 +00:00
parent 480380003c
commit 25f9458c86
2 changed files with 6 additions and 1 deletions

View File

@ -604,6 +604,9 @@ class DBManager
if opts[:refs]
rids = []
opts[:refs].each do |r|
if r.respond_to? :ctx_id
r = r.ctx_id + '-' + r.ctx_val
end
rids << find_or_create_ref(:name => r)
end
end
@ -725,7 +728,7 @@ class DBManager
end
def events(wspace=workspace)
wspace.events
wspace.events.find :all, :order => 'created_at ASC'
end
def report_event(opts = {})

View File

@ -314,9 +314,11 @@ class FrameworkEventSubscriber
# If the exploit used was multi/handler, though, we don't know what
# it's vulnerable to, so it isn't really useful to save it.
if session.via_exploit and session.via_exploit != "exploit/multi/handler"
mod = framework.modules.create(session.via_exploit)
info = {
:host => address,
:name => session.via_exploit,
:refs => mod.references,
:workspace => framework.db.find_workspace(session.workspace)
}
framework.db.report_vuln(info)