sshmitm.forwarders.agent module

class sshmitm.forwarders.agent.AgentBaseForwarder(session)

Bases: SSHMITMBaseModule

Specifies the interface for managing SSH agent forwarding and optional agent breakin.

Parameters:

session (Session)

request(existing_agent=None)
Parameters:

existing_agent (AgentProxy | None, default: None)

Return type:

AgentProxy | None

class sshmitm.forwarders.agent.AgentForwarder(session)

Bases: AgentBaseForwarder

Forwards the SSH agent from the client, with optional breakin support.

Parameters:

session (Session)

classmethod parser_arguments()
Return type:

None

request(existing_agent=None)
Parameters:

existing_agent (AgentProxy | None, default: None)

Return type:

AgentProxy | None

class sshmitm.forwarders.agent.AgentLocalSocket(transport)

Bases: object

Exposes the client’s forwarded SSH agent as a local Unix domain socket.

Opens a server socket under /tmp and, for each incoming connection, opens a fresh agent-forwarding channel through the SSH transport. The two sides are bridged at the raw byte level so any standard agent client (ssh-add, ssh-keygen, …) can use it by pointing SSH_AUTH_SOCK at the path.

Parameters:

transport (Transport)

close()
Return type:

None

class sshmitm.forwarders.agent.AgentProxy(transport)

Bases: object

Parameters:

transport (Transport)

close()
Return type:

None

forward_agent(client_channel)
Parameters:

client_channel (Channel)

Return type:

bool

get_keys()
Return type:

tuple[AgentKey, ...]