-
UID:17777
-
- 注册时间2007-05-02
- 最后登录2025-05-02
- 在线时间18636小时
-
- 发帖786303
- 搜Ta的帖子
- 精华0
- 飞翔币211574
- 威望215717
- 飞扬币2615136
- 信誉值8
-
访问TA的空间加好友用道具
- 发帖
- 786303
- 飞翔币
- 211574
- 威望
- 215717
- 飞扬币
- 2615136
- 信誉值
- 8
|
[font=-apple-system, BlinkMacSystemFont, "]使用explorer ftp没发现木马文件,asp文件管理器能看得到news.php [font=-apple-system, BlinkMacSystemFont, "] [font=-apple-system, BlinkMacSystemFont, "][font=-apple-system, BlinkMacSystemFont, "]点进去就转跳到美国**媒体,点删除就报错主机管理台直接清空主机,同样报错 [font=-apple-system, BlinkMacSystemFont, "][font=-apple-system, BlinkMacSystemFont, "]因为不太会asp,所以改php。[font=-apple-system, BlinkMacSystemFont, "]网上搜索到简单模板,然后看PHP Filesystem 参考手册 [font=-apple-system, BlinkMacSystemFont, "][font=-apple-system, BlinkMacSystemFont, "]发现木马news.php的[font=-apple-system, BlinkMacSystemFont, "]所有者fileowner()不是特殊的,问题就简单多了只是单纯的权限问题。修改php增加修改文件权限 [font=-apple-system, BlinkMacSystemFont, "][font=-apple-system, BlinkMacSystemFont, "]先chmod 再删除[font=-apple-system, BlinkMacSystemFont, "]就把木马删除掉了[PHP] 纯文本查看 复制代码?[tr=none] 001 002 003 004 005 006 007 008 009 010 011 012 013 014 015 016 017 018 019 020 021 022 023 024 025 026 027 028 029 030 031 032 033 034 035 036 037 038 039 040 041 042 043 044 045 046 047 048 049 050 051 052 053 054 055 056 057 058 059 060 061 062 063 064 065 066 067 068 069 070 071 072 073 074 075 076 077 078 079 080 081 082 083 084 085 086 087 088 089 090 091 092 093 094 095 096 097 098 099 100 <html> <head> <title>文件管理</title> <meta charset='utf-8' /> </head> <body> <?php //定义要查看的目录 $dir=dirname(__FILE__); //先判断$_GET['a']是否已经传值 防止NOTICE错误 if(isset($_GET['a'])){ //选择判断要执行的操作 switch($_GET['a']){ case 'creat': //新建文件 $filename=$_POST["filename"]; $filename=rtrim($dir,"/")."/".$filename; //写入文件 写入一个空字符串 file_put_contents($filename,""); break; case 'del': //删除文件 unlink($_GET['filename']); break; case 'ch': //文件 chmod($_GET['filename'],0777); break; case 'update': //修改文件 file_put_contents($_POST['filename'],$_POST['content']); echo "修改成功"; header("refresh:1;url=index.php"); break; } } ?> <center> <h1>文件管理</h1> <form action='index.php?a=creat' method='post'> 文件:<input type='text' name='filename' /> <input type='submit' value='新建' /> </form> <table border='1' width='900' cellpadding='5' cellspacing='0'> <tr> <th>文件名</th> <th>类型</th> <th>大小</th> <th>创建时间</th> <th>所有者</th> <th>权限</th> <th>操作</th> </tr> <?php //遍历目录 $dd=opendir($dir); while(false !== ($f=readdir($dd))){ //过滤点 if($f == "." || $f == ".."){ continue; } //拼路径 $file=rtrim($dir,"/")."/".$f; //防止 中文乱码 $f2=iconv("gb2312","utf-8",$f); echo "<tr>"; echo "<td>{$f2}</td>"; echo "<td>".filetype($file)."</td>"; echo "<td>".filesize($file)."</td>"; echo "<td>".date("Y-m-d H:i:s", filectime($file))."</td>"; echo "<td>".fileowner($file)."</td>"; echo "<td>".substr(sprintf("%o",fileperms($file)),-4)."</td>"; echo "<td align='center'> <a href='index.php?a=edit&filename={$file}'>修改</a>| <a href='index.php?a=del&filename={$file}'>删除</a>| <a href='index.php?a=ch&filename={$file}'>chmod</a> </td>"; echo "</tr>"; } ?> </table> <?php if(isset($_GET['a']) && $_GET['a']=='edit'){ echo "<hr/>"; echo "<form action='index.php?a=update' method='post'>"; echo "文件名:<input type='text' name='filename' readonly value='{$_GET['filename']}' />"; echo "<br/><br/>"; echo "<textarea name='content' rows='5' cols='30'>".file_get_contents($_GET['filename'])."</textarea>"; echo "<br/><br/>"; echo "<input type='submit' value='保存修改' />"; echo "</form>"; } ?> </center> </body></html> [font=-apple-system, BlinkMacSystemFont, "]木马解决了,又继续愉快的小学生活
|