Apr 30, 2012

block php file access (modsecurity)


Can anyone please tell me that how can i block all access to a php file. File name is like sm6######.php and #### can be any random digit.

How can I do it using mod_sec?

Asked by Kashif


SecRule REQUEST_LINE "@rx sm6[0-9]{1,}\.php" \
"phase:2,block,severity:2,msg:'Blocking access to sm6#.php files.'"
Answered by Kashif

Related posts:

  1. Nginx block access to PHP files
  2. SAN design: File & Block level access?
  3. Block access to certain file IIS 6.0
  4. IIS 6 produces a 404 error whenever I try to access a php file (PHP 5.3.5)
  5. How to block access to a file from being served by Tomcat?

Leave a comment