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

View File

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

View File

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