sshmitm.plugins.scp.store_file module

SCPStorageForwarder: store transferred files from SCP

SCPStorageForwarder is a class that is derived from SCPForwarder. This class provides a capability to store the transferred files from SCP (secure copy) to the file system.

Attributes: file_id (str): A unique identifier for each file, generated using uuid. scp_storage_dir (str): A path to the directory where files are stored.

Methods: parser_arguments: This method adds a command line argument ‘–store-scp-files’ for storing SCP files to the file system. init: This method initializes the SCPStorageForwarder class. It creates a scp_storage_dir if it doesn’t exist. process_data: This method stores the data transmitted during SCP file transfer to the file system. The files are stored in the scp_storage_dir directory.

class sshmitm.plugins.scp.store_file.SCPStorageForwarder(session)

Bases: SCPForwarder

Stores transferred files to the file system

Parameters:

session (Session)

classmethod parser_arguments()
Return type:

None

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

  • traffic (bytes)

  • isclient (bool)

Return type:

bytes

process_data(traffic)
Parameters:

traffic (bytes)

Return type:

bytes

store_command_data(file_id, traffic, suffix)
Parameters:
  • file_id (str)

  • traffic (bytes)

  • suffix (str)

Return type:

None