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
<tasos.laskos@gmail.com>
<zapotek@segfault.gr>
@version: 0.1.1
Direct Known Subclasses
Constant Summary
Constant Summary
Constants inherited from ComponentManager
ComponentManager::EXCLUDE, ComponentManager::WILDCARD
Class Method Summary (collapse)
- + (Object) 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)
Class method.
-
+ (Object) results
Class method.
Instance Method Summary (collapse)
- - (Object) do_not_store!
-
- (Manager) initialize(opts)
constructor
A new instance of Manager.
- - (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) results
-
- (Object) run(page, framework = nil)
Runs all modules against 'page'.
-
- (Object) run_one(mod, page, framework = nil)
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
- (Manager) initialize(opts)
A new instance of Manager
46 47 48 49 |
# File 'lib/arachni/module/manager.rb', line 46 def initialize( opts ) super( opts.dir['modules'], Arachni::Modules ) @opts = opts end |
Class Method Details
+ (Object) do_not_store!
82 83 84 |
# File 'lib/arachni/module/manager.rb', line 82 def self.do_not_store! @@do_not_store = true end |
+ (Object) issue_set
123 124 125 126 127 |
# File 'lib/arachni/module/manager.rb', line 123 def self.issue_set @@issue_mutex.synchronize { @@issue_set } end |
+ (Object) issue_set_id_from_elem(mod_name, elem)
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 |
+ (Object) issue_set_id_from_issue(issue)
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 |
+ (Object) on_register_results(&block)
76 77 78 |
# File 'lib/arachni/module/manager.rb', line 76 def self.on_register_results( &block ) @@on_register_results << block end |
+ (Object) register_results(results)
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 |
+ (Object) results
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
- (Object) do_not_store!
85 |
# File 'lib/arachni/module/manager.rb', line 85 def do_not_store!() self.class.do_not_store! end |
- (Object) issue_set
128 |
# File 'lib/arachni/module/manager.rb', line 128 def issue_set() self.class.issue_set end |
- (Object) issue_set_id_from_elem(mod_name, elem)
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 |
- (Object) issue_set_id_from_issue(issue)
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 |
- (Object) on_register_results(&block)
79 |
# File 'lib/arachni/module/manager.rb', line 79 def on_register_results( &block ) self.class.on_register_results( &block ) end |
- (Object) register_results(results)
105 |
# File 'lib/arachni/module/manager.rb', line 105 def register_results( results ) self.class.register_results( results ) end |
- (Object) results
142 |
# File 'lib/arachni/module/manager.rb', line 142 def results() self.class.results end |
- (Object) run(page, framework = nil)
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 |
- (Object) run_one(mod, page, framework = nil)
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 |