only attempt to send banner once.

This commit is contained in:
Michel Oosterhof
2015-06-11 14:07:21 +00:00
parent f50a4330c0
commit b7d144f8b5

View File

@@ -37,6 +37,7 @@ class HoneyPotSSHUserAuthServer(userauth.SSHUserAuthServer):
def sendBanner(self):
if self.bannerSent:
return
self.bannerSent = True
cfg = self.portal.realm.cfg
try:
honeyfs = cfg.get('honeypot', 'contents_path')
@@ -48,7 +49,6 @@ class HoneyPotSSHUserAuthServer(userauth.SSHUserAuthServer):
return
self.transport.sendPacket(
userauth.MSG_USERAUTH_BANNER, NS(data) + NS('en'))
self.bannerSent = True
def ssh_USERAUTH_REQUEST(self, packet):
self.sendBanner()