In-My-Opinion.org

»Hacking attempt?«







I don't know what I did, but when I try to change a setting in the configuration of the ACP (example I want to disable the board) when I click on submit it says "hacking attempt" and wont disable the board?

Any ideas?

posted by Sippenhaft
  

in-my-opinion.org -> Technology, Computers, Science, Internet -> Software by the admin -> hacking attempt?

Found Error



Quote:
Sometimes a hacker may try to alter variables of PHP, for example by calling "viewtopic.php?GLOBALS[...]".
Sometimes a hacker tries to cause errors by sending data that is very long (e.g. a username that is 10 megabyte characters long).
These are clear hacking attempts and we can filter them out by the following code:• Open "common.php"
• Find if ( !defined('IN_PHPBB') )

{
    die(
'Hacking attempt');




Insert thereafter:
foreach ($_REQUEST as $varname => $value)
{
if (
(preg_match('#^(globals|_|http_|php_|argv|knnvalues|argc|gateway_|server_|request_|query_|document_|remote_|script_|path_|auth_)#i',$varname)) // If someone tries to do some hacking tricks
|| (strlen($value) >= 1*1024*1024) // If posting is too long (> 1 MB)
)
{
die('Hacking attempt');
}
}


What does this code do? It finds out whether someone tries to influence global variables like $GLOBALS or $HTTP_POST_VARS and if so, then it stops.

I have not tested it out completely with all functions of phpbb and all mods, but since it works on my heavy modded site it should work on yours too

I ran into a problem with this, when you go to try and change ANY settings in the ACP it gives you an error of "HACKING ATTEMPT" and wont change the setting. (my board is HEAVY with MODS)


Steve


posted by Sippenhaft
  Rebellion is the only way to reform!



Oh man, I wonder which hack was so badly programmed. As you can guess my forum (in-my-opinion.org) is also full of mods. But none causes this error.

Some mod of yours wants to set a global variable by setting it via a $_POST or $_GET. Now this is REALLY BAD manners.

posted by knn
  



when you say its bad manners is it leaving me open for something? or are you just saying the coder did a shoddy job.

Where should I look for this "bad" code and Ill tell you what MOD it is. I have a good idea which MOD it is but don't want to say (yet).

posted by Sippenhaft
  

hmmm still not working



I have added this to a FRESH CLEAN INSTALL of 2.0.19 and again when I try to change a value in the ACP I get the HACKING ATTEMPT message and the value WONT change... Not again

Maybe 2.0.19 has something similar buried in there...?

(I also cant see the VISUAL CONFIRMATION on the fresh clean install of 2.0.19...but that's another thread I learned something new, I guess )

posted by Sippenhaft
  





Reply to topic






RegisterRegister
Log inLog in
The time now is 8 January 2009, 00:00
php B.B.