Getting server information http://moodle.schooled.htb/moodle/ ...
server : Apache/2.4.46 (FreeBSD) PHP/7.4.15
x-powered-by : PHP/7.4.15
x-frame-options : sameorigin
last-modified : Wed, 07 Apr 2021 21:33:41 GMT
Getting moodle version...
Version found via /admin/tool/lp/tests/behat/course_competencies.feature : Moodle v3.9.0-beta
Searching vulnerabilities...
Vulnerabilities found: 0
Scan completed.
```
### CMSMap
```bash
pip3 install cmsmap
cmsmap http://moodle.example.com/<moodle_path>
```
### CVEs
I found that the automatic tools are pretty **useless finding vulnerabilities affecting the moodle version**. You can **check** for them in [**https://snyk.io/vuln/composer:moodle%2Fmoodle**](https://snyk.io/vuln/composer:moodle%2Fmoodle)\*\*\*\*
## **RCE**
You need to have **manager** role and you **can install plugins** inside the **"Site administration"** tab**:**
![](../../.gitbook/assets/image%20%28448%29.png)
If you are manager you may still need to **activate this option**. You can see how ins the moodle privilege escalation PoC: [https://github.com/HoangKien1020/CVE-2020-14321](https://github.com/HoangKien1020/CVE-2020-14321).
Then, you can **install the following plugin** that contains the classic pentest-monkey php r**ev shell** \(_before uploading it you need to decompress it, change the IP and port of the revshell and crompress it again_\)
Or you could use the plugin from [https://github.com/HoangKien1020/Moodle\_RCE](https://github.com/HoangKien1020/Moodle_RCE) to get a regular PHP shell with the "cmd" parameter.
To access launch the malicious plugin you need to access to: