This module creates a mock FTP server which accepts credentials before throwing a `500` error.

## Verification Steps

  1. Start msfconsole
  2. Do: ```use auxiliary/server/capture/ftp```
  3. Do: ```run```

## Options

### BANNER

  The Banner which should be displayed (200 server message).  Default is `FTP Server Ready`.
  Some notable banners to emulate:

  * `Microsoft FTP Service`
  * `ucftpd FTP server ready.`
  * `Serv-U FTP Server v6.4 for WinSock ready...`
  * `Serv-U FTP Server v15.0 ready...`
  * `ProFTPD 1.3.4a Server (FTP-Server)`

### SSL

  Boolean if SSL should be used, making this FTPS.  FTPS is typically run on port 990.  If `SSLCert` is not set, a certificate
  will be automatically generated.  Default is `False`.

### SSLCert

  File path to a combined Private Key and Certificate file.  If not provided, a certificate will be automatically
  generated.  Default is ``.

## Scenarios

### FTP Emulating Microsoft with Telnet Client

Server:

```
msf > use auxiliary/server/capture/ftp
msf auxiliary(server/capture/ftp) > set banner "Microsoft FTP Service"
banner => Microsoft FTP Service
msf auxiliary(server/capture/ftp) > run
[*] Auxiliary module running as background job 0.
msf auxiliary(server/capture/ftp) > 
[*] Started service listener on 0.0.0.0:21 
[*] Server started.
[+] FTP LOGIN 127.0.0.1:44526 root / SuperSecret9
```

Client:

```
root@kali:~# telnet 127.0.0.1 21
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
220 Microsoft FTP Service
USER root
331 User name okay, need password...
PASS SuperSecret9  
500 Error
```

### FTPS with Self-Signed Certificate and curl/lftp Client

Server:

```
msf > openssl req -newkey rsa:2048 -nodes -keyout key.pem -x509 -days 365 -out certificate.pem
[*] exec: openssl req -newkey rsa:2048 -nodes -keyout key.pem -x509 -days 365 -out certificate.pem

Generating a RSA private key
.................................+++++
........+++++
writing new private key to 'key.pem'
-----
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [AU]:
State or Province Name (full name) [Some-State]:
Locality Name (eg, city) []:
Organization Name (eg, company) [Internet Widgits Pty Ltd]:
Organizational Unit Name (eg, section) []:
Common Name (e.g. server FQDN or YOUR name) []:
Email Address []:
msf > cat key.pem certificate.pem > selfsigned.pem
[*] exec: cat key.pem certificate.pem > selfsigned.pem

msf > cat /root/metasploit-framework/selfsigned.pem
[*] exec: cat /root/metasploit-framework/selfsigned.pem

-----BEGIN PRIVATE KEY-----

dUubf5UfmaGETVVd8MbMNvQ=
-----END PRIVATE KEY-----
-----BEGIN CERTIFICATE-----

mVuIIRbrDW/sOgu2Viis
-----END CERTIFICATE-----

msf > use auxiliary/server/capture/ftp
msf auxiliary(server/capture/ftp) > set srvport 990
srvport => 990
msf auxiliary(server/capture/ftp) > set ssl true
ssl => true
msf auxiliary(server/capture/ftp) > set sslcert /root/metasploit-framework/selfsigned.pem
sslcert => /root/metasploit-framework/selfsigned.pem
msf auxiliary(server/capture/ftp) > run
[*] Auxiliary module running as background job 0.
msf auxiliary(server/capture/ftp) > 
[*] Started service listener on 0.0.0.0:990 
[*] Server started.
[+] FTP LOGIN 127.0.0.1:33618 admin / password123
[+] FTP LOGIN 127.0.0.1:33758 admin / password4321
```

Clients:

```
root@kali:~# curl -k --ftp-ssl --user admin:password123 ftps://127.0.0.1:990
curl: (67) Access denied: 500
root@kali:~# lftp ftps://admin:password4321@127.0.0.1:990 -e "set ssl:verify-certificate no; dir;"
ls: Login failed: 500 Error
```
