2009-12-14 22:52:34 +00:00
|
|
|
module Msf
|
|
|
|
class DBManager
|
|
|
|
|
|
|
|
class Service < ActiveRecord::Base
|
|
|
|
include DBSave
|
|
|
|
has_many :vulns, :dependent => :destroy
|
2009-12-29 23:48:45 +00:00
|
|
|
has_many :notes, :dependent => :destroy
|
2010-08-18 00:58:20 +00:00
|
|
|
has_many :creds, :dependent => :destroy
|
2010-08-24 21:57:04 +00:00
|
|
|
has_many :exploited_hosts, :dependent => :destroy
|
2010-10-02 18:48:29 +00:00
|
|
|
has_many :web_sites, :dependent => :destroy
|
2009-12-14 22:52:34 +00:00
|
|
|
belongs_to :host
|
2010-10-02 18:48:29 +00:00
|
|
|
|
|
|
|
has_many :web_pages, :through => :web_sites
|
|
|
|
has_many :web_forms, :through => :web_sites
|
|
|
|
has_many :web_vulns, :through => :web_sites
|
|
|
|
|
2010-07-06 16:20:04 +00:00
|
|
|
serialize :info
|
2011-04-07 21:59:32 +00:00
|
|
|
|
|
|
|
def after_save
|
|
|
|
if info_changed?
|
|
|
|
host.normalize_os
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2009-12-14 22:52:34 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|
2009-12-29 23:48:45 +00:00
|
|
|
end
|
2010-07-06 16:20:04 +00:00
|
|
|
|