Welcome, Guest!!
follow us on... rss

Author Topic: Just a note ....  (Read 14123 times)

Mike

  • Administrator
  • Sr. Member
  • *****
  • Posts: 284
    • View Profile
Re: Just a note ....
« Reply #45 on: February 11, 2009, 06:07:37 pm »
Obviously we'll need to decide what the dummy values are going to be (and hope the spammers never pick up on it), but figured this will do in the meantime :)

Hmm, having the user specify the dummy value sounds like a hole a spammer could drive a truck through....and they would, eventually. I think it would be more secure if we modify things on this end so that it ignores empty parameters and just returns whatever it finds. It would always return a '0' or 'N' for the empty or missing values.

Give me some time to fiddle it on this end and I'll let you know as soon as it's ready.
Please don't PM me for assistance- post your questions in the forum where others can see them.

MysteryFCM

  • Moderator
  • Full Member
  • *****
  • Posts: 197
    • View Profile
    • I.T. Mate
Re: Just a note ....
« Reply #46 on: February 11, 2009, 06:32:17 pm »
No worries :)

I was actually hoping you'd deal with the empty one's at your end, specifically because of the potential abuse you mentioned :)
Regards
Steven Burn
I.T. Mate / hpHosts
it-mate.co.uk / hosts-file.net

MysteryFCM

  • Moderator
  • Full Member
  • *****
  • Posts: 197
    • View Profile
    • I.T. Mate
Re: Just a note ....
« Reply #47 on: February 11, 2009, 06:48:50 pm »
Oks, final version of the code :) (I was gonna remove the old one from the previous post but I can't edit it :()

Code: [Select]
// *********************************************************************************
// BEGIN CHECK BOTSCOUT
// *********************************************************************************
//
// Check the username etc against BotScout. Done using a single query for efficiency
// as we don't need multiple queries for the plain version.
//
// If any of the values are missing, BotScout will ignore them (better for us as it
// prevents us having to deal with them, which thus prevents spammers potentially
// abusing it)
//
if($sBSAPI !=''){
$bFoundMatch=false;
$sBSMail = $mail;
$sBSIP = $ip;
$sBSName = $name;
$fspamcheck = getURL('http://botscout.com/test/?multi&key='.$sBSAPI.'&mail='.$sBSMail.'&ip='.$sBSIP.'&name='.$sBSName);
// BotScout error codes begin with an apostrophe, so we'll check for those first
if (strpos($fspamcheck, '! ') !==False) {
$bFoundMatch = false;
echo 'Error: '.$fspamcheck;
}else{
if (strpos($fspamcheck, 'Y|') !==False) {
$bFoundMatch = true;
}
} // End if (strpos($fspamcheck, '! ') !==False)

if($bFoundMatch==true){
$bsspambot = true;
$spambot = true; // Required seperately now that dumping to a text file is optional
echo 'BotScout ';
}else{
$bsspambot = false;
} // End if($bFoundMatch==true)

} // End If ($sBSAPI !='')

// *********************************************************************************
// END CHECK BOTSCOUT
// *********************************************************************************
Regards
Steven Burn
I.T. Mate / hpHosts
it-mate.co.uk / hosts-file.net

Mike

  • Administrator
  • Sr. Member
  • *****
  • Posts: 284
    • View Profile
Re: Just a note ....
« Reply #48 on: February 11, 2009, 09:36:36 pm »
Oks, final version of the code :) (I was gonna remove the old one from the previous post but I can't edit it :()

No problem; I removed it from the earlier post and put in a link to this one.

Thank you for updating the code!
Please don't PM me for assistance- post your questions in the forum where others can see them.

MysteryFCM

  • Moderator
  • Full Member
  • *****
  • Posts: 197
    • View Profile
    • I.T. Mate
Re: Just a note ....
« Reply #49 on: February 12, 2009, 08:56:22 am »
My pleasure :)
Regards
Steven Burn
I.T. Mate / hpHosts
it-mate.co.uk / hosts-file.net

MysteryFCM

  • Moderator
  • Full Member
  • *****
  • Posts: 197
    • View Profile
    • I.T. Mate
Re: Just a note ....
« Reply #50 on: February 18, 2009, 07:43:31 pm »
Just released the new version of the SBST :)

http://www.calendarofupdates.com/updates/index.php?showtopic=17155

No changes to the BotScout code though (didn't need any hehe)

Certainly helping me learn PHP doing this :)
Regards
Steven Burn
I.T. Mate / hpHosts
it-mate.co.uk / hosts-file.net

Mike

  • Administrator
  • Sr. Member
  • *****
  • Posts: 284
    • View Profile
Re: Just a note ....
« Reply #51 on: February 18, 2009, 08:39:01 pm »
Ahh, very cool. I noticed you said you'd added some IP validation. Here's a good regex that will positively identify a valid IP address:

Code: [Select]
function validIP($ip){
    if(preg_match("'\b(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\b'", $ip)){
        return 'valid';
    }else{
        return 'invalid';
    }
}

Example use: $ip_test = validIP('122.34.18.101');


Just released the new version of the SBST :)

http://www.calendarofupdates.com/updates/index.php?showtopic=17155

No changes to the BotScout code though (didn't need any hehe)

Certainly helping me learn PHP doing this :)
Please don't PM me for assistance- post your questions in the forum where others can see them.

MysteryFCM

  • Moderator
  • Full Member
  • *****
  • Posts: 197
    • View Profile
    • I.T. Mate
Re: Just a note ....
« Reply #52 on: February 18, 2009, 08:47:42 pm »
Nice one, cheers :)
Regards
Steven Burn
I.T. Mate / hpHosts
it-mate.co.uk / hosts-file.net

MysteryFCM

  • Moderator
  • Full Member
  • *****
  • Posts: 197
    • View Profile
    • I.T. Mate
Re: Just a note ....
« Reply #53 on: February 18, 2009, 08:49:40 pm »
The following is the code I wrote for it :)

Code: [Select]
if($sIP !=''){
// The only thing an IP should contain, is periods and numbers, nothing else
$sIPV = str_replace('.', '', $sIP);
if(!ctype_digit($sIPV)){
$sIP='';
}else{
if(strpos($sIP, '.')){
        $sIP_Octets = explode(".", $sIP);
if($sIP_Octets[0] > 255 || $sIP_Octets[1] > 255 || $sIP_Octets[2] > 255){
// Empty it, we can't use it
$sIP = '';
}
}else{
// Empty it, we can't use it
$sIP = '';
}
}
}
Regards
Steven Burn
I.T. Mate / hpHosts
it-mate.co.uk / hosts-file.net

MysteryFCM

  • Moderator
  • Full Member
  • *****
  • Posts: 197
    • View Profile
    • I.T. Mate
Re: Just a note ....
« Reply #54 on: February 20, 2009, 04:44:03 am »
I've released this in response to SFS being down. All that's been added is the ability to enable/disable the checking of SFS or FSL.

To disable a database, open config.php and set the respective variable to false, for example, to disable StopForumSpam;

$CheckSFS = FALSE;

Download Spambot Search Tool v0.21
http://support.it-mate.co.uk/?mode=Products&p=spambotsearchtool

Ref:
http://hphosts.blogspot.com/2009/02/stopforumspam-offline.html
Regards
Steven Burn
I.T. Mate / hpHosts
it-mate.co.uk / hosts-file.net

Mike

  • Administrator
  • Sr. Member
  • *****
  • Posts: 284
    • View Profile
Re: Just a note ....
« Reply #55 on: February 20, 2009, 05:01:02 am »
Does SFS go down very often?

I'm wondering if it might be worth adding some sort of auto-checking so that each site (SFS, BotScout, FSpamList, etc) is tested to see if it's reachable.


I've released this in response to SFS being down. All that's been added is the ability to enable/disable the checking of SFS or FSL.

To disable a database, open config.php and set the respective variable to false, for example, to disable StopForumSpam;

$CheckSFS = FALSE;

Download Spambot Search Tool v0.21
http://support.it-mate.co.uk/?mode=Products&p=spambotsearchtool

Ref:
http://hphosts.blogspot.com/2009/02/stopforumspam-offline.html
Please don't PM me for assistance- post your questions in the forum where others can see them.

MysteryFCM

  • Moderator
  • Full Member
  • *****
  • Posts: 197
    • View Profile
    • I.T. Mate
Re: Just a note ....
« Reply #56 on: February 20, 2009, 05:17:09 am »
It's been down a few times this year, but not seen it down due to bandwidth before.

I actually tried adding auto-checking of sites to see if they were online, but couldn't get the code to work (it kept ignoring it and trying them anyway), so just went with vars instead hehe.

Does SFS go down very often?

I'm wondering if it might be worth adding some sort of auto-checking so that each site (SFS, BotScout, FSpamList, etc) is tested to see if it's reachable.


I've released this in response to SFS being down. All that's been added is the ability to enable/disable the checking of SFS or FSL.

To disable a database, open config.php and set the respective variable to false, for example, to disable StopForumSpam;

$CheckSFS = FALSE;

Download Spambot Search Tool v0.21
http://support.it-mate.co.uk/?mode=Products&p=spambotsearchtool

Ref:
http://hphosts.blogspot.com/2009/02/stopforumspam-offline.html
Regards
Steven Burn
I.T. Mate / hpHosts
it-mate.co.uk / hosts-file.net

MysteryFCM

  • Moderator
  • Full Member
  • *****
  • Posts: 197
    • View Profile
    • I.T. Mate
Re: Just a note ....
« Reply #57 on: February 22, 2009, 02:32:39 pm »
Whilst working on updates, I wrote the following to ensure the site was actually online;

Code: [Select]
function isURLOnline($sSiteToCheck){
$sIUOTemp = @get_headers($sSiteToCheck);
if(strpos($sIUOTemp[0], '200') == true){
return true;
}else{
return false;
}
}

This was originally using is_array() to ensure it actually returned headers, but for some reason, it borked when using it, so I removed that part and left it as above :).

New getURL code;

Code: [Select]
function getURL($sURL){
if(isURLOnline($sURL) == true){
if(function_exists('file_get_contents')){
// Use file_get_contents
$sURLTemp = @file_get_contents($sURL);
}else{
// Use cURL (if available)
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $sURL);
curl_setopt($curl, CURLOPT_VERBOSE, 1);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_HEADER, 0);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);
$sURLTemp = @curl_exec($curl);
curl_close($curl);
}
return $sURLTemp;
}else{
$sURLTemp = 'Unable to connect to server';
return $sURLTemp;
}
}
Regards
Steven Burn
I.T. Mate / hpHosts
it-mate.co.uk / hosts-file.net

Mike

  • Administrator
  • Sr. Member
  • *****
  • Posts: 284
    • View Profile
Re: Just a note ....
« Reply #58 on: February 22, 2009, 02:35:14 pm »
Excellent, this is a good addition to the code.
Please don't PM me for assistance- post your questions in the forum where others can see them.

MysteryFCM

  • Moderator
  • Full Member
  • *****
  • Posts: 197
    • View Profile
    • I.T. Mate
Re: Just a note ....
« Reply #59 on: February 22, 2009, 02:36:28 pm »
:)
Regards
Steven Burn
I.T. Mate / hpHosts
it-mate.co.uk / hosts-file.net