use of org.zaproxy.zap.extension.pscan.PluginPassiveScanner in project zaproxy by zaproxy.
the class AddOnInstaller method uninstallAddOnPassiveScanRules.
private static boolean uninstallAddOnPassiveScanRules(AddOn addOn, AddOnUninstallationProgressCallback callback) {
boolean uninstalledWithoutErrors = true;
List<PluginPassiveScanner> loadedPscanrules = addOn.getLoadedPscanrules();
ExtensionPassiveScan extPscan = Control.getSingleton().getExtensionLoader().getExtension(ExtensionPassiveScan.class);
if (!loadedPscanrules.isEmpty()) {
logger.debug("Uninstall pscanrules: " + addOn.getPscanrules());
callback.passiveScanRulesWillBeRemoved(loadedPscanrules.size());
for (PluginPassiveScanner pscanrule : loadedPscanrules) {
String name = pscanrule.getClass().getCanonicalName();
logger.debug("Uninstall pscanrule: " + name);
if (!extPscan.removePassiveScanner(pscanrule)) {
logger.error("Failed to uninstall pscanrule: " + name);
uninstalledWithoutErrors = false;
}
callback.passiveScanRuleRemoved(name);
}
addOn.setLoadedPscanrules(Collections.<PluginPassiveScanner>emptyList());
addOn.setLoadedPscanrulesSet(false);
}
return uninstalledWithoutErrors;
}
use of org.zaproxy.zap.extension.pscan.PluginPassiveScanner in project zaproxy by zaproxy.
the class AlertViewPanel method getSourceData.
private String getSourceData(Alert alert) {
String source = Constant.messages.getString(alert.getSource().getI18nKey());
if (alert.getPluginId() == UNDEFINED_ID) {
return source;
}
StringBuilder strBuilder = new StringBuilder(source);
strBuilder.append(" (").append(alert.getPluginId());
if (alert.getSource() == Alert.Source.ACTIVE) {
Plugin plugin = PluginFactory.getLoadedPlugin(alert.getPluginId());
if (plugin != null) {
strBuilder.append(" - ").append(plugin.getName());
}
} else if (alert.getSource() == Alert.Source.PASSIVE) {
ExtensionPassiveScan ext = Control.getSingleton().getExtensionLoader().getExtension(ExtensionPassiveScan.class);
if (ext != null) {
PluginPassiveScanner scanner = ext.getPluginPassiveScanner(alert.getPluginId());
if (scanner != null) {
strBuilder.append(" - ").append(scanner.getName());
}
}
}
strBuilder.append(')');
return strBuilder.toString();
}
use of org.zaproxy.zap.extension.pscan.PluginPassiveScanner in project zaproxy by zaproxy.
the class AddOnInstaller method installAddOnPassiveScanRules.
private static void installAddOnPassiveScanRules(AddOn addOn, AddOnClassLoader addOnClassLoader) {
List<PluginPassiveScanner> pscanrules = AddOnLoaderUtils.getPassiveScanRules(addOn, addOnClassLoader);
ExtensionPassiveScan extPscan = Control.getSingleton().getExtensionLoader().getExtension(ExtensionPassiveScan.class);
if (!pscanrules.isEmpty() && extPscan != null) {
for (PluginPassiveScanner pscanrule : pscanrules) {
String name = pscanrule.getClass().getCanonicalName();
logger.debug("Install pscanrule: " + name);
if (!extPscan.addPassiveScanner(pscanrule)) {
logger.error("Failed to install pscanrule: " + name);
}
}
}
}
use of org.zaproxy.zap.extension.pscan.PluginPassiveScanner in project zaproxy by zaproxy.
the class CoreFunctionality method createPassiveScanRules.
private static synchronized void createPassiveScanRules() {
if (builtInPassiveScanRules == null) {
ArrayList<PluginPassiveScanner> rules = new ArrayList<>();
rules.add(new org.zaproxy.zap.extension.pscan.scanner.RegexAutoTagScanner());
rules.add(new org.zaproxy.zap.extension.pscan.scanner.ScriptsPassiveScanner());
rules.add(new org.zaproxy.zap.extension.pscan.scanner.StatsPassiveScanner());
rules.trimToSize();
for (PluginPassiveScanner rule : rules) {
rule.setStatus(AddOn.Status.release);
}
builtInPassiveScanRules = Collections.unmodifiableList(rules);
}
}
Aggregations