Lame
https://app.hackthebox.com/machines/1
Difficulty: EASY
Reconnaissance
Nmap
vsftp Recon
Starting out by making some recon on the ftp server with the version 2.3.4 we see in searchsploit that there is an exploit that get us access to the system.
I will let this for later.
Samba 3.0 Recon
Using smbmap to see if using no credentials, we can see something.
In effect we see that there is a directory called tmp.
There are some directories to get in, but there is nothing special so, I'll use searchsploit to see if there is an exploit for samba 3.0.
Here we found an exploit for it, let's see what's inside.
Analyzing the script, we see that once you connect to the samba service, in the username credentials we inject the payload using '`' following by the reverse shell that we want and closing with it too.
We need to use ntlmv1 too as the script is doing.
Distccd checker
Using nmap and their checker scripts, we can check if the service 3632(Distccd) is vulnerable, in fact is it.
Exploitation
vsFTP
The vsftp service in this machine is not vulnerable, the reason is because the version that is using is a version from 2011 and over.
SAMBA 139/tcp + 445/tcp
So, knowing all the information to make the exploit, I create a simple script in python3 to exploit this.
Before to run the script you need to change some things to the script and been listening with a netcat session.
As you can see, we get access, and we rooted the machine by exploiting the samba 3.0 service.
You can exploit this using this one liner by using smbclient, more easy.
Distccd - 3632
To exploit distccd service I'll use an exploit from github.
Download the script and executed as in the following image.
Now I want to upgrade my shell so I will send a bash with netcat to the port 4444.
Now start upgrading your tty using the following commands:
Privesc (Distccd)
Once done that, start enumerating possible ways to exploit manually the linux system.
We're seeing here that the nmap binary is running as suid, to expoloit this type;
In result you will get a shell as the root user.
Last updated