锦通 发表于 2024-5-19 09:07:05

文件上传--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会无法调用到
 
文件上传一

修改后缀--失败

https://img2024.cnblogs.com/blog/1679696/202405/1679696-20240506200602298-1459832407.png
 巨细写,php3等等--没有显示错误,上传成功

https://img2024.cnblogs.com/blog/1679696/202405/1679696-20240506200736810-1227694034.png
 尝试访问图片--没有被剖析,下载到了当地
https://img2024.cnblogs.com/blog/1679696/202405/1679696-20240506200851541-1239848958.png
 尝试00截断--失败

https://img2024.cnblogs.com/blog/1679696/202405/1679696-20240506201155442-848299280.png
 使用.user.ini   使用auto_prepend_file="shell.png"

 
https://img2024.cnblogs.com/blog/1679696/202405/1679696-20240507110321273-2015806209.png
上传shell.png

https://img2024.cnblogs.com/blog/1679696/202405/1679696-20240507110439225-1890093504.png
 成功

https://img2024.cnblogs.com/blog/1679696/202405/1679696-20240507110535815-545775684.png
 
文件上传二:

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

https://img2024.cnblogs.com/blog/1679696/202405/1679696-20240507104731491-948131383.png
 上传.user.ini文件 使用 auto_append_file="1.txt"

https://img2024.cnblogs.com/blog/1679696/202405/1679696-20240507105040015-225654976.png
 上传1.txt  

 
https://img2024.cnblogs.com/blog/1679696/202405/1679696-20240507105142612-617062973.png
上传失败疑似是过滤php,使用简写

https://img2024.cnblogs.com/blog/1679696/202405/1679696-20240507105230046-2028131561.png
 成功

 
https://img2024.cnblogs.com/blog/1679696/202405/1679696-20240507105421292-1288762522.png
 

免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。
页: [1]
查看完整版本: 文件上传--php user.ini详解