这个太糟糕了,我typora截图好多,不知道有没有放乱掉
如果你目录下有user.ini会先去识别里面的配置,但是只有 PHP_INI_PERDIR 和 PHP_INI_USER 模式可以
找到这两个auto_append_file和auto_prepend_file,作用: 一个相当于在每个php文件尾加上 include(“xxxx”) 一个相当于文件头加上 include(“xxx”) 其中xxx就是 auto_append_file的值。
因为.user.ini只对他同一目录下的文件起作用,也就是说,只有他同目录下有php文件才可以。
[ctfshhow]web153
利用user.ini auto_append_file
如果上传png可以显示路径 
访问/upload/
php文件不行(这里我也试了php7,php5,phtml之类后缀,没有过滤,但是服务器无法解析) 
ps unicode编码 

首先上传一个带木马的图片,接着上传.user.ini内容为 auto_append_file=“xxx” xxx为我们上传的文件名。 这样就在每个php文件上包含了我们的木马文件。
开始传var/www/html/upload/1.png在/upload/显示没有找到文件,估计是路径猜错了 
发现可以直接写文件名 
user.ini内容为:auto_prepend_file=12.jpg //在页面顶部加载文件,所以这里的user.ini用于让index.php解析文件
注意事项:user.ini文件一段时间后生效(5分钟左右)
|