Constructor and Description |
---|
HostProcess(String hostAndPort,
Scanner parentScanner,
ScannerParam scannerParam,
ConnectionParam connectionParam,
ScanPolicy scanPolicy)
Deprecated.
Use
HostProcess(String, Scanner, ScannerParam, ConnectionParam,
ScanPolicy, RuleConfigParam) instead. It will be removed in a future version. |
HostProcess(String hostAndPort,
Scanner parentScanner,
ScannerParam scannerParam,
ConnectionParam connectionParam,
ScanPolicy scanPolicy,
RuleConfigParam ruleConfigParam)
Constructs a
HostProcess . |
Modifier and Type | Method and Description |
---|---|
void |
addStartNode(StructuralNode startNode)
Adds the given node, to start scanning from.
|
void |
alertFound(Alert alert) |
int |
getAlertCount()
Gets the alert count.
|
Analyser |
getAnalyser()
Give back the current process's Analyzer
|
List<Plugin> |
getCompleted() |
Context |
getContext() |
String |
getHostAndPort() |
HttpSender |
getHttpSender() |
int |
getNewAlertCount() |
List<Plugin> |
getPending() |
int |
getPercentageComplete() |
int |
getPluginRequestCount(int pluginId)
Gets the request count of the plugin with the given ID.
|
PluginStats |
getPluginStats(int pluginId)
Gets the stats of the
Plugin with the given ID. |
int |
getRequestCount()
Gets the count of requests sent (and received) by all
Plugin s and the Analyser . |
List<Plugin> |
getRunning() |
ScannerParam |
getScannerParam()
Gets the scanner parameters.
|
String |
getSkippedReason(Plugin plugin)
Gets the reason why the given plugin was skipped.
|
TechSet |
getTechSet()
Gets the technologies to be used in the scan.
|
int |
getTestCurrentCount(Plugin plugin)
ZAP: method to get back the current progress status of a specific plugin
|
int |
getTestTotalCount()
Gets the number of messages that will be scanned.
|
boolean |
handleAntiCsrfTokens() |
protected boolean |
isCustomPage(HttpMessage msg,
CustomPage.Type cpType)
Tells whether or not the message matches the specific
CustomPage.Type . |
boolean |
isPaused()
Check if the current host scan has been paused
|
boolean |
isSkipped(Plugin plugin)
Tells whether or not the given
plugin was skipped (either programmatically or by the
user). |
boolean |
isStop()
Check if the current host scan has been stopped
|
protected boolean |
nodeInScope(String nodeName) |
void |
notifyNewMessage(HttpMessage msg)
Notifies interested parties that a new message was sent (and received).
|
void |
notifyNewMessage(Plugin plugin)
Notifies that the given
plugin sent (and received) a non-HTTP message. |
void |
notifyNewMessage(Plugin plugin,
HttpMessage message)
Notifies that the given
plugin sent (and received) the given HTTP message. |
protected void |
performScannerHookAfterScan(HttpMessage msg,
AbstractPlugin plugin)
ZAP: abstract plugin will call this method in order to invoke any extensions that have hooked
into the active scanner
|
protected void |
performScannerHookBeforeScan(HttpMessage msg,
AbstractPlugin plugin)
ZAP: abstract plugin will call this method in order to invoke any extensions that have hooked
into the active scanner
|
void |
pluginSkipped(int pluginId,
String reason)
Skips the plugin with the given ID with the given
reason . |
void |
pluginSkipped(Plugin plugin)
Skips the given plugin.
|
void |
pluginSkipped(Plugin plugin,
String reason)
Skips the given
plugin with the given reason . |
void |
run()
Main execution method
|
void |
setContext(Context context) |
void |
setPluginRequestCount(int pluginId,
int reqCount)
Deprecated.
(2.5.0) No longer used/needed, Plugin's request count is automatically
updated/maintained by
HostProcess . |
void |
setStartNode(StructuralNode startNode)
Sets the initial starting node.
|
void |
setTechSet(TechSet techSet)
Sets the technologies to be used in the scan.
|
void |
setTestCurrentCount(Plugin plugin,
int value)
Deprecated.
(2.5.0) No longer used/needed, Plugin's progress is automatically
updated/maintained by
HostProcess . |
void |
setUser(User user)
Set the user to scan as.
|
void |
stop()
Stop the current scanning process
|
@Deprecated public HostProcess(String hostAndPort, Scanner parentScanner, ScannerParam scannerParam, ConnectionParam connectionParam, ScanPolicy scanPolicy)
HostProcess(String, Scanner, ScannerParam, ConnectionParam,
ScanPolicy, RuleConfigParam)
instead. It will be removed in a future version.HostProcess
, with no rules' configurations.hostAndPort
- the host:port value of the site that need to be processedparentScanner
- the scanner instance which instantiated this processscannerParam
- the session scanner parametersconnectionParam
- the connection parametersscanPolicy
- the scan policypublic HostProcess(String hostAndPort, Scanner parentScanner, ScannerParam scannerParam, ConnectionParam connectionParam, ScanPolicy scanPolicy, RuleConfigParam ruleConfigParam)
HostProcess
.hostAndPort
- the host:port value of the site that need to be processedparentScanner
- the scanner instance which instantiated this processscannerParam
- the session scanner parametersconnectionParam
- the connection parametersscanPolicy
- the scan policyruleConfigParam
- the rules' configurations, might be null
.public void setStartNode(StructuralNode startNode)
Nodes previously added are removed.
startNode
- the start node we should start fromaddStartNode(StructuralNode)
public void addStartNode(StructuralNode startNode)
startNode
- a start node.setStartNode(StructuralNode)
public void stop()
protected boolean nodeInScope(String nodeName)
public int getTestTotalCount()
public int getTestCurrentCount(Plugin plugin)
plugin
- the plugin we're asking the progress@Deprecated public void setTestCurrentCount(Plugin plugin, int value)
HostProcess
.plugin
- unusedvalue
- unusedpublic HttpSender getHttpSender()
public boolean isStop()
public boolean isPaused()
public int getPercentageComplete()
public void notifyNewMessage(HttpMessage msg)
Plugins
should call notifyNewMessage(Plugin)
or notifyNewMessage(Plugin, HttpMessage)
, instead.
msg
- the new HTTP messagepublic void notifyNewMessage(Plugin plugin, HttpMessage message)
plugin
sent (and received) the given HTTP message.plugin
- the plugin that sent the messagemessage
- the message sentIllegalArgumentException
- if the given plugin
is null
.notifyNewMessage(Plugin)
public void notifyNewMessage(Plugin plugin)
plugin
sent (and received) a non-HTTP message.
The call to this method has no effect if there's no Plugin
with the given ID (or,
it was not yet started).
plugin
- the plugin that sent a non-HTTP messageIllegalArgumentException
- if the given parameter is null
.notifyNewMessage(Plugin, HttpMessage)
public void alertFound(Alert alert)
public int getNewAlertCount()
public int getAlertCount()
public Analyser getAnalyser()
public boolean handleAntiCsrfTokens()
public void pluginSkipped(Plugin plugin)
Note: Whenever possible callers should use pluginSkipped(Plugin,
String)
instead.
plugin
- the plugin that will be skipped, must not be null
public void pluginSkipped(int pluginId, String reason)
reason
.
Ideally the reason
should be internationalised as it is shown in the GUI.
pluginId
- the ID of the plugin that will be skipped.reason
- the reason why the plugin was skipped, might be null
.pluginSkipped(Plugin, String)
public void pluginSkipped(Plugin plugin, String reason)
plugin
with the given reason
.
Ideally the reason
should be internationalised as it is shown in the GUI.
plugin
- the plugin that will be skipped, must not be null
reason
- the reason why the plugin was skipped, might be null
public boolean isSkipped(Plugin plugin)
plugin
was skipped (either programmatically or by the
user).plugin
- the plugin that will be checkedtrue
if plugin was skipped, false
otherwisegetSkippedReason(Plugin)
public String getSkippedReason(Plugin plugin)
plugin
- the plugin that will be checkednull
if not skipped or
there's no reasonisSkipped(Plugin)
public ScannerParam getScannerParam()
Note: Not part of the public API.
public void setUser(User user)
user
- the user to scan aspublic TechSet getTechSet()
null
(since 2.6.0)public void setTechSet(TechSet techSet)
techSet
- the technologies to be used during the scanIllegalArgumentException
- (since 2.6.0) if the given parameter is null
.protected void performScannerHookBeforeScan(HttpMessage msg, AbstractPlugin plugin)
msg
- the message being scannedplugin
- the plugin being runprotected void performScannerHookAfterScan(HttpMessage msg, AbstractPlugin plugin)
msg
- the message being scannedplugin
- the plugin being runpublic String getHostAndPort()
@Deprecated public void setPluginRequestCount(int pluginId, int reqCount)
HostProcess
.pluginId
- the ID of the pluginreqCount
- the number of requests sentpublic int getPluginRequestCount(int pluginId)
pluginId
- the ID of the plugingetRequestCount()
public int getRequestCount()
Plugin
s and the Analyser
.getPluginRequestCount(int)
,
getAnalyser()
public PluginStats getPluginStats(int pluginId)
Plugin
with the given ID.pluginId
- the ID of the plugin.null
if not found.protected boolean isCustomPage(HttpMessage msg, CustomPage.Type cpType)
CustomPage.Type
. (Does not
leverage Analyzer
).msg
- the message that will be checkedcpType
- the custom page type to be checkedtrue
if the message matches, false
otherwisepublic Context getContext()
public void setContext(Context context)