December 2012
Intermediate to advanced
552 pages
13h 16m
English
2.4.1. Escaped Encoding
An escaped octet is encoded as a character triplet, consisting of
the percent character "%" followed by the two hexadecimal digits
representing the octet code. For example, "%20" is the escaped
encoding for the US-ASCII space character.
escaped = "%" hex hex
hex = digit | "A" | "B" | "C" | "D" | "E" | "F" |
"a" | "b" | "c" | "d" | "e" | "f"
#
# Check URL encodings
#
# -=[ Rule Logic ]=-
# There are two different chained rules. We need to separate them
# as we are inspecting two different variables - REQUEST_URI and
# REQUEST_BODY.
#
# For REQUEST_BODY, we only want to run the @validateUrlEncoding
# operator if the content-type is application/x-www-form-
# urlencoding.
#
# -=[ References ]=-
# http://www.ietf.org/rfc/rfc1738.txt#
SecRule REQUEST_URI "\%((?!$|\W)|[0-9a-fA-F]{2}|u[0-9a-fA-F]{4})" \
"chain,phase:2,rev:'2.2.3',t:none,block,msg:'URL Encoding
Abuse Attack Attempt',id:'950107',tag:'PROTOCOL_VIOLATION/EVASION',
severity:'5'"
SecRule REQUEST_URI "@validateUrlEncoding" ...Read now
Unlock full access