Always send an exit-status '0' for the SSH session.

This commit is contained in:
Michel Oosterhof
2015-01-27 06:42:04 +00:00
parent c32482f6a8
commit d2915488d4
2 changed files with 4 additions and 5 deletions

View File

@@ -144,11 +144,6 @@ class HoneyPotExecProtocol(HoneyPotBaseProtocol):
log.msg( 'Running exec command "%s"' % self.execcmd )
self.cmdstack[0].lineReceived(self.execcmd)
# self.terminal.transport.session.conn.sendRequest(self.terminal.transport.session, 'exit-status', struct.pack('>L', 0))
# self.terminal.transport.session.conn.sendClose(self.terminal.transport.session)
# return
#
class HoneyPotInteractiveProtocol(HoneyPotBaseProtocol, recvline.HistoricRecvLine):
def __init__(self, avatar, env):

View File

@@ -252,6 +252,10 @@ class HoneyPotSSHSession(session.SSHSession):
log.msg('request_x11: %s' % repr(data) )
return 0
def loseConnection(self):
self.conn.sendRequest(self, 'exit-status', "\x00"*4)
session.SSHSession.loseConnection(self)
# FIXME: recent twisted conch avatar.py uses IConchuser here
@implementer(conchinterfaces.ISession)
class HoneyPotAvatar(avatar.ConchUser):