diff --git a/cowrie/core/ssh.py b/cowrie/core/ssh.py index 190884a..371e6e6 100644 --- a/cowrie/core/ssh.py +++ b/cowrie/core/ssh.py @@ -158,7 +158,7 @@ class HoneyPotSSHFactory(factory.SSHFactory): @return: The built transport. """ - _moduli = '/etc/ssh/moduli' + _modulis = '/etc/ssh/moduli', '/private/etc/moduli' # FIXME: try to mimic something real 100% t = HoneyPotTransport() @@ -170,13 +170,15 @@ class HoneyPotSSHFactory(factory.SSHFactory): t.supportedPublicKeys = self.privateKeys.keys() - try: - self.primes = primes.parseModuliFile(_moduli) - except IOError as err: - log.err(err) + for _moduli in _modulis: + try: + self.primes = primes.parseModuliFile(_moduli) + break + except IOError as err: + pass if not self.primes: - log.msg("Disabling diffie-hellman-group-exchange-sha1") + log.msg("Moduli not found, disabling diffie-hellman-group-exchange-sha1") ske = t.supportedKeyExchanges[:] ske.remove('diffie-hellman-group-exchange-sha1') t.supportedKeyExchanges = ske