|
OpenNMS API 1.2.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.opennms.netmgt.vulnscand.NessusScan
This class is a proxy for communications with the Nessus security scanner daemon, nessusd. It has been designed to:
Other functions (arbitrary plugin selection, SSL support) may be added in the future.
Field Summary | |
private NessusScanConfiguration |
config
Nessus configuration that is used to perform the current scan. |
private static java.lang.String |
INSERT_NEW_VULNERABILITY
Insert a new vulnerability into the "vulnerabilities" table |
private int |
lastPlugin
Integer of the ordinal of the last plugin that was executed against the target. |
private static java.lang.String |
NTP_CLIENT_ENTITY
|
private static java.lang.String |
NTP_PASSWORD_PROMPT
|
private static java.lang.String |
NTP_SEP
|
private static java.lang.String |
NTP_SERVER_ENTITY
|
private static java.lang.String |
NTP_USERNAME_PROMPT
|
private static java.lang.String |
NTP_VERSION_STRING
|
private org.apache.regexp.RE |
ntpTokenizer
Regex expression that is used to tokenize the messages from Nessus. |
private java.util.Set |
openVulnerabilities
List of the open vulnerabilities on an IP address |
private java.lang.String[] |
pluginLists
Array that holds the plugin lists for each scanning level. |
private static int |
PORTSCAN_PLUGIN_ID
|
private static java.lang.String |
RESOLVE_VULNERABILITY
Resolve a given vulnerability by its unique ID number. |
private boolean[] |
safeChecks
Array that holds the safe-checks settings for each scanning level. |
static int |
SCAN_COMPLETE
|
static int |
SCAN_FATAL_ERROR
|
static int |
SCAN_HOST_DOWN
|
static int |
SCAN_NON_FATAL_ERROR
|
static int |
SCAN_SUCCESS
|
private static java.lang.String |
SELECT_ALL_VULNERABILITIES
Get all unresolved vulnerabilities for a given ipaddr. |
private static java.lang.String |
SELECT_NEXT_ID
Select the next vulnerabilityID from the sequence |
private static java.lang.String |
SELECT_OPEN_VULNERABILITY
Find an open vulnerability ID in the database. |
private static java.lang.String |
SELECT_PLUGIN_INFO
This query retrieves the name and summary of a plugin out of the database so that we can construct the logmsg of the vulnerability with the fields. |
private int |
totalPlugins
Counter of the total number of plugins that will be executed against this host. |
private static java.lang.String |
VULNERABILITY_SCAN_ATTEMPTED
Update the timestamps in an open vulnerability for which the rescan failed. |
private static java.lang.String |
VULNERABILITY_SCANNED
Update the timestamps in an open vulnerability that was rescanned and still exists. |
Constructor Summary | |
NessusScan(NessusScanConfiguration newConfig)
Create a new scan that will scan the target specified in the configuration and insert the results of the scan into the database. |
Method Summary | |
private java.lang.String |
buildPreferencesString()
Build the preferences string with the appropriate plugins and safe_checks settings from the config file. |
private java.lang.String |
buildStopScanString()
|
private java.lang.String |
buildStopWholeTestString()
|
private void |
init()
|
private int |
processScanMessage(java.lang.String message)
Process a scan message. |
FifoQueue |
readLines(java.io.InputStream in)
|
void |
run()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static final java.lang.String NTP_VERSION_STRING
private static final java.lang.String NTP_CLIENT_ENTITY
private static final java.lang.String NTP_SERVER_ENTITY
private static final java.lang.String NTP_USERNAME_PROMPT
private static final java.lang.String NTP_PASSWORD_PROMPT
private static final java.lang.String NTP_SEP
private static final int PORTSCAN_PLUGIN_ID
public static final int SCAN_SUCCESS
public static final int SCAN_HOST_DOWN
public static final int SCAN_FATAL_ERROR
public static final int SCAN_NON_FATAL_ERROR
public static final int SCAN_COMPLETE
private static final java.lang.String SELECT_NEXT_ID
private static final java.lang.String SELECT_ALL_VULNERABILITIES
private static final java.lang.String SELECT_PLUGIN_INFO
private static final java.lang.String INSERT_NEW_VULNERABILITY
private static final java.lang.String SELECT_OPEN_VULNERABILITY
private static final java.lang.String VULNERABILITY_SCANNED
private static final java.lang.String VULNERABILITY_SCAN_ATTEMPTED
private static final java.lang.String RESOLVE_VULNERABILITY
private NessusScanConfiguration config
private org.apache.regexp.RE ntpTokenizer
private java.util.Set openVulnerabilities
private java.lang.String[] pluginLists
private boolean[] safeChecks
private int lastPlugin
private int totalPlugins
Constructor Detail |
public NessusScan(NessusScanConfiguration newConfig) throws java.lang.IllegalArgumentException
Method Detail |
private void init()
public void run()
run
in interface java.lang.Runnable
private java.lang.String buildStopWholeTestString()
private java.lang.String buildStopScanString()
private java.lang.String buildPreferencesString()
private int processScanMessage(java.lang.String message)
This function is designed to parse any messages that come from Nessus during a scan session (eg. after the NEW_ATTACK directive has been sent)
The following types of events are handled:
public FifoQueue readLines(java.io.InputStream in)
|
OpenNMS API 1.2.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |