diff --git a/data/sql/migrate/20101104135100_add_imported_creds.rb b/data/sql/migrate/20101104135100_add_imported_creds.rb new file mode 100644 index 0000000000..92eb12d474 --- /dev/null +++ b/data/sql/migrate/20101104135100_add_imported_creds.rb @@ -0,0 +1,17 @@ +class AddImportedCreds < ActiveRecord::Migration + + def self.up + create_table :imported_creds do |t| + t.integer :workspace_id, :null => false, :default => 1 + t.string :user, :limit => 512 + t.string :pass, :limit => 512 + t.string :ptype, :limit => 16, :default => "password" + end + end + + def self.down + drop_table :imported_creds + end + +end + diff --git a/lib/msf/core/model.rb b/lib/msf/core/model.rb index de7b2f91e1..1afc95b9f2 100644 --- a/lib/msf/core/model.rb +++ b/lib/msf/core/model.rb @@ -33,3 +33,5 @@ require 'msf/core/model/web_page' require 'msf/core/model/web_form' require 'msf/core/model/web_vuln' +require 'msf/core/model/imported_cred' + diff --git a/lib/msf/core/model/imported_cred.rb b/lib/msf/core/model/imported_cred.rb new file mode 100644 index 0000000000..a3b061d47d --- /dev/null +++ b/lib/msf/core/model/imported_cred.rb @@ -0,0 +1,12 @@ +module Msf +class DBManager + +class ImportedCred < ActiveRecord::Base + include DBSave + + belongs_to :workspace +end + +end +end + diff --git a/lib/msf/core/model/workspace.rb b/lib/msf/core/model/workspace.rb index 14b895454b..4805a7ffba 100644 --- a/lib/msf/core/model/workspace.rb +++ b/lib/msf/core/model/workspace.rb @@ -17,6 +17,7 @@ class Workspace < ActiveRecord::Base has_many :clients, :through => :hosts has_many :vulns, :through => :hosts has_many :creds, :dependent => :destroy + has_many :imported_creds, :dependent => :destroy has_many :exploited_hosts, :through => :hosts