mirror of
https://github.com/cowrie/cowrie.git
synced 2025-07-01 18:07:27 -04:00
Don't send banner if the banner file is not found (thanks mark)
git-svn-id: https://kippo.googlecode.com/svn/trunk@215 951d7100-d841-11de-b865-b3884708a8e2
This commit is contained in:
@ -534,7 +534,12 @@ class HoneyPotSSHUserAuthServer(userauth.SSHUserAuthServer):
|
|||||||
cfg = config()
|
cfg = config()
|
||||||
if not cfg.has_option('honeypot', 'banner_file'):
|
if not cfg.has_option('honeypot', 'banner_file'):
|
||||||
return
|
return
|
||||||
data = file(cfg.get('honeypot', 'banner_file')).read()
|
try:
|
||||||
|
data = file(cfg.get('honeypot', 'banner_file')).read()
|
||||||
|
except IOError:
|
||||||
|
print 'Banner file %s does not exist!' % \
|
||||||
|
cfg.get('honeypot', 'banner_file')
|
||||||
|
return
|
||||||
if not data or not len(data.strip()):
|
if not data or not len(data.strip()):
|
||||||
return
|
return
|
||||||
data = '\r\n'.join(data.splitlines() + [''])
|
data = '\r\n'.join(data.splitlines() + [''])
|
||||||
|
|||||||
Reference in New Issue
Block a user