diff --git a/canarydrop.py b/canarydrop.py index c3cdfd2cb..7ea402353 100644 --- a/canarydrop.py +++ b/canarydrop.py @@ -32,7 +32,7 @@ class Canarydrop(object): 'imgur_token' ,'imgur', 'auth', 'browser_scanner_enabled', 'web_image_path',\ 'web_image_enabled', 'type', 'clonedsite', 'aws_secret_access_key',\ 'aws_access_key_id', 'redirect_url', 'region', 'output', 'slack_api_key',\ - 'wg_key', 'kubeconfig'] + 'wg_key', 'kubeconfig', 'secure_note_text', 'secure_note_ciphertext', 'secure_note_initialization_vector'] def __init__(self, generate=False, **kwargs): self._drop = {} diff --git a/channel_http.py b/channel_http.py index c346cd51f..60afa93bb 100644 --- a/channel_http.py +++ b/channel_http.py @@ -20,6 +20,7 @@ from queries import get_canarydrop, add_canarydrop_hit, add_additional_info_to_hit from constants import INPUT_CHANNEL_HTTP from settings import TOKEN_RETURN, MAX_UPLOAD_SIZE, WEB_IMAGE_UPLOAD_PATH +import settings env = Environment(loader=FileSystemLoader('templates')) @@ -76,6 +77,17 @@ def render_GET(self, request): redirect_url=canarydrop._drop['redirect_url']).encode('utf8') if request.getHeader('Accept') and "text/html" in request.getHeader('Accept'): + if canarydrop._drop['type'] == 'secure_note': + now = datetime.datetime.now() + template = env.get_template('secure_note.html') + return template.render( + # note=canarydrop._drop['secure_note_text'], + note_ciphertext=canarydrop._drop['secure_note_ciphertext'], + initialization_vector=canarydrop._drop['secure_note_initialization_vector'], + now=now, + settings=settings + ).encode('utf8') + if canarydrop['browser_scanner_enabled']: template = env.get_template('browser_scanner.html') return template.render(key=canarydrop._drop['hit_time'], @@ -126,7 +138,7 @@ def render_POST(self, request): safety_net = request.args.get('safety_net', [None])[0] last_used = request.args.get('last_used', [None])[0] additional_info = {'AWS Key Log Data': {k:v for k,v in request.args.iteritems() if k not in ['user_agent', 'ip']}} - + self.dispatch(canarydrop=canarydrop, src_ip=src_ip, useragent=useragent, additional_info=additional_info) return self.GIF diff --git a/httpd_site.py b/httpd_site.py index 6e0b0e15c..d9746894b 100644 --- a/httpd_site.py +++ b/httpd_site.py @@ -93,6 +93,7 @@ def render_POST(self, request): 'sql_server', 'my_sql', 'aws_keys', + 'secure_note', 'signed_exe', 'fast_redirect', 'slow_redirect', @@ -169,6 +170,11 @@ def render_POST(self, request): response['Hostname'] = canarydrop.get_hostname() response['Url_components'] = list(canarydrop.get_url_components()) + if token_type == "secure_note": + canarydrop['secure_note_text'] = request.args['secure_note_text'][0] + canarydrop['secure_note_ciphertext'] = request.args['secure_note_ciphertext'][0] + canarydrop['secure_note_initialization_vector'] = request.args['secure_note_initialization_vector'][0] + response['Token'] = canarytoken.value() response['Auth'] = canarydrop['auth'] response['Email'] = email diff --git a/templates/generate_new.html b/templates/generate_new.html index 10e3ab9ba..1ead76a29 100644 --- a/templates/generate_new.html +++ b/templates/generate_new.html @@ -105,6 +105,7 @@

Select your token