Module: Arachni::Framework::Parts::Plugin

Included in:
Arachni::Framework
Defined in:
lib/arachni/framework/parts/plugin.rb

Overview

Provides a Plugin::Manager and related helpers.

Author:

  • Tasos “Zapotek” Laskos <tasos.laskos@arachni-scanner.com>

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#pluginsArachni::Plugin::Manager (readonly)



19
20
21
# File 'lib/arachni/framework/parts/plugin.rb', line 19

def plugins
  @plugins
end

Instance Method Details

#initializeObject



21
22
23
24
# File 'lib/arachni/framework/parts/plugin.rb', line 21

def initialize
    super
    @plugins = Arachni::Plugin::Manager.new( self )
end

#list_plugins(patterns = nil) ⇒ Array<Hash>

Returns Information about all available Plugins.

Returns:



28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/arachni/framework/parts/plugin.rb', line 28

def list_plugins( patterns = nil )
    loaded = @plugins.loaded

    begin
        @plugins.clear
        @plugins.available.map do |plugin|
            path = @plugins.name_to_path( plugin )
            next if patterns && !@plugins.matches_globs?( path, patterns )

            @plugins[plugin].info.merge(
                options:   @plugins[plugin].info[:options] || [],
                shortname: plugin,
                path:      path,
                author:    [@plugins[plugin].info[:author]].
                               flatten.map { |a| a.strip }
            )
        end.compact
    ensure
        @plugins.clear
        @plugins.load loaded
    end
end