Add node icons
|
@ -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
|
||||
|
|
|
@ -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 {
|
||||
|
|
After Width: | Height: | Size: 36 KiB |
After Width: | Height: | Size: 23 KiB |
After Width: | Height: | Size: 95 KiB |
After Width: | Height: | Size: 85 KiB |
After Width: | Height: | Size: 156 KiB |
After Width: | Height: | Size: 163 KiB |
After Width: | Height: | Size: 167 KiB |
After Width: | Height: | Size: 152 KiB |
After Width: | Height: | Size: 156 KiB |
After Width: | Height: | Size: 41 KiB |
After Width: | Height: | Size: 45 KiB |
After Width: | Height: | Size: 29 KiB |
After Width: | Height: | Size: 33 KiB |
After Width: | Height: | Size: 96 KiB |
After Width: | Height: | Size: 100 KiB |
After Width: | Height: | Size: 86 KiB |
After Width: | Height: | Size: 90 KiB |