Package plugins :: Package discovery :: Module webDiff :: Class webDiff
[hide private]
[frames] | no frames]

Class webDiff




This plugin compares a local directory with a remote URL path.


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

Instance Methods [hide private]
  __init__(self)
  discover(self, fuzzableRequest)
GET's local files one by one until done.
  _generateReport(self)
Generates a report based on:
  _compareDir(self, arg, dir, flist)
This function is the callback function called from os.path.walk, from the python help function: walk(top, func, arg) Directory tree walk with callback function.
  _checkContent(self, response, file)
Check if the contents match.
  _easyGet(self, url)
An easy way to get a URL using HEAD or GET depending on available methods.
  getOptionsXML(self)
This method returns a XML containing the Options that the plugin has.
  setOptions(self, optionsMap)
This method sets all the options that are configured using the user interface generated by the framework using the result of getOptionsXML().
  getPluginDeps(self)
  _verifyHeadEnabled(self, url)
Verifies if the requested URL permits a HEAD request.
  _headEnabled(self)
  getLongDesc(self)

Inherited from core.controllers.basePlugin.baseDiscoveryPlugin.baseDiscoveryPlugin: getType

Inherited from core.controllers.basePlugin.basePlugin.basePlugin: __eq__, getDesc, getName, printUniq, setUrlOpener


Method Details [hide private]

__init__(self)
(Constructor)

 
None
Overrides: core.controllers.basePlugin.baseDiscoveryPlugin.baseDiscoveryPlugin.__init__

discover(self, fuzzableRequest)

 
GET's local files one by one until done.
Parameters:
  • fuzzableRequest - A fuzzableRequest instance that contains (among other things) the URL to test.
Returns:
A list :
  1. New Url's found by plugin, could be empty when method ends.
Overrides: core.controllers.basePlugin.baseDiscoveryPlugin.baseDiscoveryPlugin.discover

_generateReport(self)

 
Generates a report based on:
  • self._notEq
  • self._notEqContent
  • self._eq
  • self._eqContent

_compareDir(self, arg, dir, flist)

 

This function is the callback function called from os.path.walk, from the python
help function:

walk(top, func, arg)
        Directory tree walk with callback function.

        For each directory in the directory tree rooted at top (including top
        itself, but excluding '.' and '..'), call func(arg, dirname, fnames).
        dirname is the name of the directory, and fnames a list of the names of
        the files and subdirectories in dirname (excluding '.' and '..').  func
        may modify the fnames list in-place (e.g. via del or slice assignment),
        and walk will only recurse into the subdirectories whose names remain in
        fnames; this can be used to implement a filter, or to impose a specific
        order of visiting.  No semantics are defined for, or required of, arg,
        beyond that arg is always passed to func.  It can be used, e.g., to pass
        a filename pattern, or a mutable object designed to accumulate
        statistics.  Passing None for arg is common.

_checkContent(self, response, file)

 
Check if the contents match.

_easyGet(self, url)

 
An easy way to get a URL using HEAD or GET depending on available methods.

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/ui/userInterface.dtd
Returns:
XML with the plugin options.
Overrides: core.controllers.basePlugin.basePlugin.basePlugin.getOptionsXML

setOptions(self, optionsMap)

 
This method sets all the options that are configured using the user interface generated by the framework using the result of getOptionsXML().
Parameters:
  • optionsMap - A dictionary with the options for the plugin.
Returns:
No value is returned.
Overrides: core.controllers.basePlugin.basePlugin.basePlugin.setOptions

getPluginDeps(self)

 
Returns:
A list with the names of the plugins that should be runned before the current one.
Overrides: core.controllers.basePlugin.basePlugin.basePlugin.getPluginDeps

_verifyHeadEnabled(self, url)

 

Verifies if the requested URL permits a HEAD request. This was saved inside the KB by the plugin allowedMethods

@return : Sets self._head to the correct value, nothing is returned.

_headEnabled(self)

 
None

getLongDesc(self)

 
Returns:
A DETAILED description of the plugin functions and features.
Overrides: core.controllers.basePlugin.basePlugin.basePlugin.getLongDesc