diff --git a/data/sql/migrate/021_standardize_info_and_data.rb b/data/sql/migrate/021_standardize_info_and_data.rb new file mode 100644 index 0000000000..bb9a2bccd6 --- /dev/null +++ b/data/sql/migrate/021_standardize_info_and_data.rb @@ -0,0 +1,18 @@ +class StandardizeInfoAndData < ActiveRecord::Migration + def self.up + # Remove the host requirement. We'll add the column back in below. + remove_column :vulns, :data + change_table :vulns do |t| + t.string :info, :limit => 65536 + end + end + + def self.down + remove_column :vulns, :info + change_table :notes do |t| + t.string :data, :limit => 65536 + + end + end +end + diff --git a/lib/msf/core/db.rb b/lib/msf/core/db.rb index a90439d94f..009bb5c100 100644 --- a/lib/msf/core/db.rb +++ b/lib/msf/core/db.rb @@ -622,14 +622,15 @@ class DBManager # :name -- the scanner-specific id of the vuln (e.g. NEXPOSE-cifs-acct-password-never-expires) # # opts can contain - # :data -- a human readable description of the vuln, free-form text + # :info -- a human readable description of the vuln, free-form text # :refs -- an array of Ref objects or string names of references # def report_vuln(opts) return if not active raise ArgumentError.new("Missing required option :host") if opts[:host].nil? + raise ArgumentError.new("Deprecated data column for vuln, use .info instead") if opts[:data] name = opts[:name] || return - data = opts[:data] + info = opts[:info] wait = opts.delete(:wait) wspace = opts.delete(:workspace) || workspace rids = nil @@ -662,8 +663,8 @@ class DBManager host = get_host(:workspace => wspace, :address => addr) end - if data - vuln = host.vulns.find_or_initialize_by_name_and_data(name, data, :include => :refs) + if info + vuln = host.vulns.find_or_initialize_by_name_and_info(name, info, :include => :refs) else vuln = host.vulns.find_or_initialize_by_name(name, :include => :refs) end