xoops forums

PeeCee

Just popping in
Posted on: 2008/6/10 6:32
PeeCee
PeeCee (Show more)
Just popping in
Posts: 5
Since: 2008/6/9 1
#1

Stop Comment-Spam and Email-Harvesting

I finally got tired of removing comment spam.
I registered for a free Account on http://www.projecthoneypot.org.

Then I downloaded this class:
http://projecthoneypot.org/board/read.php?f=10&i=179&t=179

and added this code to mainfile.php
include 'httpbl.php';
 
$h=new http_bl('*********'); // No, i will not post my Key here.
        
$ip=$_SERVER['REMOTE_ADDR']; 
        
$r=$h->query($ip);

        if(
$r>=2){
                echo (
"This IP is reported as a known Spammer. Please refer to http://www.projecthoneypot.org t ... ur status.<br>");
                die ( 
"Found a " $h->type_txt ." (".$h->type_num .") with a score of "$h->score ", last seen since "$h->days " days");
        }
}


I got no more spam from that day.

frankblack

Just can't stay away
Posted on: 2008/6/10 7:30
frankblack
frankblack (Show more)
Just can't stay away
Posts: 830
Since: 2005/6/13
#2

Re: Stop Comment-Spam and Email-Harvesting

Could be useful here against spammers like happy2008 and shopyland. Nice would if this or similar would be part of the core.

Anonymous

Posted on: 2008/6/10 8:26
Anonymous
Anonymous (Show more)
Posts: 0
Since:
#3

Re: Stop Comment-Spam and Email-Harvesting

"happy2008" is being dealt with, as will anyone else who starts spamming about shoes or anything else.

I might miss some spam comments; users are welcome to PM me with the uid and this will be dealt with.

Thanks for the honeypot link - very interesting indeed

jooel

Just popping in
Posted on: 2008/6/10 17:39
jooel
jooel (Show more)
Just popping in
Posts: 13
Since: 2006/12/10
#4

Re: Stop Comment-Spam and Email-Harvesting

Interesting!

1. I guess the code goes at top of mainfile.php?

2. Is ******** the same as the honey pot login password?

I hope i was correct in removing the last bracket. I get no errors but i also don't know how to verify that it's really working. I guess it will show in my shoutbox soon enough =)

PeeCee

Just popping in
Posted on: 2008/6/11 6:03
PeeCee
PeeCee (Show more)
Just popping in
Posts: 5
Since: 2008/6/9 1
#5

Re: Stop Comment-Spam and Email-Harvesting

No, its not the password, its the api-key you get on this page after you register.

PeeCee

Just popping in
Posted on: 2008/6/11 9:53
PeeCee
PeeCee (Show more)
Just popping in
Posts: 5
Since: 2008/6/9 1
#6

Re: Stop Comment-Spam and Email-Harvesting

I yust found out the hard way, that it is absolutely neccessary to include the "thread-level"/score in the if-statement. found IPs are never deleted, only their thread level is lowered to zero eventually. So you must check $h->score.

Dona_Brasil

Not too shy to talk
Posted on: 2008/6/11 12:23
Dona_Brasil
Dona_Brasil (Show more)
Not too shy to talk
Posts: 153
Since: 2005/10/28
#7

Re: Stop Comment-Spam and Email-Harvesting

Quote:
I yust found out the hard way, that it is absolutely neccessary to include the "thread-level"/score in the if-statement. found IPs are never deleted, only their thread level is lowered to zero eventually. So you must check $h->score.


This may be the best tip on XOOPS.org of 2008, but please tell how you did it.

What did you change in the if-statement:

if($r>=2){
                echo (
"This IP is reported as a known Spammer. Please refer to http://www.projecthoneypot.org t ... ur status.<br>");
                die ( 
"Found a " $h->type_txt ." (".$h->type_num .") with a score of "$h->score ", last seen since "$h->days " days");
        }


??

Doesn't if($r>=2) already set the correct score???

Dona_Brasil

Not too shy to talk
Posted on: 2008/6/12 7:13
Dona_Brasil
Dona_Brasil (Show more)
Not too shy to talk
Posts: 153
Since: 2005/10/28
#8

Re: Stop Comment-Spam and Email-Harvesting

By the way, there is a "}" to much in the code.

jooel

Just popping in
Posted on: 2008/6/12 8:25
jooel
jooel (Show more)
Just popping in
Posts: 13
Since: 2006/12/10
#9

Re: Stop Comment-Spam and Email-Harvesting

It seems i haven't gotten this to work for me. (I removed the last "}")

PeeCee, was something missing? I didn't quite understand.

PeeCee

Just popping in
Posted on: 2008/6/23 15:44
PeeCee
PeeCee (Show more)
Just popping in
Posts: 5
Since: 2008/6/9 1
#10

Re: Stop Comment-Spam and Email-Harvesting

right now i use this:
include 'httpbl.php';
$h=new http_bl('abcdefghi');              // put your access key here
$ip=$_SERVER['REMOTE_ADDR'];       // replace with the ip to query
$r=$h->query($ip);
if(
$r>=2){
   if (
$h->score>20){
                echo (
"This IP is reported as a known Spammer. Please refer to http://www.projecthoneypot.org t ... ur status.<br>");
                die ( 
"Found a " $h->type_txt ." (".$h->type_num .") with a score of "$h->score ", last seen since "$h->days " days");
        }
}


You must register to projecthoneypot.org for a valid api-key. Replace abcdefghi with that key.

I came up with the idea, since drupal, phpbb, Wordpress and even MediaWiki already have modules.