Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> NukeSentinel(tm)
Author Message
Raven
Site Admin/Owner



Joined: Aug 27, 2002
Posts: 17088

PostPosted: Thu Oct 07, 2004 2:35 pm Reply with quote

NukeSentinel is a Great product (shameless plug) and it keeps getting better! One of the features that will be added (eventually) will be the ability to exclude IP's from danger. I need this right now as search engines (the safe ones) sometime's get banned because they try to index a post that gets filtered. GoogleBot gets offended when you slap him ROTFL so I have a simple way to protect any IP range which I want. It does involve adding some manual code to includes/sentinel.php but it is only a few lines. I could make it an 'include' type logic, but this really is a 'kiss' method, which I like Smile.

Step 1 - BACKUP includes/sentinel.php
Step 2 - In includes/sentinel.php, find (around line 132)
Code:
$ip = explode(".", $remote);
and add these lines after it. Now I am including the logic for GoogleBot and Yahoo Search Engines that I am concerned with. You can modify and/or add new ones as you see fit. I would be very conservative in allowing Smile
Code:
/****** isAllowedByMe    ******/

$isAllowedByMe = FALSE;
/****** protect Goolebot ******/
if ($ip[0]==66 AND $ip[1]==249 AND $ip[2]>=64 AND $ip[2]<=79)  $isAllowedByMe = TRUE;
/****** protect Yahoo    ******/
if ($ip[0]==66 AND $ip[1]==196 AND $ip[2]>=64 AND $ip[2]<=127) $isAllowedByMe = TRUE;
/****** protect Yahoo    ******/
/****** isAllowedByMe    ******/

Step 3 - In includes/sentinel.php, find (around line 654)
Code:
function block_ip($ip, $banuser, $bantime, $blocker_row, $abmatch="") {
and add these lines after it
Code:
  global $isAllowedByMe;

  if ($isAllowedByMe) return;

That should do it Wink


Last edited by Raven on Wed Dec 29, 2004 11:14 am; edited 1 time in total 
View user's profile Send private message
TheosEleos
Life Cycles Becoming CPU Cycles



Joined: Sep 18, 2003
Posts: 960
Location: Missouri

PostPosted: Thu Oct 07, 2004 3:17 pm Reply with quote

This function going to be included in 2.1.0?

_________________
Only registered users can see links on this board! Get registered or login! 
View user's profile Send private message Visit poster's website AIM Address ICQ Number
Raven







PostPosted: Thu Oct 07, 2004 3:19 pm Reply with quote

I don't believe it made the cut and that's why I give you my way Wink
 
BobMarion
Former Admin in Good Standing



Joined: Oct 30, 2002
Posts: 1037
Location: RedNeck Land (known as Kentucky)

PostPosted: Thu Oct 07, 2004 8:34 pm Reply with quote

On your code Smile once I finish the "Blocked Ranges" i'll be starting "Protected Ranges" Wink so that you can enter the range of say google's bots and they will never need to worry about being blocked.

These are the last two items on my "To Do" list that I got from you on things you would like to see in hte next version. Yes, it's taken me awhile but I've been a busy little coder Bang Head

_________________
Bob Marion
Codito Ergo Sum
Only registered users can see links on this board! Get registered or login! 
View user's profile Send private message Send e-mail Visit poster's website
Raven







PostPosted: Thu Oct 07, 2004 8:39 pm Reply with quote

Hopefully that code will help Wink
 
beetraham
Regular
Regular



Joined: Dec 13, 2003
Posts: 94
Location: Finland (EU)

PostPosted: Thu Oct 07, 2004 8:52 pm Reply with quote

Please let me know your conception of the associated reliability/usability related to next source - I'd really like to hear your point of view.


Search Engine IP Addresses : Only registered users can see links on this board! Get registered or login!

Should you have any other resources available considered trustworthy, please let me know.

Thanks,

-beetraham
 
View user's profile Send private message
BobMarion







PostPosted: Thu Oct 07, 2004 9:01 pm Reply with quote

An example of what you would enter into the protected ranges from a snipplet of your:
Code:
202.212.5.30

202.212.5.32
202.212.5.33
202.212.5.34
202.212.5.35
202.212.5.36
202.212.5.37
202.212.5.38
202.212.5.39
202.212.5.47
202.212.5.48


Translates to:
Code:
202.212.5.30 - 202.212.5.48


Or if you did an IP Lookup on those you could make it:
Code:
202.212.0.0 - 202.215.255.255


Of course this solely an example and the results may not bear out that the last range be correct Smile
 
blith
Client



Joined: Jul 18, 2003
Posts: 977

PostPosted: Fri Oct 08, 2004 7:34 am Reply with quote

Raven, may I ask why the line number would differ so much from one to the other? Mine were a little bit further away than around...
 
View user's profile Send private message Visit poster's website
sharlein
Member Emeritus



Joined: Nov 19, 2002
Posts: 322
Location: On the Road

PostPosted: Sat Oct 09, 2004 1:28 pm Reply with quote

Mine were about 40 lines shy, lol. I love the search features in DSoft PHP editor!!

_________________
Give Me Ambiguity Or Give Me Something Else! 
View user's profile Send private message
blith







PostPosted: Mon Oct 18, 2004 10:44 am Reply with quote

I was just interested as to what causes them to differ from one to another... perhaps individual customization? Smile
 
BobMarion







PostPosted: Mon Oct 18, 2004 1:04 pm Reply with quote

Version number would be the cause of them differing on line numbers Smile
 
sharlein







PostPosted: Mon Oct 18, 2004 6:44 pm Reply with quote

beetraham said:
Quote:

Please let me know your conception of the associated reliability/usability related to next source - I'd really like to hear your point of view.


Search Engine IP Addresses : http://www.iplists.com/nw/

Should you have any other resources available considered trustworthy, please let me know.


I would like to bump. Is it a reliable source?
 
BobMarion







PostPosted: Tue Oct 19, 2004 10:42 pm Reply with quote

The only problem I've found with the list is it doesn't list their ranges , just single ip's. Other then that it seems to be a fairly reliable listing. I haven't checked each one myself though. You can check each ip yourself by using:
http://dnsstuff.com/tools/whois.ch?cache=off&ip=PUT_IP_HERE . Keep in mind that not all Yahoo IP's will have Yahoo listed as the owner and that the list is a "Use at your own risk" list.

From my site I have built this list of Crawlers that I exclude from being tracked since I can prove they are crawlers(by the way they move thru the site from the Tracked IP's system):
Code:
INSERT INTO nuke_nsnst_excluded_ranges VALUES (1113513984, 1113518079, '0', 'Yahoo Search', 'us');

INSERT INTO nuke_nsnst_excluded_ranges VALUES (1118019584, 1118027775, '0', 'Yahoo Search', 'us');
INSERT INTO nuke_nsnst_excluded_ranges VALUES (1120157696, 1120174079, '0', 'Yahoo Search', 'us');
INSERT INTO nuke_nsnst_excluded_ranges VALUES (1123631104, 1123635199, '0', 'Google Search', 'us');
INSERT INTO nuke_nsnst_excluded_ranges VALUES (3475898368, 3475963903, '0', 'MSN Search', 'us');
INSERT INTO nuke_nsnst_excluded_ranges VALUES (3477372928, 3477393407, '0', 'MSN Search', 'us');
INSERT INTO nuke_nsnst_excluded_ranges VALUES (3511249408, 3511271423, '0', 'AltaVista Search', 'us');
INSERT INTO nuke_nsnst_excluded_ranges VALUES (3515031552, 3515039743, '0', 'Yahoo Search', 'us');
INSERT INTO nuke_nsnst_excluded_ranges VALUES (3519725568, 3519741951, '0', 'Lycos Search', 'us');
INSERT INTO nuke_nsnst_excluded_ranges VALUES (3637019136, 3637019391, '0', 'AskJeeves Search', 'us');
INSERT INTO nuke_nsnst_excluded_ranges VALUES (1120024560, 1120024575, '0', 'Global Spec', 'us');
INSERT INTO nuke_nsnst_excluded_ranges VALUES (3522030848, 3522031359, '0', 'Alexa Search', 'us');
INSERT INTO nuke_nsnst_excluded_ranges VALUES (1093926912, 1093992447, '0', 'MSN Search', 'us');
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> NukeSentinel(tm)

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©