From 2ce27dc885fc98f88f71c1b8be6cc0e0e8272087 Mon Sep 17 00:00:00 2001 From: VakarisZ Date: Mon, 11 Feb 2019 13:24:33 +0200 Subject: [PATCH] Added primitive display of post breach actions --- monkey/monkey_island/cc/resources/telemetry_feed.py | 7 +------ monkey/monkey_island/cc/services/node.py | 3 ++- monkey/monkey_island/cc/services/report.py | 3 ++- .../src/components/report-components/BreachedServers.js | 8 +++++++- 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/monkey/monkey_island/cc/resources/telemetry_feed.py b/monkey/monkey_island/cc/resources/telemetry_feed.py index 4b373330d..05ed841a6 100644 --- a/monkey/monkey_island/cc/resources/telemetry_feed.py +++ b/monkey/monkey_island/cc/resources/telemetry_feed.py @@ -82,12 +82,7 @@ class TelemetryFeed(flask_restful.Resource): @staticmethod def get_post_breach_telem_brief(telem): - target = telem['data']['ip'] - output = telem['data']['output'] - if output: - return 'Monkey ran post breach commands on %s.' % target - else: - return 'Monkey failed running post breach commands on %s.' % target + pass TELEM_PROCESS_DICT = \ diff --git a/monkey/monkey_island/cc/services/node.py b/monkey/monkey_island/cc/services/node.py index 50c921be8..68304e60b 100644 --- a/monkey/monkey_island/cc/services/node.py +++ b/monkey/monkey_island/cc/services/node.py @@ -142,7 +142,8 @@ class NodeService: "group": NodeService.get_monkey_group(monkey), "os": NodeService.get_monkey_os(monkey), "dead": monkey["dead"], - "domain_name": "" + "domain_name": "", + "post_breach_actions": monkey["post_breach_actions"] } @staticmethod diff --git a/monkey/monkey_island/cc/services/report.py b/monkey/monkey_island/cc/services/report.py index 73ca69b5b..b84c1d4d5 100644 --- a/monkey/monkey_island/cc/services/report.py +++ b/monkey/monkey_island/cc/services/report.py @@ -155,7 +155,8 @@ class ReportService: 'domain_name': monkey['domain_name'], 'exploits': list(set( [ReportService.EXPLOIT_DISPLAY_DICT[exploit['exploiter']] for exploit in monkey['exploits'] if - exploit['result']])) + exploit['result']])), + 'post_breach_actions': monkey['post_breach_actions'] if 'post_breach_actions' in monkey else 'None' } for monkey in exploited] diff --git a/monkey/monkey_island/cc/ui/src/components/report-components/BreachedServers.js b/monkey/monkey_island/cc/ui/src/components/report-components/BreachedServers.js index 16f445ce9..02ed3610f 100644 --- a/monkey/monkey_island/cc/ui/src/components/report-components/BreachedServers.js +++ b/monkey/monkey_island/cc/ui/src/components/report-components/BreachedServers.js @@ -9,6 +9,10 @@ let renderIpAddresses = function (val) { return
{renderArray(val.ip_addresses)} {(val.domain_name ? " (".concat(val.domain_name, ")") : "")}
; }; +let renderPostBreach = function (val) { + return
{val.map(x =>
Name: {x.name}
Command: {x.command}
Output: {x.output}
)}
; +}; + const columns = [ { Header: 'Breached Servers', @@ -16,7 +20,9 @@ const columns = [ {Header: 'Machine', accessor: 'label'}, {Header: 'IP Addresses', id: 'ip_addresses', accessor: x => renderIpAddresses(x)}, - {Header: 'Exploits', id: 'exploits', accessor: x => renderArray(x.exploits)} + {Header: 'Exploits', id: 'exploits', accessor: x => renderArray(x.exploits)}, + {Header: 'Post breach actions:', id: 'post_breach_actions', accessor: x => renderPostBreach(x.post_breach_actions)} + ] } ];