...
 
Commits (7)
......@@ -22,8 +22,11 @@ all:
prepare-dev:
@# lib*-dev and cffi for building cryptography, dependency of twisted.
apt-get install -y python python-dev python-pip python3 python3-dev python3-pip sshpass libffi-dev libssl-dev
python2 -m pip install -U cffi
python3 -m pip install -U cffi
# Upgrade setuptools and pip to avoid error when installing modules with environmnent markers
python2 -m pip install -U setuptools pip
python3 -m pip install -U setuptools pip
python2 -m pip install -U cffi pyOpenSSL
python3 -m pip install -U cffi pyOpenSSL
python2 -m pip install -e .[test]
python3 -m pip install -e .[test]
......
......@@ -133,9 +133,27 @@ class ProxySSHSession(SSHSessionForUnixConchUser):
gid=None,
usePTY=self.ptyTuple,
)
fcntl.ioctl(self.pty.fileno(), tty.TIOCSWINSZ, struct.pack('4H', *self.winSize))
if self.ptyTuple:
fcntl.ioctl(self.pty.fileno(), tty.TIOCSWINSZ, struct.pack('4H', *self.winSize))
self.avatar.conn.transport.transport.setTcpNoDelay(1)
# pylint: disable=invalid-name
def execCommand(self, proto, cmd):
"""
Custom implementation of exec - proxy to real SSH to honeypot.
"""
# pylint: disable=no-member
self.pty = reactor.spawnProcess(
proto,
executable='/usr/bin/sshpass',
args=self.honeypot_ssh_arguments + [cmd],
env=self.environ,
path='/',
uid=None,
gid=None,
usePTY=self.ptyTuple,
)
@property
def honeypot_ssh_arguments(self):
"""
......