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

Class baseAttackPlugin




This is the base class for attack plugins, all attack plugins should inherit from it and implement the following methods :
  1. fastExploit(...)
  2. exploit(...)
  3. canExploit(...)



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

Instance Methods [hide private]
  GET2POST(self, vuln)
This method changes a vulnerability mutant, so all the data that was sent in the query string, is now sent in the postData; of course, the HTTP method is also changed from GET to POST.
  __init__(self)
  _cut(self, body)
After defining a cut, I can cut parts of an HTML and return the important sections.
  _defineCut(self, body, expectedResult, exact=True)
Defines the section where the result of an attack will be.
  canExploit(self)
Determines if audit plugins found exploitable vulns.
  exploit(self, url)
Exploits a vulnerability found by an audit plugin.
  fastExploit(self, url)
  getAttackType(self)
Returns the type of exploit, SHELL, PROXY, etc.
  getRootProbability(self)
  getType(self)

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

Inherited from basePlugin.basePlugin (private): _sendMutant


Method Details [hide private]

GET2POST(self, vuln)

 
This method changes a vulnerability mutant, so all the data that was sent in the query string, is now sent in the postData; of course, the HTTP method is also changed from GET to POST.

__init__(self)
(Constructor)

 
None
Overrides: basePlugin.basePlugin.__init__

_cut(self, body)

 
After defining a cut, I can cut parts of an HTML and return the important sections.

_defineCut(self, body, expectedResult, exact=True)

 
Defines the section where the result of an attack will be. For example, when doing a local File Include attack, the included file could be in the middle of some HTML text, so a regex is created to cut the important part out of a simple html.
Returns:
True if the cut could be defined

canExploit(self)

 
Determines if audit plugins found exploitable vulns.
Returns:
True if we can exploit a vuln stored in the kb.

exploit(self, url)

 
Exploits a vulnerability found by an audit plugin.
Returns:
True when the exploit finishes.

fastExploit(self, url)

 

getAttackType(self)

 
Returns the type of exploit, SHELL, PROXY, etc.

getRootProbability(self)

 
Returns:
This method returns the probability of getting a root shell using this attack plugin. This is used by the "exploit *" function to order the plugins and first try to exploit the more critical ones. This method should return 0 for an exploit that will never return a root shell, and 1 for an exploit that WILL ALWAYS return a root shell.

getType(self)

 
None
Overrides: basePlugin.basePlugin.getType