projectdiscovery/interactsh

No interactions received over FTP 21 with TLS

MMquant opened this issue · 1 comments

Interactsh version:

projectdiscovery/interactsh-server:v1.1.8 docker image

Current Behavior:

Go FTP server on port 21 doesn't support authentication over TLS.
No FTP interaction is received if there is an incoming FTP connection over TLS and no login credentials are collected.

Expected Behavior:

Receive an FTP interaction with the FTP credentials.

Steps To Reproduce:

The interactsh-server runs with this config file

$ fgrep -v '#' config.yaml | sort -u

cert: /etc/letsencrypt/live/<redacted>/cert.pem
debug: true
disable-version: true
dns-port: 53
domain: [<redacted>]
dynamic-resp: true
eviction: 30
ftp-port: 21
ftp: true
http-directory: /app/www/
http-port: 80
https-port: 443
ip: <redacted>
ldap-port: 389
ldap: true
listen-ip: 0.0.0.0
privkey: /etc/letsencrypt/live/<redacted>/privkey.pem
scan-everywhere: true
smb-port: 445
smb: true
smtp-autotls-port: 465
smtp-port: 25
smtps-port: 587
wildcard: true

nginx reverse proxy configuration for FTP

stream {

    # FTP port 21 interactions
    server {

        listen 21;
        listen [::]:21;

        proxy_pass interactsh:21;
    }

}

This should be ok as I suppose that TLS traffic terminates at the interactsh service.

The test FTP connection was performed using https://ftptest.net/.

FTP interaction was received only for plaintext FTP.

If you choose FTP over TLS the connection to interactsh is refused with the following error messages

Status: Resolving address of <redacted>
Status: Connecting to <redacted>
Warning: The entered address does not resolve to an IPv6 address.
Status: Connected, waiting for welcome message...
Reply: 220 Welcome to the Go FTP Server
Command: CLNT https://ftptest.net on behalf of <redacted>
Reply: 200 OK
Command: AUTH TLS
Reply: 550 Action not taken
Warning: Server refused AUTH TLS, trying deprecated AUTH SSL fallback.
Command: AUTH SSL
Reply: 550 Action not taken
Error: Server refused FTP over TLS

This is now fixed / supported in latest release.