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.

How to bloack some keywords on server?

Discussion in 'Security' started by Samar, Sep 30, 2011.

  1. Samar

    Samar Member

    Joined:
    Sep 30, 2011
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Hello,

    I want to block some keywords on my server like:

    If someone uses any word that is related to adult or illegal content it gets blocked and the user is redirected to default error page or any custom page.

    How we can do this?

    I have seen this works on many hosts and now i also want to do this. Will anybody be able to help me?
     
  2. newtoallthis

    newtoallthis Member

    Joined:
    Dec 1, 2008
    Messages:
    22
    Likes Received:
    0
    Trophy Points:
    1
    do you mean adds that to a text field in a form?
     
  3. Samar

    Samar Member

    Joined:
    Sep 30, 2011
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    I think my first post was a little bit confusing for you. Let me make it more clear.

    What i want to do is,

    suppose i have an account at a server with domain "example.com".
    I made a html page(you can take any eg. php,shtml etc) and in that wrote some adult or any type of not allowed words.


    Now comes the main point.

    if some one or me wants to see this page and go to the domain example.com then system should check in all files for the restricted words and if it gets any word that is not allowed it should stop loading that page and redirect that user to a specific page set by the root admin.

    I think now all will be clear what i want to do.

    Please guys if somebody knows this let me know. I need to do this as soon as possible and also this is very important for my project.
     
  4. SoftDux

    SoftDux Well-Known Member

    Joined:
    May 27, 2006
    Messages:
    983
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Johannesburg, South Africa
    cPanel Access Level:
    Root Administrator
    What you're asking is probably impossible with the current software that cPanel provides.

    You would either need to run all your websites through a reverse proxy server, which can do content filtering, and block / redirect users when a certain condition is met

    Or you'd need to put your servers behind a content filtering firewall which can do the same thing.

    Otherwise you could use mod_security with some heavy tweaking (look here: Secure your Apache2 with mod-security) but that's probably going to cause a LOT of load on your server
     
  5. Samar

    Samar Member

    Joined:
    Sep 30, 2011
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    This is already been done by a person and he had made a custom code himself.

    What happens is when a page loads if the blocked word is found then the user us forwarded to a 406error page. You can check what he has done in the support threads of this site
    simplefreeweb.com
     
  6. ModServ

    ModServ Well-Known Member

    Joined:
    Oct 17, 2006
    Messages:
    332
    Likes Received:
    5
    Trophy Points:
    18
    Location:
    Egypt
    cPanel Access Level:
    Root Administrator
    You can use something like that in modsecurity:

    SecRule REQUEST_LINE "(WORD)"
    SecRule REQUEST_BODY "(WORD)"

    That will prevent this word from being posted for example in a form.
     
  7. nobodyk

    nobodyk Well-Known Member

    Joined:
    Aug 1, 2010
    Messages:
    90
    Likes Received:
    0
    Trophy Points:
    6
    May I ask why you want to do this? If you can explain the reason behind it, maybe we can find a better alternative.
     
  8. ModServ

    ModServ Well-Known Member

    Joined:
    Oct 17, 2006
    Messages:
    332
    Likes Received:
    5
    Trophy Points:
    18
    Location:
    Egypt
    cPanel Access Level:
    Root Administrator
    I guess he already stated that:
     
  9. nobodyk

    nobodyk Well-Known Member

    Joined:
    Aug 1, 2010
    Messages:
    90
    Likes Received:
    0
    Trophy Points:
    6
    Wouldn't it be easier to suspended the offending account? or if it's a site he controls, to filter the words at the source instead?
     
  10. ModServ

    ModServ Well-Known Member

    Joined:
    Oct 17, 2006
    Messages:
    332
    Likes Received:
    5
    Trophy Points:
    18
    Location:
    Egypt
    cPanel Access Level:
    Root Administrator
    You are right, But I guess he is talking about servers containing more than 200 or 300 accounts, Something that it's hard to monitor, You know what I mean?
     

Share This Page