BotScout

General Category => BotScout Discussion => Topic started by: MysteryFCM on January 29, 2009, 06:24:17 PM

Title: Just a note ....
Post by: MysteryFCM on January 29, 2009, 06:24:17 PM
I sent you an e-mail earlier concerning the API key's usage, but decided what the heck, and figured I'd find out myself and it seems the key isn't site dependant, which is great.

I've went ahead and included a BotScout lookup in my Spambot Search Tool (http://support.it-mate.co.uk/?mode=Products&p=spambotsearchtool) :) (I use this on multiple sites for multiple forums/forms/blogs/etc)
Title: Re: Just a note ....
Post by: Mike on January 29, 2009, 06:35:58 PM
I sent you an e-mail earlier concerning the API key's usage, but decided what the heck, and figured I'd find out myself and it seems the key isn't site dependant, which is great.

I've went ahead and included a BotScout lookup in my Spambot Search Tool (http://support.it-mate.co.uk/?mode=Products&p=spambotsearchtool) :) (I use this on multiple sites for multiple forums/forms/blogs/etc)

Welcome, and thank you for implementing the API in your software!

You're correct, the API key is not site-dependent; you can use the same API key on as many sites as you need to. Currently the key is good for 300 API queries a day, but we can adjust that up if you need more (just let us know).

We're almost ready to release our Bot Trap Form Server, and you're more than welcome to use that as well. We're putting the finishing touches on it and hope to have it available within a few days.

The Form Server lets people put a small line of code in a page that invisibly embeds a randomized form in the page each time it's loaded. The form is very attractive to bots and is designed to be nearly impossible for them to identify as a bot trap.

Unfortunately, the Form Server system needs a different key for each site registered; this was a design consideration forced on us in order to prevent malicious users (botnet owners) from poisoning the database. We don't have a hard limit on the number of sites allowed yet, and the limit will be adjustable on a per-user basis, so trusted users will be able to deploy more forms than other users.

The system uses a scoring ladder to help weed out false entries, and should be very effective in proactively responding to bots and letting them add themselves to the database. :)

If you're interested in trying out the Bot Trap Form Server, let me know and we'll get you going. It's very easy to implement.

Again, welcome and thank you for implementing the BotScout API in your code!


Mike
Title: Re: Just a note ....
Post by: MysteryFCM on January 29, 2009, 06:41:06 PM
I sent you an e-mail earlier concerning the API key's usage, but decided what the heck, and figured I'd find out myself and it seems the key isn't site dependant, which is great.

I've went ahead and included a BotScout lookup in my Spambot Search Tool (http://support.it-mate.co.uk/?mode=Products&p=spambotsearchtool) :) (I use this on multiple sites for multiple forums/forms/blogs/etc)

Welcome, and thank you for implementing the API in your software!

You're correct, the API key is not site-dependent; you can use the same API key on as many sites as you need to. Currently the key is good for 300 API queries a day, but we can adjust that up if you need more (just let us know).

hehe cheers :) ....... I'll definately need more than 300 per day (the SBST gets in excess of 5000 queries per day on a single site, and I've got it installed on 3 sites so far (no idea of the traffic to them on the other two sites as I don't monitor them)).

We're almost ready to release our Bot Trap Form Server, and you're more than welcome to use that as well. We're putting the finishing touches on it and hope to have it available within a few days.

The Form Server lets people put a small line of code in a page that invisibly embeds a randomized form in the page each time it's loaded. The form is very attractive to bots and is designed to be nearly impossible for them to identify as a bot trap.

Unfortunately, the Form Server system needs a different key for each site registered; this was a design consideration forced on us in order to prevent malicious users (botnet owners) from poisoning the database. We don't have a hard limit on the number of sites allowed yet, and the limit will be adjustable on a per-user basis, so trusted users will be able to deploy more forms than other users.

The system uses a scoring ladder to help weed out false entries, and should be very effective in proactively responding to bots and letting them add themselves to the database. :)

If you're interested in trying out the Bot Trap Form Server, let me know and we'll get you going. It's very easy to implement.

Again, welcome and thank you for implementing the BotScout API in your code!

Mike

My pleasure :) and yep, I'll be interested in trying out the BTFS :)
Title: Re: Just a note ....
Post by: Mike on January 29, 2009, 06:45:20 PM
hehe cheers :) ....... I'll definately need more than 300 per day (the SBST gets in excess of 5000 queries per day on a single site, and I've got it installed on 3 sites so far (no idea of the traffic to them on the other two sites as I don't monitor them)).
Yikes, lol. Okay, we'll keep an eye on the query count for your key and if it starts to climb we'll bump it up (probably way up).

The one bit of advice I'd offer in terms of implementing the code is to check the return values carefully, the absence of a 'Y' doesn't necessarily mean there was no match- it may mean that an error is being returned (bad format, query limits, etc). We're looking at adding a special return value to help implement this, most likely a "!" returned as the first character to give scripts something to trigger on.
Title: Re: Just a note ....
Post by: MysteryFCM on January 29, 2009, 06:48:41 PM
Much appreciated, cheers :)

A return value specific to errors would be much appreciated as it would allow easier differentiation from non-matches (let me know when you've done this and I'll modify the scripts accordingly).
Title: Re: Just a note ....
Post by: Mike on January 29, 2009, 06:54:33 PM
Much appreciated, cheers :)

A return value specific to errors would be much appreciated as it would allow easier differentiation from non-matches (let me know when you've done this and I'll modify the scripts accordingly).
We'll look at adding this within the next day or so and we'll post a notice here (the API Doc page (http://botscout.com/api.htm) will also be updated).
Title: Re: Just a note ....
Post by: MysteryFCM on January 29, 2009, 06:59:28 PM
Nice one :)

Btw, your main site login form isn't allowing my full e-mail address in order to login :(

Full e-mail = botscout_com AT it-mate.co.uk

It seems to limit the chars so the last letter isn't allowed?
Title: Re: Just a note ....
Post by: Mike on January 29, 2009, 07:04:33 PM
Nice one :)

Btw, your main site login form isn't allowing my full e-mail address in order to login :(

Full e-mail = botscout_com AT it-mate.co.uk

It seems to limit the chars so the last letter isn't allowed?
Whoops. That's fixed now. It should take up to 50 characters now.

My partner is adding the error handling modification to the API and says he'll be done by the time I finish this message. Here's the change to the API info page:

API Error Handling
In the event of an API error or query limit, the API will return an exclamation mark (!) followed by a single space, and then the text of the error message. For example:

! Sorry, but that doesn't appear to be a valid API key.

If your code tests for an exclamation mark as the first character and finds one, then it can expect an error message to follow. The message could be emailed to an admin. It's possible we'll add an error code for the various messages, but I'm not sure if there's much utility in doing that. (??)
Title: Re: Just a note ....
Post by: Mike on January 29, 2009, 07:16:05 PM
I sent you an e-mail earlier concerning the API key's usage, but decided what the heck, and figured I'd find out myself and it seems the key isn't site dependant, which is great.
Hmmm, did you send the email through the contact form? I looked but didn't see anything. (??)
Title: Re: Just a note ....
Post by: MysteryFCM on January 29, 2009, 07:25:35 PM
I sent you an e-mail earlier concerning the API key's usage, but decided what the heck, and figured I'd find out myself and it seems the key isn't site dependant, which is great.
Hmmm, did you send the email through the contact form? I looked but didn't see anything. (??)

I did, yep :)
Title: Re: Just a note ....
Post by: MysteryFCM on January 29, 2009, 07:26:11 PM
Nice one :)

Btw, your main site login form isn't allowing my full e-mail address in order to login :(

Full e-mail = botscout_com AT it-mate.co.uk

It seems to limit the chars so the last letter isn't allowed?
Whoops. That's fixed now. It should take up to 50 characters now.

My partner is adding the error handling modification to the API and says he'll be done by the time I finish this message. Here's the change to the API info page:

API Error Handling
In the event of an API error or query limit, the API will return an exclamation mark (!) followed by a single space, and then the text of the error message. For example:

! Sorry, but that doesn't appear to be a valid API key.

If your code tests for an exclamation mark as the first character and finds one, then it can expect an error message to follow. The message could be emailed to an admin. It's possible we'll add an error code for the various messages, but I'm not sure if there's much utility in doing that. (??)


Cool :) I've just made another modification to the script so will add this aswell then re-release it :)
Title: Re: Just a note ....
Post by: MysteryFCM on January 29, 2009, 07:43:17 PM
I've added this in and released the new version :)

Btw, the bot trapping form generator doesn't seem able to detect the domains IP? (domain is the hosts-file.net server)
Title: Re: Just a note ....
Post by: Mike on January 29, 2009, 08:18:51 PM
I've added this in and released the new version :)

Btw, the bot trapping form generator doesn't seem able to detect the domains IP? (domain is the hosts-file.net server)
I'll have a look at this, let me see what I can find. It should trigger once you TAB away from the field or click on the next field.

..........

Hmmmm, it seemed to find it okay for me: 67.228.216.52

Sometimes it takes it a moment or two to resolve the IP. If it still doesn't find it for you, let me know. Are you using IE or Firefox, or...?

I tried it with FF and IE 7.0 and it worked okay for me. (??)
Title: Re: Just a note ....
Post by: MysteryFCM on January 29, 2009, 08:28:10 PM
It's detecting an IP now, but the wrong one ???

hosts-file.net = 212.56.95.253 (PTR: mysteryfcm.plus.com)

67.228.216.52 = eccparking.com

http://hosts-file.net/?s=67.228.216.52

Incidentally, I've got 3 sites on that IP listed in the hpHosts blacklist;

http://hosts-file.net/?s=67.228.216.52&sDM=1#matches

/edit

Using Avant Browser btw (uses the same Trident engine as IE)
Title: Re: Just a note ....
Post by: Mike on January 29, 2009, 08:33:38 PM
Weird. Hmmm. Well, go ahead and save it and I'll change the IP manually. Tell me which IP to put in there and we'll give it a shot.

The form server code is nearly done and should be available within a day or so. Once you get the form key you can go here to get a preview of the form server (the forms are visible now, but they won't be when it's released):

http://botscout.com/form/?apikey=your_form_api_key

(Note that the form key isn't the same as your regular API key)

We use the PHP function gethostbyname() to resolve the IP address, but apparently it's not reliable...so we'll need to find a reliable method of getting IP addresses. (Suggestions  welcome, lol)




It's detecting an IP now, but the wrong one ???

hosts-file.net = 212.56.95.253 (PTR: mysteryfcm.plus.com)

67.228.216.52 = eccparking.com

http://hosts-file.net/?s=67.228.216.52

Incidentally, I've got 3 sites on that IP listed in the hpHosts blacklist;

http://hosts-file.net/?s=67.228.216.52&sDM=1#matches

/edit

Using Avant Browser btw (uses the same Trident engine as IE)
Title: Re: Just a note ....
Post by: MysteryFCM on January 29, 2009, 08:38:51 PM
heh just added it, went to the URL you mentioned above (appended the form API key) and it's returning an "Invalid API key" error.

Where does it give me the file to upload to the server btw? (can't see an option for it)
Title: Re: Just a note ....
Post by: Mike on January 29, 2009, 08:57:05 PM
heh just added it, went to the URL you mentioned above (appended the form API key) and it's returning an "Invalid API key" error.

Where does it give me the file to upload to the server btw? (can't see an option for it)
Yep, it's not matching. We're looking at alternative ways to get a reliable IP address because the gethostbyname() function appears to have issues with some records.

The form (file) code isn't ready yet, but we expect to have a prelim version within a day or so. I'll get you a copy as soon as it's available.
Title: Re: Just a note ....
Post by: MysteryFCM on January 29, 2009, 09:49:54 PM
Nice one, cheers :)
Title: Re: Just a note ....
Post by: Mike on January 29, 2009, 10:03:57 PM
Okay, let's try this again....delete the entry and then add it again. It should come up with the correct IP now.
Title: Re: Just a note ....
Post by: MysteryFCM on January 29, 2009, 10:29:11 PM
Worked perfectly, cheers :)
Title: Re: Just a note ....
Post by: Mike on January 29, 2009, 11:06:03 PM
Worked perfectly, cheers :)
Hmmm, I'm not certain, you might want to do it again. I'll have another look in the morning to make sure.
Title: Re: Just a note ....
Post by: Mike on January 30, 2009, 06:40:50 AM
I'll definately need more than 300 per day (the SBST gets in excess of 5000 queries per day on a single site, and I've got it installed on 3 sites so far (no idea of the traffic to them on the other two sites as I don't monitor them)).
Wow, you weren't kidding....we had raised your initial query limit to 800/day, but I noticed first thing this morning that it had already topped out. I just raised it to 5000/day, and I'll keep an eye on it to make sure it doesn't get overrun again.
Title: Re: Just a note ....
Post by: MysteryFCM on January 30, 2009, 08:58:26 AM
hehe ;) (got the SBST script on a few very high traffic (and consequently, very spammer friendly) sites)
Title: Re: Just a note ....
Post by: MysteryFCM on January 30, 2009, 09:03:20 AM
I've asked him to join over here, but just as a heads up;

http://www.stopforumspam.com/forum/p3053-Today-2%3A46#p3053
Title: Re: Just a note ....
Post by: Mike on January 30, 2009, 09:17:30 AM
I've asked him to join over here, but just as a heads up;

http://www.stopforumspam.com/forum/p3053-Today-2%3A46#p3053
No problem; we'll be glad to help him out.

If you have any sample or development code that you'd like to share, we'd be more than happy to post it or link to it (and credit you, of course). 
Title: Re: Just a note ....
Post by: diabolic.bg on January 30, 2009, 10:03:33 AM
Hi, I'm new here and have a problem. Today four times I try to get API but get an error:
Quote
There was an error creating your API Key entry.

NOTE: Failure to create an API Key may be due to duplicate web site or email addresses. An API Key may be used across an entire domain, so you don't need to create multiple API Keys to use the bot testing code on different pages of your site.

If this error persists, please contact the Administrators and inform them of this problem.
Help me please!
Title: Re: Just a note ....
Post by: Mike on January 30, 2009, 10:06:46 AM
Hi, I'm new here and have a problem. Today four times I try to get API but get an error
Help me please!

Welcome, Diabolic. Could you please post the user name, domain name, and email that you're trying to sign up with? If you don't want to post them publicly, please PM them to me.

Title: Re: Just a note ....
Post by: MysteryFCM on January 30, 2009, 10:58:54 AM
I've asked him to join over here, but just as a heads up;

http://www.stopforumspam.com/forum/p3053-Today-2%3A46#p3053
No problem; we'll be glad to help him out.

If you have any sample or development code that you'd like to share, we'd be more than happy to post it or link to it (and credit you, of course). 

Feel free to post it :) The code I wrote that checks BS is;

Code: [Select]
// *********************************************************************************
// BEGIN CHECK BOTSCOUT
// *********************************************************************************
//
// Check the e-mail address against BotScout
//
if($mail !='' && $sBSAPI !=''){
$bFoundMatch=false;
$fspamcheck = getURL('http://botscout.com/test/?key='.$sBSAPI.'&mail='.$mail);
if (strpos($fspamcheck, '! ') !==False) {
$bFoundMatch = false;
echo 'Error: '.$fspamcheck;
}else{
if (strpos($fspamcheck, 'Y|') !==False) {
$bFoundMatch = true;
}
}
if($bFoundMatch==true){
$bsspambot = true;
} // End if($bsxml->appears == 'Y') (Email)
} // End If

//
// Now check the IP
//
if($ip !='' && $sBSAPI !=''){
$bFoundMatch=false;
$fspamcheck = getURL('http://botscout.com/test/?key='.$sBSAPI.'&ip='.$ip);
if (strpos($fspamcheck, '! ') !==False) {
$bFoundMatch = false;
echo 'Error: '.$fspamcheck;
}else{
if (strpos($fspamcheck, 'Y|') !==False) {
$bFoundMatch = true;
}
}
if($bFoundMatch==true){
$bsspambot = true;
} // End if($bsxml->appears == 'Y') (IP)
        } // End If

//
// Lets check the username
//
if($name !='' && $sBSAPI !=''){
$bFoundMatch=false;
$fspamcheck = getURL('http://botscout.com/test/?key='.$sBSAPI.'&name='.$name);
if (strpos($fspamcheck, '! ') !==False) {
$bFoundMatch = false;
echo 'Error: '.$fspamcheck;
}else{
if (strpos($fspamcheck, 'Y|') !==False) {
$bFoundMatch = true;
}
}
if($bFoundMatch==true){
                $bsspambot = true;
} // End if($bsxml->appears == 'Y') (username)
} // End If

if($bsspambot == true){
$spambot = true; // Required seperately now that dumping to a text file is optional
echo 'BotScout ';
}
// *********************************************************************************
// END CHECK BOTSCOUT
// *********************************************************************************

getURL is a function I wrote that allows determination of whether to use cURL or file_get_contents;

Code: [Select]
function getURL($sURL){
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;
}
Title: Re: Just a note ....
Post by: Mike on January 30, 2009, 11:28:43 AM
Great, I'll post this on the download page as well as in a 'Code Samples" thread. Thank you!
Title: Re: Just a note ....
Post by: MysteryFCM on January 30, 2009, 11:30:20 AM
My pleasure :)
Title: Re: Just a note ....
Post by: Mike on January 30, 2009, 11:41:32 AM
Hi, I'm new here and have a problem. Today four times I try to get API but get an error
Help me please!

As mentioned in the PM I sent you, you should be all set and good to go now.  :)  Please let me know if you have any difficulty.
Title: Re: Just a note ....
Post by: MysteryFCM on February 03, 2009, 10:48:25 AM
Site login doesn't seem to be working again? :( (refusing to recognize my password)

/edit

Just did the "Forget your password" thing, and tried the password it sent me, and it's not accepting that one either :(
Title: Re: Just a note ....
Post by: Mike on February 03, 2009, 12:17:30 PM
Site login doesn't seem to be working again? :( (refusing to recognize my password)

/edit

Just did the "Forget your password" thing, and tried the password it sent me, and it's not accepting that one either :(
Hmmm, we haven't changed anything there as far as I know, but let me doublecheck.

I just looked and everything should be the same. You're using the email you signed up with as a user name, correct? I'll PM you the password I see listed for you. Let me know if any of that stuff doesn't match.

I gotta dash here in a minute but I'll be back shortly.
Title: Re: Just a note ....
Post by: MysteryFCM on February 03, 2009, 12:25:38 PM
hehe your PM pointed out what was wrong ...... I was using my username instead of e-mail address, as the username for logging in :oops:
Title: Re: Just a note ....
Post by: Mike on February 03, 2009, 01:18:06 PM
hehe your PM pointed out what was wrong ...... I was using my username instead of e-mail address, as the username for logging in :oops:
:) No problem. Usernames can be duplicated; we use the email address as a unique identifier.
Title: Re: Just a note ....
Post by: MysteryFCM on February 03, 2009, 01:20:25 PM
No worries :)
Title: Re: Just a note ....
Post by: Mike on February 03, 2009, 01:22:09 PM
No worries :)
I notice your avatar froze, no more Homer popping up and down. (??)
Title: Re: Just a note ....
Post by: MysteryFCM on February 03, 2009, 01:29:00 PM
hehe I've noticed it does that from time to time, never figured out why  ???
Title: Re: Just a note ....
Post by: MysteryFCM on February 04, 2009, 12:44:00 AM
Just an FYI, someone asked for a desktop "standalone" version of the Spambot Search Tool, so I've written one and included BS in that too :) (it's not been released yet as it's currently awaiting beta testers).

You can post the code (VB6) if you like. The code required (obviously slimmed down and simplified as the code required for this specific application is somewhat different due to the way the program works and displays the information);

(code moved to the Code Samples (http://botscout.com/forum/index.php/topic,4.0.html) thread)
Title: Re: Just a note ....
Post by: MysteryFCM on February 04, 2009, 01:03:31 AM
Example VB6 project attached :)
Title: Re: Just a note ....
Post by: Mike on February 04, 2009, 06:36:08 AM
Example VB6 project attached :)
Ahh, this looks very useful. I'll post this on the code page shortly, and I'll move the code above to the "Code Samples" thread. Thank you!
Title: Re: Just a note ....
Post by: MysteryFCM on February 04, 2009, 06:47:09 AM
My pleasure :)
Title: Re: Just a note ....
Post by: Mike on February 04, 2009, 06:51:00 AM
Take a look at this listing and see if I got everything right:

http://botscout.com/code.htm

(Scroll down tho the second blue box for "VB6 Project Code for use with BotScout")
Title: Re: Just a note ....
Post by: MysteryFCM on February 04, 2009, 06:54:44 AM
Everything looks right to me :)
Title: Re: Just a note ....
Post by: MysteryFCM on February 11, 2009, 04:10:23 PM
New example code (as is now used in the next release of the Spambot Search Tool) for querying BotScout :) This now uses the multi query;

UPDATED; please see this post (http://botscout.com/forum/index.php/topic,2.msg110.html#msg110).
Title: Re: Just a note ....
Post by: Mike 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.
Title: Re: Just a note ....
Post by: MysteryFCM 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 :)
Title: Re: Just a note ....
Post by: MysteryFCM 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
// *********************************************************************************
Title: Re: Just a note ....
Post by: Mike 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!
Title: Re: Just a note ....
Post by: MysteryFCM on February 12, 2009, 08:56:22 AM
My pleasure :)
Title: Re: Just a note ....
Post by: MysteryFCM 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 :)
Title: Re: Just a note ....
Post by: Mike 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 :)
Title: Re: Just a note ....
Post by: MysteryFCM on February 18, 2009, 08:47:42 PM
Nice one, cheers :)
Title: Re: Just a note ....
Post by: MysteryFCM 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 = '';
}
}
}
Title: Re: Just a note ....
Post by: MysteryFCM 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
Title: Re: Just a note ....
Post by: Mike 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
Title: Re: Just a note ....
Post by: MysteryFCM 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
Title: Re: Just a note ....
Post by: MysteryFCM 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;
}
}
Title: Re: Just a note ....
Post by: Mike on February 22, 2009, 02:35:14 PM
Excellent, this is a good addition to the code.
Title: Re: Just a note ....
Post by: MysteryFCM on February 22, 2009, 02:36:28 PM
:)
Title: Re: Just a note ....
Post by: MysteryFCM on February 22, 2009, 05:23:15 PM
Spambot Search Tool v0.22 has been released :)

Changes:

+ Added function to check if server is online
+ Added notes to top of all files
* Moved getURL function to functions.php
* Re-written e-mail validation as a function and moved to functions.php
* Replaced IP validation with function by Mike (botscout.com)
* Moved old IP validation routine to functions.php and re-written as function
* Partial re-write of Spamhaus query routine in check_spammers_plain.php
* Fixed fSpamList SimpleXMLElement check (was only checking $xml->Email instead of all 3)
* Modified ProjectHoneyPot query so "Search Engine" and "Suspicious" aren't flagged when using check_spammers_plain.php
* Fixed SpamHaus query so PBL and CBL aren't flagged when using check_spammers_plain.php

Download:
http://support.it-mate.co.uk/?mode=Products&act=DL&p=spambotsearchtool

Next to add is the caching :)
Title: Re: Just a note ....
Post by: MysteryFCM on February 22, 2009, 06:07:30 PM
Didn't manage to add the code I mentioned previously (concerning usernames) as it kept borking, so gotta figure out where I went wrong :)
Title: Re: Just a note ....
Post by: MysteryFCM on February 25, 2009, 08:09:00 AM
Had a friend unable to get the SBST to work correctly, and narrowed the problem down to file_put_contents() not being available, and get_headers() not being available, so modified the isURLOnline function to;

Code: [Select]
function isURLOnline($sSiteToCheck){
if(function_exists('get_headers')==True){
$sIUOTemp = @get_headers($sSiteToCheck);
if(strpos($sIUOTemp[0], '200') == true){
return true;
}else{
return false;
}
}else{
return true; // Assume true if we can't check it .......
}
}

Thought the @ was supposed to supress errors, but I guess not ....
Title: Re: Just a note ....
Post by: MysteryFCM on March 11, 2009, 08:00:36 PM
v0.24 12-03-09 :)

Changes:

+ Added extra match options for $BaseMatch var (you can now use multiple match selections without manually editing the switch codes)
* Fixed counter increments when check_spammers_plain.php is queried, regardless of whether or $spambot = true
* Moved counter control to IncreaseCatchCount() function to save code duplication
* Moved text file controls (for logging spammers) to LogSpammerToFile function to save code duplication
* Username passed is now wrapped in htmlentities() and urlencode() for additional security (albeit not much)
+ Added optional logging to MySQL database (created automagically if it doesn't exist). To enable this, see config.php