Class: FIDIUS::EvasionDB::Knowledge::AttackModule
- Inherits:
-
Connection
- Object
- ActiveRecord::Base
- Connection
- FIDIUS::EvasionDB::Knowledge::AttackModule
- Defined in:
- lib/evasion-db/knowledge/attack_module.rb
Overview
Represents an Attack in metasploit this would be exploits or auxiliaries
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.find_or_create_by_name_and_options(name, options) ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/evasion-db/knowledge/attack_module.rb', line 16 def self.(name,) hash = Digest::MD5.hexdigest(.to_s) attack_module = self.(name,hash) if attack_module..size == 0 attack_module. = hash $logger.debug "PAYLOAD: #{['PAYLOAD']}" attack_module.attack_payload = AttackPayload.new(:name=>["Payload"]) if ["Payload"] .each do |k,v| attack_module. << AttackOption.new(:option_key=>k,:option_value=>v) end attack_module.save end attack_module end |
.table_name ⇒ Object
12 13 14 |
# File 'lib/evasion-db/knowledge/attack_module.rb', line 12 def self.table_name "attack_modules" end |
Instance Method Details
#has_option(k, v) ⇒ Object
31 32 33 |
# File 'lib/evasion-db/knowledge/attack_module.rb', line 31 def has_option(k,v) .find_by_option_key_and_option_value(k,v) != nil end |
#has_options(options = {}) ⇒ Object
35 36 37 38 39 40 |
# File 'lib/evasion-db/knowledge/attack_module.rb', line 35 def ( = {}) .each do |k,v| return false if !self.has_option(k,v) end true end |