From 4afbfb8280f83df8ea6f86fc511c0650a1aa21f9 Mon Sep 17 00:00:00 2001 From: Itay Mizeretz Date: Sun, 24 Sep 2017 16:41:04 +0300 Subject: [PATCH] Cosmetic fixes and improves to map --- monkey_island/cc/services/edge.py | 2 +- .../cc/ui/src/components/pages/MapPage.js | 5 + .../components/preview-pane/PreviewPane.js | 138 ++++++++++++------ 3 files changed, 98 insertions(+), 47 deletions(-) diff --git a/monkey_island/cc/services/edge.py b/monkey_island/cc/services/edge.py index 4c309a872..ca3b9c597 100644 --- a/monkey_island/cc/services/edge.py +++ b/monkey_island/cc/services/edge.py @@ -133,7 +133,7 @@ class EdgeService: @staticmethod def get_infected_monkey_island_pseudo_edges(): monkey = cc.services.node.NodeService.get_monkey_island_monkey() - existing_ids = [x["_id"] for x in mongo.db.edge.find({"to": monkey["_id"]})] + existing_ids = [x["from"] for x in mongo.db.edge.find({"to": monkey["_id"]})] monkey_ids = [x["_id"] for x in mongo.db.monkey.find({}) if ("tunnel" not in x) and (x["_id"] not in existing_ids)] edges = [] diff --git a/monkey_island/cc/ui/src/components/pages/MapPage.js b/monkey_island/cc/ui/src/components/pages/MapPage.js index 16be1f2c8..db387f2e6 100644 --- a/monkey_island/cc/ui/src/components/pages/MapPage.js +++ b/monkey_island/cc/ui/src/components/pages/MapPage.js @@ -22,6 +22,11 @@ let options = { layout: { improvedLayout: false }, + edges: { + smooth: { + type: "curvedCW" + } + }, 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', diff --git a/monkey_island/cc/ui/src/components/preview-pane/PreviewPane.js b/monkey_island/cc/ui/src/components/preview-pane/PreviewPane.js index 03d7e4030..9c4f973c9 100644 --- a/monkey_island/cc/ui/src/components/preview-pane/PreviewPane.js +++ b/monkey_island/cc/ui/src/components/preview-pane/PreviewPane.js @@ -2,27 +2,88 @@ import React from 'react'; import {Icon} from "react-fa"; class PreviewPaneComponent extends React.Component { + + osRow(asset) { + return ( + + Operating System + {asset.os} + + ); + } + + ipsRow(asset) { + return ( + + IP Addresses + {asset.ip_addresses.map(val =>
{val}
)} + + ); + } + + servicesRow(asset) { + return ( + + Services + {asset.services.map(val =>
{val}
)} + + ); + } + + accessibleRow(asset) { + return ( + + Accessible From + {asset.accessible_from_nodes.map(val =>
{val}
)} + + ); + } + + descriptionRow(asset) { + return ( + + Description + {asset.description} + + ); + } + + aliveRow(asset) { + return ( + + Alive + {(!asset.dead).toString()} + + ); + } + + exploitsTimeline(asset) { + return ( +
+

Timeline

+ +
+ ) + } + assetInfo(asset) { return (
- - - - - - - - - - - - - - - - + {this.osRow(asset)} + {this.ipsRow(asset)} + {this.servicesRow(asset)} + {this.accessibleRow(asset)}
Operating System{asset.os}
IP Addresses{asset.ip_addresses.map(val =>
{val}
)}
Services{asset.services.map(val =>
{val}
)}
Accessible From{asset.accessible_from_nodes.map(val =>
{val}
)}
@@ -32,27 +93,21 @@ class PreviewPaneComponent extends React.Component { infectedAssetInfo(asset) { return (
- {this.assetInfo(asset)} - -

Timeline

- + + + {this.descriptionRow(asset)} + {this.aliveRow(asset)} + {this.osRow(asset)} + {this.ipsRow(asset)} + {this.servicesRow(asset)} + {this.accessibleRow(asset)} + +
+ {this.exploitsTimeline(asset)}
); } - infectionInfo(edge) { - return this.scanInfo(edge); - } - scanInfo(edge) { return (
@@ -76,7 +131,7 @@ class PreviewPaneComponent extends React.Component {