Search in sources :

Example 1 with PassiveScript

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

the class ScriptsPassiveScanner method scanHttpResponseReceive.

@Override
public void scanHttpResponseReceive(HttpMessage msg, int id, Source source) {
    if (this.getExtension() != null) {
        currentHRefId = id;
        List<ScriptWrapper> scripts = extension.getScripts(ExtensionPassiveScan.SCRIPT_TYPE_PASSIVE);
        for (ScriptWrapper script : scripts) {
            try {
                if (script.isEnabled()) {
                    PassiveScript s = extension.getInterface(script, PassiveScript.class);
                    if (s != null) {
                        s.scan(this, msg, source);
                    } else {
                        extension.handleFailedScriptInterface(script, Constant.messages.getString("pscan.scripts.interface.passive.error", script.getName()));
                    }
                }
            } catch (Exception e) {
                extension.handleScriptException(script, e);
            }
        }
    }
}
Also used : ScriptWrapper(org.zaproxy.zap.extension.script.ScriptWrapper) PassiveScript(org.zaproxy.zap.extension.pscan.PassiveScript)

Aggregations

PassiveScript (org.zaproxy.zap.extension.pscan.PassiveScript)1 ScriptWrapper (org.zaproxy.zap.extension.script.ScriptWrapper)1