From 47baea039ad0a01d066f76cbdab557b9b0e043a0 Mon Sep 17 00:00:00 2001 From: Dhayalan Date: Tue, 12 Mar 2019 19:44:45 +0100 Subject: [PATCH] Update vsftpd.py Better exception log --- monkey/infection_monkey/exploit/vsftpd.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/monkey/infection_monkey/exploit/vsftpd.py b/monkey/infection_monkey/exploit/vsftpd.py index 86e64953a..c2088514a 100644 --- a/monkey/infection_monkey/exploit/vsftpd.py +++ b/monkey/infection_monkey/exploit/vsftpd.py @@ -42,8 +42,8 @@ class VSFTPDExploiter(HostExploiter): ftp_socket.close() LOG.info('[+] Triggered backdoor') - except Exception: - LOG.info('[!] Failed to trigger backdoor on %s' , self.host.ip_addr) + except socket.error as e: + LOG.error('[!] Failed to trigger backdoor on %s' , self.host.ip_addr) try: LOG.info('[*] Attempting to connect to backdoor...') @@ -111,8 +111,9 @@ class VSFTPDExploiter(HostExploiter): self._exploit_info['Vulnerability'] = {"Success":"True"} - except Exception: - LOG.info('[!] Failed to connect to backdoor on %s:6200', self.host.ip_addr) + except socket.error as e: + LOG.error('[!] Failed to connect to backdoor on %s:6200', self.host.ip_addr) + LOG.error('Error Connecting to backdoor. Error: %s' % e) return False return True