PHP用于文件管理的函数,如果输入变量可由用户提交,程序中也没有做数据验证,可能成为
高危漏洞
eg:
1。unlink(删除文件漏洞)
如以下代码
<?php $file=$_GET[‘file’] If(is_file($file)) { Unlink($file); } ?>
如果file参数可被控制则会导致被任意删除文件
2.file_get_content用来获取php原文件
查看源代码才能获取的到
3.readfile
echo readfile()
4.file_put_contents($file,$txt),可以通过这个函数写入一句话
如访问以下url
http://localhost/1.php?file=test.php&txt=<?php phpinfo()?>
test.php将会有函数phpinfo()
5.fwrite()函数将内容写入一个打开的文件夹中
可以配合fopen函数一起使用
http://localhost/1.php?file=4.php
6.copy函数
copy函数将文件从source拷贝destination.如果成功则返回TRUE,否则返回FALSE,如果目标文件已存在,将会被覆盖
<?php
copy(\'1.txt\',\'2.txt\');
?>
同目录下拷贝