0bb79ba890
[#46491831] Move Msf::DBManager#import_msf_xml into Msf::DBManager::ImportMsfXml#import_msf_xml and include Msf::DBManager::ImportMsfXml to cut down size of the infamous db.rb. Break up #import_msf_xml to have separate methods for parsing web_forms, web_pages, and web_vulns. The method for web_vulns, #import_msf_web_vuln_element is needed so that it can be overridden in Pro to handle the Pro-only changes to Mdm::WebVuln.
34 lines
649 B
Ruby
34 lines
649 B
Ruby
FactoryGirl.define do
|
|
factory :mdm_web_form, :class => Mdm::WebForm do
|
|
#
|
|
# Associations
|
|
#
|
|
association :web_site, :factory => :mdm_web_site
|
|
|
|
# attributes that would be in web_form element from Pro export
|
|
trait :exported do
|
|
method { generate :mdm_web_form_method }
|
|
params { generate :mdm_web_form_params }
|
|
path { generate :mdm_web_form_path }
|
|
end
|
|
end
|
|
|
|
methods = ['GET', 'POST']
|
|
|
|
sequence :mdm_web_form_method do |n|
|
|
methods[n % methods.length]
|
|
end
|
|
|
|
sequence :mdm_web_form_params do |n|
|
|
[
|
|
[
|
|
"name#{n}",
|
|
"value#{n}"
|
|
]
|
|
]
|
|
end
|
|
|
|
sequence :mdm_web_form_path do |n|
|
|
"path/to/web/form/#{n}"
|
|
end
|
|
end |