diff --git a/README.md b/README.md index e0ec474..e25ce0b 100644 --- a/README.md +++ b/README.md @@ -29,12 +29,20 @@ Software required: * An operating system (tested on Debian, CentOS, FreeBSD and Windows 7) * Python 2.7+ * Twisted 8.0+ -* python-crypto +* python-cryptography * python-pyasn1 * python-gmpy2 (recommended) * python-mysqldb (for MySQL output) * Zope Interface 3.6.0+ +### Example requirements in alpine 3.4 + +``` +apk add python py-asn1 py-twisted py-zope-interface libffi-dev \ + py-cryptography py-pip py-six py-cffi py-idna py-ipaddress py-openssl +pip install enum34 +``` + ## Files of interest: * `cowrie.cfg` - Cowrie's configuration file. Default values can be found in `cowrie.cfg.dist` diff --git a/cowrie/ssh/transport.py b/cowrie/ssh/transport.py index 30ff40b..d9b2092 100644 --- a/cowrie/ssh/transport.py +++ b/cowrie/ssh/transport.py @@ -143,9 +143,13 @@ class HoneyPotSSHFactory(factory.SSHFactory): if not self.primes: ske = t.supportedKeyExchanges[:] - ske.remove('diffie-hellman-group-exchange-sha1') + if 'diffie-hellman-group-exchange-sha1' in ske: + ske.remove('diffie-hellman-group-exchange-sha1') + log.msg("No moduli, no diffie-hellman-group-exchange-sha1") + if 'diffie-hellman-group-exchange-sha256' in ske: + ske.remove('diffie-hellman-group-exchange-sha256') + log.msg("No moduli, no diffie-hellman-group-exchange-sha256") t.supportedKeyExchanges = ske - log.msg("No moduli, disabled diffie-hellman-group-exchange-sha1") # Reorder supported ciphers to resemble current openssh more t.supportedCiphers = ['aes128-ctr', 'aes192-ctr', 'aes256-ctr', @@ -312,4 +316,3 @@ class HoneyPotTransport(transport.SSHServerTransport, TimeoutMixin): log.msg('[SERVER] - Disconnecting with error, code %s\nreason: %s' % (reason, desc)) self.transport.loseConnection() - diff --git a/start.sh b/start.sh index f0cff1a..1556622 100755 --- a/start.sh +++ b/start.sh @@ -25,10 +25,10 @@ then . $VENV/bin/activate fi -echo "Starting cowrie in the background..." +echo "Starting cowrie with extra arguments [$XARGS] ..." if [ $AUTHBIND_ENABLED = "no" ] then - twistd -l log/cowrie.log --umask 0077 --pidfile cowrie.pid cowrie + twistd $XARGS -l log/cowrie.log --umask 0077 --pidfile cowrie.pid cowrie else - authbind --deep twistd -l log/cowrie.log --umask 0077 --pidfile cowrie.pid cowrie + authbind --deep twistd $XARGS -l log/cowrie.log --umask 0077 --pidfile cowrie.pid cowrie fi