Class: Arachni::Plugin::Base Abstract

Inherits:
Object
  • Object
show all
Includes:
Module::Output, Module::Utilities
Defined in:
lib/arachni/plugin/base.rb

Overview

This class is abstract.

Arachni::Plugin::Base class

An abstract class for the plugins.<br/> All plugins must extend this.

@author: Tasos “Zapotek” Laskos

<[email protected]>
<[email protected]>

@version: 0.1.1

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Module::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 Module::Output

#o_print_bad, #o_print_debug, #o_print_error, #o_print_info, #o_print_line, #o_print_ok, #o_print_status, #o_print_verbose, #print_bad, #print_debug, #print_error, #print_info, #print_line, #print_ok, #print_status, #print_verbose

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?

Constructor Details

#initialize(framework, options) ⇒ Base

Returns a new instance of Base.

Parameters:



59
60
61
62
# File 'lib/arachni/plugin/base.rb', line 59

def initialize( framework, options )
    @framework = framework
    @options   = options
end

Class Method Details

.distributable?Boolean

OPTIONAL

Only used when in Grid mode.

Should the plug-in be distributed across all instances or only run by the master prior to any distributed operations?

For example, if a plug-in dynamically modifies the framework options in any way and wants these changes to be identical across instances this method should return ‘false’.

Returns:

  • (Boolean)


107
108
109
# File 'lib/arachni/plugin/base.rb', line 107

def self.distributable?
    false
end

.gemsObject



90
91
92
# File 'lib/arachni/plugin/base.rb', line 90

def self.gems
    [ ]
end

.infoObject

REQUIRED

Do not omit any of the info.



127
128
129
130
131
132
133
134
135
136
137
138
139
# File 'lib/arachni/plugin/base.rb', line 127

def self.info
    {
        :name           => 'Abstract plugin class',
        :description    => %q{Abstract plugin class.},
        :author         => 'Tasos "Zapotek" Laskos <[email protected]>',
        :version        => '0.1',
        :options        => [
            #                        option name       required?       description                     default
            # Arachni::OptBool.new( 'print_framework', [ false, 'Do you want to print the framework?', false ] ),
            # Arachni::OptString.new( 'my_name_is',    [ false, 'What\'s you name?', 'Tasos' ] ),
        ]
    }
end

.merge(results) ⇒ Object

REQUIRED IF self.distributable? RETURNS ‘TRUE’

Only used when in Grid mode.

Merges an array of results as gathered by the plug-in when run by multiple instances.



119
120
# File 'lib/arachni/plugin/base.rb', line 119

def self.merge( results )
end

Instance Method Details

#clean_upObject

OPTIONAL



82
83
84
# File 'lib/arachni/plugin/base.rb', line 82

def clean_up( )

end

#prepareObject

OPTIONAL



68
69
70
# File 'lib/arachni/plugin/base.rb', line 68

def prepare( )

end

#register_results(results) ⇒ Object



141
142
143
# File 'lib/arachni/plugin/base.rb', line 141

def register_results( results )
    @framework.plugin_store( self, results )
end

#runObject

REQUIRED



75
76
77
# File 'lib/arachni/plugin/base.rb', line 75

def run( )

end

#wait_while_framework_runningObject



86
87
88
# File 'lib/arachni/plugin/base.rb', line 86

def wait_while_framework_running
    ::IO.select( nil, nil, nil, 1 ) while( @framework.running? )
end