Skip to content

Commit

Permalink
STARTTLS for FTP, tested with ProFTPD
Browse files Browse the repository at this point in the history
  • Loading branch information
ioerror committed Aug 14, 2010
1 parent 8372e72 commit 9193327
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions sslscan.c
Original file line number Diff line number Diff line change
Expand Up @@ -408,10 +408,24 @@ int tcpConnect(struct sslCheckOptions *options)
{
tlsStarted = 1;
memset(buffer, 0, BUFFERSIZE);

// Fetch the server banner
recv(socketDescriptor, buffer, BUFFERSIZE - 1, 0);
printf("Server reported: %s\n", buffer);
if (options->verbose)
printf("Server banner: %s\n", buffer);

// Send TLS request
send(socketDescriptor, "AUTH TLS\r\n", 10, 0);
printf("STARTLS FTP setup complete.\n");
recv(socketDescriptor, buffer, BUFFERSIZE - 1, 0);
if (strstr(buffer, "234 AUTH TLS successful")) {
if (options->verbose)
printf("STARTLS FTP setup complete.\n");
} else {
if (options->verbose)
printf("STARTLS FTP setup possibly not complete.\n");
}
if (options->verbose)
printf("Server reported: %s\n", buffer);
}

// Return
Expand Down

0 comments on commit 9193327

Please sign in to comment.