【发布时间】:2015-12-04 08:01:50
【问题描述】:
我阅读了相关的post,我得到的印象是php 中的system() 函数不使用shell。但是后来看到owasp上发布了以下示例-页面上的示例6:
以下 PHP 代码 sn-p 易受命令注入攻击:
<?php
print("Please specify the name of the file to delete");
print("<p>");
$file=$_GET['filename'];
system("rm $file");
?>
以下请求和响应是成功攻击的示例: 请求
http://127.0.0.1/delete.php?filename=bob.txt;id
回应
Please specify the name of the file to delete
uid=33(www-data) gid=33(www-data) groups=33(www-data)
如果没有shell,为什么系统会被分号或php中的system()函数实现以这种方式识别分号?
【问题讨论】:
标签: php