J Doe
2017-03-02 21:52:04 UTC
Hello,
I have two questions regarding @strmatch in ModSecurity 2.9.1.
According to the ModSecurity wiki, @strmatch performs a "single pattern matching operator". I take that to mean that I can specify one "pattern" for it to match against as in the example in the wiki:
# Detect suspicious client by looking art the user agent identification
SecRule REQUEST_HEADERS:User-Agent "@strmatch WebZIP" "id:177"
Does this mean that it will attempt to match "WebZIP" to any portion of the User-Agent string (so User-Agent strings of "WebZip" and "WebZip 2000" would match), as opposed to the @streq operator, which would look for "WebZIP" as the exact string (ie: User-Agent is only "WebZIP") ?
If this is the case, the wiki notes that @strmatch uses the Boyer-Moore-Horspool algorithm which is "...much better than a regular expression."
Does this mean that if I am matching on a single pattern I want to ALWAYS use @strmatch over @rx ?
Thanks
I note in the ModSecurity wiki that @strMatch performs a "single pattern matching operator". I am assuming that means
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
mod-security-users mailing list
mod-security-***@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mod-security-users
Commercial ModSecurity Rules and Support from Trustwave's SpiderLabs:
http://www.modsecurity.org/projects/commercial/rules/
http://www.modsecurity.org/projects/commercial/support/
I have two questions regarding @strmatch in ModSecurity 2.9.1.
According to the ModSecurity wiki, @strmatch performs a "single pattern matching operator". I take that to mean that I can specify one "pattern" for it to match against as in the example in the wiki:
# Detect suspicious client by looking art the user agent identification
SecRule REQUEST_HEADERS:User-Agent "@strmatch WebZIP" "id:177"
Does this mean that it will attempt to match "WebZIP" to any portion of the User-Agent string (so User-Agent strings of "WebZip" and "WebZip 2000" would match), as opposed to the @streq operator, which would look for "WebZIP" as the exact string (ie: User-Agent is only "WebZIP") ?
If this is the case, the wiki notes that @strmatch uses the Boyer-Moore-Horspool algorithm which is "...much better than a regular expression."
Does this mean that if I am matching on a single pattern I want to ALWAYS use @strmatch over @rx ?
Thanks
I note in the ModSecurity wiki that @strMatch performs a "single pattern matching operator". I am assuming that means
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
mod-security-users mailing list
mod-security-***@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mod-security-users
Commercial ModSecurity Rules and Support from Trustwave's SpiderLabs:
http://www.modsecurity.org/projects/commercial/rules/
http://www.modsecurity.org/projects/commercial/support/