Search in sources :

Example 1 with ExtensionAlert

use of org.zaproxy.zap.extension.alert.ExtensionAlert in project zaproxy by zaproxy.

the class HostProcess method alertFound.

public void alertFound(Alert alert) {
    ExtensionAlert extensionAlertRef = Control.getSingleton().getExtensionLoader().getExtension(ExtensionAlert.class);
    if (extensionAlertRef.isNewAlert(alert)) {
        newAlertCount++;
    }
    parentScanner.notifyAlertFound(alert);
    PluginStats pluginStats = mapPluginStats.get(alert.getPluginId());
    if (pluginStats != null) {
        pluginStats.incAlertCount();
    }
    alertCount++;
}
Also used : ExtensionAlert(org.zaproxy.zap.extension.alert.ExtensionAlert)

Example 2 with ExtensionAlert

use of org.zaproxy.zap.extension.alert.ExtensionAlert in project zaproxy by zaproxy.

the class ExtensionPassiveScan method getPassiveScanThread.

private PassiveScanThread getPassiveScanThread() {
    if (pst == null) {
        final ExtensionLoader extensionLoader = Control.getSingleton().getExtensionLoader();
        final ExtensionHistory extHist = extensionLoader.getExtension(ExtensionHistory.class);
        final ExtensionAlert extAlert = extensionLoader.getExtension(ExtensionAlert.class);
        pst = new PassiveScanThread(getPassiveScannerList(), extHist, extAlert, getPassiveScanParam());
        pst.start();
    }
    return pst;
}
Also used : ExtensionHistory(org.parosproxy.paros.extension.history.ExtensionHistory) ExtensionAlert(org.zaproxy.zap.extension.alert.ExtensionAlert) ExtensionLoader(org.parosproxy.paros.extension.ExtensionLoader)

Example 3 with ExtensionAlert

use of org.zaproxy.zap.extension.alert.ExtensionAlert in project zaproxy by zaproxy.

the class ExtensionHistory method showAlertAddDialog.

/**
 * @deprecated (2.7.0) Use {@link ExtensionAlert#showAlertAddDialog(HistoryReference)} instead.
 * @param ref the {@code HistoryReference} that will have the new alert, if created.
 */
@Deprecated
public void showAlertAddDialog(HistoryReference ref) {
    ExtensionAlert extAlert = Control.getSingleton().getExtensionLoader().getExtension(ExtensionAlert.class);
    if (extAlert == null) {
        return;
    }
    extAlert.showAlertAddDialog(ref);
}
Also used : ExtensionAlert(org.zaproxy.zap.extension.alert.ExtensionAlert)

Example 4 with ExtensionAlert

use of org.zaproxy.zap.extension.alert.ExtensionAlert in project zaproxy by zaproxy.

the class ExtensionHistory method showAlertAddDialog.

/**
 * Sets the {@code HttpMessage} and the history type of the {@code HistoryReference} that will
 * be created if the user creates the alert. The current session will be used to create the
 * {@code HistoryReference}. The alert created will be added to the newly created {@code
 * HistoryReference}.
 *
 * <p>Should be used when the alert is added to a temporary {@code HistoryReference} as the
 * temporary {@code HistoryReference}s are deleted when the session is closed.
 *
 * @deprecated (2.7.0) Use {@link ExtensionAlert#showAlertAddDialog(HttpMessage, int)} instead.
 * @param httpMessage the {@code HttpMessage} that will be used to create the {@code
 *     HistoryReference}, must not be {@code null}
 * @param historyType the type of the history reference that will be used to create the {@code
 *     HistoryReference}
 * @see Model#getSession()
 * @see HistoryReference#HistoryReference(org.parosproxy.paros.model.Session, int, HttpMessage)
 */
@Deprecated
public void showAlertAddDialog(HttpMessage httpMessage, int historyType) {
    ExtensionAlert extAlert = Control.getSingleton().getExtensionLoader().getExtension(ExtensionAlert.class);
    if (extAlert == null) {
        return;
    }
    extAlert.showAlertAddDialog(httpMessage, historyType);
}
Also used : ExtensionAlert(org.zaproxy.zap.extension.alert.ExtensionAlert)

Example 5 with ExtensionAlert

use of org.zaproxy.zap.extension.alert.ExtensionAlert in project zaproxy by zaproxy.

the class PopupMenuPurgeHistory method purgeHistory.

private void purgeHistory(HistoryReference ref) {
    if (ref == null) {
        return;
    }
    extension.removeFromHistoryList(ref);
    ExtensionAlert extAlert = (ExtensionAlert) Control.getSingleton().getExtensionLoader().getExtension(ExtensionAlert.NAME);
    if (extAlert != null) {
        extAlert.deleteHistoryReferenceAlerts(ref);
    }
    extension.delete(ref);
    SiteNode node = ref.getSiteNode();
    if (node == null) {
        return;
    }
    SiteMap map = Model.getSingleton().getSession().getSiteTree();
    if (node.getHistoryReference() == ref) {
        // same active Node
        extension.purge(map, node);
    } else {
        node.getPastHistoryReference().remove(ref);
        map.removeHistoryReference(ref.getHistoryId());
    }
}
Also used : SiteMap(org.parosproxy.paros.model.SiteMap) ExtensionAlert(org.zaproxy.zap.extension.alert.ExtensionAlert) SiteNode(org.parosproxy.paros.model.SiteNode)

Aggregations

ExtensionAlert (org.zaproxy.zap.extension.alert.ExtensionAlert)9 SiteNode (org.parosproxy.paros.model.SiteNode)3 HistoryReference (org.parosproxy.paros.model.HistoryReference)2 SiteMap (org.parosproxy.paros.model.SiteMap)2 HeadlessException (java.awt.HeadlessException)1 JButton (javax.swing.JButton)1 URIException (org.apache.commons.httpclient.URIException)1 Alert (org.parosproxy.paros.core.scanner.Alert)1 DatabaseException (org.parosproxy.paros.db.DatabaseException)1 ExtensionLoader (org.parosproxy.paros.extension.ExtensionLoader)1 ExtensionHistory (org.parosproxy.paros.extension.history.ExtensionHistory)1 HttpMalformedHeaderException (org.parosproxy.paros.network.HttpMalformedHeaderException)1