Lame - HackTheBox
Info
Name: Lame
OS: Linux
Recon
Starting a port scan with nmap:
We can scan with nmap scripts for version and vulnerabilities associated with the ports mentioned above:
FTP - Port 21
We can log in with de anonymous user, but it is empty.
We see that the version of the FTP server is vulnerable (searchsploit). Using a python exploit and metasploit we have not been able to access.
Samba - Port 445
Searching in searchsploit we can see that samba is vulnerable to remote command execution. We are going to look for a Python script to exploit the vuln (according to searchsploit there was only for metasploit, so…) :
Next, we will see the script and we will change the payload with msfvenom with our IP address:
As we can see, it is not necessary to change anything else. We will have to install pysmb (pip install pysmb).
In the other hand, we should listen with netcat by 443 port (nc -lvp 443) that it returns a root shell. Searching for flags at this point is trivial.