5
J_Dream | PHP文件上传-流量层面WAF绕过
source link: https://blog.51cto.com/JDream/5445370
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
J_Dream | PHP文件上传-流量层面WAF绕过
今天刷某论坛发现挺新奇的东西(流量层面WAF绕过)但是因为配置环境一点难弄,我就简单写几句php代码,复现一下文件上传绕过原理!!!
简陋环境介绍
一共2页面upload.html
、up.php
,工具利用了burp
<!--上面图片upload.html-->
<html><head><meta charset="utf-8"><title>upload</title></head>
<body>
<p>upload_file -> txt</p>
<form method="post" action="up.php" enctype="multipart/form-data">
<label for="file">upload_file:</label><input type="file" name="upfile" value=""><br>
<input type="submit" name="submit" value="submit">
</form>
</body></html> <!-- 就是简陋的上传页面 -->
<?php
//up.php接收upload.html的数据打印出来,不进行保存文件
var_dump($_POST);
?>
绕过waf小技巧还原
\
跟/
加入文件名里面
可以进行截断,从而绕过流量waf。- 例如
test.txt\test.php
经过php处理后截断成test.php
- 这个跟上面差不多,后向就是在文件
后面
加入00
截断 - 类似
test.php(00)aaa
的文件名经php处理过后会变成test.php
- 绕过步骤 打开
Request包
的Hex页
面找到test.phpaaa
在test.php
后面插入一个16进制的00
文件名末尾
只加入\
字符会被忽略掉
- 看图吧
文件中;
可以影响文件名解析的结果
- 但是记得要把
""
去到,不然解析失败哒!
双写filename
来绕过
- 也就是写多一个
filename=xxx;filename=xxx
好啦,就介绍到这里啦!
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK