Class: Arachni::Module::Manager
- Inherits:
-
ComponentManager
- Object
- Hash
- ComponentManager
- Arachni::Module::Manager
- Includes:
- Utilities, UI::Output
- Defined in:
- lib/arachni/module/manager.rb
Overview
Arachni::Module::Manager class
Holds and manages the modules and their results.
@author: Tasos “Zapotek” Laskos
<[email protected]>
<[email protected]>
@version: 0.1.1
Direct Known Subclasses
Constant Summary
Constants inherited from ComponentManager
ComponentManager::EXCLUDE, ComponentManager::WILDCARD
Class Method Summary collapse
- .do_not_store! ⇒ Object
- .issue_set ⇒ Object
- .issue_set_id_from_elem(mod_name, elem) ⇒ Object
- .issue_set_id_from_issue(issue) ⇒ Object
- .on_register_results(&block) ⇒ Object
-
.register_results(results) ⇒ Object
Class method.
-
.results ⇒ Object
Class method.
Instance Method Summary collapse
- #do_not_store! ⇒ Object
-
#initialize(opts) ⇒ Manager
constructor
A new instance of Manager.
- #issue_set ⇒ Object
- #issue_set_id_from_elem(mod_name, elem) ⇒ Object
- #issue_set_id_from_issue(issue) ⇒ Object
- #on_register_results(&block) ⇒ Object
- #register_results(results) ⇒ Object
- #results ⇒ Object
-
#run(page, framework = nil) ⇒ Object
Runs all modules against ‘page’.
-
#run_one(mod, page, framework = nil) ⇒ Object
Runs a single module against ‘page’.
Methods included from Utilities
#exception_jail, #get_path, #hash_keys_to_str, #normalize_url, #read_file, #seed, #uri_decode, #uri_encode, #uri_parse, #uri_parser, #url_sanitize
Methods included from UI::Output
#buffer, #debug!, #debug?, #flush_buffer, #mute!, #muted?, #only_positives!, #only_positives?, #print_bad, #print_debug, #print_debug_backtrace, #print_debug_pp, #print_error, #print_error_backtrace, #print_info, #print_line, #print_ok, #print_status, #print_verbose, #reroute_to_file, #reroute_to_file?, #uncap_buffer!, #unmute!, #verbose!, #verbose?
Methods inherited from ComponentManager
#[], #available, #load, #name_to_path, #parse, #path_to_name, #paths, #prep_opts, #wilcard_to_names
Constructor Details
Class Method Details
.do_not_store! ⇒ Object
82 83 84 |
# File 'lib/arachni/module/manager.rb', line 82 def self.do_not_store! @@do_not_store = true end |
.issue_set ⇒ Object
123 124 125 126 127 |
# File 'lib/arachni/module/manager.rb', line 123 def self.issue_set @@issue_mutex.synchronize { @@issue_set } end |
.issue_set_id_from_elem(mod_name, elem) ⇒ Object
115 116 117 118 119 120 |
# File 'lib/arachni/module/manager.rb', line 115 def self.issue_set_id_from_elem( mod_name, elem ) elem_url = URI( elem.action ) elem_url_str = elem_url.scheme + "://" + elem_url.host + elem_url.path return "#{mod_name}:#{elem.type}:#{elem.altered}:#{elem_url_str}" end |
.issue_set_id_from_issue(issue) ⇒ Object
107 108 109 110 111 |
# File 'lib/arachni/module/manager.rb', line 107 def self.issue_set_id_from_issue( issue ) issue_url = URI( issue.url ) issue_url_str = issue_url.scheme + "://" + issue_url.host + issue_url.path return "#{issue.mod_name}:#{issue.elem}:#{issue.var}:#{issue_url_str}" end |
.on_register_results(&block) ⇒ Object
76 77 78 |
# File 'lib/arachni/module/manager.rb', line 76 def self.on_register_results( &block ) @@on_register_results << block end |
.register_results(results) ⇒ Object
Class method
Registers module results with…well..us.
94 95 96 97 98 99 100 101 102 103 104 |
# File 'lib/arachni/module/manager.rb', line 94 def self.register_results( results ) @@on_register_results.each { |block| block.call( results ) } return if @@do_not_store @@issue_mutex.synchronize { @@results |= results results.each { |issue| @@issue_set << self.issue_set_id_from_issue( issue ) } } end |
.results ⇒ Object
Class method
Gets module results
137 138 139 140 141 |
# File 'lib/arachni/module/manager.rb', line 137 def self.results @@issue_mutex.synchronize { @@results } end |
Instance Method Details
#do_not_store! ⇒ Object
85 |
# File 'lib/arachni/module/manager.rb', line 85 def do_not_store!() self.class.do_not_store! end |
#issue_set ⇒ Object
128 |
# File 'lib/arachni/module/manager.rb', line 128 def issue_set() self.class.issue_set end |
#issue_set_id_from_elem(mod_name, elem) ⇒ Object
121 |
# File 'lib/arachni/module/manager.rb', line 121 def issue_set_id_from_elem( mod_name, elem ) self.class.issue_set_id_from_elem( mod_name, elem ) end |
#issue_set_id_from_issue(issue) ⇒ Object
112 |
# File 'lib/arachni/module/manager.rb', line 112 def issue_set_id_from_issue( issue ) self.class.issue_set_id_from_issue( issue ) end |
#on_register_results(&block) ⇒ Object
79 |
# File 'lib/arachni/module/manager.rb', line 79 def on_register_results( &block ) self.class.on_register_results( &block ) end |
#register_results(results) ⇒ Object
105 |
# File 'lib/arachni/module/manager.rb', line 105 def register_results( results ) self.class.register_results( results ) end |
#results ⇒ Object
142 |
# File 'lib/arachni/module/manager.rb', line 142 def results() self.class.results end |
#run(page, framework = nil) ⇒ Object
Runs all modules against ‘page’.
57 58 59 |
# File 'lib/arachni/module/manager.rb', line 57 def run( page, framework = nil ) keys.each { |mod| exception_jail( false ){ run_one( mod, page, framework ) } } end |
#run_one(mod, page, framework = nil) ⇒ Object
Runs a single module against ‘page’.
68 69 70 71 72 73 74 |
# File 'lib/arachni/module/manager.rb', line 68 def run_one( mod, page, framework = nil ) mod_new = mod.new( page ) mod_new.set_framework( framework ) if framework mod_new.prepare mod_new.run mod_new.clean_up end |