Results 1 to 4 of 4

Thread: block directory requests with mod_security

  1. #1
    Member
    Join Date
    Jul 2003
    Posts
    278

    Default block directory requests with mod_security

    Hey everyone, need someone who knows mod_security to give me a quick hand setting up a rule.
    What I want to do is block all access to a specific directory server-wide with mod_security.
    So say someone were to query www.mydomain.com/notreallyhere/... I want mod_security to intercept that request and 503 the user.
    Anyone know how to get a rule to do that?

  2. #2
    Member
    Join Date
    Feb 2005
    Posts
    306

    Default

    Quote Originally Posted by NightStorm View Post
    Hey everyone, need someone who knows mod_security to give me a quick hand setting up a rule.
    What I want to do is block all access to a specific directory server-wide with mod_security.
    So say someone were to query www.mydomain.com/notreallyhere/... I want mod_security to intercept that request and 503 the user.
    Anyone know how to get a rule to do that?
    If you are using rules from GotRoot or ASL, modify the file called MALWARE-SCRITP.TXT and add in there the domain+directory that you want to block, easy as that.

    After you restart apache no one will enter into that directory anymore.

    Regards,

    Sergio

  3. #3
    Member
    Join Date
    Jul 2003
    Posts
    278

    Default

    Not quite what I'm after...
    I want to catch all requests coming in to a specific directory across all sites on my server... irregardless of where the request is originating from.
    Also, I'm not using ASL rules... I have a different set of rules loaded... can't remember where I got them from... I think someone posted them here at some point, actually. Either way, it's somewhat unrelated to what I'm looking for.

  4. #4
    Member
    Join Date
    Feb 2005
    Posts
    306

    Default

    Well, in your first post you wrote:
    Quote Originally Posted by NightStorm View Post
    ... What I want to do is block all access to a specific directory server-wide with mod_security.
    So say someone were to query www.mydomain.com/notreallyhere/... I want mod_security to intercept that request and 503 the user.
    If you do as I said, everybody will be blocked trying to enter into that directory on that specific domain. But if you don't have GotRoot modsec rules, then what I wrote will not help you, sorry.

    On the other hand, you can write at AtomiCorp Forum (creators of GotRoot rules) asking for help on creating the rule that you need.

    Regards,

    Sergio

Similar Threads

  1. mod_security log only external requests
    By ecommy in forum New User Questions
    Replies: 1
    Last Post: 05-01-2012, 06:56 AM
  2. Replies: 2
    Last Post: 08-07-2011, 05:23 AM
  3. Block GET Requests to specific files
    By dannet in forum cPanel & WHM Discussions
    Replies: 0
    Last Post: 04-11-2009, 07:15 PM
  4. Replies: 0
    Last Post: 06-16-2008, 11:51 PM
  5. How to block Acunetix scanner with mod_security ?
    By WebHostDog in forum cPanel & WHM Discussions
    Replies: 0
    Last Post: 08-12-2007, 01:17 PM