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

Class baseGrepPlugin




This is the base class for grep plugins, all grep plugins should inherit from it and implement the following methods :
  1. testResponse(...)
  2. setOptions( OptionList )
  3. getOptionsXML()



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

Instance Methods [hide private]
  __init__(self)
  _testResponse(self, request, response)
This method tries to find patterns on responses.
  _wasSent(self, request, theWord)
Checks if the theWord was sent in the request, this is mainly used to avoid false positives.
  end(self)
This method is called when the plugin wont be used anymore.
  getType(self)
  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).
  testResponse(self, fuzzableRequest, response)
This method tries to find patterns on responses.

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

Inherited from basePlugin.basePlugin (private): _sendMutant


Method Details [hide private]

__init__(self)
(Constructor)

 
None
Overrides: basePlugin.basePlugin.__init__

_testResponse(self, request, response)

 

This method tries to find patterns on responses.

This method MUST be implemented on every plugin.
Parameters:
  • response - This is the htmlString response to test
  • request - This is the request object that generated the current response being analyzed.
Returns:
If something is found it must be reported to the Output Manager and the KB.

_wasSent(self, request, theWord)

 
Checks if the theWord was sent in the request, this is mainly used to avoid false positives.

end(self)

 
This method is called when the plugin wont be used anymore.

getType(self)

 
None
Overrides: basePlugin.basePlugin.getType

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)

testResponse(self, fuzzableRequest, response)

 

This method tries to find patterns on responses.

This method CAN be implemented on a plugin, but its better to do your searches in _testResponse().
Parameters:
  • response - This is the httpResponse object to test.
  • fuzzableRequest - This is the fuzzable request object that generated the current response being analyzed.
Returns:
If something is found it must be reported to the Output Manager and the KB.