Package core :: Package controllers :: Package basePlugin :: Module basePlugin :: Class basePlugin
[hide private]

Class basePlugin




This is the base class for ALL plugins, all plugins should inherit from it and implement the following method :
  1. getPluginDeps()
Please note that this class is a configurable object, so it must implement:
  1. setOptions( OptionList )
  2. getOptions()



Author: Andres Riancho ( andres.riancho@gmail.com )

Instance Methods [hide private]
 
__eq__(self, other)
This function is called when extending a list of plugin instances.
 
__init__(self)
 
_analyzeResult(self, mutant, res)
Analyze the result of sending the mutant to the remote web server.
 
_sendMutant(self, mutant, analyze=True, grepResult=True, analyze_callback=None)
Sends a mutant to the remote web server.
 
end(self)
This method is called by w3afCore to let the plugin know that it wont be used anymore.
 
getDesc(self)
Returns: A description of the plugin.
 
getLongDesc(self)
Returns: A DETAILED description of the plugin functions and features.
 
getName(self)
 
getOptions(self)
Returns: A list of option objects for this plugin.
 
getPluginDeps(self)
Returns: A list with the names of the plugins that should be runned before the current one.
 
getType(self)
 
printUniq(self, infoObjList, unique)
Print the items of infoObjList to the user interface
 
setOptions(self, optionsMap)
Sets the Options given on the OptionList to self.
 
setUrlOpener(self, urlOpener)
This method should not be overwritten by any plugin (but you are free to do it, for example a good idea is to rewrite this method to change the UrlOpener to do some IDS evasion technic).
Method Details [hide private]

_analyzeResult(self, mutant, res)

 
Analyze the result of sending the mutant to the remote web server.
Parameters:
  • mutant - The mutated request.
  • res - The HTTP response.

end(self)

 
This method is called by w3afCore to let the plugin know that it wont be used anymore. This is helpfull to do some final tests, free some structures, etc.

getDesc(self)

 
Returns:
A description of the plugin.

getLongDesc(self)

 
Returns:
A DETAILED description of the plugin functions and features.

getName(self)

 
Overrides: configurable.configurable.getName

getOptions(self)

 

This method returns an optionList containing the options objects that the configurable object has. Using this option list the framework will build a window, a menu, or some other input method to retrieve the info from the user.

This method MUST be implemented on every plugin.
Returns:
A list of option objects for this plugin.
Overrides: configurable.configurable.getOptions

getPluginDeps(self)

 
Returns:
A list with the names of the plugins that should be runned before the current one.

getType(self)

 
Overrides: configurable.configurable.getType

printUniq(self, infoObjList, unique)

 
Print the items of infoObjList to the user interface
Parameters:
  • infoObjList - A list of info objects
  • unique - Defines whats unique:
    • 'URL': The URL must be unique
    • 'VAR': The url/variable combination must be unique
    • None: Print all vulns, nothing should be unique

setOptions(self, optionsMap)

 

Sets the Options given on the OptionList to self. The options are the result of a user entering some data on a window that was constructed using the options that were retrieved from the plugin using getOptions()

This method MUST be implemented on every plugin.
Returns:
No value is returned.
Overrides: configurable.configurable.setOptions

setUrlOpener(self, urlOpener)

 

This method should not be overwritten by any plugin (but you are free to do it, for example a good idea is to rewrite this method to change the UrlOpener to do some IDS evasion technic).

This method takes a CustomUrllib object as parameter and assigns it to itself. Then, on the testUrl method you use self.CustomUrlOpener._custom_urlopen(...) to open a Url and you are sure that the plugin is using the user supplied settings (proxy, user agent, etc).
Returns:
No value is returned.