1.1.2.9. ssh_host_key

1.1.2.9.1. Classes

class BaseHostKeyDialog(application, hostname, key)[source]

Bases: king_phisher.client.gui_utilities.GladeGObject

A base class for dialogs which show information about SSH host keys. It is assumed that the widgets defined in dependencies are present including one button to accept the host key, and one to reject. The class’s default response can be set using default_response.

__init__(application, hostname, key)[source]
Parameters:
  • application (KingPhisherClientApplication) – The application to associate this popup dialog with.
  • hostname (str) – The hostname associated with the key.
  • key (paramiko.pkey.PKey) – The host’s SSH key.
default_response = None[source]

The response that should be selected as the default for the dialog.

class HostKeyAcceptDialog(application, hostname, key)[source]

Bases: king_phisher.client.dialogs.ssh_host_key.BaseHostKeyDialog

A dialog that shows an SSH host key for a host that has not previously had one associated with it.

class HostKeyWarnDialog(application, hostname, key)[source]

Bases: king_phisher.client.dialogs.ssh_host_key.BaseHostKeyDialog

A dialog that warns about an SSH host key that does not match the one that was previously stored for the host.

class MissingHostKeyPolicy(application)[source]

Bases: paramiko.client.MissingHostKeyPolicy

A host key policy for use with paramiko that will validate SSH host keys correctly. If a key is new, the user will be prompted with HostKeyAcceptDialog dialog to accept it or if the host key does not match the user will be warned with HostKeyWarnDialog. The host keys accepted through this policy are stored in an OpenSSH compatible “known_hosts” file using paramiko.

__init__(application)[source]
Parameters:application (KingPhisherClientApplication) – The application which is using this policy.
missing_host_key(client, hostname, key)[source]

Called when an .SSHClient receives a server key for a server that isn’t in either the system or local .HostKeys object. To accept the key, simply return. To reject, raised an exception (which will be passed to the calling application).