|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.securitycentric.metacoretex.lib.AbstractProbe
This is the base abstract probe from which all probes are extended. This implementation takes care of almost all of the necissary data management functions so developers can focus on the probe code alone. To extend this probe, you may do as little as implement the probe() method, but be sure to set up all the necissary information when your class is instanciated!
Field Summary | |
java.lang.String |
copyright
the copyright string for this probe |
java.util.Vector |
depVect
Vector of KB keys (Strings) this probe depends on |
boolean |
enabled
probes may be disabled by user input, store it in the probe. |
java.lang.String |
familyStr
the name of the family for this probe which is used in GUI rendering |
java.lang.String |
helpStr
the help String for this probe |
java.lang.String |
nameStr
the human readable name of this probe |
java.util.Properties |
options
The Properties object which holds user configurable options. |
ProbeException |
pException
an exception to throw if things go bad. |
int |
probeId
this probe's ID |
java.util.Hashtable |
provHash
key->value pairs of kbentry->description |
boolean |
reportable
does this probe have anything to report? |
java.lang.String |
repStr
The Report string |
boolean |
safe
keep track of weather or not this probe is safe. |
int |
severity
this probes current severity |
Target |
target
The target which this probe will poke. |
int |
timeout
this probes timeout in miliseconds (setting to 42666 uses global default) |
java.lang.String |
unspec
a string to use for junk that developers didn't initialize. |
Version |
version
the Version object for the version of this probe |
Constructor Summary | |
AbstractProbe()
|
Method Summary | |
void |
addDepends(java.lang.String name)
Add the key to the list of KB objects which this probe uses (KB objects provided by other probes). |
void |
addOption(java.lang.String opt,
java.lang.String value)
Add a user-configurable option with a default value. |
void |
addProvides(java.lang.String name,
java.lang.String descr)
Add a KB key to the list of keys provided by this probe. |
void |
addReport(java.lang.String reptAddStr)
Add the specified string and a newline to the report. |
java.util.Vector |
depends()
Return a vector of the KB keys this probe requires to run. |
java.util.Properties |
dumpOptions()
This method provides the probe handling subsystems with a way to get a reference to the Properties objec which stores the configuration options for this probe. |
java.lang.String |
getCopyright()
Get the copyright string for this probe. |
ProbeException |
getException()
Return a copy of a ProbeException which may have occured during the course of the probe() method. |
java.lang.String |
getFamily()
Get the String name of the family of probes to which this probe belongs. |
java.lang.String |
getHelp()
Get a reference to the help string for the current probe. |
java.lang.String |
getHost()
Get the name/ip for the current Target as a String. |
java.lang.String |
getName()
Get the human readable name for this probe |
java.lang.String |
getOption(java.lang.String opt)
Get the String representing the user configured option. |
java.util.Vector |
getOptionKeys()
Return a vector of all the option KEYS |
int |
getProbeId()
Get the ID of this probe. |
java.lang.String |
getReport()
Get the String of the report for the probe. |
int |
getSeverity()
Get the integer value for the severity of this probe: 0 - Data Gathering - Could be good or bad, Requires analysis 1 - Low Risk 2 - Medium Risk 3 - High Risk |
Target |
getTarget()
Get a reference to the Target object for this probe. |
int |
getTimeout()
Get the timeout in milliseconds that this probe should use when running. |
java.lang.String |
getVersion()
Get a String representation of the version of this probe |
boolean |
hasSafe()
Find out if this probe has a "safe" attack or not |
boolean |
isEnabled()
Checks to see if this probe is currently enabled (will fire on launch) |
boolean |
isReportable()
Test weather or not this probe has anything to report. |
java.lang.Object |
kbGet(java.lang.String key)
Get the Object referenced at the specified KB key |
boolean |
kbHas(java.lang.String key)
Test to see if the KB contains the specified key. |
void |
kbPut(java.lang.String key,
java.lang.Object obj)
Put an Object into the Target's KB for later use by other probes. |
void |
probeSafe()
This method represents the "safe" option for the probe. |
java.util.Hashtable |
provides()
Return a Hashtable of the KB keys this probe provides sets and their descriptions. |
void |
replaceOptions(java.util.Properties prop)
This method is used by the scan configuration loader to override the default configuration options for the probe. |
void |
run()
implement the runnable interface for threading junk |
void |
setCopyright(java.lang.String copyright)
Set the copyright information for this probe. |
void |
setEnabled(boolean bol)
Set the enabled flag on this probe. |
void |
setFamily(java.lang.String newFam)
Use the setFamily() method to set the family (more importantly the tab in the UI) for this probe. |
void |
setHelp(java.lang.String help)
Set the String value returened by the getHelp() method (used by the UI) |
void |
setName(java.lang.String myname)
REQUIRED: Set the human readable name for this probe. |
void |
setProbeId(int x)
Set the ID of this probe. |
void |
setReport(java.lang.String newRpt)
Set the report String for this probe. |
void |
setReportable(boolean x)
Set the reportable status of this report. |
void |
setSeverity(int x)
Set the severity rating for this probe's report. |
void |
setTarget(Target targ)
Set the Target this probe will attack on invocation of the probe() method. |
void |
setTimeout(int timeout)
Set the timeout in milliseconds that this probe should use when running. |
void |
setVersion(java.lang.String ver)
Set the version string for this probe |
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 |
probe |
Field Detail |
public int probeId
public int severity
public int timeout
public java.util.Properties options
public Target target
public ProbeException pException
public java.lang.String repStr
public java.lang.String nameStr
public Version version
public java.lang.String unspec
public java.lang.String copyright
public java.lang.String helpStr
public boolean enabled
public boolean safe
public boolean reportable
public java.util.Vector depVect
public java.util.Hashtable provHash
public java.lang.String familyStr
Constructor Detail |
public AbstractProbe()
Method Detail |
public void run()
run
in interface java.lang.Runnable
public int getProbeId()
getProbeId
in interface Probe
public void setProbeId(int x)
setProbeId
in interface Probe
x
- int ID to set for this probe.public java.lang.String getFamily()
getFamily
in interface Probe
public void setFamily(java.lang.String newFam)
Probe
setFamily
in interface Probe
newFam
- String name of the new probe familypublic java.lang.String getName()
getName
in interface Probe
public void setName(java.lang.String myname)
setName
in interface Probe
myname
- String name for this probe.public boolean hasSafe()
hasSafe
in interface Probe
public java.lang.String getReport()
getReport
in interface Probe
public void setReport(java.lang.String newRpt)
setReport
in interface Probe
newRpt
- String The new reportable value for this probe.public void addReport(java.lang.String reptAddStr)
addReport
in interface Probe
reptAddStr
- String to add to the reportpublic Target getTarget()
getTarget
in interface Probe
public void setTarget(Target targ)
setTarget
in interface Probe
targ
- com.securitycentric.metacoretex.lib.Target This probe's target.public boolean isEnabled()
isEnabled
in interface Probe
public void setEnabled(boolean bol)
setEnabled
in interface Probe
bol
- boolean true for enabled, false for notpublic void probeSafe() throws ProbeException
probeSafe
in interface Probe
ProbeException
- This exception is thrown if the probe is unable to process.
ex. network outage. SQL failure etc.public java.util.Vector depends()
Probe
depends
in interface Probe
public java.util.Hashtable provides()
Probe
provides
in interface Probe
public java.util.Vector getOptionKeys()
getOptionKeys
in interface Probe
public void addProvides(java.lang.String name, java.lang.String descr)
addProvides
in interface Probe
name
- String Name for the KB key provided by this probedescr
- String Description of the Object (include type) which this probe puts
in the KB.public void addDepends(java.lang.String name)
addDepends
in interface Probe
name
- String The KB key which is used by this probe.public void addOption(java.lang.String opt, java.lang.String value)
addOption
in interface Probe
opt
- String Name of the optionvalue
- String Default value for this optionpublic java.lang.String getOption(java.lang.String opt)
getOption
in interface Probe
opt
- String The option name specified in an earlier call to addOption()
public java.lang.String getVersion()
getVersion
in interface Probe
public void setVersion(java.lang.String ver)
setVersion
in interface Probe
ver
- String A version string like: "1.34.3_5" etc.public java.util.Properties dumpOptions()
Probe
dumpOptions
in interface Probe
public void replaceOptions(java.util.Properties prop)
Probe
replaceOptions
in interface Probe
prop
- New Properties object for this probe to use.public void kbPut(java.lang.String key, java.lang.Object obj)
kbPut
in interface Probe
key
- String The key for the KB object. Usually this is the same as the key specified
in a call to addProvides() during instantiation.obj
- Object The Object in insert into the KB. Can be anything you want.public java.lang.Object kbGet(java.lang.String key)
kbGet
in interface Probe
key
- String The key which identifies the Object in the KB
public boolean kbHas(java.lang.String key)
kbHas
in interface Probe
key
- String The key to test for in the KB
public java.lang.String getHost()
getHost
in interface Probe
public int getSeverity()
getSeverity
in interface Probe
public void setSeverity(int x)
setSeverity
in interface Probe
x
- int The severitypublic boolean isReportable()
isReportable
in interface Probe
public void setReportable(boolean x)
setReportable
in interface Probe
x
- booleanpublic ProbeException getException()
getException
in interface Probe
public java.lang.String getHelp()
getHelp
in interface Probe
public void setCopyright(java.lang.String copyright)
setCopyright
in interface Probe
copyright
- String The copyright info like : (c) 2003, visigoth blah blah blahpublic java.lang.String getCopyright()
getCopyright
in interface Probe
public void setHelp(java.lang.String help)
setHelp
in interface Probe
help
- String help/config informationpublic int getTimeout()
Probe
getTimeout
in interface Probe
public void setTimeout(int timeout)
Probe
setTimeout
in interface Probe
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |