mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-10-02 04:27:47 +03:00
Adds first PoC for the operator offset feature
This commit is contained in:
committed by
Felipe Zimmerle
parent
9a8fc3116a
commit
ecbf292f6d
@@ -21,6 +21,7 @@
|
||||
#include "src/operators/operator.h"
|
||||
#include "src/macro_expansion.h"
|
||||
#include "modsecurity/rule.h"
|
||||
#include "modsecurity/rule_message.h"
|
||||
|
||||
namespace modsecurity {
|
||||
namespace operators {
|
||||
@@ -28,7 +29,7 @@ namespace operators {
|
||||
|
||||
|
||||
bool Rx::evaluate(Transaction *transaction, Rule *rule,
|
||||
const std::string& input) {
|
||||
const std::string& input, RuleMessage *ruleMessage) {
|
||||
SMatch match;
|
||||
std::list<SMatch> matches;
|
||||
|
||||
@@ -50,6 +51,10 @@ bool Rx::evaluate(Transaction *transaction, Rule *rule,
|
||||
}
|
||||
}
|
||||
|
||||
for (const auto & i : matches) {
|
||||
logOffset(ruleMessage, i.m_offset, i.m_length);
|
||||
}
|
||||
|
||||
if (matches.size() > 0) {
|
||||
return true;
|
||||
}
|
||||
|
Reference in New Issue
Block a user