Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Block IP Addresses

Discussion in 'Security' started by JasMax, May 8, 2014.

  1. JasMax

    JasMax Member

    Joined:
    Jan 26, 2014
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    How to block incoming traffic for a domain on server ? for all services.
    Other domains should not affect.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  2. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,809
    Likes Received:
    1,898
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello :)

    Do you control the DNS for this domain name? If so, simply change it's name servers so that it does not resolve to your server.

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. JasMax

    JasMax Member

    Joined:
    Jan 26, 2014
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Hello Michael,

    Thank you, I have done the same thing, but I am facing problem with few bots like gate.php, cfg.bin.
    I have created mod-security rule also deleted files, but traffic is still coming to a domain, also tried to delete the apache entry for the domain, but then traffic comes to server (hostname)

    Looking forward to block traffic for problem files or domain.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. quizknows

    quizknows Well-Known Member

    Joined:
    Oct 20, 2009
    Messages:
    1,011
    Likes Received:
    88
    Trophy Points:
    78
    cPanel Access Level:
    DataCenter Provider
    What ModSecurity rule(s) are you using? You can block an entire domain with this rule:

    Code:
    SecRule SERVER_NAME "site-to-block.com" "deny,phase:1,nolog,id:2333897,status:406"
    Try it without 'nolog' first, and if that works, add 'nolog' to save the resources from logging all the blocks.

    Also set this in the sites main .htaccess to minimize response size:

    Code:
    errordocument 406 default
     
  5. JasMax

    JasMax Member

    Joined:
    Jan 26, 2014
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Dear quizknows,

    Thank you for answer, I am using same rule for domain and for files using code below.

    SecRule REQUEST_FILENAME "^/gate\.php$" "phase:2,deny,status:402,id:10124480,log,msg:'Bad File'"

    Still domain is using server bandwidth in 24 hours it has used 5 GB bandwidth.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  6. quizknows

    quizknows Well-Known Member

    Joined:
    Oct 20, 2009
    Messages:
    1,011
    Likes Received:
    88
    Trophy Points:
    78
    cPanel Access Level:
    DataCenter Provider
    Are you only trying to block the bad file(s)? Or do you want to completely block traffic to the domain?

    I also do like Michael's recommendation of changing the site's DNS record. If you don't need the site, set their DNS A record to something like 127.0.0.1 and the bots will send their traffic to themselves instead of your server.
     
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice