diff --git a/monkey_island/cc/services/node.py b/monkey_island/cc/services/node.py index 8666bcfca..47c8ca96b 100644 --- a/monkey_island/cc/services/node.py +++ b/monkey_island/cc/services/node.py @@ -77,6 +77,10 @@ class NodeService: os = "windows" return os + @staticmethod + def get_node_os(node): + return node["os"]["type"] + @staticmethod def get_monkey_manual_run(monkey): for p in monkey["parent"]: @@ -96,13 +100,19 @@ class NodeService: @staticmethod def get_monkey_group(monkey): if len(set(monkey["ip_addresses"]).intersection(local_ip_addresses())) != 0: - return "islandInfected" + monkey_type = "island_monkey" + else: + monkey_type = "manual" if NodeService.get_monkey_manual_run(monkey) else "monkey" - return "manuallyInfected" if NodeService.get_monkey_manual_run(monkey) else "infected" + monkey_os = NodeService.get_monkey_os(monkey) + monkey_running = "" if monkey["dead"] else "_running" + return "%s_%s%s" % (monkey_type, monkey_os, monkey_running) @staticmethod def get_node_group(node): - return "exploited" if node.get("exploited") else "clean" + node_type = "exploited" if node.get("exploited") else "clean" + node_os = NodeService.get_node_os(node) + return "%s_%s" % (node_type, node_os) @staticmethod def monkey_to_net_node(monkey): @@ -122,7 +132,7 @@ class NodeService: "id": node["_id"], "label": NodeService.get_node_label(node), "group": NodeService.get_node_group(node), - "os": node["os"]["type"] + "os": NodeService.get_node_os(node) } @staticmethod @@ -221,7 +231,7 @@ class NodeService: { "id": NodeService.get_monkey_island_pseudo_id(), "label": "MonkeyIsland", - "group": "islandClean", + "group": "island", } @staticmethod diff --git a/monkey_island/cc/ui/src/components/pages/MapPage.js b/monkey_island/cc/ui/src/components/pages/MapPage.js index 224cb299f..16be1f2c8 100644 --- a/monkey_island/cc/ui/src/components/pages/MapPage.js +++ b/monkey_island/cc/ui/src/components/pages/MapPage.js @@ -5,40 +5,27 @@ import PreviewPane from 'components/preview-pane/PreviewPane'; import {Link} from 'react-router-dom'; import {Icon} from 'react-fa'; +let groupsToGroupsOptions = (groupNames) => { + let groupOptions = {}; + for (let groupName of groupNames) { + groupOptions[groupName] = + { + shape: 'image', + size: 50, + image: '../images/nodes/' + groupName + '.png' + }; + } + return groupOptions; +}; + let options = { layout: { improvedLayout: false }, - groups: { - manuallyInfected: { - shape: 'icon', - icon: { - face: 'FontAwesome', - code: '\uf120', - size: 50, - color: '#8f5a0b' - } - }, - infected: { - shape: 'icon', - icon: { - face: 'FontAwesome', - code: '\uf06d', - size: 50, - color: '#d30d09' - } - }, - clean: { - shape: 'icon', - icon: { - face: 'FontAwesome', - code: '\uf108', - size: 50, - color: '#999' - } - } - } - + groups: groupsToGroupsOptions(['clean_linux', 'clean_windows', 'exploited_linux', 'exploited_windows', 'island', + 'island_monkey_linux', 'island_monkey_linux_running', 'island_monkey_windows', 'island_monkey_windows_running', + 'manual_linux', 'manual_linux_running', 'manual_windows', 'manual_windows_running', 'monkey_linux', + 'monkey_linux_running', 'monkey_windows', 'monkey_windows_running']) }; class MapPageComponent extends React.Component { diff --git a/monkey_island/cc/ui/src/images/nodes/clean_linux.png b/monkey_island/cc/ui/src/images/nodes/clean_linux.png new file mode 100644 index 000000000..5c00186c5 Binary files /dev/null and b/monkey_island/cc/ui/src/images/nodes/clean_linux.png differ diff --git a/monkey_island/cc/ui/src/images/nodes/clean_windows.png b/monkey_island/cc/ui/src/images/nodes/clean_windows.png new file mode 100644 index 000000000..08f8f37f1 Binary files /dev/null and b/monkey_island/cc/ui/src/images/nodes/clean_windows.png differ diff --git a/monkey_island/cc/ui/src/images/nodes/exploited_linux.png b/monkey_island/cc/ui/src/images/nodes/exploited_linux.png new file mode 100644 index 000000000..e95dfdd71 Binary files /dev/null and b/monkey_island/cc/ui/src/images/nodes/exploited_linux.png differ diff --git a/monkey_island/cc/ui/src/images/nodes/exploited_windows.png b/monkey_island/cc/ui/src/images/nodes/exploited_windows.png new file mode 100644 index 000000000..75350fb73 Binary files /dev/null and b/monkey_island/cc/ui/src/images/nodes/exploited_windows.png differ diff --git a/monkey_island/cc/ui/src/images/nodes/island.png b/monkey_island/cc/ui/src/images/nodes/island.png new file mode 100644 index 000000000..68d627b32 Binary files /dev/null and b/monkey_island/cc/ui/src/images/nodes/island.png differ diff --git a/monkey_island/cc/ui/src/images/nodes/island_monkey_linux.png b/monkey_island/cc/ui/src/images/nodes/island_monkey_linux.png new file mode 100644 index 000000000..f98b5ebbd Binary files /dev/null and b/monkey_island/cc/ui/src/images/nodes/island_monkey_linux.png differ diff --git a/monkey_island/cc/ui/src/images/nodes/island_monkey_linux_running.png b/monkey_island/cc/ui/src/images/nodes/island_monkey_linux_running.png new file mode 100644 index 000000000..62fabc360 Binary files /dev/null and b/monkey_island/cc/ui/src/images/nodes/island_monkey_linux_running.png differ diff --git a/monkey_island/cc/ui/src/images/nodes/island_monkey_windows.png b/monkey_island/cc/ui/src/images/nodes/island_monkey_windows.png new file mode 100644 index 000000000..79cb177e1 Binary files /dev/null and b/monkey_island/cc/ui/src/images/nodes/island_monkey_windows.png differ diff --git a/monkey_island/cc/ui/src/images/nodes/island_monkey_windows_running.png b/monkey_island/cc/ui/src/images/nodes/island_monkey_windows_running.png new file mode 100644 index 000000000..525f671a1 Binary files /dev/null and b/monkey_island/cc/ui/src/images/nodes/island_monkey_windows_running.png differ diff --git a/monkey_island/cc/ui/src/images/nodes/manual_linux.png b/monkey_island/cc/ui/src/images/nodes/manual_linux.png new file mode 100644 index 000000000..fedb1e426 Binary files /dev/null and b/monkey_island/cc/ui/src/images/nodes/manual_linux.png differ diff --git a/monkey_island/cc/ui/src/images/nodes/manual_linux_running.png b/monkey_island/cc/ui/src/images/nodes/manual_linux_running.png new file mode 100644 index 000000000..d57728276 Binary files /dev/null and b/monkey_island/cc/ui/src/images/nodes/manual_linux_running.png differ diff --git a/monkey_island/cc/ui/src/images/nodes/manual_windows.png b/monkey_island/cc/ui/src/images/nodes/manual_windows.png new file mode 100644 index 000000000..950c10fb6 Binary files /dev/null and b/monkey_island/cc/ui/src/images/nodes/manual_windows.png differ diff --git a/monkey_island/cc/ui/src/images/nodes/manual_windows_running.png b/monkey_island/cc/ui/src/images/nodes/manual_windows_running.png new file mode 100644 index 000000000..8eef19528 Binary files /dev/null and b/monkey_island/cc/ui/src/images/nodes/manual_windows_running.png differ diff --git a/monkey_island/cc/ui/src/images/nodes/monkey_linux.png b/monkey_island/cc/ui/src/images/nodes/monkey_linux.png new file mode 100644 index 000000000..dad9c2b01 Binary files /dev/null and b/monkey_island/cc/ui/src/images/nodes/monkey_linux.png differ diff --git a/monkey_island/cc/ui/src/images/nodes/monkey_linux_running.png b/monkey_island/cc/ui/src/images/nodes/monkey_linux_running.png new file mode 100644 index 000000000..21cded913 Binary files /dev/null and b/monkey_island/cc/ui/src/images/nodes/monkey_linux_running.png differ diff --git a/monkey_island/cc/ui/src/images/nodes/monkey_windows.png b/monkey_island/cc/ui/src/images/nodes/monkey_windows.png new file mode 100644 index 000000000..669630d21 Binary files /dev/null and b/monkey_island/cc/ui/src/images/nodes/monkey_windows.png differ diff --git a/monkey_island/cc/ui/src/images/nodes/monkey_windows_running.png b/monkey_island/cc/ui/src/images/nodes/monkey_windows_running.png new file mode 100644 index 000000000..6c6daf672 Binary files /dev/null and b/monkey_island/cc/ui/src/images/nodes/monkey_windows_running.png differ