Search in sources :

Example 1 with ExtensionHookView

use of org.parosproxy.paros.extension.ExtensionHookView in project zaproxy by zaproxy.

the class ExtensionBreak method hook.

@Override
public void hook(ExtensionHook extensionHook) {
    super.hook(extensionHook);
    extensionHook.addOptionsParamSet(getOptionsParam());
    extensionHook.addProxyListener(getProxyListenerBreak());
    extensionHook.addSessionListener(this);
    extensionHook.addOptionsChangedListener(this);
    extensionHook.addApiImplementor(api);
    if (getView() != null) {
        breakPanel = new BreakPanel(this, getOptionsParam());
        breakPanel.setName(Constant.messages.getString("tab.break"));
        breakpointMessageHandler = new BreakpointMessageHandler2(breakPanel);
        breakpointMessageHandler.setEnabledBreakpoints(getBreakpointsModel().getBreakpointsEnabledList());
        breakpointMessageHandler.setEnabledIgnoreRules(breakPanel.getIgnoreRulesEnableList());
        breakpointManagementInterface = breakPanel;
        ExtensionHookView pv = extensionHook.getHookView();
        pv.addWorkPanel(breakPanel);
        pv.addOptionPanel(getOptionsPanel());
        extensionHook.getHookView().addStatusPanel(getBreakpointsPanel());
        extensionHook.getHookMenu().addPopupMenuItem(getPopupMenuEdit());
        extensionHook.getHookMenu().addPopupMenuItem(getPopupMenuDelete());
        mapBreakpointUiManager = new HashMap<>();
        mapMessageUiManager = new HashMap<>();
        httpBreakpoints = new HttpBreakpointsUiManagerInterface(extensionHook.getHookMenu(), this);
        addBreakpointsUiManager(httpBreakpoints);
        extensionHook.getHookMenu().addToolsMenuItem(getMenuToggleBreakOnRequests());
        extensionHook.getHookMenu().addToolsMenuItem(getMenuToggleBreakOnResponses());
        extensionHook.getHookMenu().addToolsMenuItem(getMenuStep());
        extensionHook.getHookMenu().addToolsMenuItem(getMenuContinue());
        extensionHook.getHookMenu().addToolsMenuItem(getMenuDrop());
        extensionHook.getHookMenu().addToolsMenuItem(getMenuAddHttpBreakpoint());
        ExtensionHelp.enableHelpKey(breakPanel, "ui.tabs.break");
        ExtensionHelp.enableHelpKey(getBreakpointsPanel(), "ui.tabs.breakpoints");
    } else {
        this.breakpointManagementInterface = new HttpBreakpointManagementDaemonImpl();
        breakpointMessageHandler = new BreakpointMessageHandler2(breakpointManagementInterface);
        breakpointMessageHandler.setEnabledBreakpoints(new ArrayList<>());
        breakpointMessageHandler.setEnabledIgnoreRules(new ArrayList<>());
    }
}
Also used : HttpBreakpointManagementDaemonImpl(org.zaproxy.zap.extension.brk.impl.http.HttpBreakpointManagementDaemonImpl) ExtensionHookView(org.parosproxy.paros.extension.ExtensionHookView) HttpBreakpointsUiManagerInterface(org.zaproxy.zap.extension.brk.impl.http.HttpBreakpointsUiManagerInterface)

Example 2 with ExtensionHookView

use of org.parosproxy.paros.extension.ExtensionHookView in project zaproxy by zaproxy.

the class ExtensionHistory method hook.

@SuppressWarnings("deprecation")
@Override
public void hook(ExtensionHook extensionHook) {
    super.hook(extensionHook);
    extensionHook.addSessionListener(this);
    extensionHook.addProxyListener(getProxyListenerLog());
    extensionHook.addConnectionRequestProxyListener(getProxyListenerLog());
    if (hasView()) {
        ExtensionHookView pv = extensionHook.getHookView();
        pv.addStatusPanel(getLogPanel());
        extensionHook.addOptionsChangedListener((OptionsChangedListener) getResendDialog());
        extensionHook.getHookMenu().addPopupMenuItem(getPopupMenuTag());
        // ZAP: Added history notes
        extensionHook.getHookMenu().addPopupMenuItem(getPopupMenuNote());
        // extensionHook.getHookMenu().addPopupMenuItem(getPopupMenuExportMessage());
        // extensionHook.getHookMenu().addPopupMenuItem(getPopupMenuExportResponse());
        extensionHook.getHookMenu().addPopupMenuItem(getPopupMenuPurgeHistory());
        // same as PopupMenuExport but for File menu
        // ZAP: Move 'export' menu items to Report menu
        extensionHook.getHookMenu().addReportMenuItem(getPopupMenuExportMessage2());
        extensionHook.getHookMenu().addReportMenuItem(getPopupMenuExportResponse2());
        extensionHook.getHookMenu().addReportMenuItem(extensionHook.getHookMenu().getMenuSeparator());
        extensionHook.getHookMenu().addReportMenuItem(getPopupMenuExportURLs());
        extensionHook.getHookMenu().addReportMenuItem(getPopupMenuExportSelectedURLs());
        extensionHook.getHookMenu().addReportMenuItem(getPopupMenuExportContextURLs());
        extensionHook.getHookMenu().addReportMenuItem(extensionHook.getHookMenu().getMenuSeparator());
        extensionHook.getHookMenu().addPopupMenuItem(createPopupMenuExportURLs());
        extensionHook.getHookMenu().addPopupMenuItem(createPopupMenuExportSelectedURLs());
        ExtensionHelp.enableHelpKey(this.getLogPanel(), "ui.tabs.history");
    }
}
Also used : ExtensionHookView(org.parosproxy.paros.extension.ExtensionHookView)

Example 3 with ExtensionHookView

use of org.parosproxy.paros.extension.ExtensionHookView 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

ExtensionHookView (org.parosproxy.paros.extension.ExtensionHookView)3 ExtensionLoader (org.parosproxy.paros.extension.ExtensionLoader)1 HttpBreakpointManagementDaemonImpl (org.zaproxy.zap.extension.brk.impl.http.HttpBreakpointManagementDaemonImpl)1 HttpBreakpointsUiManagerInterface (org.zaproxy.zap.extension.brk.impl.http.HttpBreakpointsUiManagerInterface)1 ExtensionPassiveScan (org.zaproxy.zap.extension.pscan.ExtensionPassiveScan)1