From 8546df235de85534b31b120fe5c415dac6b903f3 Mon Sep 17 00:00:00 2001 From: Michel Oosterhof Date: Sun, 1 Feb 2015 07:47:08 +0000 Subject: [PATCH] banner_file is now '/etc/issue.net' in honeyfs by default add default Debian motd file --- honeyfs/etc/motd | 7 +++++++ kippo.cfg.dist | 3 +-- kippo/core/ssh.py | 10 ++++------ 3 files changed, 12 insertions(+), 8 deletions(-) create mode 100644 honeyfs/etc/motd diff --git a/honeyfs/etc/motd b/honeyfs/etc/motd new file mode 100644 index 00000000..0c87dd33 --- /dev/null +++ b/honeyfs/etc/motd @@ -0,0 +1,7 @@ + +The programs included with the Debian GNU/Linux system are free software; +the exact distribution terms for each program are described in the +individual files in /usr/share/doc/*/copyright. + +Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent +permitted by applicable law. diff --git a/kippo.cfg.dist b/kippo.cfg.dist index b112ecab..a73fcf6a 100644 --- a/kippo.cfg.dist +++ b/kippo.cfg.dist @@ -148,8 +148,7 @@ ssh_version_string = SSH-2.0-OpenSSH_5.1p1 Debian-5 # Banner file to be displayed before the first login attempt. # -# (default: not specified) -#banner_file = +#banner_file = DEPRECATED; always '/etc/issue.net' in honeyfs # exit_jail tries to 'trick' the attacker with another shell. Set to true to create # another fake prompt after logout diff --git a/kippo/core/ssh.py b/kippo/core/ssh.py index 11629eff..60591994 100644 --- a/kippo/core/ssh.py +++ b/kippo/core/ssh.py @@ -38,17 +38,15 @@ class HoneyPotSSHUserAuthServer(userauth.SSHUserAuthServer): if self.bannerSent: return cfg = config() - if not cfg.has_option('honeypot', 'banner_file'): - return try: - data = file(cfg.get('honeypot', 'banner_file')).read() + honeyfs = cfg.get('honeypot', 'contents_path') + issuefile = honeyfs + "/etc/issue.net" + data = file( issuefile ).read() except IOError: - log.msg( 'Banner file %s does not exist!' % \ - cfg.get('honeypot', 'banner_file') ) return if not data or not len(data.strip()): return - data = '\r\n'.join(data.splitlines() + ['']) + data = '\r\n'.join(data.splitlines() ) self.transport.sendPacket( userauth.MSG_USERAUTH_BANNER, NS(data) + NS('en')) self.bannerSent = True