From 204962648ce30bc08e79e45a7dbbe18269cf67bd Mon Sep 17 00:00:00 2001 From: dmiller Date: Fri, 29 Jul 2016 15:50:47 +0000 Subject: [PATCH] Bounce scan: detect no-password-needed logon --- nmap_ftp.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/nmap_ftp.cc b/nmap_ftp.cc index 8989f802f..faf80f168 100644 --- a/nmap_ftp.cc +++ b/nmap_ftp.cc @@ -221,6 +221,14 @@ int ftp_anon_connect(struct ftpinfo *ftp) { if (recvbuf[0] == '5') fatal("Your FTP bounce server doesn't like the username \"%s\"", ftp->user); + if (!strncmp(recvbuf, "230", 3)) { + // 230 User logged in + // No need to send PASS + if (o.verbose) + log_write(LOG_STDOUT, "Login credentials accepted by FTP server!\n"); + ftp->sd = sd; + return sd; + } Snprintf(command, 511, "PASS %s\r\n", ftp->pass); send(sd, command, strlen(command), 0);