Skip to content

Commit

Permalink
Bounce scan: detect no-password-needed logon
Browse files Browse the repository at this point in the history
  • Loading branch information
bonsaiviking committed Jul 29, 2016
1 parent bb9d032 commit 2049626
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions nmap_ftp.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 2049626

Please sign in to comment.