Page 1 of 1

owner access can get blocked by ip ban

Posted: Sun Apr 19, 2009 2:21 pm
by gildionne
Version of script: 1.6 and also a modified 1.6

What terms did you try when SEARCHING for a solution:
ip banning,
wrong ip,
junkmark,
loss of access

PROBLEM:
Previous accessible gbook suddenly becomes unaccessible to Owner. Only sees blank page.

ONE PROBABLE CAUSE:
If the owner is on a local network -
An automated or manual ban of an offender's IP address, when the address of user and owner are the same. This can occur when both computers are on the same sub-net of a larger carrier.

TEMPORARY FIX:
Access gbook files with your ftp program. Edit the banned ip file to delete the specific IP that both share.

BACKGROUND:
During some testing of a modified gbook 1.6, I lost owner access to my gbook for a few hours. My browser would just show a blank page. I eventually tracked the problem to an entry in the banned_ip file. After deleting the responsible entry, I regained access. I tried the test again with the original 1.6 version of gbook and found that the loss of access can still occur.

My wireless carrier purchases bandwidth on a cable company's fibre-optic network. Some web-sites have incorrectly reported my IP to be that of the cable company. It seems that blocks of users on my wireless carrier are considered to be local networks on the cable company, and share the same main IP address.

If a user in the local network, posts to gbook and triggers the automatic banning of the IP address, or if the user is manually banned, the IP address that is added to the banned ip file, is the point where the sub-net connects to the main carrier, the 'gateway IP'

I ask Henrie to check his guestbook for a short message from me, (should be posted within a few minutes) and report the first octet of the ip address that is recorded. Windows ipconfig gives my IP as 192.168.x.x while 'speedtest.net' refers to my IP as 24.222.x.x

Is a permanent resolution possible? Can gbook get the information of the actual computer being used, even on a sub-net?

Posted: Sun Apr 19, 2009 2:25 pm
by Klemen
Hi,

Try setting the

Code: Select all

$settings['ignore_proxies']
to 1 in settings file and see if that helps.

Posted: Sun Apr 19, 2009 2:54 pm
by gildionne
Hi Klemen,

I tried the setting change suggested, but it still shows only the gateway address in both the original 1.6 version and my mod

Posted: Sun Apr 19, 2009 3:09 pm
by Klemen
It will always show the gateway address because it's the address PHP gets ($_SERVER['REMOTE_ADDR']). Try if the suggested change prevents you from getting banned.

Posted: Sun Apr 19, 2009 3:21 pm
by gildionne
Klemen,

Posted before I read your last post.

It is not often that a computer on your own network may wish to 'spam', but to avoid the disruption that a ban of a 'gateway' address may cause, it might be best to disable the ban for your own IP address. This could be a new $settings['no-ban']="x.x.x.x" (for IPv4). Not sure the best location to add code.

Posted: Sun Apr 19, 2009 3:41 pm
by gildionne
Hi again Klemen,

I tested again with the setting 'ignore proxies' set to 1. It still allows the ban of my own address. There is no error message, just a blank screen when trying to view the gbook.

Posted: Sun Apr 19, 2009 4:18 pm
by Klemen
You can try changing

Code: Select all

function gbook_banIP($ip,$doDie=0) {
	global $settings, $lang;
    $fp=fopen('banned_ip.txt','a');
    fputs($fp,$ip.'%');
    fclose($fp);
    if ($doDie) {
        die($lang['e21']);
    }
    return true;
} // END gbook_banIP()
to for example

Code: Select all

function gbook_banIP($ip,$doDie=0) {
	global $settings, $lang;
if ($ip == '123.123.123.123') {return true;}
    $fp=fopen('banned_ip.txt','a');
    fputs($fp,$ip.'%');
    fclose($fp);
    if ($doDie) {
        die($lang['e21']);
    }
    return true;
} // END gbook_banIP()
where 123.123.123.123 is your IP

Posted: Mon Apr 20, 2009 2:52 am
by Henrie
Hello Gildionne,

Sorry for my late reaction, but i was busy with other things

This is the IP i get from the message you posted:
24.222.23.3 (blk-222-23-3.eastlink.ca)

Will take a look at your private message about the central admin area later this week, i am kinda busy right now.
But it really should be directed to Klemen, he is the author.
And yes, i would like to see a table-less layout too. That is why i made it. But to be honest, it is not more easy to customise, because a lot more tags are used (maybe i wanted it to be to flexible).

Greetings,
Henrie