parameterize idle timeout

This commit is contained in:
Michel Oosterhof 2017-06-16 16:06:36 +04:00
parent 3d12c8c54b
commit 0866708ee4
2 changed files with 12 additions and 1 deletions

View File

@ -89,6 +89,12 @@ txtcmds_path = txtcmds
ttylog = true
# Interactive timeout determines when logged in sessions are
# terminated for being idle.
# (default: 180)
interactive_timeout = 180
# ============================================================================
# Network Specific Options

View File

@ -86,7 +86,12 @@ class HoneyPotBaseProtocol(insults.TerminalProtocol, TimeoutMixin):
self.realClientPort = pt.transport.getPeer().port
self.clientVersion = self.getClientVersion()
self.logintime = time.time()
self.setTimeout(180)
try:
timeout = self.cfg.getint('honeypot', 'interactive_timeout')
except:
timeout = 180
self.setTimeout(timeout)
# Source IP of client in user visible reports (can be fake or real)
try: