# FTP - 21

* **FTP commands** -[https://www.smartfile.com/blog/the-ultimate-ftp-commands-list/](https://www.smartfile.com/blog/the-ultimate-ftp-commands-list/)

### Service Interaction

```bash
# Anonymous Login
ftp ip

# vsFTPd status
status

# vsFTPd Detailed Output
debug 
trace

# Recursive Listing
ls -R

# Download a file
get filename

# Download All Available Files
wget -m --no-passive <ftp://anonymous:anonymous@10.10.10.10>

# Upload a file
put filename

# Netcat 
 nc -nv ip 21

# telnet
telnet ip 21

# Using OpenSSl for TLS/SSL encryption
openssl s_client -connect 10.129.14.136:21 -starttls ftp
```

### **Nmap FTP Scripts**

```bash
# updating database of NSE scripts
sudo nmap --script-updatedb

# find the available ftp nmap scripts in system
find / -type f -name ftp* 2>/dev/null | grep scripts 

# Nmap scan for FTP on port 21
nmap -sV -p21 -sC -A ip

# to trace the progress of NSE scripts
nmap -sV -p21 -sC -A ip --script-trace
```

### Brute Forcing

```bash
# Medusa 
# LINK : <https://github.com/jmk-foofus/medusa>

# Brute forcing using medusa
medusa -u fiona -P /usr/share/wordlists/rockyou.txt -h ip -M ftp
```
