mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-11-18 10:20:35 +03:00
Adds first PoC for the operator offset feature
This commit is contained in:
committed by
Felipe Zimmerle
parent
9a8fc3116a
commit
ecbf292f6d
@@ -22,11 +22,15 @@
|
||||
namespace modsecurity {
|
||||
namespace operators {
|
||||
|
||||
bool Contains::evaluate(Transaction *transaction, const std::string &input) {
|
||||
bool Contains::evaluate(Transaction *transaction, Rule *rule,
|
||||
const std::string &input, RuleMessage *ruleMessage) {
|
||||
std::string p = MacroExpansion::expand(m_param, transaction);
|
||||
bool contains = input.find(p) != std::string::npos;
|
||||
size_t offset = input.find(p);
|
||||
|
||||
bool contains = offset != std::string::npos;
|
||||
|
||||
if (contains && transaction) {
|
||||
logOffset(ruleMessage, offset, p.size());
|
||||
transaction->m_matched.push_back(p);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user