Forum Moderators: coopster

Message Too Old, No Replies

PHP Script

baning referal spam

         

4css

1:08 pm on Nov 23, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I have a script that I found online that is supposed to ban somehow referal spam etc...

I'm not a php person, and was wondering if I could pm it to someone to view it to make sure it is a legitmate scrpt for uploading to my server.

The owner of the script does have a forum, and he maintains the database of bad referals for this script. You can also somehow enter in your own that you find that still come through.

I have been trying to ban these people through IP's etc.. but am fearful of baning legitmate people. If I search for the url's of the people hiting me, I usually don't get any results of the ones that are in my stats.

My stats are not viewable by the public, so am not sure how this is happening. I have banned 2 members that just happened to appear around the time this all started.

Any help would be greatly appreciated. This is a battle that is wearing me out about now.

vincevincevince

3:40 pm on Nov 23, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You could always check that a link to your page exists on the referring page.


<?php
$fh=fopen($_SERVER[HTTP_REFERER],"r");
while ((!strpos(strtolower($page),strtolower($_SERVER[HTTP_HOST])))&&($page.=fread($fh,1024)));
fclose($fh);
if (strpos(strtolower($page),strtolower($_SERVER[HTTP_HOST])))
{
header("HTTP/1.1: 404 Not Found");
header("Status: 404 Not Found");
die();
}
?>

Or something remotely like that (untested)

4css

5:01 pm on Nov 23, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



But, this is in my stats, these aren't people who are within my forum? These are referral links that are appearing in my stats ex: porn, texasholdem etc....

I have a medical forum. None of these referals are at all relative to what I have in my forum.

btw, thanks for your reply. This is all confusing to me, no matter how much time I spend reading up on this stuff.

Anyango

7:18 pm on Nov 23, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hello There!

Although this might not help "Fully" but this will help "Considerably" and might not appear as logical but in my experience it definitely is.

Most of the spammers of such kind who post these referral links like of porn , casino or drugs etc , do this on a massive scale, they are not like

"mmm i think leme post my link on 10 random forums"

no, they don't have this mentallity, they want hundreds and thousands of links. Now, fortunately this is not humanly possible to go on thousands of forums daily and post your links, and hence it is more then 95% of the time done using bots. Again, fortunately, bots can be prevented easily from posting on your sites by using some sort of captcha, as you know bots can't read artistic text printed in artistic image, you can use that on your "Post Message" form, anyone who provides wrong value for that, is simply rejected.

Although you might feel that this doesn't make sense, but give it a try atleast and you ll yourself come to know that it was a very good solution. And rest of
5% those do it by hand, hand posts are so less that you can check your board weekly or daily and delete those one or two new hand posts.

And ofcourse there are many other ways for protection too but to start of with, i chose this.

Regards,
Kami

vincevincevince

7:21 pm on Nov 23, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Something just occured to me - they must be finding your forum somehow.

Try changing all the fixed text to other wording to the same effect.

If it says "You may post in this topic" change it to "Posting in topic: Allowed"

That may stop you being picked up.

4css

8:53 pm on Nov 23, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



ok, I dont think you understand my problem.

I know somehow these bots are getting into my referrals, but its not through my forum.

I have the graphic registration, and I have to approve registration. If I get an iffy screen name that I search and think hmm, don't like what I find, I don't permit that person to join.

The people who join my fourm are doing so for medical information about fibromyalgia and residual illnesses.

I noticed that my normal bandwidth is about 2-300mb a month. Now its up to between 1-5gb a month?

And its not from people posting either.

I suggest a search on referal, referral spam, spelled both ways to get an idea of what it is that I am dealing with.

I have a very small membership, and not that many posts. I"m not even up to 3,000 posts on my forum.

Anyango

4:36 pm on Nov 24, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Well, Ok. i am sorry to have wasted your time then.

jd01

8:18 pm on Nov 24, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The problem is:
If the referrer is set, Apache logs it... Does not matter if the request is real or automated. So, people write a script that sets a referrer and opens your page --- not really much you can do about it that does not hurt your site in some way, because the referrer is in the original request line and logged before your server responds with whatever error you decide to serve.

Justin