Module: Msf::Module::HasActions
- Included in:
- PostMixin
- Defined in:
- lib/msf/core/module/has_actions.rb
Instance Attribute Summary collapse
-
#actions ⇒ Object
Allow access to the hash table of actions and the string containing the default action.
-
#default_action ⇒ Object
Allow access to the hash table of actions and the string containing the default action.
-
#passive ⇒ Object
Allow access to the hash table of actions and the string containing the default action.
-
#passive_actions ⇒ Object
Allow access to the hash table of actions and the string containing the default action.
Instance Method Summary collapse
- #action ⇒ Object
- #find_action(name) ⇒ Object
- #initialize(info = {}) ⇒ Object
-
#passive? ⇒ Boolean
Returns a boolean indicating whether this module should be run passively.
-
#passive_action?(name) ⇒ Boolean
Returns a boolean indicating whether this specific action should be run passively.
Instance Attribute Details
#actions ⇒ Object
Allow access to the hash table of actions and the string containing the default action
50 51 52 |
# File 'lib/msf/core/module/has_actions.rb', line 50 def actions @actions end |
#default_action ⇒ Object
Allow access to the hash table of actions and the string containing the default action
50 51 52 |
# File 'lib/msf/core/module/has_actions.rb', line 50 def default_action @default_action end |
#passive ⇒ Object
Allow access to the hash table of actions and the string containing the default action
50 51 52 |
# File 'lib/msf/core/module/has_actions.rb', line 50 def passive @passive end |
#passive_actions ⇒ Object
Allow access to the hash table of actions and the string containing the default action
50 51 52 |
# File 'lib/msf/core/module/has_actions.rb', line 50 def passive_actions @passive_actions end |
Instance Method Details
#action ⇒ Object
16 17 18 19 20 |
# File 'lib/msf/core/module/has_actions.rb', line 16 def action sa = datastore['ACTION'] return find_action(default_action) if not sa return find_action(sa) end |
#find_action(name) ⇒ Object
22 23 24 25 26 27 28 |
# File 'lib/msf/core/module/has_actions.rb', line 22 def find_action(name) return nil if not name actions.each do |a| return a if a.name == name end return nil end |
#initialize(info = {}) ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 |
# File 'lib/msf/core/module/has_actions.rb', line 4 def initialize(info={}) super self.actions = Rex::Transformer.transform( info['Actions'], Array, [ Msf::Module::AuxiliaryAction ], 'AuxiliaryAction' ) self.passive = (info['Passive'] and info['Passive'] == true) || false self.default_action = info['DefaultAction'] self.passive_actions = info['PassiveActions'] || [] end |
#passive? ⇒ Boolean
Returns a boolean indicating whether this module should be run passively
33 34 35 36 37 |
# File 'lib/msf/core/module/has_actions.rb', line 33 def passive? act = action() return passive_action?(act.name) if act return self.passive end |
#passive_action?(name) ⇒ Boolean
Returns a boolean indicating whether this specific action should be run passively
42 43 44 |
# File 'lib/msf/core/module/has_actions.rb', line 42 def passive_action?(name) passive_actions.include?(name) end |