Export host_details and vuln_details, add missing refs to db_export

unstable
HD Moore 2012-06-08 22:55:55 -05:00
parent 376aaa410b
commit 465998bc17
3 changed files with 37 additions and 1 deletions

View File

@ -3393,6 +3393,12 @@ class DBManager
}
host_address = host_data[:host].dup # Preserve after report_host() deletes
hobj = report_host(host_data)
# XXX: HOST_DETAILS
host.elements["host_details"].each do |hdet|
hdet_data = {}
end
host.elements.each('services/service') do |service|
service_data = {}
service_data[:workspace] = wspace

View File

@ -362,6 +362,16 @@ class Export
report_file.write(" #{el}\n") # Not checking types
end
# Host details sub-elements
report_file.write(" <host_details>\n")
h.host_details.find(:all).each do |d|
d.attributes.each_pair do |k,v|
el = create_xml_element(k,v)
report_file.write(" #{el}\n")
end
end
report_file.write(" </host_details>\n")
# Service sub-elements
report_file.write(" <services>\n")
@services.find_all_by_host_id(host_id).each do |e|
@ -394,6 +404,26 @@ class Export
el = create_xml_element(k,v)
report_file.write(" #{el}\n")
end
# References
report_file.write(" <refs>\n")
e.refs.each do |ref|
el = create_xml_element("ref",ref.name)
report_file.write(" #{el}\n")
end
report_file.write(" </refs>\n")
# Vuln details sub-elements
report_file.write(" <vuln_details>\n")
e.vuln_details.find(:all).each do |d|
d.attributes.each_pair do |k,v|
el = create_xml_element(k,v)
report_file.write(" #{el}\n")
end
end
report_file.write(" </vuln_details>\n")
report_file.write(" </vuln>\n")
end
report_file.write(" </vulns>\n")

View File

@ -302,7 +302,7 @@ class DBManager
success = false
end
::FileUtils.rm_rf(temp_dir)
# ::FileUtils.rm_rf(temp_dir)
return true
end