I’m practising some Proving Grounds labs and I’ve run into an issue where I cannot receive the directory listing of an FTP service, but I can successfully connect and authenticate to it. The error I get is 421 Service not available, remote server timed out. Connection closed.
This lab in particular is Stapler, but there have been others where this same issue has occurred. After looking up several writeups of the box, the FTP service should indeed respond to FTP commands and viewing/getting files is possible.
Another issue that I believe is related to this behaviour is the fact that I have not been able to establish a reverse shell in any of these labs, even going through the official writeups and following the steps meticulously.
I am connecting to the labs with my OpenVPN configuration, which enables me to interact with them. I can conduct nmap scans, upload files, enumerate webpages etc. But as soon as some sort of FTP or reverse shell connection is attempted I cannot progress.
What is odd is that I have never before run into this problem when connecting to TryHackMe or Hack The Box’s labs when connecting to their VPN’s, only OffSec’s Proving Ground labs.
I am using a Kali Linux VM on a Windows host. I have attempted the following:
- Changed my network connection from NAT to Bridged in my VMWare network settings
- Added the google DNS to my resolv.conf
- Killed all active VPN connections and redownloaded my configuration file
- Changed my tun0 interface MTU to 1200
- Opened up ports 20 and 21 of my firewall rules so that incoming connections shouldn’t be filtered (on Kali using ufw)
I am by no means a networking guru, but I believe the underlying issue is the VPN connection. When I do the labs from the in-browser instance, there is no issue at all and I can fully interact with FTP and receive reverse shells as expected using the exact same steps. It only plays up when I do the labs from my Kali connecting through the VPN.
Any help or guidance would be greatly appreciated!
It was a firewall issue. Enabling ports 20 and 21 was not enough for FTP to work. See other post here.
Simply disabling ufw resolved all my problems:
sudo ufw disable
This also opened up the port I was listening to for the reverse shell. I then reverted back to a NATted network connection to be slightly more secure.