From 6b6a1b4de585b13e387e18944ffc4ce274badb48 Mon Sep 17 00:00:00 2001 From: ganapati Date: Wed, 25 Oct 2017 10:28:55 +0200 Subject: [PATCH] Fix errors from empire --- cme/modules/empire_exec.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cme/modules/empire_exec.py b/cme/modules/empire_exec.py index 473c7579..70251371 100644 --- a/cme/modules/empire_exec.py +++ b/cme/modules/empire_exec.py @@ -47,7 +47,13 @@ class CMEModule: payload = {'StagerName': 'multi/launcher', 'Listener': module_options['LISTENER']} r = requests.post(base_url + '/api/stagers?token={}'.format(token), json=payload, headers=headers, verify=False) - self.empire_launcher = r.json()['multi/launcher']['Output'] + + response = r.json() + if "error" in response: + context.log.error("Error from empire : {}".format(response["error"])) + sys.exit(1) + + self.empire_launcher = response['multi/launcher']['Output'] context.log.success("Successfully generated launcher for listener '{}'".format(module_options['LISTENER']))