sshmitm.plugins.sftp.replace_file module

class sshmitm.plugins.sftp.replace_file.SFTPProxyReplaceHandler(sftp: SFTPBaseHandle, filename: str)

Bases: SFTPHandlerPlugin

Replaces a SFTP transmitted File during transit

class SFTPInterface(serverinterface: BaseServerInterface)

Bases: SFTPProxyServerInterface

lstat(path: str) SFTPAttributes | int

Return an .SFTPAttributes object for a path on the server, or an error code. If your server supports symbolic links (also known as “aliases”), you should not follow them – instead, you should return data on the symlink or alias itself. (stat is the corresponding call that follows symlinks/aliases.)

Parameters:

path (str) – the requested path (relative or absolute) to fetch file statistics for.

Returns:

an .SFTPAttributes object for the given file, or an SFTP error code (like SFTP_PERMISSION_DENIED).

stat(path: str) SFTPAttributes | int

Return an .SFTPAttributes object for a path on the server, or an error code. If your server supports symbolic links (also known as “aliases”), you should follow them. (lstat is the corresponding call that doesn’t follow symlinks/aliases.)

Parameters:

path (str) – the requested path (relative or absolute) to fetch file statistics for.

Returns:

an .SFTPAttributes object for the given file, or an SFTP error code (like SFTP_PERMISSION_DENIED).

close() None
classmethod get_interface() Type[BaseSFTPServerInterface] | None
handle_data(data: bytes, *, offset: int | None = None, length: int | None = None) bytes
classmethod parser_arguments() None