File: /home/srv52894/test/scan.php
<?php
//srv52894.ht-test.ru/scan.php
//srv52894.ht-test.ru/t.php
define( 'ROOT', dirname(__FILE__));
ini_set('log_errors', 1);
ini_set('error_log', ROOT . '/logs/php-error.log');
set_time_limit(3600);
header('Content-Type: text/plain; charset=UTF-8');
$files = glob("/home/srv52894/htdocs/*/wp-config.php");
foreach ($files as $k => $file){
$txt = file_get_contents($file);
$pattern1 = "/define\('DB_USER', '(.*)'\)/";
$pattern2 = "/define\('DB_PASSWORD', '(.*)'\)/";
$pass = preg_match($pattern2, $txt, $m) ;
$u = preg_match($pattern1, $txt, $n);
if($n[1] === 'srv52894_user' && $m[1]==='Dsz@1w67954#'){
echo $k ."\t". $file ."\t". $m[1] . "\n";
$txt = str_replace('1faromir63', 'Dsz@1w67954#', $txt);
//file_put_contents($file, $txt);
}
}