News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

httpBL

Started by Diego Andrés, February 17, 2010, 03:55:54 PM

Previous topic - Next topic

snoopy_virtual

@EL34

I have found the problem.

It is a bug in the code.

While I sort it in the next version you can correct it manually:

Inside your Sources folder look for the file httpBL_Subs.php

Inside it (line 680) look for the code:


$ip = httpBL_look_for_empty_ip();


Replace it with:


$ip = httpBL_look_for_empty_ip($ip);


Save the modified file and upload it to your forum.

===============

Anyway that mistakes only happens when a visitor has no IP (when it's blank) and that's a case I have never seen yet.

Could you check your httpBL logs to see if there are any entries with no IP?

I am very interested, as this is a very extremely rare case and I never had any other opportunity to study it yet.

El verdadero sabio es aquel que lo ve todo, lo estudia todo, lo analiza todo y molesta poco.
A true wise man is he who sees everything, studies everything, analyses everything and hardly ever annoys.

EL34

#481
I edited the code the code.

No errors show up in the httpBL errors log.
This is the same as the last time it happened also.
The errors only show up in the main forum error log.

Thanks snoop

Forum History -> EZBoard -> YABB -> SMF 1.1.19 -> SMF 2.0.19

snoopy_virtual

No. They won't be inside the httpBL error log.

If somebody arrives with a blank IP they will see the captcha, so they will be either in the spammers log (if they didn't answer correctly) or in the humans log (if they did).

But in any case they won't have an IP

El verdadero sabio es aquel que lo ve todo, lo estudia todo, lo analiza todo y molesta poco.
A true wise man is he who sees everything, studies everything, analyses everything and hardly ever annoys.

Arantor

QuoteAnyway that mistakes only happens when a visitor has no IP (when it's blank) and that's a case I have never seen yet.

Depends if you really mean blank or not a real IP address ;)

Truly blank should only occur if SMF is really not able to get an IP address, and even then it should be defaulting to its standard unknown 0.0.0.0 IP address (e.g. using IPv6 or something else prevents PHP getting an IP address, like it's being invoked through CLI or something equally weird)

EL34

Ok, sorry, I read your post too fast.

I had already reset the spammers log this morning before I had looked at the forum log.
The logs are empty now so I can't look for blank IP guest.
Forum History -> EZBoard -> YABB -> SMF 1.1.19 -> SMF 2.0.19

snoopy_virtual

Quote from: Arantor on January 19, 2011, 11:38:46 AM
QuoteAnyway that mistakes only happens when a visitor has no IP (when it's blank) and that's a case I have never seen yet.

Depends if you really mean blank or not a real IP address ;)

Truly blank should only occur if SMF is really not able to get an IP address, and even then it should be defaulting to its standard unknown 0.0.0.0 IP address (e.g. using IPv6 or something else prevents PHP getting an IP address, like it's being invoked through CLI or something equally weird)

All that started when (more than a year ago) somebody reported he was getting strange things in the logs, with entries with nothing at all in the IP (not even 0.0.0.0, but completely blank).

This mod is getting the IP from $user_info['ip'] and (as far as I know) that shouldn't be blank doesn't matter what, so I modified the mod and added a conditional inside it:


$ip = $user_info['ip'];

// some more code doing other things, but not affecting the IP

if ($ip == '')
{
    // some code to see what happens here
}
else
    // the mod continues as always


So that piece of code will be triggered only if the IP is blank.

As I said I haven't seen it happening yet.

El verdadero sabio es aquel que lo ve todo, lo estudia todo, lo analiza todo y molesta poco.
A true wise man is he who sees everything, studies everything, analyses everything and hardly ever annoys.

Arantor

There shouldn't be any reason for it to be actually blank that I remember - even if the user's IP can't be established through conventional means, it should be falling back to 0.0.0.0. I suspect your user had modified something there that he wasn't meant to.

EL34

QuoteI suspect your user had modified something there that he wasn't meant to.

You can erase all your suspicions and be at peace.  :)

I have not modded anything that snoop did not tell me to mod.

Looks at post #472 to see a list of the mods I have installed if you think another mod is messing with the httpBL mod.
Forum History -> EZBoard -> YABB -> SMF 1.1.19 -> SMF 2.0.19

Arantor

I didn't think you had, EL34 - I was referring to the user snoopy mentioned that was getting what should be an impossible circumstance in their forum...

EL34

Sorry, two different things going on at the same time

see ya
Forum History -> EZBoard -> YABB -> SMF 1.1.19 -> SMF 2.0.19

snoopy_virtual

It was madfitz:

http://www.simplemachines.org/community/index.php?topic=283309.msg2504550#msg2504550

Answered here:

http://www.snoopyvirtualstudio.com/trankos/portal/index.php?option=com_smf&Itemid=36&topic=309.0

The problem was he never reported back so I didn't had a chance to study the case properly.

But if the visitor EL34 is getting has triggered that piece of code it means the IP there is also blank, so I hope this time I will have a chance to see what is happening.

El verdadero sabio es aquel que lo ve todo, lo estudia todo, lo analiza todo y molesta poco.
A true wise man is he who sees everything, studies everything, analyses everything and hardly ever annoys.

EL34

Snoop,
Should I change the code back to stock and report back if it happens again?
This time I will scan the httpBL logs and look for an empty IP?
Forum History -> EZBoard -> YABB -> SMF 1.1.19 -> SMF 2.0.19

snoopy_virtual

I don't think so. Leave it the way it is just now.

Just check every now and then to see if you get any blanks IPs in your httpBL logs.

El verdadero sabio es aquel que lo ve todo, lo estudia todo, lo analiza todo y molesta poco.
A true wise man is he who sees everything, studies everything, analyses everything and hardly ever annoys.

EL34

Forum History -> EZBoard -> YABB -> SMF 1.1.19 -> SMF 2.0.19

perf

Hi, and thanks for a great mod. Together with Stop Spammer, it saves me at least half an hour a day (not having to check and delete spammer accounts).

I did however have som problems installing it under 2.0 RC4. The installation script wouldn't create the log_httpBL table.  Here's the entry from the log:

http://forum.student.lth.se/index.php?action=admin;area=packages;sa=install2;package=httpBL_v2_5_1.zip;pid=0
Database Error: Table 'smf.student_log_httpBL' doesn't exist
File: /usr/local/apache2/htdocs.student/Packages/temp/install_2.php
Line: 69


I managed to work around this problem by creating the table manually.

On anoter RC4 forum (using the same database) I had prevously used httpBL with SMF 1.12, and on that forum there were no problems installing it under RC4.
Per Foreby
hxxp:forum.student.lth.se/ [nonactive]

snoopy_virtual

Quote from: perf on January 20, 2011, 05:35:35 AM
I did however have som problems installing it under 2.0 RC4. The installation script wouldn't create the log_httpBL table.

That's strange.

Of course, the only RC4 forum I have was RC2 when I installed the mod, so the table was created then without a problem.

I will create another RC4 forum (whenever I have time) to test that up and see if I can reproduce the error to find why it's happening.

El verdadero sabio es aquel que lo ve todo, lo estudia todo, lo analiza todo y molesta poco.
A true wise man is he who sees everything, studies everything, analyses everything and hardly ever annoys.

Arantor

There was a change to how the table create statement worked sometime around RC2 where previously, it didn't use to require the db_prefix being in the table name (because it would add by default) but now it requires the db_prefix to be explicitly specified in the table-create call.

snoopy_virtual

It is:


$smcFunc['db_create_table'](
'{db_prefix}log_httpBL',
array (
etc etc


It even has $db_prefix and $smcFunc declared globals at the top of the file just in case. (To be sure to be sure).

El verdadero sabio es aquel que lo ve todo, lo estudia todo, lo analiza todo y molesta poco.
A true wise man is he who sees everything, studies everything, analyses everything and hardly ever annoys.

Arantor

What you can try instead, as I know this has been contentious at times:

$smcFunc['db_create_table'](
$db_prefix . 'log_httpBL',
array (
etc etc

snoopy_virtual

In theory both things should be the same, but who knows ...

I will try both in a fresh RC4 forum and see what happens.

El verdadero sabio es aquel que lo ve todo, lo estudia todo, lo analiza todo y molesta poco.
A true wise man is he who sees everything, studies everything, analyses everything and hardly ever annoys.

Advertisement: