mirror of
https://github.com/aljazceru/cowrie.git
synced 2026-01-27 18:14:32 +01:00
Search for moduli in right place on MacosX
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user