The section Filter Contents belongs to Linux Fundamentals module.
Download the VPN file from HTB Academy and run the following command in the same directory:
sudo openvpn academy-regular.ovpn # Make sure you have openvpn installed.
Open a terminal and use netstat to find the listening services on all interfaces:
netstat -tln | grep -v tcp6 | grep -v "127.0.0." | grep LISTEN | wc -l
-t → Show TCP connections only.-l → Show only listening ports (servers waiting for connections).-n → Show numeric IP addresses and port numbers (don't resolve names).To check the username, use the ps command:
ps aux | grep proftpd
The first word of the output is the username.
Use the curl command to get the code then filter it via tr and grep:
curl https://www.inlanefreight.com | tr " " "\n" | grep -Eo "https://www.inlanefreight.com[^\"']*" | sort -u | wc -l
curl https://www.inlanefreight.com: Fetches the raw HTML source code of the website.tr " " "\n": Splits strings by replacing spaces with newlines to ensure each URL/path sits on its own line.grep -Eo "https://www.inlanefreight.com[^\"']*": Isolates only strings that start with the target domain, extracting everything up to a closing quote.sort -u: Alphabetically sorts the lines and removes duplicates to retain only unique paths.wc -l: Counts the final number of total lines outputted.The
-Eflag forgrepused to tell that it is going to use Enhanced RegEx.