mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-29 19:24:29 +03:00
Adds support to custom operator's message in case of a match
This commit is contained in:
@@ -28,7 +28,9 @@ class DetectSQLi : public Operator {
|
||||
public:
|
||||
/** @ingroup ModSecurity_Operator */
|
||||
DetectSQLi(std::string op, std::string param, bool negation)
|
||||
: Operator(op, param, negation) { }
|
||||
: Operator(op, param, negation) {
|
||||
m_match_message.assign("detected SQLi using libinjection.");
|
||||
}
|
||||
|
||||
bool evaluate(Transaction *transaction, const std::string &input);
|
||||
};
|
||||
|
@@ -27,7 +27,9 @@ class DetectXSS : public Operator {
|
||||
public:
|
||||
/** @ingroup ModSecurity_Operator */
|
||||
DetectXSS(std::string op, std::string param, bool negation)
|
||||
: Operator(op, param, negation) { }
|
||||
: Operator(op, param, negation) {
|
||||
m_match_message.assign("detected XSS using libinjection.");
|
||||
}
|
||||
|
||||
bool evaluate(Transaction *transaction, const std::string &input);
|
||||
};
|
||||
|
@@ -50,6 +50,8 @@ class Operator {
|
||||
virtual bool evaluate(Transaction *transaction, const std::string &str);
|
||||
static Operator *instantiate(std::string op);
|
||||
|
||||
std::string m_match_message;
|
||||
|
||||
protected:
|
||||
bool debug(Transaction *transaction, int x, std::string a);
|
||||
};
|
||||
|
Reference in New Issue
Block a user