Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 7 of 7
  1. #1
    Member
    Join Date
    May 2010
    Posts
    321

    Default Understanding mod_security

    I have had this enabled for a while but recently I been getting emails with the following:

    Time: Wed Jun 9 08:50:00 2010 -0600
    IP: 8*.***.***.*0 (GB/United Kingdom/host8*.***.***.*0.range**-***.btcentralplus.com)
    Failures: 5 (mod_security)
    Interval: 300 seconds
    Blocked: Permanent Block

    Log entries:

    [Wed Jun 09 08:49:03 2010] [error] [client 8*.***.***.*0] ModSecurity: Access denied with code 501 (phase 2). Match of "rx ^((??:POS|GE)T|OPTIONS|HEAD))$" against "REQUEST_METHOD" required. [file "/usr/local/apache/conf/modsec2.user.conf"] [line "38"] [id "960032"] [msg "Method is not allowed by policy"] [severity "CRITICAL"] [tag "POLICY/METHOD_NOT_ALLOWED"] [hostname "hosting.*********"] [uri "/"] [unique_id "TA@p37IgX0wAAD58hV4AAAAa"]


    This is around 4 times per email


    Can someone explain the above and roughly what the attempt was.

    Thank you in advance.

  2. #2
    cPanel Partner NOC cPanel Partner NOC Badge
    Join Date
    Jun 2004
    Posts
    313
    cPanel/Enkompass Access Level

    DataCenter Provider

    Default

    Looks like someone is trying to make requests on your server other than the methods permitted by your mod_sec ruleset (GET, POST, HEAD, OPTIONS) and mod_sec is blocking that request. Usually this is someone who is trying to use the TRACE method to get unauthorized information from the server such as cookie data.
    NDCHost (ProVPS): Xen VPS / Dedicated / Co-Location
    Contact us for your cPanel Licensing needs! We price match, provide better support, and take care of our customers!

  3. #3
    Member
    Join Date
    Nov 2008
    Posts
    174

    Default

    960032 is quite a common rule to be triggered. As garrettp says, it's a non standard type of http request. I think it's mainly bored kids learning how to use netcat to probe for vulnerabilities... If the probe is coming from a UK IP address, report it to the ISP concerned. A bit like painting a rivet on the severn bridge, but it'll make you feel better

  4. #4
    Member
    Join Date
    May 2010
    Posts
    321

    Default

    Thank you for your replies guys, Much appreciated by me.

  5. #5
    Member
    Join Date
    Feb 2006
    Posts
    9

    Cool How to get more log info on this rule?

    Hi

    Is there a way to log the full request header so I can see exactly what is triggering this rule? Because...

    I too have been seeing this rule getting triggered more regularly lately. I thought nothing of it, being thankful mod_sec was doing its job. That is, until two legitimate, definitely non-hacker type, local clients got blocked by it in this past week. :/ Hmmm!

    I'm wondered if maybe they're running some kind of (crappy?) anti-virus software — you know, with those 'protect you from bad web links" modules — or perhaps some malware jumping on the back of their legitimate requests. One client didn't know if they had anti-virus software or not (!! *sigh*) and the other says definitely not — and they're on a Mac — and they have a static IP.

    So what I really need to do now is get more log details about exactly what the request (the full header would be good) is, so I can figure out what's going on.
    Last edited by gruvin; 06-14-2010 at 05:34 PM. Reason: typo

  6. #6
    cPanel Product Evangelist Infopro's Avatar
    Join Date
    May 2003
    Location
    Pennsylvania
    Posts
    7,891
    cPanel/Enkompass Access Level

    Root Administrator

    Lightbulb

    modsecurity is like most everything else, you need to tweak it a bit for your own needs. If you see valid users being blocked you can always disable that one rule easy enough if you like.

    Find this line:

    SecRule REQUEST_METHOD "!^((?:(?:POS|GE)T|OPTIONS|HEAD))$" \
    "phase:2,t:none,log,auditlog,status:501,msg:'Method is not allowed by policy', severity:'2',id:'960032',tag:'POLICY/METHOD_NOT_ALLOWED'"

    And change it to this:

    #SecRule REQUEST_METHOD "!^((?:(?:POS|GE)T|OPTIONS|HEAD))$" \
    "phase:2,t:none,log,auditlog,status:501,msg:'Method is not allowed by policy', severity:'2',id:'960032',tag:'POLICY/METHOD_NOT_ALLOWED'"

    Here: /usr/local/apache/conf/modsec2.user.conf

  7. #7
    Member
    Join Date
    Feb 2006
    Posts
    9

    Cool

    Thanks for the comment.

    Well yes, sure. We could simply disable the rule.

    But surely there's a way to get log information of the full header-set that triggered the rule in the first place?

    The customer (remote end) might have malware that we could detect and then help them remove, for example.

    Personally, I don't think simply disabling rules that cause "problems" is an especially intelligent way to go — though there certainly are cases where such an action is the only way to go, and we've had a couple of those concerning the handling of GB Chinese character sets for example.

Similar Threads & Tags
Similar threads

  1. Understanding Mod_Security
    By GaryT in forum Security
    Replies: 4
    Last Post: 08-11-2010, 05:41 PM
  2. Not understanding DNS Only
    By rocketfuel in forum New User Questions
    Replies: 2
    Last Post: 06-16-2010, 09:16 AM
  3. Understanding Exim
    By eaudet in forum E-mail Discussions
    Replies: 4
    Last Post: 09-20-2007, 12:14 PM
  4. Need help understanding error
    By mickalo in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 06-21-2006, 05:15 PM
  5. Slap me for not understanding but....
    By CYS in forum New User Questions
    Replies: 2
    Last Post: 07-14-2005, 04:53 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube