Lampwrights Forum > Lounge, A Secure Web, Managing Communities, Pertaining to Spam > Pertaining to SPAM

Reply
 
Thread Tools
07-30-2010, 12:27 PM   #1
Jeff
Administrator
 
Jeff's Avatar
 
Join Date: Jul 2010
Posts: 402
Rep Power: 10
Jeff is getting browny points
Checking IP's against spammer database

There is a good free RBL that checks users against a database of known forum spammers. You can check a users IP against it before allowing them to do anything on your site. Here is some example PHP code:

Code:
function blacklisted($ip) 
{
    $dnsbl_check=array("dnsbl.tornevall.org");

    if($ip){
        $rip=implode('.',array_reverse(explode(".",$ip)));
        foreach($dnsbl_check as $val){
            if(checkdnsrr($rip.'.'.$val.'.','A'))
                return $rip.'.'.$val;
        }
    }

    return false;
}
Basically just pass the IP to this function and if it comes back as true, then the IP is listed.

Enjoy!
Jeff is offline   Reply With Quote

01-21-2011, 12:07 PM   #2
thisbuzz
Junior Member
 
Join Date: Jan 2011
Posts: 6
Rep Power: 0
thisbuzz is getting browny points
Hi Jeff .. where should we place this code, please?

In which file

Thanks

G
thisbuzz is offline   Reply With Quote
01-21-2011, 12:24 PM   #3
Jeff
Administrator
 
Jeff's Avatar
 
Join Date: Jul 2010
Posts: 402
Rep Power: 10
Jeff is getting browny points
Quote:
Originally Posted by thisbuzz View Post
Hi Jeff .. where should we place this code, please?

In which file

Thanks

G
It depends on your code.
Jeff is offline   Reply With Quote
01-21-2011, 12:36 PM   #4
thisbuzz
Junior Member
 
Join Date: Jan 2011
Posts: 6
Rep Power: 0
thisbuzz is getting browny points
OK maybe I am not understanding how this works

the above code which starts with

function blacklisted

I thought that the code would check with the SPAM IP site?

so I was wondering where the code would be placed

my apologies in advance if I have the wrong end of the stick

Thanks

G
thisbuzz is offline   Reply With Quote
01-21-2011, 12:40 PM   #5
Jeff
Administrator
 
Jeff's Avatar
 
Join Date: Jul 2010
Posts: 402
Rep Power: 10
Jeff is getting browny points
If you have some PHP code, and you want to check to see if an IP address is of a known spammer, put the function in the first post of this thread into your PHP script. WHERE exactly I cannot tell you as that is different in every script.

Then you just pass the IP to the function and it will tell you true or false:

Code:
if (blacklisted('123.123.111.123'))
{
## This IP is blacklisted!
}
If you think you can just plug this into any script without any programming knowledge, then I would say no. You have to have some understanding how the code is working. This is a generic function, not a specific one for a particular program.
Jeff is offline   Reply With Quote
01-21-2011, 12:57 PM   #6
kpmedia
Junior Member
 
Join Date: Jan 2011
Posts: 23
Rep Power: 0
kpmedia is getting browny points
There's a plugin for this: http://www.vbulletin.org/forum/showthread.php?t=176481
Works quite well.
__________________
.
Thanks.
Tip: You can also find me at digitalFAQ.com/forum, if I don't reply here.
kpmedia is offline   Reply With Quote
01-22-2011, 02:19 AM   #7
thisbuzz
Junior Member
 
Join Date: Jan 2011
Posts: 6
Rep Power: 0
thisbuzz is getting browny points
Thanks Jeff
thisbuzz is offline   Reply With Quote
Reply

Tags

contact form spam

,

forum spam

,

other spam


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT -4. The time now is 09:00 PM.


Powered by vBulletin® Version 3.8.8 Beta 4
Copyright ©2000 - 2014, vBulletin Solutions, Inc.