Am 18.04.2007 um 10:38 schrieb Marc Stern:
> To clarify my previous post, I tried several syntaxes
to parse both
> query/post args:
> 1. SecRule ARGS "..."
> 2. SecRule ARGS "..."
"phase:1-2"
> 3. SecRule ARGS "...""phase:1,
phase:2"
> 4. SecRule ARGS "..." "phase:1"
> SecRule ARGS "..."
"phase:2"
>
> 1 & 2 only work for query args.
> 3 only works for post args.
> Only 4 works for both.
That is probably, because when the 3rd rule is created, it
will be
set to be in
phase-2, the same as in the 2nd rule. (I guess, parsing
"1-2" will
either return
"1", or revert into the default-action).
Anyway I didn't expect modsec to even accept
"phase:1-2".
> If I look to core rules, I see that they use, to block
SQL
> Injection, "SecDefaultAction
log,pass,phase:2,..."
> So, it seems they only check POST args ???
No, see my answer to your previous mail. In Phase:2 ARGS
contains the
POST- as well as
the GET-arguments. The only feature, that this lacks, is
that you
cannot distinguish to
check a GET-arg or a POST-arg in Phase:2 (as it will always
check both).
So, to check for SPAM-Injection for example you could just
use
SecRule ARGS
"n[[:space:]]*(to|bcc|cc)[[:space:]]*:.* "
"phase:2,deny,status:
500,t:tolowercase,t:urldecode,msg:'Possible
SPAM-Injection'"
If you defined your default-action to be in phase:2
somewhere as follows
SecDefaultAction
"log,phase:2,t:urldecode,t:tolowercase,deny,status:
500"
then you don't need to specify all this as your rule will
INHERIT
these actions and your
rule can be shortened to this:
SecRule ARGS
"n[[:space:]]*(to|bcc|cc)[[:space:]]*:.* "
Regards,
Chris
------------------------------------------------------------
-------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and
take
control of your XML. No limits. Just data. Click to get it
now.
http://sourcefor
ge.net/powerbar/db2/
_______________________________________________
mod-security-users mailing list
mod-security-users lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mod-
security-users
|