Skip to content

Commit ebf4ea8

Browse files
sftp client is created only on sftp subsystem request
1 parent 97dfa41 commit ebf4ea8

4 files changed

Lines changed: 11 additions & 4 deletions

File tree

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## [0.5.0] - 2021-03-26
8+
9+
## Changed
10+
11+
- sftp client is created only on sftp subsystem request
12+
13+
714
## [0.5.0] - 2021-03-26
815

916
## Added
@@ -47,6 +54,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
4754

4855
- fixed pseudo terminal on exec command
4956

57+
[0.5.0]: https://github.com/ssh-mitm/ssh-mitm/compare/0.5.0...0.5.1
5058
[0.5.0]: https://github.com/ssh-mitm/ssh-mitm/compare/0.4.3...0.5.0
5159
[0.4.3]: https://github.com/ssh-mitm/ssh-mitm/compare/0.4.2...0.4.3
5260
[0.4.2]: https://github.com/ssh-mitm/ssh-mitm/compare/0.4.1...0.4.2

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def get_entry_points():
2020

2121
setup(
2222
name='ssh-mitm',
23-
version='0.5.0',
23+
version='0.5.1',
2424
author='SSH-MITM Dev-Team',
2525
author_email='support@ssh-mitm.at',
2626
description='ssh mitm server for security audits supporting public key authentication, session hijacking and file manipulation',

ssh_proxy_server/authentication.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
from sshpubkeys import SSHKey
66

77
from ssh_proxy_server.clients.ssh import SSHClient, AuthenticationMethod
8-
from ssh_proxy_server.clients.sftp import SFTPClient
98
from ssh_proxy_server.exceptions import MissingHostException
109

1110

@@ -162,7 +161,6 @@ def get_agent_pubkeys():
162161
)
163162
if sshclient.connect():
164163
self.session.ssh_client = sshclient
165-
self.session.sftp_client = SFTPClient.from_client(sshclient)
166164
return paramiko.AUTH_SUCCESSFUL
167165
logging.warning('connection failed!')
168166
return paramiko.AUTH_FAILED

ssh_proxy_server/interfaces/server.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
from sshpubkeys import SSHKey
55

66
from enhancements.modules import BaseModule
7+
from ssh_proxy_server.clients.sftp import SFTPClient
78

89

910
class BaseServerInterface(paramiko.ServerInterface, BaseModule):
@@ -240,7 +241,7 @@ def check_global_request(self, msg):
240241

241242
class ProxySFTPServer(paramiko.SFTPServer):
242243
def start_subsystem(self, name, transport, channel):
243-
self.server.session.sftp_client_ready.wait()
244+
self.server.session.sftp_client = SFTPClient.from_client(self.server.session.ssh_client)
244245
self.server.session.sftp_client.subsystem_count += 1
245246
super().start_subsystem(name, transport, channel)
246247

0 commit comments

Comments
 (0)