1.2.8. plugins
1.2.8.1. Classes
- class ServerPlugin(root_config)[source]
Bases:
king_phisher.plugins.PluginBaseThe base object to be inherited by plugins that are loaded into the King Phisher server. This provides a convenient interface for interacting with the runtime.
- property config[source]
A dictionary that can be used by this plugin to access it’s configuration. Any changes to this configuration will be lost with the server restarts.
- register_http(path, method)[source]
Register a new HTTP request handler at path that is handled by method. Two parameters are passed to the method. The first parameter is a
KingPhisherRequestHandlerinstance and the second is a dictionary of the HTTP query parameters. The specified path is added within the plugins private HTTP handler namespace at_/plugins/$PLUGIN_NAME/$PATHWarning
This resource can be reached by any user whether or not they are authenticated and or associated with a campaign.
New in version 1.7.0.
- Parameters
path (str) – The path to register the method at.
method – The handler for the HTTP method.
- register_rpc(path, method, database_access=False)[source]
Register a new RPC function at path that is handled by method. This RPC function can only be called by authenticated users. A single parameter of the
KingPhisherRequestHandlerinstance is passed to method when the RPC function is invoked. The specified path is added within the plugins private RPC handler namespace atplugins/$PLUGIN_NAME/$PATH.New in version 1.7.0.
Changed in version 1.12.0: Added the database_access parameter.
- Parameters
path (str) – The path to register the method at.
method – The handler for the RPC method.
- server[source]
A reference to the
KingPhisherServerinstance. Only available if the instance has been created.
- storage[source]
An instance of
KeyValueStoragefor this plugin to use for persistent data storage. This attribute is None until thedb_initializedsignal is emitted.
- class ServerPluginManager(config)[source]
Bases:
king_phisher.plugins.PluginManagerBaseThe manager for plugins loaded into the King Phisher server application.