use of org.zaproxy.zap.extension.pscan.ExtensionPassiveScan in project zaproxy by zaproxy.
the class ExtensionAntiCSRF method unload.
@Override
public void unload() {
ExtensionPassiveScan extensionPassiveScan = Control.getSingleton().getExtensionLoader().getExtension(ExtensionPassiveScan.class);
if (extensionPassiveScan != null) {
extensionPassiveScan.removePassiveScanner(antiCsrfDetectScanner);
}
super.unload();
}
use of org.zaproxy.zap.extension.pscan.ExtensionPassiveScan in project zaproxy by zaproxy.
the class ExtensionParams method unload.
@Override
public void unload() {
ExtensionPassiveScan extensionPassiveScan = Control.getSingleton().getExtensionLoader().getExtension(ExtensionPassiveScan.class);
if (extensionPassiveScan != null) {
extensionPassiveScan.removePassiveScanner(paramScanner);
}
super.unload();
}
use of org.zaproxy.zap.extension.pscan.ExtensionPassiveScan 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.ExtensionPassiveScan in project zaproxy by zaproxy.
the class ExtensionAntiCSRF method hook.
@Override
public void hook(ExtensionHook extensionHook) {
super.hook(extensionHook);
extensionHook.addOptionsParamSet(antiCsrfParam);
final ExtensionHistory extensionHistory = Control.getSingleton().getExtensionLoader().getExtension(ExtensionHistory.class);
if (extensionHistory != null) {
historyReferenceFactory = new HistoryReferenceFactory() {
@Override
public HistoryReference createHistoryReference(int id) {
return extensionHistory.getHistoryReference(id);
}
};
} else {
historyReferenceFactory = new HistoryReferenceFactory() {
@Override
public HistoryReference createHistoryReference(int id) throws HttpMalformedHeaderException, DatabaseException {
return new HistoryReference(id);
}
};
}
AntiCsrfToken.setHistoryReferenceFactory(historyReferenceFactory);
extensionHook.addSessionListener(this);
if (getView() != null) {
extensionHook.getHookView().addOptionPanel(getOptionsAntiCsrfPanel());
extensionHook.getHookMenu().addPopupMenuItem(this.getPopupMenuGenerateForm());
}
ExtensionPassiveScan extensionPassiveScan = Control.getSingleton().getExtensionLoader().getExtension(ExtensionPassiveScan.class);
if (extensionPassiveScan != null) {
extensionPassiveScan.addPassiveScanner(antiCsrfDetectScanner);
}
AntiCsrfAPI api = new AntiCsrfAPI(this);
api.addApiOptions(getParam());
extensionHook.addApiImplementor(api);
}
use of org.zaproxy.zap.extension.pscan.ExtensionPassiveScan 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();
}
Aggregations