Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Member
    Join Date
    Nov 2006
    Posts
    101

    Default Mod Security Rule Question

    I'm currently using a custom set of mod security rules that works beautifully, however, one of the rules I added:
    Code:
    SecRule REQUEST_URI|ARGS "\.txt"
    Blocks any attempt to visit any url on the server with .txt in the request uri, it works how I want it to to prevent any remote injection like ht tp://trimedia-online.net/ihmank/id.txt (no thats not my site, it was an attempt that was blocked). However, it blocks bots from reading robots.txt.

    Is there any way I can have it block any url with .txt in the REQUEST_URI with the exception of robots.txt? I'm sure there is, I'm just not any good with regex :/

    Thanks
    - John
    Last edited by Infopro; 12-21-2007 at 08:00 PM.

  2. #2
    Member
    Join Date
    Dec 2005
    Posts
    5

    Default mmm

    hello


    Why you block .txt only files ??? RFI attacks could be in any type lie .jpg , .pl etc etc.

    In my server I have this rule:


    SecFilterSelective THE_REQUEST "=http://"


    it block any remote file inclusion =) , because all url lika blah.com/id.php?root_path=http://


    will be blocked.

    good luck , bye

  3. #3
    Member
    Join Date
    Nov 2006
    Posts
    101

    Default

    It's so damn obvious I can't believe I didn't think of it.... Thanks

    EDIT: Used the following rules for anyone else who may want to do this with mod_security2

    Code:
    SecRule REQUEST_URI|ARGS "=http://"
    SecRule REQUEST_URI|ARGS "=https://"
    SecRule REQUEST_URI|ARGS "=ftp://"
    Last edited by Nhojohl; 12-21-2007 at 11:07 PM.

Similar Threads & Tags
Similar threads

  1. Mod Security
    By aaronkolodjski in forum Data Protection
    Replies: 7
    Last Post: 12-20-2009, 05:50 PM
  2. Mod Security Rule
    By SandM in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 01-16-2008, 11:44 AM
  3. Simple security question about mod-security rule sets.
    By jols in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 08-09-2007, 04:37 AM
  4. Mod Security Rule help
    By mickalo in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 01-13-2007, 08:21 AM
  5. Mod Security but how?
    By MrNone in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 11-02-2004, 09:15 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube