The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

mod security issue

Discussion in 'Security' started by hostnex, Oct 26, 2013.

  1. hostnex

    hostnex Well-Known Member

    Joined:
    May 2, 2008
    Messages:
    77
    Likes Received:
    1
    Trophy Points:
    8
    Location:
    Islamabad, Pakistan, Pakistan
    cPanel Access Level:
    Root Administrator
    when we add the rule given below in mod security Apache stops working. We are using Apache 2.x .Can anyone help me to resolve the issue.

    SecRule RESPONSE_BODY "<?" "deny,msg:'PHP source code
    disclosure blocked'"
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,852
    Likes Received:
    675
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    I recommend first reading the following document for information about using Mod_Security and implementing custom rules:

    EasyApache - Mod_Security

    Then, once you have ensured your rule is correctly formatted with a rule ID, check /usr/local/apache/logs/error_log for the specific error message associated with the rule you have added. Restarting Apache should also generate a specific error related to the rule.

    Thank you.
     
  3. quizknows

    quizknows Well-Known Member

    Joined:
    Oct 20, 2009
    Messages:
    942
    Likes Received:
    57
    Trophy Points:
    28
    cPanel Access Level:
    DataCenter Provider
    You need to ID the rule. Try this:
    Code:
    SecRule RESPONSE_BODY "<?" "deny,id:2000345,msg:'PHP source code disclosure blocked'" 
    
     
  4. hostnex

    hostnex Well-Known Member

    Joined:
    May 2, 2008
    Messages:
    77
    Likes Received:
    1
    Trophy Points:
    8
    Location:
    Islamabad, Pakistan, Pakistan
    cPanel Access Level:
    Root Administrator
  5. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,852
    Likes Received:
    675
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    That post is from 2011, and likely is intended for an earlier version of Mod_Security. Did you try the rule from user quizknows in the post before yours?

    Thank you.
     
  6. hostnex

    hostnex Well-Known Member

    Joined:
    May 2, 2008
    Messages:
    77
    Likes Received:
    1
    Trophy Points:
    8
    Location:
    Islamabad, Pakistan, Pakistan
    cPanel Access Level:
    Root Administrator
    is there any post on the cpanel forum from we can have some good mod security rules. Gotroot doesn't give free rules anymore :(
     
Loading...

Share This Page