shengqi158/fastjson-remote-code-execute-poc: fastjson remote code execute poc 直接用intellij IDEA打开即可 首先编译得到Test.class,然后运行Poc.java
2019-07-01 16:10:46 Author: github.com(查看原文) 阅读量:211 收藏

Join GitHub today

GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.

Sign up

fastjson remote code execute poc 直接用intellij IDEA打开即可 首先编译得到Test.class,然后运行Poc.java

支持jdk1.7,1.8 该poc只能运行在fastjson-1.2.22到fastjson-1.2.24版本区间,因为fastjson从1.2.22版本才开始引入SupportNonPublicField

详情分析:http://xxlegend.com/2017/04/29/title-%20fastjson%20%E8%BF%9C%E7%A8%8B%E5%8F%8D%E5%BA%8F%E5%88%97%E5%8C%96poc%E7%9A%84%E6%9E%84%E9%80%A0%E5%92%8C%E5%88%86%E6%9E%90/ 基于JdbcRowSetImpl的Fastjson RCE PoC构造与分析:http://xxlegend.com/2017/12/06/%E5%9F%BA%E4%BA%8EJdbcRowSetImpl%E7%9A%84Fastjson%20RCE%20PoC%E6%9E%84%E9%80%A0%E4%B8%8E%E5%88%86%E6%9E%90/ 其他参考:http://xxlegend.com/2017/11/23/Java%20JSON%E5%8F%8D%E5%BA%8F%E5%88%97%E5%8C%96%E4%B9%8B%E6%AE%87-%E7%9C%8B%E9%9B%AA%E5%AE%89%E5%85%A8%E5%BC%80%E5%8F%91%E8%80%85%E5%B3%B0%E4%BC%9A/

基于JNDI的poc,JdbcRowSetImplPoc.java

1,在远程服务器上运行server中的JNDIServer或者LdapServer 2,将Exploit.class放到上述服务指定的位置,一般都是web服务目录下 3,执行JdbcRowSetImplPoc.java

注意事项:

启动JNDIServer或者LdapServer的时候 factoryLocation 一定得是ip后带斜杠,这个斜杠少不得,少了的话到web服务器的请求就变成了GET / 而不是正常的GET /Exploit.class,正常的示例如下: 224.206.180.18 - - [07/Dec/2017:02:11:15 -0500] "GET /Exploit.class HTTP/1.1" 200 860 "-" "Java/1.8.0_102"


文章来源: https://github.com/shengqi158/fastjson-remote-code-execute-poc
如有侵权请联系:admin#unsafe.sh