mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-30 03:34:29 +03:00
Adds first PoC for the operator offset feature
This commit is contained in:
committed by
Felipe Zimmerle
parent
9a8fc3116a
commit
ecbf292f6d
@@ -24,7 +24,8 @@ namespace modsecurity {
|
||||
namespace operators {
|
||||
|
||||
|
||||
bool BeginsWith::evaluate(Transaction *transaction, const std::string &str) {
|
||||
bool BeginsWith::evaluate(Transaction *transaction, Rule *rule,
|
||||
const std::string &str, RuleMessage *ruleMessage) {
|
||||
bool ret = false;
|
||||
|
||||
std::string p = MacroExpansion::expand(m_param, transaction);
|
||||
@@ -32,6 +33,7 @@ bool BeginsWith::evaluate(Transaction *transaction, const std::string &str) {
|
||||
if (str.size() < p.size()) {
|
||||
ret = false;
|
||||
} else if (!str.compare(0, p.size(), p)) {
|
||||
logOffset(ruleMessage, 0, p.size());
|
||||
ret = true;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user