Skip to content

Commit

Permalink
Merge 'dev' into 'master' Version 1.10.0 Final
Browse files Browse the repository at this point in the history
  • Loading branch information
Erik Daguerre committed Mar 16, 2018
2 parents 91fb64a + dfdd66d commit 63aaf47
Show file tree
Hide file tree
Showing 147 changed files with 3,720 additions and 2,352 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -14,6 +14,7 @@ build/*
configs/*
dist/*
docs/build/*
docs/coverage/*
docs/html/*
ssl/*

Expand Down
6 changes: 3 additions & 3 deletions KingPhisherServer
Expand Up @@ -137,10 +137,10 @@ def _ex_config_logging(arguments, config, console_handler):
if isinstance(options, dict): # new style
if not options.get('enabled', True):
break
if not 'path' in options:
if 'path' not in options:
color.print_error('logging.file is missing required key \'path\'')
sys.exit(os.EX_CONFIG)
if not 'level' in options:
if 'level' not in options:
color.print_error('logging.file is missing required key \'level\'')
sys.exit(os.EX_CONFIG)
file_path = options['path']
Expand Down Expand Up @@ -173,7 +173,7 @@ def _ex_config_logging(arguments, config, console_handler):

if arguments.loglvl is None and 'level' in options:
log_level = str(options.get('level', '')).upper()
if not log_level in log_levels:
if log_level not in log_levels:
color.print_error('logging.console.level is invalid, must be one of: ' + ', '.join(log_levels))
sys.exit(os.EX_CONFIG)
console_handler.setLevel(getattr(logging, log_level))
Expand Down
36 changes: 31 additions & 5 deletions data/client/king_phisher/client_config.json
Expand Up @@ -5,15 +5,41 @@
"dashboard.bottom": "VisitsTimeline",
"dashboard.top_left": "Overview",
"dashboard.top_right": "VisitorInfo",
"mailer.attachment_file": null,
"filter.campaign.expired": false,
"filter.campaign.other_users": false,
"filter.campaign.user": true,
"mailer.attachment_file": "",
"mailer.attachment_file.post_processing": null,
"mailer.calendar_invite_all_day": false,
"mailer.calendar_invite_date": {
"__complex_type__": "datetime.date",
"value": "2015-10-19"
},
"mailer.calendar_invite_duration": 60.0,
"mailer.calendar_invite_location": "",
"mailer.calendar_invite_start_hour": 12.0,
"mailer.calendar_invite_start_minute": 0.0,
"mailer.calendar_invite_summary": "",
"mailer.calendar_request_rsvp": false,
"mailer.company_name": "",
"mailer.html_file": "",
"mailer.importance": "Normal",
"mailer.max_messages_per_connection": 5,
"mailer.message_type": "email",
"mailer.recipient_email_cc": "",
"mailer.recipient_email_to": "",
"mailer.reply_to_email": "",
"mailer.sensitivity": "Normal",
"mailer.source_email": "",
"mailer.source_email_alias": "",
"mailer.source_email_smtp": "",
"mailer.subject": "",
"mailer.target_email_address": "",
"mailer.target_field": "to",
"mailer.target_file": "",
"mailer.target_name": "",
"mailer.target_type": "file",
"filter.campaign.expired": false,
"filter.campaign.user": true,
"filter.campaign.other_users": false,
"mailer.webserver_url": "",
"plugins": {},
"plugins.enabled": [],
"plugins.installed": {},
Expand All @@ -23,14 +49,14 @@
"server_use_ssl": false,
"server_username": "",
"sftp_client": "filezilla --logontype=interactive sftp://{username}@{server}{web_root}",
"ssh_preferred_key": null,
"smtp_max_send_rate": 45.0,
"smtp_server": "localhost:25",
"smtp_ssh_enable": false,
"smtp_ssl_enable": false,
"smtp_username": "",
"spf_check_level": 1,
"spf_check_timeout": 10,
"ssh_preferred_key": null,
"ssh_server": "localhost:22",
"ssh_username": "",
"text_font": "monospace 11",
Expand Down
11 changes: 9 additions & 2 deletions data/client/king_phisher/plugins/check_for_updates.py
Expand Up @@ -5,14 +5,18 @@
import king_phisher.client.gui_utilities as gui_utilities

import requests
import requests.exceptions

StrictVersion = distutils.version.StrictVersion

def release_to_version(release):
return StrictVersion(release['tag_name'][1:])

def get_latest_release():
releases = requests.get('https://api.github.com/repos/securestate/king-phisher/releases').json()
try:
releases = requests.get('https://api.github.com/repos/securestate/king-phisher/releases').json()
except requests.exceptions.ConnectionError:
return None
releases = [release for release in releases if not release['draft']]
releases = sorted(
releases,
Expand All @@ -30,12 +34,16 @@ class Plugin(plugins.ClientPlugin):
will be notified with a dialog box after logging into the server.
"""
homepage = 'https://github.com/securestate/king-phisher'
version = '1.0.1'
def initialize(self):
self.signal_connect('server-connected', self.signal_server_connected)
return True

def signal_server_connected(self, _):
release = get_latest_release()
if release is None:
self.logger.error('failed to find the latest release')
return
self.logger.info('found latest release: ' + release['tag_name'])
client_version = StrictVersion(version.distutils_version)
release_version = release_to_version(release)
Expand All @@ -57,4 +65,3 @@ def signal_server_connected(self, _):
"<a href=\"{release[html_url]}\">{release[tag_name]}</a> is now available.".format(part=out_of_date, release=release),
secondary_use_markup=True
)

220 changes: 0 additions & 220 deletions data/client/king_phisher/plugins/data_collection.py

This file was deleted.

25 changes: 25 additions & 0 deletions data/client/king_phisher/queries/get_campaign.graphql
@@ -0,0 +1,25 @@
# retrieve a campaign by it's ID
query getCampaign($id: String!) {
db {
campaign(id: $id) {
id
created
description
expiration
maxCredentials
name
campaignType {
id
name
}
company {
id
name
}
user {
id
name
}
}
}
}

0 comments on commit 63aaf47

Please sign in to comment.