02. FTP Anonymous Login
1. Scanning for FTP Service Version using Nmap¶
Command:
Explanation:
nmap: Runs the Nmap network scanner.<IP Address>: Target system's IP address.-p 21: Scans only port 21 (FTP service port).-sV: Enables service version detection to determine the FTP software and version running.
Example:
Output (example):
2. Checking for Anonymous FTP Login using Nmap¶
Command:
Explanation:
--script ftp-anon: Uses the Nmap script to check if anonymous login is allowed.
Example:
Output (if anonymous login is allowed):
3. Anonymous FTP Login Attempt¶
Command:
- Connects to the FTP service on the target system.
- When prompted for login credentials, enter:
- Username:
anonymous - Password: (Leave blank or enter
anonymous)
- Username:
Example:
Output (if anonymous login is successful):
Connected to 192.168.1.10.
220 (vsFTPd 3.0.3)
Name (192.168.1.10:user): anonymous
331 Please specify the password.
Password:
230 Login successful.
ftp>
4. Common FTP Commands After Login¶
Once logged in, you can use the following FTP commands:
-
ls– Lists files in the current directory. -
pwd– Displays the current directory. -
cd <directory>– Changes the directory. -
get <filename>– Downloads a file from the server. -
put <filename>– Uploads a file to the server. -
byeorexit– Closes the FTP session.
5. Risks and Mitigations¶
Risks:¶
- Anonymous Login Exploitation: Attackers can access sensitive files if anonymous login is enabled.
- Brute Force Attacks: Weak FTP credentials can be guessed using brute-force techniques.
- Cleartext Transmission: FTP transfers data, including credentials, in plaintext, making it vulnerable to interception.
- Misconfigured Permissions: Poorly configured FTP directories may allow unauthorized file uploads or modifications.
- Denial of Service (DoS) Attacks: Attackers can overload the FTP server with requests, making it unavailable.
Mitigations:¶
- Disable Anonymous Login: Configure the FTP server to require authentication for access.
- Use Strong Authentication: Enforce strong passwords and multi-factor authentication.
- Implement Encryption: Use FTPS (FTP Secure) or SFTP (SSH File Transfer Protocol) instead of plain FTP.
- Restrict Access: Limit FTP access to only trusted IP addresses and users.
- Regular Monitoring: Continuously monitor FTP logs for unauthorized access attempts.
- Update FTP Software: Ensure the FTP server software is regularly updated with security patches.
- Enforce Least Privilege: Set strict permissions to prevent unauthorized users from modifying or uploading files.
- Enable Intrusion Detection: Use tools like Fail2Ban to detect and block repeated failed login attempts.