News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

How can add link of blackhole bad robot ban

Started by ahmadtrco, November 22, 2013, 01:54:41 PM

Previous topic - Next topic

ahmadtrco

As per this link blackhole which ban all bad bots:-
http://perishablepress.com/blackhole-bad-bots/

I want to add following:-
<? include ($_SERVER['DOCUMENT_ROOT'] . '/blackhole/blackhole.php');  ?>

<a style="display:none;" href="http://doamin.com/blackhole/" rel="nofollow">Do NOT follow this link or you will be banned from the site!</a>


I tried but both don't work as per forum scripts issue but work in all other web pages than forum

Please suggest in which forum script page I add to get results?

Kindred

1- it's a pretty stupid idea actually...   if they are "bad bots" and they ignore the "no follow", then they are going to ignore the robots.txt
2- even google occasionally ignored a no-follow...   so you want to prevent google?

3- if you still inisist that you need it (even though it's a bad idea and basically useless), then you would have to include the link somewher ein index.template.php for every theme that you use.

I can't tell you where to include blackhole.php without looking deeper into what the file actually is and does....   probably needs to drop into index.php or index.template.php with corrections to that $_SERVER['DOCUMENT_ROOT'] to be the actual path
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Arantor

Quote1- it's a pretty stupid idea actually...   if they are "bad bots" and they ignore the "no follow", then they are going to ignore the robots.txt

That's the point. Good robots adhere to robots.txt and won't follow the link. Bad robots will follow the link anyway and then proceed to get blacklisted. Google adheres to robots.txt.

Quote3- if you still inisist that you need it (even though it's a bad idea and basically useless), then you would have to include the link somewher ein index.template.php for every theme that you use.

It's not entirely a bad idea. It's how Project Honeypot works, to a point.


However without even looking at the code, merely the website around it, I would strongly contest the methodology they are using to store and track this. I can think of eventualities where this will get messed up and cause greater problems (race condition on a flatfile storage)

Kindred

yes, but from what I saw described on that site, all this does is create a robots.txt....

if the bot doesn't "listen" to the no-follow command in the first place, what are the chances that it will "listen" to a robots.txt?
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Arantor

No, that's not what it does. You put it into the blackhole folder, block the blackhole folder with robots.txt. Anything that hits the blackhole folder in spite of a robots.txt is therefore deemed to be inappropriate.

Kindred

ah... I misunderstood then....

What's done in the blackhole folder? does that write to your server side block/ban?
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Arantor

No, that just maintains a lot itself of - presumably - IP addresses, thus you have to include the main blackhole file every page load.

Kindred

oh. ick.

that's gonna eventually kill performance too, won't it?
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Arantor

Well, to a point, certainly it's I/O bound and will run in linear time as the list gets bigger. This can be mitigated by way of using systems far better designed to cope (like databases with caching), and that will also fix the side issue that the blackhole can actually miss items under some circumstances.

ahmadtrco

I tried and added
<? include ($_SERVER['DOCUMENT_ROOT'] . '/blackhole/blackhole.php');  ?>
in:-
/forum/index.php
/forum/Themes/default/index.php
/forum/Themes/default/index.template.php
 
but it don't work
Please suggest where i add it to get result?
When i add in other web pages it work but don't work in forum
How can add third party script in Forum?

This script is best and reduce server and web load

Arantor

Best? Please don't make me laugh. Let's pull it apart and see just how many things are wrong with it, because there's quite a few.

1. Storing the IP addresses in a flat file. This is prone to corruption, prone to locking issues, and totally I/O bound as opposed to being memory or CPU bound (which are far less contentious on all hosts, doubly so if you're using proper caching techniques)

2. Makes use of eregi, which was deprecated (obsolete) in PHP 5.3.0 (PHP 5.3 is entering end of life soon, 5.5 is the current version, though 5.4 is still maintained), likely will cause many errors on your hosting account.

3. Bare gethostbyname without any local-side caching so EVERY page load is going to be hit with a rDNS query. SMF at least allows you to turn this off and tries to cache it for you. If there are any issues with the rDNS, you're going to get errors with no way to block them.

4. No IPv6 support.

5. Tries to do its own WHOIS, inefficiently, and potentially causing you lots of errors in the process.

6. The recorded log contains the IP address, HTTP method, protocol version, date/time and the user agent. This means it's going to fill up pretty quick and then proceed to slow down every page on your website by having to chew through that every page.

7. Every single time you get a first-time hit from an IP address, which will be many, you are going to get an email. Assuming your host actually has PHP email configured properly, otherwise you'll just get lots of errors because it doesn't have SMTP support. And looking at the way it sends that email, there's a reasonable chance your email provider will flag it as spam anyway.

8. Any script that's going to do its job properly to keep bots away would be issuing the appropriate headers. This script does not. I will not elaborate, would rather not give the game away to would-be bot authors.


I'm sorry but there's no way I'm going to encourage or help you integrate that buggy mess into your site. There's a better than average chance it just wouldn't work properly even if I did.

ahmadtrco

Question is not this script is good or bad question is how can add it in forum?

Arantor

Which part of "I won't help you do this because it will give you lots of problems" was unclear?

ahmadtrco

in which forum file I add

<? include ($_SERVER['DOCUMENT_ROOT'] . '/blackhole/blackhole.php');  ?>

for its proper working
I want to add it as top script

Arantor

Even if I tell you it still won't work properly.

Kindred

the short if it is - you can't just add that code as is to ANY of the SMF files...
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

ahmadtrco

So did SMF provide bad robot ban option and security or SMF is fail in it ?

As many fake post and account registration attempt to add their web links in posts and in their forum profiles as well as bad bots traffic to slow down the web and server and make server over load

Kindred

Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

ahmadtrco

Given options does not cover bad robots as bad robots don't need registration or don't make post it only do  browsing the forum pages again and again and make server and web overload

So SMF look fail to stop it

Arantor

So will that mod, incidentally. It will give you many errors and NOT MAKE THE BOTS GO AWAY.

Try using the Bad Behaviour mod.

Advertisement: