sshmitm.authentication module

class sshmitm.authentication.Authenticator(session: Session)

Bases: BaseModule

REQUEST_AGENT_BREAKIN = False
auth_agent(username: str, host: str, port: int) int
auth_fallback(username: str) int
auth_password(username: str, host: str, port: int, password: str) int
auth_publickey(username: str, host: str, port: int, key: PKey) int
authenticate(username: Optional[str] = None, password: Optional[str] = None, key: Optional[PKey] = None, store_credentials: bool = True) int
connect(user: str, host: str, port: int, method: AuthenticationMethod, password: Optional[str] = None, key: Optional[PKey] = None, *, run_post_auth: bool = True) int
classmethod get_auth_methods(host: str, port: int) Optional[List[str]]
get_remote_host_credentials(username: str, password: Optional[str] = None, key: Optional[PKey] = None) RemoteCredentials
classmethod parser_arguments() None
post_auth_action(success: bool) None
pre_auth_action() None
class sshmitm.authentication.AuthenticatorPassThrough(session: Session)

Bases: Authenticator

pass the authentication to the remote server (reuses the credentials)

auth_agent(username: str, host: str, port: int) int
auth_password(username: str, host: str, port: int, password: str) int
auth_publickey(username: str, host: str, port: int, key: PKey) int
post_auth_action(success: bool) None
class sshmitm.authentication.RemoteCredentials(*, username: str, password: Optional[str] = None, key: Optional[PKey] = None, host: Optional[str] = None, port: Optional[int] = None)

Bases: object

sshmitm.authentication.probe_host(hostname_or_ip: str, port: int, username: str, public_key: PublicBlob) bool