Search in sources :

Example 6 with ExtensionPassiveScan

use of org.zaproxy.zap.extension.pscan.ExtensionPassiveScan 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);
            }
        }
    }
}
Also used : ExtensionPassiveScan(org.zaproxy.zap.extension.pscan.ExtensionPassiveScan) PluginPassiveScanner(org.zaproxy.zap.extension.pscan.PluginPassiveScanner)

Example 7 with ExtensionPassiveScan

use of org.zaproxy.zap.extension.pscan.ExtensionPassiveScan in project zaproxy by zaproxy.

the class ExtensionParams method hook.

@Override
public void hook(ExtensionHook extensionHook) {
    super.hook(extensionHook);
    extensionHook.addApiImplementor(new ParamsAPI(this));
    extensionHook.addSessionListener(this);
    extensionHook.addSiteMapListener(this);
    if (getView() != null) {
        @SuppressWarnings("unused") ExtensionHookView pv = extensionHook.getHookView();
        extensionHook.getHookView().addStatusPanel(getParamsPanel());
        final ExtensionLoader extLoader = Control.getSingleton().getExtensionLoader();
        if (extLoader.isExtensionEnabled(ExtensionSearch.NAME)) {
            extensionHook.getHookMenu().addPopupMenuItem(getPopupMenuParamSearch());
        }
        if (extLoader.isExtensionEnabled(ExtensionAntiCSRF.NAME)) {
            extensionHook.getHookMenu().addPopupMenuItem(getPopupMenuAddAntiCSRF());
            extensionHook.getHookMenu().addPopupMenuItem(getPopupMenuRemoveAntiCSRF());
        }
        if (extLoader.isExtensionEnabled(ExtensionHttpSessions.NAME)) {
            extensionHook.getHookMenu().addPopupMenuItem(getPopupMenuAddSession());
            extensionHook.getHookMenu().addPopupMenuItem(getPopupMenuRemoveSession());
        }
        ExtensionHelp.enableHelpKey(getParamsPanel(), "ui.tabs.params");
    }
    ExtensionPassiveScan extensionPassiveScan = Control.getSingleton().getExtensionLoader().getExtension(ExtensionPassiveScan.class);
    if (extensionPassiveScan != null) {
        paramScanner = new ParamScanner(this);
        extensionPassiveScan.addPassiveScanner(new ParamScanner(this));
    }
}
Also used : ExtensionPassiveScan(org.zaproxy.zap.extension.pscan.ExtensionPassiveScan) ExtensionHookView(org.parosproxy.paros.extension.ExtensionHookView) ExtensionLoader(org.parosproxy.paros.extension.ExtensionLoader)

Aggregations

ExtensionPassiveScan (org.zaproxy.zap.extension.pscan.ExtensionPassiveScan)7 PluginPassiveScanner (org.zaproxy.zap.extension.pscan.PluginPassiveScanner)3 Plugin (org.parosproxy.paros.core.scanner.Plugin)1 DatabaseException (org.parosproxy.paros.db.DatabaseException)1 ExtensionHookView (org.parosproxy.paros.extension.ExtensionHookView)1 ExtensionLoader (org.parosproxy.paros.extension.ExtensionLoader)1 ExtensionHistory (org.parosproxy.paros.extension.history.ExtensionHistory)1 HistoryReference (org.parosproxy.paros.model.HistoryReference)1 HttpMalformedHeaderException (org.parosproxy.paros.network.HttpMalformedHeaderException)1