Package core :: Package controllers :: Package basePlugin :: Module basePlugin :: Class basePlugin
[hide private]
[frames] | no frames]

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. getOptionsXML()



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)
  _sendMutant(self, mutant, analyze=True, grepResult=True)
Sends a mutant to the remote web server.
  getDesc(self)
  getLongDesc(self)
  getName(self)
  getOptionsXML(self)
This method returns a XML containing the Options that the plugin has.
  getPluginDeps(self)
  getType(self)
  printUniq(self, vulnList, unique)
Print to the user interface the list of vulns ( vulnList )
  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]

__eq__(self, other)
(Equality operator)

 
This function is called when extending a list of plugin instances.

__init__(self)
(Constructor)

 
None

_sendMutant(self, mutant, analyze=True, grepResult=True)

 
Sends a mutant to the remote web server.

getDesc(self)

 
Returns:
A description of the plugin.

getLongDesc(self)

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

getName(self)

 
None
Overrides: configurable.configurable.getName

getOptionsXML(self)

 

This method returns a XML containing the Options that the plugin has. Using this XML the framework will build a window, a menu, or some other input method to retrieve the info from the user. The XML has to validate against the xml schema file located at : w3af/core/display.xsd

This method MUST be implemented on every plugin.
Returns:
XML String
Overrides: configurable.configurable.getOptionsXML

See Also: core/display.xsd

getPluginDeps(self)

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

getType(self)

 
None
Overrides: configurable.configurable.getType

printUniq(self, vulnList, unique)

 
Print to the user interface the list of vulns ( vulnList )
Parameters:
  • vulnList - A list of vuln 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 XML Options that was retrieved from the plugin using getOptionsXML()

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.