publishAlert(type, null, message, request, response, properties);
}
public void publishAlert(String type, String key, String message, HttpRequest request, IHttpResponse response, Object ...properties) {
debug("Publishing Alert: ("+ type + ") ["+ request.getRequestLine().getUri() + "] ");
final IScanInstance scan = scanState.getScanInstance();
final IRequestLog requestLog = scanState.getRequestLog();
synchronized(scan) {
if(key != null && scan.hasAlertKey(key))
return;
final long requestId = requestLog.addRequestResponse(response);
final IScanAlert alert = scan.createAlert(type, key, requestId);
for(int i = 0; (i + 1) < properties.length; i += 2) {
if(properties[i] instanceof String) {
alert.setProperty((String) properties[i], properties[i + 1]);
} else {
logger.warning("Property key passed to publishAlert() is not a string");
}
}
if (pathState.isParametric()) {
if (pathState.getFuzzableParameter() != null) {
alert.setProperty("param", pathState.getFuzzableParameter().getName());
}
}
alert.setProperty("methods", request.getRequestLine().getMethod());
if(message != null)
alert.setStringProperty("message", message);
for(String hl: stringHighlights) {
alert.addStringMatchHighlight(hl);
}
for(String hl: regexHighlights) {
alert.addRegexHighlight(hl);
}
for (String hl: caseInsensitiveRegexHighlights) {
alert.addRegexCaseInsensitiveHighlight(hl);
}
scan.addAlert(alert);
}
}