From 4b84810fae4a69daf35592424802ca6a69c5be18 Mon Sep 17 00:00:00 2001 From: Shay Nehmad Date: Thu, 24 Oct 2019 18:54:20 +0300 Subject: [PATCH] Updated format errors in aws_exporter and lowered errors to infos in vsftpd exploiter --- monkey/infection_monkey/exploit/vsftpd.py | 6 +++--- monkey/monkey_island/cc/services/reporting/aws_exporter.py | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/monkey/infection_monkey/exploit/vsftpd.py b/monkey/infection_monkey/exploit/vsftpd.py index 136a8a36b..d4116c96c 100644 --- a/monkey/infection_monkey/exploit/vsftpd.py +++ b/monkey/infection_monkey/exploit/vsftpd.py @@ -45,7 +45,7 @@ class VSFTPDExploiter(HostExploiter): s.connect((ip_addr, port)) return True except socket.error as e: - LOG.error('Failed to connect to %s', self.host.ip_addr) + LOG.info('Failed to connect to %s: %s', self.host.ip_addr, str(e)) return False def socket_send_recv(self, s, message): @@ -53,7 +53,7 @@ class VSFTPDExploiter(HostExploiter): s.send(message) return s.recv(RECV_128).decode('utf-8') except socket.error as e: - LOG.error('Failed to send payload to %s', self.host.ip_addr) + LOG.info('Failed to send payload to %s: %s', self.host.ip_addr, str(e)) return False def socket_send(self, s, message): @@ -61,7 +61,7 @@ class VSFTPDExploiter(HostExploiter): s.send(message) return True except socket.error as e: - LOG.error('Failed to send payload to %s', self.host.ip_addr) + LOG.info('Failed to send payload to %s: %s', self.host.ip_addr, str(e)) return False def _exploit_host(self): diff --git a/monkey/monkey_island/cc/services/reporting/aws_exporter.py b/monkey/monkey_island/cc/services/reporting/aws_exporter.py index 0940be503..8690f6ee1 100644 --- a/monkey/monkey_island/cc/services/reporting/aws_exporter.py +++ b/monkey/monkey_island/cc/services/reporting/aws_exporter.py @@ -107,10 +107,10 @@ class AWSExporter(Exporter): else: return False except UnknownServiceError as e: - logger.warning('AWS exporter called but AWS-CLI securityhub service is not installed. Error: ' + e) + logger.warning('AWS exporter called but AWS-CLI security hub service is not installed. Error: {}'.format(e)) return False except Exception as e: - logger.exception('AWS security hub findings failed to send. Error: ' + e) + logger.exception('AWS security hub findings failed to send. Error: {}'.format(e)) return False @staticmethod