com.securitycentric.metacoretex.lib
Class AbstractVersionProbe

java.lang.Object
  extended bycom.securitycentric.metacoretex.lib.AbstractProbe
      extended bycom.securitycentric.metacoretex.lib.AbstractVersionProbe
All Implemented Interfaces:
Probe, java.lang.Runnable, VersionProbe

public class AbstractVersionProbe
extends AbstractProbe
implements VersionProbe

One of the other Abstract probe classes which doesn't require the developer to implement a probe() method. These probes usually just test their specified version against a KB key set by another probe which gathered verion information from a Target.

Author:
visigoth

Field Summary
 
Fields inherited from class com.securitycentric.metacoretex.lib.AbstractProbe
copyright, depVect, enabled, familyStr, helpStr, nameStr, options, pException, probeId, provHash, reportable, repStr, safe, severity, target, timeout, unspec, version
 
Constructor Summary
AbstractVersionProbe()
           
 
Method Summary
 java.lang.String getKbKey()
          Get the KB key used for the Version object this probe tests.
 Version getTestVersion()
          Get the Version object which this probe has set for itself.
 boolean matchRelease()
          Determines if this VersionProbe must match the release to bother testing
 void probe()
          Carry out the probe.
 void setKbKey(java.lang.String key)
          Set the KB key which is used by this probe to get the Version to test agains.
 void setMatchRelease(boolean mat)
          Set the value for the match release parameter.
 void setTestVersion(java.lang.String ver)
          Set the version string tested by this probe.
 
Methods inherited from class com.securitycentric.metacoretex.lib.AbstractProbe
addDepends, addOption, addProvides, addReport, depends, dumpOptions, getCopyright, getException, getFamily, getHelp, getHost, getName, getOption, getOptionKeys, getProbeId, getReport, getSeverity, getTarget, getTimeout, getVersion, hasSafe, isEnabled, isReportable, kbGet, kbHas, kbPut, probeSafe, provides, replaceOptions, run, setCopyright, setEnabled, setFamily, setHelp, setName, setProbeId, setReport, setReportable, setSeverity, setTarget, setTimeout, setVersion
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.securitycentric.metacoretex.interfaces.Probe
addDepends, addOption, addProvides, addReport, depends, dumpOptions, getCopyright, getException, getFamily, getHelp, getHost, getName, getOption, getOptionKeys, getProbeId, getReport, getSeverity, getTarget, getTimeout, getVersion, hasSafe, isEnabled, isReportable, kbGet, kbHas, kbPut, probeSafe, provides, replaceOptions, setCopyright, setEnabled, setFamily, setHelp, setName, setProbeId, setReport, setReportable, setSeverity, setTarget, setTimeout, setVersion
 
Methods inherited from interface java.lang.Runnable
run
 

Constructor Detail

AbstractVersionProbe

public AbstractVersionProbe()
Method Detail

getKbKey

public java.lang.String getKbKey()
Get the KB key used for the Version object this probe tests.

Specified by:
getKbKey in interface VersionProbe
Returns:
String The KB key for the Version object this probe comapres to.

getTestVersion

public Version getTestVersion()
Get the Version object which this probe has set for itself. This is used to compare to a KB key during the AbstactVersionProbe probe() method.

Specified by:
getTestVersion in interface VersionProbe
Returns:
com.securitycentric.metacoretex.lib.Version to test

matchRelease

public boolean matchRelease()
Determines if this VersionProbe must match the release to bother testing

Specified by:
matchRelease in interface VersionProbe
Returns:
boolean true if this Version must match release in order to test.

setKbKey

public void setKbKey(java.lang.String key)
Set the KB key which is used by this probe to get the Version to test agains.

Specified by:
setKbKey in interface VersionProbe

setMatchRelease

public void setMatchRelease(boolean mat)
Set the value for the match release parameter. If true, this probe will only test versions if the release version (like the 4 in 4.23.5) matches.

Specified by:
setMatchRelease in interface VersionProbe

setTestVersion

public void setTestVersion(java.lang.String ver)
Set the version string tested by this probe. This should be the value of the first FIXED version of the application in question. For example, if MySQL is vulnerable up to 3.23.55, you would test for 3.23.56...

Specified by:
setTestVersion in interface VersionProbe

probe

public void probe()
           throws ProbeException
Carry out the probe. Throw a ProbeException only if test cannot determine (possibly due to network failure or other).

Specified by:
probe in interface Probe
Throws:
ProbeException - These exceptions are thrown when failure causes the probe to be unable to determine weather or not the target is vulnerable.