Updated format errors in aws_exporter and lowered errors to infos in vsftpd exploiter

This commit is contained in:
Shay Nehmad 2019-10-24 18:54:20 +03:00
parent c66a0cd44c
commit 4b84810fae
2 changed files with 5 additions and 5 deletions

View File

@ -45,7 +45,7 @@ class VSFTPDExploiter(HostExploiter):
s.connect((ip_addr, port)) s.connect((ip_addr, port))
return True return True
except socket.error as e: 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 return False
def socket_send_recv(self, s, message): def socket_send_recv(self, s, message):
@ -53,7 +53,7 @@ class VSFTPDExploiter(HostExploiter):
s.send(message) s.send(message)
return s.recv(RECV_128).decode('utf-8') return s.recv(RECV_128).decode('utf-8')
except socket.error as e: 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 return False
def socket_send(self, s, message): def socket_send(self, s, message):
@ -61,7 +61,7 @@ class VSFTPDExploiter(HostExploiter):
s.send(message) s.send(message)
return True return True
except socket.error as e: 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 return False
def _exploit_host(self): def _exploit_host(self):

View File

@ -107,10 +107,10 @@ class AWSExporter(Exporter):
else: else:
return False return False
except UnknownServiceError as e: 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 return False
except Exception as e: 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 return False
@staticmethod @staticmethod