generalexperts Posted January 29, 2014 Share Posted January 29, 2014 Under stats in Prestashop I can look at where these visitors are being referred from. Some Google, t.co, etc. Frequently I have a lot of .ru sites. These sites seem to be fake. I have gone to the site and emailed them, asking them to stop, and then it clears up and I stop getting visits for a few days. The .ru visitors keep coming back. I know there is a module to block 10 free IP addresses, but I need it to block Russian sites. Can anyone help? Thank you! Link to comment Share on other sites More sharing options...
eleazar Posted January 29, 2014 Share Posted January 29, 2014 You may try first by adding some lines to your robots.txt, like e.g.: #Annoying Bots User-agent: MJ12bot Disallow: / User-agent: majestic12 Disallow: / User-agent: Yandex Disallow: / User-agent: Baidu Disallow: / User-agent: Naver Disallow: / User-agent: Goo Disallow: / User-agent: SoGou Disallow: / User-agent: Youdao Disallow: / Or suspicious sites: # Suspicious sites Deny from 178.151.143.247 Deny from 37.140.165.207 Deny from 87.178.34.253 Deny from 94.222.146.143 If this doesn't help, modify your .htaccess file in your root directory like in this following example for blocking Yandex, Baidu and Sogou spiders. Just include the following code in your .htaccess file: RewriteEngine on Options +FollowSymlinks RewriteBase / RewriteCond %{HTTP_USER_AGENT} ^Baiduspider [NC,OR" RewriteCond %{HTTP_USER_AGENT} ^Sogou RewriteCond %{HTTP_USER_AGENT} ^Yandex RewriteRule ^.*$ - [F" Explanation: The various User Agents to be blocked from access are listed one per line. The Rewrite conditions are connected via "OR". "NC" means "no case" - case-insensitive execution. The caret "^" character stipulates that the User Agent must start with the listed string (e.g. "Yandex"). "[F”" serves the spider a "Forbidden" instruction. Thus, if you want to block Yandex spiders, for instance, you can use the following code: RewriteCond %{HTTP_USER_AGENT} Yandex In this particular case the block will be effected whenever the string "Yandex" occurs in the User Agent identifier. IMPORTANT: You should place every modification above the generating text to privent that this will be overidden when refreshing your .htacess file. Link to comment Share on other sites More sharing options...
selectshop.at Posted January 29, 2014 Share Posted January 29, 2014 (edited) I don't recommend to do this by .htaccess. Simply use a tool like honeypot for to block all suspicious and malicious accesses to your server, or activate the Prestashop module Gelocation targeting (on your back-office, tab preferences -> geolocation). With this module you will be able to block users by countries from visiting your site and not only the russian bots as mentioned by @eleazar. By adding lines to your .htaccess you will have: a) too much work for to manage it, because you have to read stats constantly and add new lines or ranges b ) you speed down your site, cause each line must be processed before your site loads. To manage it by php (like the module geolocation and honeypot is doing), this is a cleaner and faster way for to block on long-term and without any extra work suspicious and malicious accesses to your site. Edited January 29, 2014 by selectshop.at (see edit history) Link to comment Share on other sites More sharing options...
generalexperts Posted January 29, 2014 Author Share Posted January 29, 2014 Thank you for the replies! I tried HoneyPot and couldn't get it to install, but I did do the geolocation in Prestashop and it seemed to work. Now I will just have to monitor it to make sure it works. Reading about HoneyPot and what it does seems like it would still benefit me. How come there isn't a Prestashop module for that?!? Link to comment Share on other sites More sharing options...
selectshop.at Posted January 29, 2014 Share Posted January 29, 2014 Because you need to have a community working on that constantly. Geolocation blocks all countries you add to blocklist. Users/bots will visit you page and receive a 400 page : "Sorry but you are not allow to visit this page" if you configured it correctly. Disable the view of your site completely, not only the buying possibility. On server stats you than will see several links like this: yourdomain/themes/yourtheme/css/restricted-country.css. If you have these links you can be sure that module is working well. Once a month mindmax database is updated, please don't forget to update it as well. An automatic update is not implemented in this feature (unfortunately). Link to comment Share on other sites More sharing options...
benjamin utterback Posted January 29, 2014 Share Posted January 29, 2014 Thank you for the replies! I tried HoneyPot and couldn't get it to install, but I did do the geolocation in Prestashop and it seemed to work. Now I will just have to monitor it to make sure it works. Reading about HoneyPot and what it does seems like it would still benefit me. How come there isn't a Prestashop module for that?!? Just use the Geolocation feature, if it is doing what you want it to. It will block all users from that country from visiting your website. You can also have a white list of good IP's if you do find a Russian customer at some point in time but still want to block the rest. Link to comment Share on other sites More sharing options...
eleazar Posted January 29, 2014 Share Posted January 29, 2014 I don't recommend to do this by .htaccess. By adding lines to your .htaccess you will have: a) too much work for to manage it, because you have to read stats constantly and add new lines or ranges b ) you speed down your site, cause each line must be processed before your site loads. To manage it by php (like the module geolocation and honeypot is doing), this is a cleaner and faster way for to block on long-term and without any extra work suspicious and malicious accesses to your site. Which means you suspect Prestashop for slowing down the whole shop system because of its large .htacess, selectstop? I guess you should communicate your insights to the developers. I'm afraid they didn't know yet. And btw: Geolocation is no safe instrument to block bots' activities! Link to comment Share on other sites More sharing options...
generalexperts Posted January 30, 2014 Author Share Posted January 30, 2014 I appreciate everyone's comments. Thank you! I agree this Geolocation feature most likely won't cut it in the long run. Now I'm blocking everyone in certain countries (seems a little ridiculous way to solve the problem). I would really like to see someone on prestashop come up with something... as it seems pretty critical. Link to comment Share on other sites More sharing options...
generalexperts Posted February 8, 2014 Author Share Posted February 8, 2014 I tried the geolocation and blocked Russia all together. A week later, I am still seeing .ru sites and sites like onlinefilmz.net. I tried to set up honeypot but couldn't figure out how to set it up. Does anyone know the steps I need to do to configure it correctly? Thank you! Link to comment Share on other sites More sharing options...
prestaquest Posted March 3, 2014 Share Posted March 3, 2014 I'm having the same problem guys! the only way to get these .RU sites abandoned from my stats is by turning on Geo Location and blocking the Russian Federation + everybody from undefined countries. The latter also blocks everybody who uses a VPN, which is an undesired side-effect. Don't these Russians have anything better to do..? Prestashop 1.4.8.2 I tried the geolocation and blocked Russia all together. A week later, I am still seeing .ru sites and sites like onlinefilmz.net. I tried to set up honeypot but couldn't figure out how to set it up. Does anyone know the steps I need to do to configure it correctly? Thank you! Link to comment Share on other sites More sharing options...
selectshop.at Posted March 3, 2014 Share Posted March 3, 2014 I tried the geolocation and blocked Russia all together. A week later, I am still seeing .ru sites and sites like onlinefilmz.net. I tried to set up honeypot but couldn't figure out how to set it up. Does anyone know the steps I need to do to configure it correctly? Thank you! If you are seing them on your stats, you should also track the whole connection. By using Geolocations tool the user will be redirected to: /themes/default/css/restricted-country.css. So you can be sure that it is blocked with Geolocation tool. A second possibility to stop .ru without stuffing your .htaccess and slowing down your server is to block the whole country with only one line in your shop .htaccess. Simply add on the top of your .htaccess, before Prestashop block: #deny all russian IP's Order allow,deny deny from .ru Allow from all This will invoke that all IP's with veverse DNS .ru are blocked from accessing your site. Nevertheless on your server logs you will continue to see the requests/visits, but with a forbidden http-header. Not all servers allow to block by country, sou you should try by yourself or ask your provider. Link to comment Share on other sites More sharing options...
foxygardner Posted March 20, 2015 Share Posted March 20, 2015 I blocked all countries except the United States using geolocation. It worked for about 12 hours then I started getting "ghost spammed" again. Mostly from Russia but also India and other countries. Right now, the ghost spamming outnumbers my actual visits. Since they have 100% bounce rate, I'm really concerned about how this is affecting my SEO. Has anyone found a solution? Link to comment Share on other sites More sharing options...
sharingsunshine Posted July 10, 2015 Share Posted July 10, 2015 We use ipset and ipdeny.com country blocks to block countries we don't distribute into. Also, we are able to stop runaway robots burning up our bandwidth using fail2ban. You can google both terms and find a great deal of information on them. Link to comment Share on other sites More sharing options...
Recommended Posts