Back to HTBHack The Box
Write-up

😾Meow

File Transfer Protocol Port 21

🐱 HTB Meow β€” Solution Notes

Platform: Hack The Box β€” Starting Point (Tier 0) Machine: Meow OS: Linux Difficulty: Very Easy Vulnerability Type: Misconfiguration β€” FTP Anonymous Login (Unauthenticated Access)


πŸ—ΊοΈ Attack Chain

Ping β†’ Nmap β†’ FTP (Port 21) discovery β†’ Anonymous Login β†’ ls β†’ get flag.txt β†’ cat flag.txt


🧠 How Does a Hacker Think? β€” Before You Begin

Before starting any machine, the first question should be: "Is the target up and is my connection working?"

1️⃣ Reconnaissance

Verifying the Target is Alive

πŸ’‘ What is ping?

bash

ping <TARGET_IP>

If you get replies, proceed.

Port Scanning

πŸ’‘ nmap Parameters

bash

nmap -sV -sC -O <TARGET_IP>

Findings:

nmap with -sC may detect anonymous FTP login automatically. If you see a line like Anonymous FTP login allowed in the output β†’ try connecting directly.

🧠 How Does a Hacker Think? β€” First Look at FTP

You found the FTP port. Now ask yourself these questions:

2️⃣ Exploitation β€” FTP Anonymous Login

πŸ’‘ What is FTP (File Transfer Protocol)?

Step 1: Establish Connection

bash

ftp <TARGET_IP>

Step 2: Anonymous Login

bash

Name: anonymous Password: (leave blank, just press Enter)

If you see 230 Login successful, the anonymous login worked.

Step 3: List Files

bash

ftp> ls

Example output:

Step 4: Download the Flag

πŸ’‘ Why is the get Command Necessary?

bash

ftp> get flag.txt ftp> exit


3️⃣ Reading the Flag

bash

cat flag.txt


🧠 How Does a Hacker Think? β€” Why Did This Vulnerability Exist?

The FTP Anonymous Login vulnerability almost always stems from one of these scenarios:

4️⃣ Remediation

bash

# The following settings should be applied in vsftpd.conf: # 1. Disable anonymous login anonymous_enable=NO # 2. Restrict local users to their home directories chroot_local_user=YES # 3. Use encrypted SFTP instead of FTP (via SSH) # OpenSSH is sufficient for SFTP β€” no separate installation needed


πŸ“š Concepts Learned


πŸ”‘ General Hacker Mindset Summary

  1. Ping first, then nmap: Is the target up? Is VPN working? Verify before anything else.
  2. Run nmap with sC: Automatically detects vulnerabilities like anonymous FTP and default credentials.
  3. Always try anonymous login on FTP: anonymous / blank password is the most common misconfiguration.
  4. Don't use cat in FTP, use get: Download the file first, then read it in your local terminal.
  5. Nothing set up as "temporary" ever stays temporary: The biggest security holes come from "this will do for now" decisions.