1
PeeCee
Stop Comment-Spam and Email-Harvesting
  • 2008/6/10 6:32

  • PeeCee

  • Just popping in

  • Posts: 5

  • Since: 2008/6/9 1


I finally got tired of removing comment spam.
I registered for a free Account onhttp://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 to change your 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.

2
frankblack
Re: Stop Comment-Spam and Email-Harvesting
  • 2008/6/10 7:30

  • frankblack

  • Just can't stay away

  • Posts: 830

  • Since: 2005/6/13


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

3
Anonymous
Re: Stop Comment-Spam and Email-Harvesting
  • 2008/6/10 8:26

  • Anonymous

  • Posts: 0

  • Since:


"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

4
jooel
Re: Stop Comment-Spam and Email-Harvesting
  • 2008/6/10 17:39

  • jooel

  • Just popping in

  • Posts: 13

  • Since: 2006/12/10


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 =)

5
PeeCee
Re: Stop Comment-Spam and Email-Harvesting
  • 2008/6/11 6:03

  • PeeCee

  • Just popping in

  • Posts: 5

  • Since: 2008/6/9 1


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

6
PeeCee
Re: Stop Comment-Spam and Email-Harvesting
  • 2008/6/11 9:53

  • PeeCee

  • Just popping in

  • Posts: 5

  • Since: 2008/6/9 1


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.

7
Dona_Brasil
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 to change your 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???

8
Dona_Brasil
Re: Stop Comment-Spam and Email-Harvesting

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

9
jooel
Re: Stop Comment-Spam and Email-Harvesting
  • 2008/6/12 8:25

  • jooel

  • Just popping in

  • Posts: 13

  • Since: 2006/12/10


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

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

10
PeeCee
Re: Stop Comment-Spam and Email-Harvesting
  • 2008/6/23 15:44

  • PeeCee

  • Just popping in

  • Posts: 5

  • Since: 2008/6/9 1


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 to change your 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.

Login

Who's Online

196 user(s) are online (103 user(s) are browsing Support Forums)


Members: 0


Guests: 196


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Mar 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits