removed reports_exist check

git-svn-id: file:///home/svn/framework3/trunk@5785 4d416f70-5f16-0410-b530-b9f4589650da
This commit is contained in:
et 2008-10-23 04:23:54 +00:00
parent c4dc77c15b
commit 29e983567e
3 changed files with 23 additions and 23 deletions

View File

@ -26,13 +26,17 @@ module Auxiliary::WMAPModule
end
def wmap_base_report_id(host,port,ssl)
if not ssl
num_ssl = 0
else
num_ssl = 1
if framework.db.report_active?
if not ssl
num_ssl = 0
else
num_ssl = 1
end
return framework.db.last_report_id(host,port,num_ssl)
end
framework.db.last_report_id(host,port,num_ssl)
nil
end
#
@ -40,15 +44,13 @@ module Auxiliary::WMAPModule
# It return the id to be used to add context to additional data
#
def wmap_report(parent_id,entity,etype,value,notes)
framework.db.create_report(parent_id,entity,etype,value,notes,self.name)
if parent_id and framework.db.report_active?
return framework.db.create_report(parent_id,entity,etype,value,notes,self.name)
end
nil
end
#
# Report if report exists
#
def wmap_report_exists?
framework.db.report_exists?
end
#modified from CGI.rb as we dont use arrays
def headersparse(qheaders)

View File

@ -411,7 +411,7 @@ class DBManager
# Selected id
#
def selected_id
Target.find(:first, :conditions => ["selected > 0"] ).id
Target.find(:first, :conditions => ["selected > 0"] ).object_id
end
#
@ -595,7 +595,7 @@ class DBManager
#
# Quick way to identify if the report database is available
#
def report_exists?
def report_active?
begin
Report.table_exists?
rescue
@ -605,4 +605,4 @@ class DBManager
end
end
end

View File

@ -47,14 +47,12 @@ class Metasploit3 < Msf::Auxiliary
extra = http_fingerprint(res)
print_status("#{ip} is running #{res.headers['Server']}#{extra}")
if wmap_report_exists?
rep_id = wmap_base_report_id(
self.target_host,
self.target_port,
self.ssl
)
wmap_report(rep_id,'WEB_SERVER','TYPE',"#{res.headers['Server']}#{extra}",nil)
end
rep_id = wmap_base_report_id(
self.target_host,
self.target_port,
self.ssl
)
wmap_report(rep_id,'WEB_SERVER','TYPE',"#{res.headers['Server']}#{extra}",nil)
end
rescue ::Rex::ConnectionRefused, ::Rex::HostUnreachable, ::Rex::ConnectionTimeout