How to block these requests with http:// in the params?

Igor Sysoev igor at sysoev.ru
Tue Nov 24 11:12:49 MSK 2009


On Tue, Nov 24, 2009 at 02:41:04PM +0800, Shri @ DevLib.Org wrote:

> How would I go about blocking requests which try to exploit application / php flaws?
> 
> One in particular is ... of the form http://www.domain.com/search.php?searchterm=http://217.218.xxx.x/abc.php 
> 
> I'd like to block all requests which have a param that begins with http:// (searchterm in the above case).
> 
> Can this be done at a server level?

     server {

         if ($arg_searchterm ~ ^http://) {
             return 403;
         }

or for any paramter name:

         if ($args ~ =http://) {
             return 403;
         }


-- 
Igor Sysoev
http://sysoev.ru/en/




More information about the nginx mailing list