Search in sources :

Example 1 with ScriptType

use of org.zaproxy.zap.extension.script.ScriptType in project zaproxy by zaproxy.

the class ExtensionPassiveScan method hook.

@Override
public void hook(ExtensionHook extensionHook) {
    super.hook(extensionHook);
    extensionHook.addOptionsParamSet(getPassiveScanParam());
    extensionHook.addProxyListener(getPassiveScanThread());
    extensionHook.addSessionListener(this);
    if (getView() != null) {
        extensionHook.getHookView().addOptionPanel(getPassiveScannerOptionsPanel());
        extensionHook.getHookView().addOptionPanel(getOptionsPassiveScan(getPassiveScanThread()));
        extensionHook.getHookView().addOptionPanel(getPolicyPanel());
        getView().getMainFrame().getMainFooterPanel().addFooterToolbarRightLabel(getScanStatus().getCountLabel());
    }
    ExtensionScript extScript = Control.getSingleton().getExtensionLoader().getExtension(ExtensionScript.class);
    if (extScript != null) {
        extScript.registerScriptType(new ScriptType(SCRIPT_TYPE_PASSIVE, "pscan.scripts.type.passive", createScriptIcon(), true));
    }
    extensionHook.addApiImplementor(new PassiveScanAPI(this));
}
Also used : ScriptType(org.zaproxy.zap.extension.script.ScriptType) ExtensionScript(org.zaproxy.zap.extension.script.ExtensionScript)

Example 2 with ScriptType

use of org.zaproxy.zap.extension.script.ScriptType in project zaproxy by zaproxy.

the class ExtensionActiveScan method hook.

@Override
public void hook(ExtensionHook extensionHook) {
    super.hook(extensionHook);
    attackModeScanner = new AttackModeScanner(this);
    if (getView() != null) {
        extensionHook.getHookMenu().addAnalyseMenuItem(getMenuItemPolicy());
        extensionHook.getHookMenu().addToolsMenuItem(getMenuItemCustomScan());
        extensionHook.getHookMenu().addPopupMenuItem(getPopupMenuActiveScanCustomWithContext());
        extensionHook.getHookView().addStatusPanel(getActiveScanPanel());
        extensionHook.getHookView().addOptionPanel(getOptionsScannerPanel());
        extensionHook.getHookView().addOptionPanel(getOptionsVariantPanel());
        extensionHook.getHookView().addMainToolBarComponent(this.getPolicyButton());
        getView().getMainFrame().getMainFooterPanel().addFooterToolbarRightLabel(attackModeScanner.getScanStatus().getCountLabel());
        ExtensionHelp.enableHelpKey(getActiveScanPanel(), "ui.tabs.ascan");
    }
    extensionHook.addSessionListener(this);
    extensionHook.addOptionsParamSet(getScannerParam());
    // TODO this isn't currently implemented
    // extensionHook.addCommandLine(getCommandLineArguments());
    ExtensionScript extScript = Control.getSingleton().getExtensionLoader().getExtension(ExtensionScript.class);
    if (extScript != null) {
        extScript.registerScriptType(new ScriptType(SCRIPT_TYPE_ACTIVE, "ascan.scripts.type.active", createIcon("script-ascan.png"), true));
        extScript.registerScriptType(new ScriptType(SCRIPT_TYPE_VARIANT, "variant.scripts.type.variant", createIcon("script-variant.png"), true));
    }
    this.ascanController.setExtAlert(Control.getSingleton().getExtensionLoader().getExtension(ExtensionAlert.class));
    this.activeScanApi = new ActiveScanAPI(this);
    this.activeScanApi.addApiOptions(getScannerParam());
    extensionHook.addApiImplementor(activeScanApi);
}
Also used : ScriptType(org.zaproxy.zap.extension.script.ScriptType) ExtensionScript(org.zaproxy.zap.extension.script.ExtensionScript) ExtensionAlert(org.zaproxy.zap.extension.alert.ExtensionAlert)

Example 3 with ScriptType

use of org.zaproxy.zap.extension.script.ScriptType in project zaproxy by zaproxy.

the class ScriptBasedAuthenticationMethodType method hook.

@Override
public void hook(ExtensionHook extensionHook) {
    // Hook up the Script Type
    if (getScriptsExtension() != null) {
        log.debug("Registering Script...");
        getScriptsExtension().registerScriptType(new ScriptType(SCRIPT_TYPE_AUTH, "authentication.method.script.type", SCRIPT_ICON_AUTH, false, new String[] { ScriptType.CAPABILITY_APPEND }));
    }
}
Also used : ScriptType(org.zaproxy.zap.extension.script.ScriptType)

Example 4 with ScriptType

use of org.zaproxy.zap.extension.script.ScriptType in project zaproxy by zaproxy.

the class ScriptBasedSessionManagementMethodType method hook.

@Override
public void hook(ExtensionHook extensionHook) {
    // Hook up the Script Type
    if (getScriptsExtension() != null) {
        LOG.debug("Registering Script...");
        getScriptsExtension().registerScriptType(new ScriptType(SCRIPT_TYPE_SESSION, "session.method.script.type", SCRIPT_ICON_SESSION, false, new String[] { ScriptType.CAPABILITY_APPEND }));
    }
}
Also used : ScriptType(org.zaproxy.zap.extension.script.ScriptType)

Aggregations

ScriptType (org.zaproxy.zap.extension.script.ScriptType)4 ExtensionScript (org.zaproxy.zap.extension.script.ExtensionScript)2 ExtensionAlert (org.zaproxy.zap.extension.alert.ExtensionAlert)1