Make ourVersionString configurable (Resolves issue #54)

git-svn-id: https://kippo.googlecode.com/svn/trunk@247 951d7100-d841-11de-b865-b3884708a8e2
This commit is contained in:
desaster@gmail.com
2014-02-16 09:50:41 +00:00
parent 1a78b7c30a
commit 42585c44c9
2 changed files with 33 additions and 1 deletions

View File

@@ -110,6 +110,32 @@ private_key = private.key
# (default: not specified)
#fake_addr = 192.168.66.254
# SSH Version String
#
# Use this to disguise your honeypot from a simple SSH version scan
# frequent Examples: (found experimentally by scanning ISPs)
# SSH-2.0-OpenSSH_5.1p1 Debian-5
# SSH-1.99-OpenSSH_4.3
# SSH-1.99-OpenSSH_4.7
# SSH-1.99-Sun_SSH_1.1
# SSH-2.0-OpenSSH_4.2p1 Debian-7ubuntu3.1
# SSH-2.0-OpenSSH_4.3
# SSH-2.0-OpenSSH_4.6
# SSH-2.0-OpenSSH_5.1p1 Debian-5
# SSH-2.0-OpenSSH_5.1p1 FreeBSD-20080901
# SSH-2.0-OpenSSH_5.3p1 Debian-3ubuntu5
# SSH-2.0-OpenSSH_5.3p1 Debian-3ubuntu6
# SSH-2.0-OpenSSH_5.3p1 Debian-3ubuntu7
# SSH-2.0-OpenSSH_5.5p1 Debian-6
# SSH-2.0-OpenSSH_5.5p1 Debian-6+squeeze1
# SSH-2.0-OpenSSH_5.5p1 Debian-6+squeeze2
# SSH-2.0-OpenSSH_5.8p2_hpn13v11 FreeBSD-20110503
# SSH-2.0-OpenSSH_5.9p1 Debian-5ubuntu1
# SSH-2.0-OpenSSH_5.9
#
# (default: "SSH-2.0-OpenSSH_5.1p1 Debian-5")
ssh_version_string = SSH-2.0-OpenSSH_5.1p1 Debian-5
# Banner file to be displayed before the first login attempt.
#
# (default: not specified)

View File

@@ -640,10 +640,16 @@ class HoneyPotSSHFactory(factory.SSHFactory):
self.dbloggers.append(dblogger)
def buildProtocol(self, addr):
cfg = config()
# FIXME: try to mimic something real 100%
t = HoneyPotTransport()
t.ourVersionString = 'SSH-2.0-OpenSSH_5.1p1 Debian-5'
if cfg.has_option('honeypot', 'ssh_version_string'):
t.ourVersionString = cfg.get('honeypot','ssh_version_string')
else:
t.ourVersionString = "SSH-2.0-OpenSSH_5.1p1 Debian-5"
t.supportedPublicKeys = self.privateKeys.keys()
if not self.primes: