sshmitm.forwarders.scp module

class sshmitm.forwarders.scp.SCPBaseForwarder(session)

Bases: ExecHandlerRegistry, ExecForwarder

Defines the interface used for handling SCP (Secure Copy Protocol) file transfers, including uploads and downloads.

Parameters:

session (Session)

property client_channel: Channel | None

Returns the client channel for the current plugin type

forward()

Forwards data between the client and the server

Return type:

None

rewrite_scp_command(command)
Parameters:

command (str)

Return type:

str

class sshmitm.forwarders.scp.SCPForwarder(session)

Bases: SCPBaseForwarder

Transparent SCP plugin — forwards all data unchanged.

This is the base class for all SCP plugins. Inherit from this class to implement custom SCP behaviour; override only the methods you need.

Parameters:

session (Session)

handle_client_data(data)
Parameters:

data (bytes)

Return type:

bytes

handle_command(data)
Parameters:

data (bytes)

Return type:

bytes

handle_scp(data)
Parameters:

data (bytes)

Return type:

bytes

handle_server_data(data)
Parameters:

data (bytes)

Return type:

bytes

process_command_data(command, data, isclient)
Parameters:
  • command (bytes)

  • data (bytes)

  • isclient (bool)

Return type:

bytes

process_data(data)
Parameters:

data (bytes)

Return type:

bytes

process_response(data)
Parameters:

data (bytes)

Return type:

bytes