1.1.3.1. campaign

This module provides the contents of the tab representing the campaign information in client’s graphical interface.

1.1.3.1.1. Classes

class CampaignViewCredentialsTab(*args, **kwargs)[source]

Bases: CampaignViewGenericTableTab

Display campaign information regarding submitted credentials.

dependencies = <GladeDependencies name='CampaignViewCredentialsTab' >[source]

A GladeDependencies instance which defines information for loading the widget from the GTK builder data.

format_node_data(node)[source]

This method is overridden by subclasses to format the raw node data returned from the server. The length of the list must equal the number of columns in the table. This method is called for each node in the remote table by the loader thread.

Parameters

node (dict) – The node from a GraphQL query representing data for this table.

Returns

The formatted row data.

Return type

list

label_text = 'Credentials'[source]

The label of the tab for display in the GUI.

node_query = '\tquery getCredential($id: String!) {\n\t\tdb {\n\t\t\tnode: credential(id: $id) {\n\t\t\t\tid\n\t\t\t\tsubmitted\n\t\t\t\tmessage { targetEmail }\n\t\t\t\tusername\n\t\t\t\tpassword\n\t\t\t\tmfaToken\n\t\t\t\tregexValidated\n\t\t\t}\n\t\t}\n\t}\n\t'[source]

The GraphQL query used to load a particular node from the remote table. This query is provided with a single parameter of the node’s id.

table_name = 'credentials'[source]

The database table represented by this tab.

table_query = '\tquery getCredentials($campaign: String!, $count: Int!, $cursor: String) {\n\t\tdb {\n\t\t\tcampaign(id: $campaign) {\n\t\t\t\tcredentials(first: $count, after: $cursor) {\n\t\t\t\t\ttotal\n\t\t\t\t\tedges {\n\t\t\t\t\t\tnode {\n\t\t\t\t\t\t\tid\n\t\t\t\t\t\t\tmessage { targetEmail }\n\t\t\t\t\t\t\tsubmitted\n\t\t\t\t\t\t\tusername\n\t\t\t\t\t\t\tpassword\n\t\t\t\t\t\t\tmfaToken\n\t\t\t\t\t\t\tregexValidated\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tpageInfo {\n\t\t\t\t\t\tendCursor\n\t\t\t\t\t\thasNextPage\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t'[source]

The GraphQL query used to load the desired information from the remote table. This query is provided with the following three parameters: campaign, count and cursor.

class CampaignViewDashboardTab(*args, **kwargs)[source]

Bases: CampaignViewGenericTab

Display campaign information on a graphical dash board.

dependencies = <GladeDependencies name='CampaignViewDashboardTab' >[source]

A GladeDependencies instance which defines information for loading the widget from the GTK builder data.

graphs[source]

The CampaignGraph classes represented on the dash board.

label_text = 'Dashboard'[source]

The tabs label for display in the GUI.

load_campaign_information(force=True)[source]

Load the necessary campaign information from the remote server. Unless force is True, the last_load_time is compared with the refresh_frequency to check if the information is stale. If the local data is not stale, this function will return without updating the table.

Parameters

force (bool) – Ignore the load life time and force loading the remote data.

loader_idle_routine()[source]

The routine which refreshes the campaign data at a regular interval.

loader_thread_routine()[source]

The loading routine to be executed within a thread.

class CampaignViewDeaddropTab(*args, **kwargs)[source]

Bases: CampaignViewGenericTableTab

Display campaign information regarding dead drop connections.

dependencies = <GladeDependencies name='CampaignViewDeaddropTab' >[source]

A GladeDependencies instance which defines information for loading the widget from the GTK builder data.

format_node_data(connection)[source]

This method is overridden by subclasses to format the raw node data returned from the server. The length of the list must equal the number of columns in the table. This method is called for each node in the remote table by the loader thread.

Parameters

node (dict) – The node from a GraphQL query representing data for this table.

Returns

The formatted row data.

Return type

list

label_text = 'Deaddrop Connections'[source]

The label of the tab for display in the GUI.

node_query = '\tquery getDeaddropConnection($id: String!) {\n\t\tdb {\n\t\t\tnode: deaddropConnection(id: $id) {\n\t\t\t\tid\n\t\t\t\tdeaddropDeployment { destination }\n\t\t\t\tcount\n\t\t\t\tip\n\t\t\t\tlocalUsername\n\t\t\t\tlocalHostname\n\t\t\t\tlocalIpAddresses\n\t\t\t\tfirstSeen\n\t\t\t\tlastSeen\n\t\t\t}\n\t\t}\n\t}\n\t'[source]

The GraphQL query used to load a particular node from the remote table. This query is provided with a single parameter of the node’s id.

table_name = 'deaddrop_connections'[source]

The database table represented by this tab.

table_query = '\tquery getDeaddropConnections($campaign: String!, $count: Int!, $cursor: String) {\n\t\tdb {\n\t\t\tcampaign(id: $campaign) {\n\t\t\t\tdeaddrop_connections: deaddropConnections(first: $count, after: $cursor) {\n\t\t\t\t\ttotal\n\t\t\t\t\tedges {\n\t\t\t\t\t\tnode {\n\t\t\t\t\t\t\tid\n\t\t\t\t\t\t\tdeaddropDeployment {\n\t\t\t\t\t\t\t\tid\n\t\t\t\t\t\t\t\tdestination\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tcount\n\t\t\t\t\t\t\tip\n\t\t\t\t\t\t\tlocalUsername\n\t\t\t\t\t\t\tlocalHostname\n\t\t\t\t\t\t\tlocalIpAddresses\n\t\t\t\t\t\t\tfirstSeen\n\t\t\t\t\t\t\tlastSeen\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tpageInfo {\n\t\t\t\t\t\tendCursor\n\t\t\t\t\t\thasNextPage\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t'[source]

The GraphQL query used to load the desired information from the remote table. This query is provided with the following three parameters: campaign, count and cursor.

class CampaignViewGenericTab(*args, **kwargs)[source]

Bases: GladeGObject

This object is meant to be subclassed by all of the tabs which load and display information about the current campaign.

dependencies = <GladeDependencies name='CampaignViewGenericTab' >[source]

A GladeDependencies instance which defines information for loading the widget from the GTK builder data.

label[source]

The Gtk.Label representing this tab with text from label_text.

label_text = 'Unknown'[source]

The label of the tab for display in the GUI.

last_load_time[source]

The last time the data was loaded from the server.

loader_thread[source]

The thread object which loads the data from the server.

loader_thread_lock[source]

The threading.Lock object used for synchronization between the loader and main threads.

loader_thread_stop[source]

The threading.Event object used to request that the loader thread stop before completion.

refresh_frequency[source]

The lifetime in seconds to wait before refreshing the data from the server.

top_gobject = 'box'[source]

The name of the attribute to set a reference of the top level GObject to.

class CampaignViewGenericTableTab(*args, **kwargs)[source]

Bases: CampaignViewGenericTab

This object is meant to be subclassed by tabs which will display campaign information of different types from specific database tables. The data in this object is refreshed when multiple events occur and it uses an internal timer to represent the last time the data was refreshed.

dependencies = <GladeDependencies name='CampaignViewGenericTableTab' >[source]

A GladeDependencies instance which defines information for loading the widget from the GTK builder data.

export_table_to_csv(filtered=False)[source]

Export the data represented by the view to a CSV file.

export_table_to_xlsx_worksheet(worksheet, title_format)[source]

Export the data represented by the view to an XLSX worksheet.

Parameters
  • worksheet (xlsxwriter.worksheet.Worksheet) – The destination sheet for the store’s data.

  • title_format (xlsxwriter.format.Format) – The formatting to use for the title row.

format_node_data(node)[source]

This method is overridden by subclasses to format the raw node data returned from the server. The length of the list must equal the number of columns in the table. This method is called for each node in the remote table by the loader thread.

Parameters

node (dict) – The node from a GraphQL query representing data for this table.

Returns

The formatted row data.

Return type

list

load_campaign_information(force=True)[source]

Load the necessary campaign information from the remote server. Unless force is True, the last_load_time is compared with the refresh_frequency to check if the information is stale. If the local data is not stale, this function will return without updating the table.

Parameters

force (bool) – Ignore the load life time and force loading the remote data.

loader_thread_routine(store)[source]

The loading routine to be executed within a thread.

Parameters

store (Gtk.ListStore) – The store object to place the new data.

node_query = None[source]

The GraphQL query used to load a particular node from the remote table. This query is provided with a single parameter of the node’s id.

popup_menu[source]

The Gtk.Menu object which is displayed when right-clicking in the view area.

table_name = ''[source]

The database table represented by this tab.

table_query = None[source]

The GraphQL query used to load the desired information from the remote table. This query is provided with the following three parameters: campaign, count and cursor.

class CampaignViewMessagesTab(*args, **kwargs)[source]

Bases: CampaignViewGenericTableTab

Display campaign information regarding sent messages.

dependencies = <GladeDependencies name='CampaignViewMessagesTab' >[source]

A GladeDependencies instance which defines information for loading the widget from the GTK builder data.

format_node_data(node)[source]

This method is overridden by subclasses to format the raw node data returned from the server. The length of the list must equal the number of columns in the table. This method is called for each node in the remote table by the loader thread.

Parameters

node (dict) – The node from a GraphQL query representing data for this table.

Returns

The formatted row data.

Return type

list

label_text = 'Messages'[source]

The label of the tab for display in the GUI.

node_query = '\tquery getMessage($id: String!) {\n\t\tdb {\n\t\t\tnode: message(id: $id) {\n\t\t\t\tid\n\t\t\t\ttargetEmail\n\t\t\t\tsent\n\t\t\t\ttrained\n\t\t\t\tcompanyDepartment { name }\n\t\t\t\topened\n\t\t\t\topenerIp\n\t\t\t\topenerUserAgent\n\t\t\t\tdeliveryStatus\n\t\t\t\tdeliveryDetails\n\t\t\t}\n\t\t}\n\t}\n\t'[source]

The GraphQL query used to load a particular node from the remote table. This query is provided with a single parameter of the node’s id.

table_name = 'messages'[source]

The database table represented by this tab.

table_query = '\tquery getMessages($campaign: String!, $count: Int!, $cursor: String) {\n\t\tdb {\n\t\t\tcampaign(id: $campaign) {\n\t\t\t\tmessages(first: $count, after: $cursor) {\n\t\t\t\t\ttotal\n\t\t\t\t\tedges {\n\t\t\t\t\t\tnode {\n\t\t\t\t\t\t\tid\n\t\t\t\t\t\t\ttargetEmail\n\t\t\t\t\t\t\tsent\n\t\t\t\t\t\t\ttrained\n\t\t\t\t\t\t\tcompanyDepartment { name }\n\t\t\t\t\t\t\topened\n\t\t\t\t\t\t\topenerIp\n\t\t\t\t\t\t\topenerUserAgent\n\t\t\t\t\t\t\tdeliveryStatus\n\t\t\t\t\t\t\tdeliveryDetails\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tpageInfo {\n\t\t\t\t\t\tendCursor\n\t\t\t\t\t\thasNextPage\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t'[source]

The GraphQL query used to load the desired information from the remote table. This query is provided with the following three parameters: campaign, count and cursor.

class CampaignViewTab(parent, application)[source]

Bases: object

The King Phisher client top-level ‘View Campaign’ tab. This object manages the sub-tabs which display all the information regarding the current campaign.

__init__(parent, application)[source]
Parameters
  • parent (Gtk.Window) – The parent window for this object.

  • application (Gtk.Application) – The main client application instance.

label[source]

The Gtk.Label representing this tabs name.

notebook[source]

The Gtk.Notebook for holding sub-tabs.

tabs[source]

A dict object holding the sub tabs managed by this object.

class CampaignViewVisitsTab(*args, **kwargs)[source]

Bases: CampaignViewGenericTableTab

Display campaign information regarding incoming visitors.

dependencies = <GladeDependencies name='CampaignViewVisitsTab' >[source]

A GladeDependencies instance which defines information for loading the widget from the GTK builder data.

format_node_data(node)[source]

This method is overridden by subclasses to format the raw node data returned from the server. The length of the list must equal the number of columns in the table. This method is called for each node in the remote table by the loader thread.

Parameters

node (dict) – The node from a GraphQL query representing data for this table.

Returns

The formatted row data.

Return type

list

label_text = 'Visits'[source]

The label of the tab for display in the GUI.

node_query = '\tquery getVisit($id: String!) {\n\t\tdb {\n\t\t\tnode: visit(id: $id) {\n\t\t\t\tid\n\t\t\t\tmessage { targetEmail }\n\t\t\t\tip\n\t\t\t\tcount\n\t\t\t\tuserAgent\n\t\t\t\tipGeoloc { city }\n\t\t\t\tfirstSeen\n\t\t\t\tlastSeen\n\t\t\t}\n\t\t}\n\t}\n\t'[source]

The GraphQL query used to load a particular node from the remote table. This query is provided with a single parameter of the node’s id.

table_name = 'visits'[source]

The database table represented by this tab.

table_query = '\tquery getVisits($campaign: String!, $count: Int!, $cursor: String) {\n\t\tdb {\n\t\t\tcampaign(id: $campaign) {\n\t\t\t\tvisits(first: $count, after: $cursor) {\n\t\t\t\t\ttotal\n\t\t\t\t\tedges {\n\t\t\t\t\t\tnode {\n\t\t\t\t\t\t\tid\n\t\t\t\t\t\t\tmessage { targetEmail }\n\t\t\t\t\t\t\tip\n\t\t\t\t\t\t\tcount\n\t\t\t\t\t\t\tuserAgent\n\t\t\t\t\t\t\tipGeoloc { city }\n\t\t\t\t\t\t\tfirstSeen\n\t\t\t\t\t\t\tlastSeen\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tpageInfo {\n\t\t\t\t\t\tendCursor\n\t\t\t\t\t\thasNextPage\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t'[source]

The GraphQL query used to load the desired information from the remote table. This query is provided with the following three parameters: campaign, count and cursor.