Skip to main content

mod_security how to trigger error page (custom rule for xmlrpc.php attack)

Comments

3 comments

  • cPanelMichael
    Hello :) Are you sure the CMS has not implemented custom error page rules in the .htaccess file for the account? Thank you.
    0
  • quizknows
    Usually what I do is set an odd status like status:411 in the rule. Many times CMS custom 404 still hijacks that causing load rendering the php 404 pages. What's happening is ModSecurity is intercepting it, but when it goes to give the 403 page for the status you set, it can't find it so a 404 is also triggered, and the CMS then runs from there with 404 handling. In this case I add this to the sites .htaccess (or even /home/.htaccess for all sites): ErrorDocument 411 default #(or 403 in your case) ErrorDocument 403 default
    You could also do a custom errordoc relative to the docroot as outlined in the apache manual for "errordocument" Basically if you use a status action for a modsec rule, you have to make sure the errordocument exists for the status code you're returning, otherwise a 404 will also be triggered.
    0
  • oempire
    thanks for the info mate. Im hoping for a way to intercept it before it even gets to the customers CMS. Ive had customers call in in the past where a rule has resulted in them getting an internal server error, until i white listed the rule in question. It just presented that really basic text only internal server error page - that way it uses nearly no resources. hmm [COLOR="silver">- - - Updated - - - ok re-read your post i added that to the /home/.htacess and its working sweet across all sites :)
    0

Please sign in to leave a comment.