News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

httpBL

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

Previous topic - Next topic

snoopy_virtual

Quote from: Wizzlefits on September 07, 2010, 01:16:59 AM
@Vandaahl
Just for grins & giggles...
Put the following just below <?php
in your warning.php

  error_reporting(E_ALL);


etc...

Wizzlefits is right. That's one of the first things I want to do as soon as Vandaahl contact me, so we can have an idea about where is the error. Anyway, I would like to look first (using phpinfo) inside the server properties to see what else (apart from the error_reporting) has been turn off in that server and how is everything in there.

The possibilities are too many (for example the state of the globals can also affect the mod, as you are going to understand if you continue reading) and that's why I suggested it was better if we look at them together while talking through Skype.

Even better. We can make an appointment. Look for a day and time suitable for the 3 of us (I mean Vandaahl, Wizzlefits and myself) and connect to Skype the 3 of us at the same time to look at it.

As they say, 6 eyes see more than 2.

And of course, anybody else interested in this problem will be welcome. As far as I know there is no limit on how many people can join a multi-conference in Skype.

Quote from: Wizzlefits on September 07, 2010, 01:16:59 AM
@Snoopy
warning.php gives me this error... 2 different sites, totally different mods.
Undefined index:  response in /warning.php on line 128
Which is..
$response = $_SESSION['response'];
Remark it out... no errors... but......?

shaitanfr already asked that here:

http://www.simplemachines.org/community/index.php?topic=366399.msg2690621#msg2690621

I gave him a quick answer then:

http://www.simplemachines.org/community/index.php?topic=366399.msg2692346#msg2692346

But I can explain it a little more:

When you are NOT just "visiting" the warning page (to check the design or something like that) but you have been re-directed to the warning page by the mod itself, the process your IP follows is this one:

First of all the mod try to find your IP and it sends it to PHP (Project Honey Pot) to see if there is any information in there, using the function httpBL_dnslookup().

All the "response" from PHP is then stored in an array called $response.

If there is no information in the DB about that IP, $response has only one value: The boolean value "FALSE", but if there is any information there, $response is a big array with a lot of values in it.

Next the mod checks some of the values of $response. If it is FALSE or if the threat level is too low, etc, the mod just doesn't do anything else and SMF continue loading as always.

But if the mod decide your IP is a bad one and re-directs you to the warning page, the first thing it does is to stop loading SMF and start a brand new script, so all the variables SMF had created until that point are lost.

But we don't want to loose all the values in $response, so before re-directing you anywhere, the mod store all those values inside the server using one of the GLOBAL variables available there. In this case inside $_SESSION['response'].

Then, as soon as you are already inside the warning page, the script need to read the values inside the global $_SESSION to restore the array $response and use it.

Maybe now you can understand better what I told shaitanfr here:

Quote from: snoopy_virtual on July 06, 2010, 09:42:58 AM
...

The warning.php page is supposed to work when somebody have a bad IP and is redirected here through the mod.

When that happen they already have a "response" inside their "$_SESSION", so there are no errors. (Shouldn't be at least)

You are getting the errors because you are going to the page warning.php directly to see how it looks like, without passing first through the mod, so you haven't got a "response" inside your "$_SESSION".

The way you are modifying the page warning.php you are not going to have any errors when you visit it to see how it looks like, but (if you are not careful) maybe it's not going to work properly when a spammer arrives to it.

I will sort this in the next version so you never get an error visiting the page warning.php in any case. Either when you are redirected there automatically or when you are just viewing the page to see how it looks like.

In the mean time I think it would be better if you leave the page the way it was and just ignore any errors you may get when you just visit it.

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.

Vandaahl

Quote from: snoopy_virtual on September 07, 2010, 06:38:23 AM
Quote from: Wizzlefits on September 07, 2010, 01:16:59 AM
@Vandaahl
Just for grins & giggles...
Put the following just below <?php
in your warning.php

  error_reporting(E_ALL);


etc...

Wizzlefits is right. That's one of the first things I want to do as soon as Vandaahl contact me, so we can have an idea about where is the error. Anyway, I would like to look first (using phpinfo) inside the server properties to see what else (apart from the error_reporting) has been turn off in that server and how is everything in there.

The possibilities are too many (for example the state of the globals can also affect the mod, as you are going to understand if you continue reading) and that's why I suggested it was better if we look at them together while talking through Skype.

Even better. We can make an appointment. Look for a day and time suitable for the 3 of us (I mean Vandaahl, Wizzlefits and myself) and connect to Skype the 3 of us at the same time to look at it.

As they say, 6 eyes see more than 2.

And of course, anybody else interested in this problem will be welcome. As far as I know there is no limit on how many people can join a multi-conference in Skype.

I think it is really cool that you offer support like this! Do you have a MSN account? I would prefer that over Skype.

Regarding my warning.php issue: I'm pretty sure it must be a mod conflict, because I have a copy of my site running locally and it does not work there either. But it HAS worked locally, because I remember testing warning.php and it worked fine. But now it doesn't.

snoopy_virtual

Quote from: Vandaahl on September 07, 2010, 06:33:13 AM
snoopy_virtual, I sent you a personal message btw.

Message answered.  ;)

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.

snoopy_virtual

Problem half sorted.

We have been (Vandaahl and me) checking his site and we have found the problem was inside his SSI.php file, more or less around line 150:


// Load the current or SSI theme. (just use $ssi_theme = id_theme;)
loadTheme(isset($ssi_theme) ? (int) $ssi_theme : 0);


After adding a lot of "echo" statements and deleting some lines to see what happen, we discovered that as soon as we arrived to that line the page crashed and stopped.

It means any of the mods Vandaahl has in his site has modified the function loadTheme somehow.

We haven't found what mod can be doing this, but as we don't need any SMF theme for the warning page we have changed those lines for these ones:


// Load the current or SSI theme. (just use $ssi_theme = id_theme;)
// Only if we are not coming from the httpBL_warning page
if (!$httpBL_warning) {
    loadTheme(isset($ssi_theme) ? (int) $ssi_theme : 0);
}


And now his warning page works as expected.

Still I would like to know what mod is causing this, to find a more permanent solution and make this mod also compatible with the one causing the problem, but the function loadTheme(), defined inside the file /Sources/Load.php has more than 400 lines, so it would take too long to compare the original one with the modified one to find why it's crashing.

Any ideas?

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.

Vandaahl

I will start checking which MOD it could be when I have some extra time. I think I can narrow the list of mods down to maybe 2 or 3, because that's how many mods I installed AFTER I installed httpBL (which was working correctly up to that point). I will report back here soon.

Vandaahl

I made a Dutch translation of Warning.php:

/*******************
*  Set 2 - Dutch *
*******************/
$txt['httpBL_warn_title_2'] = 'Waarschuwing';
$txt['httpBL_warn_head_2'] = '<span class="red">WAARSCHUWING!</span><br />Je computer is mogelijk betrokken bij schadelijk online gedrag.';
$txt['httpBL_warn_infected_2'] = 'Dit komt waarschijnlijk doordat je computer, of een andere computer binnen je lokale netwerk, <b>besmet is met een virus, trojan of worm</b>. Besmette computers worden door criminelen gebruikt, zonder dat hun eigenaar daar erg in heeft, om spam mee te verzenden en websites zoals deze aan te vallen.';
$txt['httpBL_warn_dinamic_IP_2'] = 'Als je gebruik maakt van een dynamisch IP adres (het type dat iedere keer verandert zodra je je computer opnieuw opstart) is het probleem mogelijk dat je een IP gebruikt dat eerder werd toegeschreven aan een besmette computer. Daarom kun je proberen je computer te herstarten en deze website opnieuw te openen om te kijken of je hem nu wel normaal kunt benaderen.';
$txt['httpBL_warn_technician_1_2'] = 'Om te testen of je computer besmet is met een virus en om deze te verwijderen, raden we je aan om zo snel mogelijk een computer technicus te contacteren en hem te vragen om <b>www.projecthoneypot.org</b> te bezoeken en daar je IP adres te controleren:';
$txt['httpBL_warn_technician_2_2'] = 'om te zien zien wat er fout ging.';
$txt['httpBL_warn_info_2'] = 'Voor meer informatie, neem contact op met:';
$txt['httpBL_warn_at_2'] = 'at';
$txt['httpBL_warn_dot_2'] = 'punt';
$txt['httpBL_warn_hurry_2'] = 'Als je nu geen tijd hebt om je computer of IP adres te controleren, of je vermoedt een vals alarm, dan kun je onze website tijdelijk bereiken. We stellen hieronder 2 vragen die spam robots niet kunnen beantwoorden, maar echte bezoekers wel. Vul aub alleen de eerste vraag in om te bewijzen dat je geen robot bent en druk op de <b>"Verstuur"</b> knop:';
$txt['httpBL_warn_send_2'] = 'Verstuur';
$txt['httpBL_warn_blank_2'] = 'Laat dit veld leeg.<br />Typ het antwoord in het bovenstaande invoerveld.';
$txt['httpBL_warn_wrong_answer_2'] = 'Misschien hebben we het verkeerd uitgelegd of het je op de verkeerde knop gedrukt. Hier zie je twee verschillende rijen. In de eerste rij zie je een eenvoudige rekensom, een leeg veld en een "Verstuur" knop. In dat eerste lege veld moet je het antwoord (cijfer) invullen en op de knop klikken. Het veld op de tweede rij moet je leeg laten.';
$txt['httpBL_warn_good_answer_2'] = 'Je antwoord was correct, maar let wel dat een robot, zelfs als hij de vraag niet begrijpt, het juiste antwoord zou kunnen invullen door willekeurige cijfers te proberen. Natuurlijk is het vrijwel onmogelijk om het juiste antwoord 2 keer achter elkaar te raden, dus, als je het niet erg vindt, beantwoordt aub deze laatste vraag en druk nogmaals op de <b>"Verstuur"</b> knop:';

Propbndr

OK, a simple question (I hope).  How do you tell if httpbl is enabled?  There is a check box in the httpbl admin panel that says enable/disable.  Currently it is empty.  I have filled in the other information but did nothing with the check box in fear of disabling the mod.

Vandaahl

Quote from: Propbndr on September 08, 2010, 06:40:12 AM
OK, a simple question (I hope).  How do you tell if httpbl is enabled?  There is a check box in the httpbl admin panel that says enable/disable.  Currently it is empty.  I have filled in the other information but did nothing with the check box in fear of disabling the mod.

You check the checkbox to enable the mod. Is that really hard to understand?

snoopy_virtual

Quote from: Vandaahl on September 08, 2010, 07:21:25 AM
Quote from: Propbndr on September 08, 2010, 06:40:12 AM
OK, a simple question (I hope).  How do you tell if httpbl is enabled?  There is a check box in the httpbl admin panel that says enable/disable.  Currently it is empty.  I have filled in the other information but did nothing with the check box in fear of disabling the mod.

You check the checkbox to enable the mod. Is that really hard to understand?

Yes, with the checkbox checked the mod is ON. With the checkbox unchecked the mod is OFF.

Anyway I suppose Propbndr was not asking something so obvious. His question actually is "How do you tell if httpbl is enabled?"

The problem here is you don't see any difference at all in your forum with the mod enable or disable, so it's not easy to tell if the mod is working properly or not.

Of course there are differences, so you can find out if the mod is working.

There are some ways to check if the mod is working, but the easiest way is to enable the mod, wait a couple of hours and then check the mod's log.

Depending on the traffic your site has and a few other things, the mod stop at least one spammer every hour or every couple of hours.

Of course that's not a fix rule. In some of my forums, some days I see the mod has stopped only 5 spammers, and other days has stopped a hundred, but I haven't seen yet a forum where the mod didn't stop a spammer after 24 hours working.

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.

snoopy_virtual

Quote from: Vandaahl on September 07, 2010, 01:38:22 PM
I made a Dutch translation of Warning.php:

Thanks a lot mate.

Now the mod has already been translated to a few different languages, so I will start a "language pack" as soon as I can so anybody interested can find them all in one place.

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.

Propbndr

You are right Snoopy, I was asking how you could tell if it was enabled.  Some mods enable themselves when they are loaded.  Others, like this one, require action by the admin.

Thanks, Snoopy. 

Vandaahl

I am having an issue with httpBL.template.php. When I view the httpBL Spammers log, and I go to page 2 for example, then the upper part of the admin area disappears, because the page index URL's are not correct. The URL should be index.php?action=admin;area=httpBL;sa=viewlog;sort=date;desc;start=30, but in my case it is index.php?action=httpBL;area=httpBL;sa=viewlog;sort=date;desc;start=30 (I highlighted the wrong part).

It seems like $context['page_index'] is not properly set, is that correct?

snoopy_virtual

Quote from: Vandaahl on September 13, 2010, 08:46:51 AM
I am having an issue with httpBL.template.php. When I view the httpBL Spammers log, and I go to page 2 for example, then the upper part of the admin area disappears, because the page index URL's are not correct. The URL should be index.php?action=admin;area=httpBL;sa=viewlog;sort=date;desc;start=30, but in my case it is index.php?action=httpBL;area=httpBL;sa=viewlog;sort=date;desc;start=30 (I highlighted the wrong part).

It seems like $context['page_index'] is not properly set, is that correct?

The correct link should be:

action=httpBL;sa=viewlog;sort=date;desc;start=30

whithout any area=whatever

The mod httpBL has its own action defined (independent of the rest of actions you can do with SMF) and inside the mod there are only a few sub-actions (sa) defined (config, viewlog, etc) but no areas at all.

If you have anything different there is something wrong somewhere, but I cannot imaging where.

If the problem persists contact me through Skype and we check it out.

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.

Vandaahl

Quote from: snoopy_virtual on September 13, 2010, 09:16:57 AM
The correct link should be:

action=httpBL;sa=viewlog;sort=date;desc;start=30

Oh really? Hmm... The reason I thought action=admin should be there, is because without action=admin a few missing index errors show up in my log when I browse the httpBL spam log.

I will go through the installation files to see if anything went wrong there.

Wizzlefits

Snoopy
SMF 1.1.11 uses...
action=httpBL;sa=yada yada

SMF 2.0 RC3 uses...
action=admin;area=httpBL;sa=yada yada

Vandaahl is using 2.0 RC3  ;)

Wizzlefits

#295
Vandaahl,
Ya know, it looks like "maybe" when the mod installed, something went haywire and it installed the 1.1.11 version. Although I don't think 1.1.11 would even work on 2.0 RC3. But what do I know! lol!

Just tried the URL from 1.1.11 in 2.0 RC3 and it WORKED!
Well, it has the same problem as your having, missing part of the admin page.
Sooooo.....
Make sure that you have /Sources/httpBL_2_Config.php
and not /Sources/httpBL_Config.php


That was a dumb idea! ::)
Unless.... :-X

Vandaahl

Quote from: Wizzlefits on September 13, 2010, 09:03:43 PM
Vandaahl,
Ya know, it looks like "maybe" when the mod installed, something went haywire and it installed the 1.1.11 version. Although I don't think 1.1.11 would even work on 2.0 RC3. But what do I know! lol!

Just tried the URL from 1.1.11 in 2.0 RC3 and it WORKED!
Well, it has the same problem as your having, missing part of the admin page.
Sooooo.....
Make sure that you have /Sources/httpBL_2_Config.php
and not /Sources/httpBL_Config.php


That was a dumb idea! ::)
Unless.... :-X

Hi Wizzlefits, thank you for thinking along here! Yes, I forgot to mention I am using SMF 2, sorry about that. I checked the installation files, and it looks like it installed the correct version of httpBL, including httpBL_2_Config.php.

snoopy_virtual

Sorry. I thought Vandaahl was using SMF 1.1.11, so yesterday I only checked that part.

I have just checked it on my SMF 2.0 RC3 forum and I have the same problem, so it means there is a bug in that part of the mod.

I will sort that as soon as I can.

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.

snoopy_virtual

OK, I have sorted it.

I will include this in the next version I'm doing. In the mean time, any of you with SMF 2.0 (RC2 or RC3) download the file attached httpBL_2_Config.zip, unzip it to extract the file httpBL_2_Config.php and put it inside your Sources folder instead of the one you must have there.

That will sort the bug Vandaahl was talking about.

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.

Wizzlefits

Quote from: snoopy_virtual on September 14, 2010, 09:57:52 AM
OK, I have sorted it.

I will include this in the next version I'm doing. In the mean time, any of you with SMF 2.0 (RC2 or RC3) download the file attached httpBL_2_Config.zip, unzip it to extract the file httpBL_2_Config.php and put it inside your Sources folder instead of the one you must have there.

That will sort the bug Vandaahl was talking about.
Dangit Snoopy!
You sorted it to fast! 8)
I was just 8 minutes to slow.  :P

array httpBL_ViewLog()
- show a list of logged access attempts by spammers and internal errors from MOD httpBL.
- is accessed by ?action=admin;area=httpBL;sa=viewlog.
              -  ?action=admin;area=httpBL;sa=viewlogpass.
              -  ?action=admin;area=httpBL;sa=viewlogerror.


Should have waited to get more coffee! LOL!

Advertisement: