sshmitm.server package

class sshmitm.server.SSHProxyServer(listen_port, *, key_file=None, key_algorithm='rsa', key_length=2048, ssh_interface=<class 'sshmitm.forwarders.ssh.SSHForwarder'>, scp_interface=<class 'sshmitm.forwarders.scp.SCPForwarder'>, sftp_interface=<class 'sshmitm.interfaces.sftp.SFTPProxyServerInterface'>, sftp_handler=<class 'sshmitm.forwarders.sftp.SFTPHandlerPlugin'>, server_tunnel_interface=<class 'sshmitm.forwarders.tunnel.RemotePortForwardingForwarder'>, client_tunnel_interface=<class 'sshmitm.forwarders.tunnel.LocalPortForwardingForwarder'>, authentication_interface=<class 'sshmitm.interfaces.server.ServerInterface'>, authenticator=<class 'sshmitm.authentication.AuthenticatorPassThrough'>, transparent=False, session_class=<class 'sshmitm.session.Session'>, banner_name=None, debug=False)

Bases: object

Parameters:
  • listen_port (int) –

  • key_file (Optional[str], default: None) –

  • key_algorithm (str, default: 'rsa') –

  • key_length (int, default: 2048) –

  • ssh_interface (Type[SSHBaseForwarder], default: <class 'sshmitm.forwarders.ssh.SSHForwarder'>) –

  • scp_interface (Type[SCPBaseForwarder], default: <class 'sshmitm.forwarders.scp.SCPForwarder'>) –

  • sftp_interface (Type[BaseSFTPServerInterface], default: <class 'sshmitm.interfaces.sftp.SFTPProxyServerInterface'>) –

  • sftp_handler (Type[SFTPHandlerBasePlugin], default: <class 'sshmitm.forwarders.sftp.SFTPHandlerPlugin'>) –

  • server_tunnel_interface (Type[RemotePortForwardingForwarder], default: <class 'sshmitm.forwarders.tunnel.RemotePortForwardingForwarder'>) –

  • client_tunnel_interface (Type[LocalPortForwardingForwarder], default: <class 'sshmitm.forwarders.tunnel.LocalPortForwardingForwarder'>) –

  • authentication_interface (Type[BaseServerInterface], default: <class 'sshmitm.interfaces.server.ServerInterface'>) –

  • authenticator (Type[Authenticator], default: <class 'sshmitm.authentication.AuthenticatorPassThrough'>) –

  • transparent (bool, default: False) –

  • session_class (Type[Session], default: <class 'sshmitm.session.Session'>) –

  • banner_name (Optional[str], default: None) –

  • debug (bool, default: False) –

SELECT_TIMEOUT = 0.5
create_session(client, addr, remoteaddr)
Parameters:
  • client (socket) –

  • addr (Union[Tuple[str, int], Tuple[str, int, int, int]]) –

  • remoteaddr (Union[Tuple[str, int], Tuple[str, int, int, int]]) –

Return type:

None

generate_host_key()
Return type:

None

property host_key: PKey | None
print_serverinfo(json_log=False)
Parameters:

json_log (bool, default: False) –

Return type:

None

start()
Return type:

None

Submodules