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

Class baseManglePlugin




This is the base class for mangle plugins, all mangle plugins should inherit from it and implement the following methods :
  1. mangleRequest( request )
  2. mangleResponse( request )
  3. setOptions( OptionList )
  4. getOptionsXML()



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

Instance Methods [hide private]
  __eq__(self, other)
This function is called when sorting mangle plugins.
  __gt__(self, other)
This function is called when sorting mangle plugins.
  __init__(self)
  __lt__(self, other)
This function is called when sorting evasion plugins.
  _createFuzzFromRequest(self, command, url, postData, headers)
Creates a fuzzable request based on a query sent FROM the browser.
  _fixContentLen(self, response)
If the content-length header is present, calculate the new len and update the header.
  getPriority(self)
This function is called when sorting mangle plugins.
  getType(self)
  mangleRequest(self, request)
This method mangles the request.
  mangleResponse(self, response)
This method mangles the response.
  setUrlOpener(self, foo)
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).

Inherited from basePlugin.basePlugin: getDesc, getLongDesc, getName, getOptionsXML, getPluginDeps, printUniq, setOptions

Inherited from basePlugin.basePlugin (private): _sendMutant


Method Details [hide private]

__eq__(self, other)
(Equality operator)

 
This function is called when sorting mangle plugins.
Overrides: basePlugin.basePlugin.__eq__

__gt__(self, other)
(Greater-than operator)

 
This function is called when sorting mangle plugins.

__init__(self)
(Constructor)

 
None
Overrides: basePlugin.basePlugin.__init__

__lt__(self, other)
(Less-than operator)

 
This function is called when sorting evasion plugins.

_createFuzzFromRequest(self, command, url, postData, headers)

 
Creates a fuzzable request based on a query sent FROM the browser. This was stolen from spiderMan plugin. TODO: put this transformation functions somewhere else...

_fixContentLen(self, response)

 
If the content-length header is present, calculate the new len and update the header.

getPriority(self)

 
This function is called when sorting mangle plugins. Each mangle plugin should implement this.
Returns:
An integer specifying the priority. 100 is runned first, 0 last.

getType(self)

 
None
Overrides: basePlugin.basePlugin.getType

mangleRequest(self, request)

 

This method mangles the request.

This method MUST be implemented on every plugin.
Parameters:
  • request - This is the request to mangle.
Returns:
A mangled version of the request.

mangleResponse(self, response)

 

This method mangles the response.

This method MUST be implemented on every plugin.
Parameters:
  • response - This is the response to mangle.
Returns:
A mangled version of the response.

setUrlOpener(self, foo)

 

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.
Overrides: basePlugin.basePlugin.setUrlOpener
(inherited documentation)