Oracle WebLogic Server Java Deserialization Remote Code Execution Vulnerability (CVE-2018-2628) Bypass

Oracle patched a critical Java RMI Deserialization vulnerability in WebLogic server earlier this month (CPU April 2018). It was assigned CVE-2018-2628.

However,  as @pyn3rd tweeted this morning, it turns out that it was a blacklist based incomplete fix that could be bypassed easily.

7.JPG

As you can see from above screenshot, Oracle used a blacklist approach to block java.rmi.registry.Registry and it was possible to bypass this patch easily using java.rmi.activation.Activator.

Let’s try to exploit a WebLogic server that is already patched for CVE-2018-2628/CPU-April-2018 using ysoserial and an existing exploit for CVE-2018-2628.

WebLogicServerJavaDeserBypass
a quick GIF
2
Patched WebLogic Server
1
Patched WebLogic Server

As you can see the target WebLogic server has patches from Oracle Critical Patch Update for April 2018. Let’s fire up a JRMP Listener using a different payload Jdk7u21 instead of CommonsCollections1:

3

Let’s run the exploit using JRMPClient2 as that uses java.rmi.activation.Activator:

4

And we have an incoming connection from WebLogic Server on our attacking machine’s JRMPListenere over port 1099:

5

and that spawns Calc.exe on the target WebLogic Server!

7

 

Leave a comment