Results 1 to 11 of 11
  1. #1

    Angry Allowing only 1 country to login to my website

    Hello,

    I've a vps, and suffering from ddos attack
    i want to block all IPs on all countries except saudi arabia

    Does anyone know how to do that?

  2. #2
    Join Date
    Dec 2001
    Location
    San Antonio, TX
    Posts
    98

  3. #3
    Join Date
    Nov 2012
    Location
    Denver
    Posts
    33
    if you have CSF firewall you can set the cc_allow to the saudi arabia country code and it will only allow that country. This may impact performance though so make sure you monitor upon making this change.

  4. #4
    You can use mod_geoip, which is basically lines that you enter to your .htaccess file, or you can use the Firewall on the server to stop users from even accessing the site.

    Following is a link to the mod_geoip:

    https://billing.handsonwebhosting.co...article&id=234

  5. #5
    Join Date
    Nov 2007
    Location
    New Jersey, USA
    Posts
    4,740
    Remember, when doing this your performance will degrade since there will be so many entries.

    - Daniel

  6. #6
    Quote Originally Posted by vicgrc13 View Post
    i tried the above solution but i guess it doesn't work
    i added this lines inside .htaccess
    <Limit GET HEAD POST>
    order deny,allow
    deny from 210.5.193.40/29
    deny from 203.215.32.0/20
    deny from 203.208.205.192/26
    deny from 203.88.92.0/24
    deny from 203.88.68.224/27
    deny from 203.88.68.216/29
    deny from 203.88.68.192/29
    deny from 203.88.68.188/31
    deny from 203.88.68.184/30
    deny from 203.88.68.176/29
    deny from 203.88.68.160/28
    deny from 203.88.68.144/28
    deny from 203.88.68.128/29
    deny from 203.88.68.64/26
    deny from 203.88.68.56/29
    deny from 203.88.68.32/28
    deny from 203.88.68.16/28
    deny from 203.88.68.8/29
    deny from 204.231.159.0/27
    deny from 205.234.153.80/29
    deny from 206.217.128.112/29
    deny from 210.5.193.24/29
    deny from 208.251.201.56/29
    deny from 208.251.176.232/29
    deny from 208.115.117.144/29
    deny from 208.35.53.176/28
    deny from 206.226.106.32/29
    deny from 206.226.105.24/29
    deny from 206.226.94.56/29
    deny from 206.226.88.32/29
    deny from 206.226.87.216/29
    deny from 206.226.82.224/29
    deny from 206.226.81.168/29
    deny from 206.226.79.16/29
    deny from 206.226.76.144/29
    deny from 206.226.67.144/29
    deny from 206.217.134.48/29
    deny from 206.217.132.104/29
    deny from 202.174.157.232/29
    deny from 202.174.157.192/27
    deny from 202.174.157.128/26
    deny from 202.174.133.32/28
    deny from 202.174.133.8/29
    deny from 202.133.13.56/29
    deny from 202.133.13.40/29
    deny from 202.133.13.16/28
    deny from 202.133.13.8/29
    deny from 202.133.9.248/29
    deny from 202.86.16.0/20
    deny from 202.56.176.0/20
    deny from 199.16.201.64/29
    deny from 193.220.157.0/27
    deny from 193.219.255.112/29
    deny from 193.219.243.192/26
    deny from 193.219.243.176/28
    deny from 193.219.243.168/29
    deny from 193.219.243.152/29
    deny from 193.219.243.128/29
    deny from 202.174.133.144/29
    deny from 202.174.134.0/29
    deny from 202.174.144.0/29
    deny from 202.174.156.248/29
    deny from 202.174.156.224/29
    deny from 202.174.156.208/29
    deny from 202.174.156.192/28
    deny from 202.174.155.240/29
    deny from 202.174.155.216/29
    deny from 202.174.155.144/29
    deny from 202.174.155.128/29
    deny from 202.174.155.32/29
    deny from 202.174.154.24/29
    deny from 202.174.153.184/29
    deny from 202.174.148.128/29
    deny from 202.174.148.48/29
    deny from 202.174.148.32/29
    deny from 202.174.147.0/24
    deny from 202.174.145.128/29
    deny from 202.174.144.216/29
    deny from 193.219.243.112/28
    deny from 210.5.194.32/28
    deny from 217.195.145.128/25
    deny from 212.21.35.48/30
    deny from 212.21.35.20/30
    deny from 210.89.93.224/27
    deny from 210.89.93.208/29
    deny from 210.89.93.16/28
    deny from 210.89.87.0/24
    deny from 210.89.78.248/29
    deny from 210.89.78.208/28
    deny from 210.89.78.160/28
    deny from 210.89.78.144/28
    deny from 210.89.78.96/27
    deny from 210.89.78.72/29
    deny from 210.89.78.48/29
    deny from 210.89.78.32/28
    deny from 210.89.78.0/28
    deny from 210.89.74.240/29
    deny from 210.89.74.224/28
    deny from 212.21.40.88/29
    deny from 212.21.40.112/28
    deny from 212.21.40.128/27
    deny from 217.195.145.96/27
    deny from 217.195.145.80/28
    deny from 217.195.145.56/29
    deny from 217.195.145.32/28
    deny from 217.195.145.0/27
    deny from 217.195.144.32/30
    deny from 217.195.144.24/29
    deny from 217.10.167.0/24
    deny from 213.255.195.0/27
    deny from 212.116.232.208/28
    deny from 212.21.59.0/24
    deny from 212.21.52.128/27
    deny from 212.21.52.64/26
    deny from 212.21.52.32/27
    deny from 212.21.52.0/28
    deny from 212.21.44.80/28
    deny from 212.21.40.160/29
    deny from 210.89.74.192/27
    deny from 210.89.74.128/26
    deny from 210.89.74.0/25
    deny from 210.5.235.200/29
    deny from 210.5.235.144/28
    deny from 210.5.235.112/29
    deny from 210.5.235.96/29
    deny from 210.5.235.88/29
    deny from 210.5.235.64/29
    deny from 210.5.235.56/29
    deny from 210.5.235.32/29
    deny from 210.5.235.24/29
    deny from 210.5.226.0/24
    deny from 210.5.215.176/29
    deny from 210.5.215.152/29
    deny from 210.5.215.104/29
    deny from 210.5.215.80/29
    deny from 210.5.214.128/29
    deny from 210.5.214.88/29
    deny from 210.5.214.56/29
    deny from 210.5.235.240/29
    deny from 210.5.236.48/29
    deny from 210.89.67.184/29
    deny from 210.89.73.240/28
    deny from 210.89.71.240/28
    deny from 210.89.71.238/32
    deny from 210.89.71.236/31
    deny from 210.89.71.232/30
    deny from 210.89.71.224/29
    deny from 210.89.71.192/27
    deny from 210.89.71.176/28
    deny from 210.89.71.168/29
    deny from 210.89.71.128/27
    deny from 210.89.71.0/25
    deny from 210.89.69.160/28
    deny from 210.89.69.144/29
    deny from 210.89.69.128/29
    deny from 210.89.69.112/28
    deny from 210.89.69.32/27
    deny from 210.89.67.192/26
    deny from 210.5.214.24/29
    deny from 109.235.205.72/29
    deny from 103.5.172.0/22
    deny from 96.8.113.216/29
    deny from 91.109.216.0/21
    deny from 87.249.84.0/24
    deny from 87.249.65.0/24
    deny from 84.11.33.0/24
    deny from 82.205.204.0/22
    deny from 82.205.202.0/23
    deny from 82.205.192.0/24
    deny from 81.31.199.32/30
    deny from 80.247.139.0/24
    deny from 78.41.227.168/29
    deny from 72.9.146.168/29
    deny from 69.88.10.160/28
    deny from 69.88.2.244/30
    deny from 69.61.127.128/27
    deny from 69.61.125.64/27
    deny from 103.5.196.0/23
    deny from 103.7.104.0/22
    deny from 103.12.96.0/22
    deny from 109.235.205.64/30
    deny from 109.235.205.48/28
    deny from 109.235.205.40/30
    deny from 109.235.205.36/30
    deny from 109.235.205.24/29
    deny from 109.235.205.16/30
    deny from 109.235.205.8/30
    deny from 109.235.205.0/29
    deny from 109.235.203.0/28
    deny from 103.247.198.0/24
    deny from 103.30.136.0/22
    deny from 103.28.132.0/22
    deny from 103.23.247.0/24
    deny from 103.23.36.0/22
    deny from 103.15.238.0/23
    deny from 103.14.24.0/24
    deny from 103.13.64.0/22
    deny from 69.61.103.0/27
    deny from 69.61.102.224/27
    deny from 69.61.84.32/27
    deny from 64.86.63.64/27
    deny from 64.71.230.128/28
    deny from 63.250.182.192/29
    deny from 63.250.179.160/27
    deny from 63.99.56.40/29
    deny from 63.87.97.88/29
    deny from 63.76.180.160/29
    deny from 61.5.192.0/20
    deny from 58.147.128.0/19
    deny from 46.136.147.0/24
    deny from 46.136.7.0/24
    deny from 37.223.0.0/24
    deny from 37.222.9.0/24
    deny from 31.201.1.192/30
    deny from 27.116.56.0/22
    deny from 5.225.9.0/24
    deny from 5.224.9.0/24
    deny from 65.197.180.160/29
    deny from 65.199.111.24/29
    deny from 65.213.122.40/29
    deny from 69.61.66.32/27
    deny from 69.61.59.128/27
    deny from 69.61.43.0/27
    deny from 69.61.40.128/26
    deny from 69.61.33.64/29
    deny from 69.61.25.80/29
    deny from 69.61.16.216/29
    deny from 69.43.228.224/27
    deny from 66.181.39.96/29
    deny from 65.242.147.16/29
    deny from 65.241.40.200/29
    deny from 65.241.40.176/29
    deny from 65.223.246.232/29
    deny from 65.223.240.16/29
    deny from 65.219.15.80/29
    deny from 65.219.15.72/29
    deny from 65.216.143.16/28
    deny from 5.132.9.0/24
    deny from 109.235.205.112/30
    deny from 193.219.243.96/29
    deny from 175.176.243.192/27
    deny from 175.176.243.128/26
    deny from 175.176.243.0/25
    deny from 175.176.242.0/24
    deny from 175.176.241.192/26
    deny from 175.176.241.176/28
    deny from 175.176.241.168/29
    deny from 175.176.240.224/29
    deny from 175.176.240.192/27
    deny from 175.176.240.128/26
    deny from 175.176.240.0/25
    deny from 175.176.239.192/26
    deny from 175.176.239.176/28
    deny from 175.176.239.168/29
    deny from 175.176.238.240/28
    deny from 175.176.238.238/32
    deny from 175.176.238.236/31
    deny from 175.176.243.224/28
    deny from 175.176.243.240/29
    deny from 175.176.244.80/28
    deny from 193.219.243.64/27
    deny from 193.219.243.48/28
    deny from 193.219.243.16/28
    deny from 193.219.243.8/29
    deny from 193.219.208.192/28
    deny from 182.50.176.0/20
    deny from 180.222.136.0/21
    deny from 180.94.64.0/19
    deny from 175.176.245.0/24
    deny from 175.176.244.224/27
    deny from 175.176.244.192/28
    deny from 175.176.244.160/28
    deny from 175.176.244.144/28
    deny from 175.176.244.140/31
    deny from 175.176.244.136/30
    deny from 175.176.244.128/29
    deny from 175.176.244.96/27
    deny from 175.176.238.232/30
    deny from 175.176.238.224/29
    deny from 175.176.238.192/27
    deny from 122.201.38.224/27
    deny from 122.201.38.32/28
    deny from 122.201.36.96/28
    deny from 122.201.36.88/29
    deny from 121.127.32.0/19
    deny from 121.100.48.0/21
    deny from 119.59.80.0/21
    deny from 117.104.224.0/21
    deny from 117.55.192.0/20
    deny from 113.208.72.0/23
    deny from 111.223.244.0/22
    deny from 111.125.152.0/21
    deny from 109.235.206.32/27
    deny from 109.235.206.24/29
    deny from 109.235.206.0/28
    deny from 109.235.205.152/30
    deny from 109.235.205.136/30
    deny from 122.201.39.128/28
    deny from 122.201.44.48/28
    deny from 124.199.112.0/20
    deny from 175.176.238.176/28
    deny from 175.176.238.168/29
    deny from 175.176.238.128/27
    deny from 175.176.238.0/25
    deny from 175.176.236.0/24
    deny from 175.176.230.112/28
    deny from 175.176.228.176/28
    deny from 175.176.226.64/28
    deny from 175.176.225.240/28
    deny from 175.176.225.192/28
    deny from 175.106.32.0/19
    deny from 173.253.122.48/29
    deny from 173.253.122.32/29
    deny from 173.253.117.136/29
    deny from 172.10.2.128/29
    deny from 172.10.2.0/25
    deny from 125.213.192.0/19
    deny from 109.235.205.120/29
    allow from all
    </Limit>



    Also this lines inside /etc/deny.hosts and /etc/apf/deny_hosts.rules

    210.5.193.40/29
    203.215.32.0/20
    203.208.205.192/26
    203.88.92.0/24
    203.88.68.224/27
    203.88.68.216/29
    203.88.68.192/29
    203.88.68.188/31
    203.88.68.184/30
    203.88.68.176/29
    203.88.68.160/28
    203.88.68.144/28
    203.88.68.128/29
    203.88.68.64/26
    203.88.68.56/29
    203.88.68.32/28
    203.88.68.16/28
    203.88.68.8/29
    204.231.159.0/27
    205.234.153.80/29
    206.217.128.112/29
    210.5.193.24/29
    208.251.201.56/29
    208.251.176.232/29
    208.115.117.144/29
    208.35.53.176/28
    206.226.106.32/29
    206.226.105.24/29
    206.226.94.56/29
    206.226.88.32/29
    206.226.87.216/29
    206.226.82.224/29
    206.226.81.168/29
    206.226.79.16/29
    206.226.76.144/29
    206.226.67.144/29
    206.217.134.48/29
    206.217.132.104/29
    202.174.157.232/29
    202.174.157.192/27
    202.174.157.128/26
    202.174.133.32/28
    202.174.133.8/29
    202.133.13.56/29
    202.133.13.40/29
    202.133.13.16/28
    202.133.13.8/29
    202.133.9.248/29
    202.86.16.0/20
    202.56.176.0/20
    199.16.201.64/29
    193.220.157.0/27
    193.219.255.112/29
    193.219.243.192/26
    193.219.243.176/28
    193.219.243.168/29
    193.219.243.152/29
    193.219.243.128/29
    202.174.133.144/29
    202.174.134.0/29
    202.174.144.0/29
    202.174.156.248/29
    202.174.156.224/29
    202.174.156.208/29
    202.174.156.192/28
    202.174.155.240/29
    202.174.155.216/29
    202.174.155.144/29
    202.174.155.128/29
    202.174.155.32/29
    202.174.154.24/29
    202.174.153.184/29
    202.174.148.128/29
    202.174.148.48/29
    202.174.148.32/29
    202.174.147.0/24
    202.174.145.128/29
    202.174.144.216/29
    193.219.243.112/28
    210.5.194.32/28
    217.195.145.128/25
    212.21.35.48/30
    212.21.35.20/30
    210.89.93.224/27
    210.89.93.208/29
    210.89.93.16/28
    210.89.87.0/24
    210.89.78.248/29
    210.89.78.208/28
    210.89.78.160/28
    210.89.78.144/28
    210.89.78.96/27
    210.89.78.72/29
    210.89.78.48/29
    210.89.78.32/28
    210.89.78.0/28
    210.89.74.240/29
    210.89.74.224/28
    212.21.40.88/29
    212.21.40.112/28
    212.21.40.128/27
    217.195.145.96/27
    217.195.145.80/28
    217.195.145.56/29
    217.195.145.32/28
    217.195.145.0/27
    217.195.144.32/30
    217.195.144.24/29
    217.10.167.0/24
    213.255.195.0/27
    212.116.232.208/28
    212.21.59.0/24
    212.21.52.128/27
    212.21.52.64/26
    212.21.52.32/27
    212.21.52.0/28
    212.21.44.80/28
    212.21.40.160/29
    210.89.74.192/27
    210.89.74.128/26
    210.89.74.0/25
    210.5.235.200/29
    210.5.235.144/28
    210.5.235.112/29
    210.5.235.96/29
    210.5.235.88/29
    210.5.235.64/29
    210.5.235.56/29
    210.5.235.32/29
    210.5.235.24/29
    210.5.226.0/24
    210.5.215.176/29
    210.5.215.152/29
    210.5.215.104/29
    210.5.215.80/29
    210.5.214.128/29
    210.5.214.88/29
    210.5.214.56/29
    210.5.235.240/29
    210.5.236.48/29
    210.89.67.184/29
    210.89.73.240/28
    210.89.71.240/28
    210.89.71.238/32
    210.89.71.236/31
    210.89.71.232/30
    210.89.71.224/29
    210.89.71.192/27
    210.89.71.176/28
    210.89.71.168/29
    210.89.71.128/27
    210.89.71.0/25
    210.89.69.160/28
    210.89.69.144/29
    210.89.69.128/29
    210.89.69.112/28
    210.89.69.32/27
    210.89.67.192/26
    210.5.214.24/29
    109.235.205.72/29
    103.5.172.0/22
    96.8.113.216/29
    91.109.216.0/21
    87.249.84.0/24
    87.249.65.0/24
    84.11.33.0/24
    82.205.204.0/22
    82.205.202.0/23
    82.205.192.0/24
    81.31.199.32/30
    80.247.139.0/24
    78.41.227.168/29
    72.9.146.168/29
    69.88.10.160/28
    69.88.2.244/30
    69.61.127.128/27
    69.61.125.64/27
    103.5.196.0/23
    103.7.104.0/22
    103.12.96.0/22
    109.235.205.64/30
    109.235.205.48/28
    109.235.205.40/30
    109.235.205.36/30
    109.235.205.24/29
    109.235.205.16/30
    109.235.205.8/30
    109.235.205.0/29
    109.235.203.0/28
    103.247.198.0/24
    103.30.136.0/22
    103.28.132.0/22
    103.23.247.0/24
    103.23.36.0/22
    103.15.238.0/23
    103.14.24.0/24
    103.13.64.0/22
    69.61.103.0/27
    69.61.102.224/27
    69.61.84.32/27
    64.86.63.64/27
    64.71.230.128/28
    63.250.182.192/29
    63.250.179.160/27
    63.99.56.40/29
    63.87.97.88/29
    63.76.180.160/29
    61.5.192.0/20
    58.147.128.0/19
    46.136.147.0/24
    46.136.7.0/24
    37.223.0.0/24
    37.222.9.0/24
    31.201.1.192/30
    27.116.56.0/22
    5.225.9.0/24
    5.224.9.0/24
    65.197.180.160/29
    65.199.111.24/29
    65.213.122.40/29
    69.61.66.32/27
    69.61.59.128/27
    69.61.43.0/27
    69.61.40.128/26
    69.61.33.64/29
    69.61.25.80/29
    69.61.16.216/29
    69.43.228.224/27
    66.181.39.96/29
    65.242.147.16/29
    65.241.40.200/29
    65.241.40.176/29
    65.223.246.232/29
    65.223.240.16/29
    65.219.15.80/29
    65.219.15.72/29
    65.216.143.16/28
    5.132.9.0/24
    109.235.205.112/30
    193.219.243.96/29
    175.176.243.192/27
    175.176.243.128/26
    175.176.243.0/25
    175.176.242.0/24
    175.176.241.192/26
    175.176.241.176/28
    175.176.241.168/29
    175.176.240.224/29
    175.176.240.192/27
    175.176.240.128/26
    175.176.240.0/25
    175.176.239.192/26
    175.176.239.176/28
    175.176.239.168/29
    175.176.238.240/28
    175.176.238.238/32
    175.176.238.236/31
    175.176.243.224/28
    175.176.243.240/29
    175.176.244.80/28
    193.219.243.64/27
    193.219.243.48/28
    193.219.243.16/28
    193.219.243.8/29
    193.219.208.192/28
    182.50.176.0/20
    180.222.136.0/21
    180.94.64.0/19
    175.176.245.0/24
    175.176.244.224/27
    175.176.244.192/28
    175.176.244.160/28
    175.176.244.144/28
    175.176.244.140/31
    175.176.244.136/30
    175.176.244.128/29
    175.176.244.96/27
    175.176.238.232/30
    175.176.238.224/29
    175.176.238.192/27
    122.201.38.224/27
    122.201.38.32/28
    122.201.36.96/28
    122.201.36.88/29
    121.127.32.0/19
    121.100.48.0/21
    119.59.80.0/21
    117.104.224.0/21
    117.55.192.0/20
    113.208.72.0/23
    111.223.244.0/22
    111.125.152.0/21
    109.235.206.32/27
    109.235.206.24/29
    109.235.206.0/28
    109.235.205.152/30
    109.235.205.136/30
    122.201.39.128/28
    122.201.44.48/28
    124.199.112.0/20
    175.176.238.176/28
    175.176.238.168/29
    175.176.238.128/27
    175.176.238.0/25
    175.176.236.0/24
    175.176.230.112/28
    175.176.228.176/28
    175.176.226.64/28
    175.176.225.240/28
    175.176.225.192/28
    175.106.32.0/19
    173.253.122.48/29
    173.253.122.32/29
    173.253.117.136/29
    172.10.2.128/29
    172.10.2.0/25
    125.213.192.0/19
    109.235.205.120/29


    But it didn't work cause i'm out side saudiarabia and still can access the website.
    Please check and confirm
    http://www.tdwlksa.net/vb/

  7. #7
    Join Date
    Jul 2012
    Location
    localhost
    Posts
    156
    Yes, I can access on that website.


    Try to do this:

    Quote Originally Posted by DWH-Dan View Post
    if you have CSF firewall you can set the cc_allow to the saudi arabia country code and it will only allow that country. This may impact performance though so make sure you monitor upon making this change.

  8. #8
    Join Date
    Dec 2012
    Location
    Canada
    Posts
    68
    Yes CSF is a better option.

  9. #9
    i tried to do that, but i didn't find saudi arabia code at the provided url
    so is there any other way to get this code?

  10. #10
    Join Date
    Dec 2012
    Location
    Canada
    Posts
    68
    SA is Saudi arabias code for CSF.

  11. #11
    Join Date
    Jun 2004
    Location
    Omaha, Nebraska
    Posts
    211
    As others mentioned, if you have CSF, it's a better option, but keep in mind that the more lines you have, the more processing that has to be done before a page gets displayed. For that reason, instead of entering a bunch of IPs for DENY, it's better to go with the mod_geoip and use the country option (if using .htaccess), or just entering "US" as the country code (or other 2 letter ISO country code) if using the CSF option.

    You can view a list of two letter country codes here - http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2

    Keep in mind that this will only keep SOME of the traffic out of your machine. Anyone could load up a proxy server and still get access, so it's kind of like locking the doors on the house. It'll keep the honest people out, but if they really want to get in, they just use another entrance.
    Conor Treacy
    Hands-on Web Hosting
    E-Commerce cPanel Web Hosting | PCI Compliance Hosting

Similar Threads

  1. ssh authenication not allowing remote login
    By WEBCRAFT-TUCKY in forum Hosting Security and Technology
    Replies: 10
    Last Post: 06-05-2011, 06:25 AM
  2. HOW-TO: Allowing your Reseller's clients to login to Plesk.
    By sgarbus in forum Hosting Software and Control Panels
    Replies: 1
    Last Post: 10-10-2005, 09:33 PM
  3. Allowing client to login to any control panel
    By n_rajul in forum Programming Discussion
    Replies: 2
    Last Post: 07-11-2005, 07:40 AM
  4. re-allowing direct root login?
    By milkmycow in forum Hosting Security and Technology
    Replies: 15
    Last Post: 08-02-2004, 12:51 AM
  5. Hosting which allowing login to RHN?
    By afch in forum Dedicated Server
    Replies: 0
    Last Post: 03-14-2004, 05:11 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •