Skip to content

Commit 997e78b

Browse files
committed
Update pscan rule handling
Signed-off-by: kingthorin <[email protected]>
1 parent 7ab1a16 commit 997e78b

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
1313
- Update minimum ZAP version to 2.16.0 and compile with Java 17.
1414
- Add cautionary note to help and readme.
1515
- Maintenance and documentation changes.
16+
- Updated scan_rule_list.js to work with ZAP 2.16.0 and later.
1617

1718
### Fixed
1819
- The following scripts were not being loaded as scan rules:

standalone/alertAndPluginDetails.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* Output sample:
2-
* Alert_Name Source:PluginName WASC CWE
3-
* Cross Site Scripting (DOM Based) ACTIVE:Cross Site Scripting (DOM Based) 8 79
4-
* Non-Storable Content PASSIVE:Content Cacheability 13 524
2+
* Alert_Name Source:PluginName WASC CWE
3+
* Cross Site Scripting (DOM Based) ACTIVE:Cross Site Scripting (DOM Based) 8 79
4+
* Non-Storable Content PASSIVE:Content Cacheability 13 524
55
* It's tab separated so you can simply copy/paste it into Excel (or whatever).
66
*/
77

@@ -11,7 +11,7 @@ extAlert = control
1111

1212
extPscan = control
1313
.getExtensionLoader()
14-
.getExtension(org.zaproxy.zap.extension.pscan.ExtensionPassiveScan.NAME);
14+
.getExtension(org.zaproxy.addon.pscan.ExtensionPassiveScan2.NAME);
1515

1616
var pf = Java.type("org.parosproxy.paros.core.scanner.PluginFactory");
1717

@@ -43,7 +43,7 @@ function printAlert(alert) {
4343
}
4444
}
4545
if (alert.getSource() == Alert.Source.PASSIVE && extPscan != null) {
46-
plugin = extPscan.getPluginPassiveScanner(alert.getPluginId());
46+
plugin = extPscan.getPassiveScannersManager().getScanRule(alert.getPluginId());
4747
if (plugin != null) {
4848
scanner = plugin.getName();
4949
}

standalone/scan_rule_list.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ for (var i = 0; i < plugins.length; i++) {
2929

3030
extPscan = control
3131
.getExtensionLoader()
32-
.getExtension(org.zaproxy.zap.extension.pscan.ExtensionPassiveScan.NAME);
32+
.getExtension(org.zaproxy.addon.pscan.ExtensionPassiveScan2.NAME);
3333

34-
plugins = extPscan.getPluginPassiveScanners().toArray();
34+
plugins = extPscan.getPassiveScannersManager().getScanRules();
3535

3636
for (var i = 0; i < plugins.length; i++) {
3737
try {

0 commit comments

Comments
 (0)