Class ExtensionActiveScan

    • Constructor Detail

      • ExtensionActiveScan

        public ExtensionActiveScan()
    • Method Detail

      • hook

        public void hook​(ExtensionHook extensionHook)
        Description copied from interface: Extension
        Called during extension's initialisation to allow to add new functionality to core components.
        Specified by:
        hook in interface Extension
        Overrides:
        hook in class ExtensionAdaptor
        Parameters:
        extensionHook - the hook to add the components.
      • getActiveActions

        public java.util.List<java.lang.String> getActiveActions()
        Description copied from interface: Extension
        Returns the (internationalised) names of all active actions of the extension - if there are any the user will be given the option not to exit ZAP or, if the extension is bundled in an add-on that's being updated or uninstalled, not to continue with the changes.

        An active action is something that's started by the user, for example, a scan.

        Specified by:
        getActiveActions in interface Extension
        Overrides:
        getActiveActions in class ExtensionAdaptor
        Returns:
        a List containing the active actions or null if none
        See Also:
        Extension.getUnsavedResources()
      • startScanAllInScope

        public void startScanAllInScope()
      • startScan

        public int startScan​(SiteNode startNode)
        Start the scanning process beginning to a specific node
        Parameters:
        startNode - the start node where the scanning should begin to work
        Returns:
        the ID of the scan
      • startScanNode

        public int startScanNode​(SiteNode startNode)
      • startScan

        public int startScan​(Target target)
      • startScan

        public int startScan​(Target target,
                             User user,
                             java.lang.Object[] contextSpecificObjects)
      • isPanelSwitch

        public boolean isPanelSwitch()
        Returns true if the GUI will switch to the Active Scan panel when a scan is started.
        Since:
        2.11.0
      • setPanelSwitch

        public void setPanelSwitch​(boolean panelSwitch)
        Sets if the GUI will switch to the Active Scan panel when a scan is started. Code should only set this to false just before starting a scan and reset it to true as soon as the scan has started.
        Since:
        2.11.0
      • showPolicyDialog

        protected void showPolicyDialog​(PolicyManagerDialog parent)
                                 throws org.apache.commons.configuration.ConfigurationException
        Throws:
        org.apache.commons.configuration.ConfigurationException
      • showPolicyDialog

        protected void showPolicyDialog​(PolicyManagerDialog parent,
                                        java.lang.String name)
                                 throws org.apache.commons.configuration.ConfigurationException
        Throws:
        org.apache.commons.configuration.ConfigurationException
      • sessionChanged

        public void sessionChanged​(Session session)
        Description copied from interface: SessionChangedListener
        Called just after the session has changed. sessionChanged may be called by non-event thread. Should handle with care in all the listener. Use EventThread for each GUI event.
        Specified by:
        sessionChanged in interface SessionChangedListener
        Parameters:
        session - the new session
      • getScannerParam

        protected ScannerParam getScannerParam()
        This method initializes scannerParam
        Returns:
        org.parosproxy.paros.core.scanner.ScannerParam
      • setExcludeList

        public void setExcludeList​(java.util.List<java.lang.String> urls)
        Sets the exclude list.
        Parameters:
        urls - the new exclude list
      • getExcludeList

        public java.util.List<java.lang.String> getExcludeList()
        Gets the exclude list.
        Returns:
        the exclude list
      • getDependencies

        public java.util.List<java.lang.Class<? extends Extension>> getDependencies()
        Description copied from interface: Extension
        Gets the list of Extensions that this extension depends on.
        Specified by:
        getDependencies in interface Extension
        Overrides:
        getDependencies in class ExtensionAdaptor
        Returns:
        the list of dependencies, empty (or null) if none.
      • sessionAboutToChange

        public void sessionAboutToChange​(Session session)
        Description copied from interface: SessionChangedListener
        Called just prior to the session changing. Listeners should close down any resources associated with this session. sessionAboutToChange may be called by non-event thread. Should handle with care in all the listener. Use EventThread for each GUI event.
        Specified by:
        sessionAboutToChange in interface SessionChangedListener
        Parameters:
        session - the session about to be closed
      • getAuthor

        public java.lang.String getAuthor()
        Description copied from interface: Extension
        Gets the author of the extension.

        Since 2.9.0 defaults to the author of the add-on, if set, otherwise an empty string.

        Specified by:
        getAuthor in interface Extension
        Returns:
        the author of the extension, might be null.
      • getDescription

        public java.lang.String getDescription()
        Description copied from interface: Extension
        Returns the description of the extension, to be shown in UI components. The description must be internationalised.
        Specified by:
        getDescription in interface Extension
        Overrides:
        getDescription in class ExtensionAdaptor
        Returns:
        the description of the extension, never null
      • sessionScopeChanged

        public void sessionScopeChanged​(Session session)
        Description copied from interface: SessionChangedListener
        Called when the user has changes the session scope. sessionScopeChanged may be called by non-event thread. Should handle with care in all the listener. Use EventThread for each GUI event.
        Specified by:
        sessionScopeChanged in interface SessionChangedListener
        Parameters:
        session - the current session
      • sessionModeChanged

        public void sessionModeChanged​(Control.Mode mode)
        Description copied from interface: SessionChangedListener
        Called when the user changes the mode. sessionModeChanged may be called by non-event thread. Should handle with care in all the listener. Use EventThread for each GUI event.
        Specified by:
        sessionModeChanged in interface SessionChangedListener
        Parameters:
        mode - the new mode
      • destroy

        public void destroy()
        Description copied from interface: Extension
        Performs final cleanups, free resources.

        Called when the extension is removed (i.e. corresponding add-on is uninstalled) and when ZAP shuts down.

        Called after stopping the extension.

        Should be called only by core functionality.

        Specified by:
        destroy in interface Extension
        Overrides:
        destroy in class ExtensionAdaptor
      • showCustomScanDialog

        public void showCustomScanDialog​(SiteNode node)
      • showCustomScanDialog

        public void showCustomScanDialog​(Target target)
        Shows the active scan dialogue with the given target, if not already visible.
        Parameters:
        target - the target, might be null.
        Since:
        2.8.0.
      • addCustomScanPanel

        public void addCustomScanPanel​(CustomScanPanel panel)
      • removeCustomScanPanel

        public void removeCustomScanPanel​(CustomScanPanel panel)
      • showPolicyManagerDialog

        public void showPolicyManagerDialog()
      • handleFile

        public boolean handleFile​(java.io.File file)
        Description copied from interface: CommandLineListener
        Handle the specified file (in whatever way is appropriate). This will only be called for files specified on the command line without switches and which match one of the extensions returned by getHandledExtensions()
        Specified by:
        handleFile in interface CommandLineListener
        Parameters:
        file - the file provided through the command line
        Returns:
        true if the listener handled the file, false otherwise
      • getHandledExtensions

        public java.util.List<java.lang.String> getHandledExtensions()
        Description copied from interface: CommandLineListener
        Get the list of extensions this listener can handle
        Specified by:
        getHandledExtensions in interface CommandLineListener
        Returns:
        a List with the handled extensions
      • registerScan

        public int registerScan​(ActiveScan scanner)
      • getAttackModeStackSize

        public int getAttackModeStackSize()
      • supportsLowMemory

        public boolean supportsLowMemory()
        Description copied from interface: Extension
        Return true it the extension can run with the 'low memory' option. If the low memory option is set (and the extension supports it) then code should minimize the data stored in memory, using the db for all significant data. Extensions that do not support the low memory option will not be run if the option is set.
        Specified by:
        supportsLowMemory in interface Extension
        Overrides:
        supportsLowMemory in class ExtensionAdaptor
        Returns:
        true if the extension support the 'low memory' option, false otherwise
      • supportsDb

        public boolean supportsDb​(java.lang.String type)
        Part of the core set of features that should be supported by all db types
        Specified by:
        supportsDb in interface Extension
        Overrides:
        supportsDb in class ExtensionAdaptor
        Parameters:
        type - the db type
        Returns:
        true if the specified db type is supported by the extension (or if it doesn't use any db)
        See Also:
        Database.getType()