From 13d8d4cfc15244d62fb1a1a5246538f79df42dbd Mon Sep 17 00:00:00 2001
From: Itay Mizeretz
Date: Tue, 14 Nov 2017 15:49:14 +0200
Subject: [PATCH] Add scanned-exploited pie chart Merged stolen passwords
section Styled tables' header
---
monkey_island/cc/ui/package.json | 1 +
.../cc/ui/src/components/pages/ReportPage.js | 41 +++++++++-------
.../report-components/BreachedServers.js | 11 +++--
.../report-components/ScannedBreachedChart.js | 49 +++++++++++++++++++
.../report-components/ScannedServers.js | 13 +++--
.../report-components/StolenPasswords.js | 13 +++--
6 files changed, 100 insertions(+), 28 deletions(-)
create mode 100644 monkey_island/cc/ui/src/components/report-components/ScannedBreachedChart.js
diff --git a/monkey_island/cc/ui/package.json b/monkey_island/cc/ui/package.json
index 71f2decd4..537982386 100644
--- a/monkey_island/cc/ui/package.json
+++ b/monkey_island/cc/ui/package.json
@@ -80,6 +80,7 @@
"react-modal-dialog": "^4.0.7",
"react-redux": "^5.0.6",
"react-router-dom": "^4.2.2",
+ "react-svg-piechart": "^1.4.0",
"react-table": "^6.7.4",
"react-toggle": "^4.0.1",
"redux": "^3.7.2"
diff --git a/monkey_island/cc/ui/src/components/pages/ReportPage.js b/monkey_island/cc/ui/src/components/pages/ReportPage.js
index b5e808e0e..1bf41a2e8 100644
--- a/monkey_island/cc/ui/src/components/pages/ReportPage.js
+++ b/monkey_island/cc/ui/src/components/pages/ReportPage.js
@@ -5,6 +5,7 @@ import ScannedServers from 'components/report-components/ScannedServers';
import {ReactiveGraph} from 'components/reactive-graph/ReactiveGraph';
import {options, edgeGroupToColor} from 'components/map/MapOptions';
import StolenPasswords from 'components/report-components/StolenPasswords';
+import ScannedBreachedChart from 'components/report-components/ScannedBreachedChart';
class ReportPageComponent extends React.Component {
constructor(props) {
@@ -102,31 +103,37 @@ class ReportPageComponent extends React.Component {
A full report of the Monkeys activities follows.
-
+
- Network Overview
+ At a Glance
-
- {/* TODO: Replace 6,2 with data */}
- During the current run, the Monkey discovered 6 machines and successfully breached 2 of them.
- In addition, it attempted to exploit the rest, any security software installed in the network should have picked up the attack attempts and logged them.
-
- Detailed recommendations in the next part of the
report.
-
Breached Servers
+
+
+ {/* TODO: Replace 6,2 with data */}
+ During the current run, the Monkey discovered 6 machines and successfully breached 2 of them.
+
+ In addition, it attempted to exploit the rest, any security software installed in the network should have picked up the attack attempts and logged them.
+
+ Detailed recommendations in the next part of the report.
+
+
+
+
+
+
+
+
+
-
-
Scanned Servers
+
{/* TODO: Add table of scanned servers */}
-
-
-
- Stolen Credentials
-
-
+
+
+
diff --git a/monkey_island/cc/ui/src/components/report-components/BreachedServers.js b/monkey_island/cc/ui/src/components/report-components/BreachedServers.js
index 0a7d3ed93..d8c91f5ca 100644
--- a/monkey_island/cc/ui/src/components/report-components/BreachedServers.js
+++ b/monkey_island/cc/ui/src/components/report-components/BreachedServers.js
@@ -9,9 +9,14 @@ let renderArray = function(val) {
};
const columns = [
- { Header: 'Machine', accessor: 'label'},
- { Header: 'IP Addresses', id: 'ip_addresses', accessor: x => renderArray(x.ip_addresses)},
- { Header: 'Exploits', id: 'exploits', accessor: x => renderArray(x.exploits)}
+ {
+ Header: 'Breached Servers',
+ columns: [
+ {Header: 'Machine', accessor: 'label'},
+ {Header: 'IP Addresses', id: 'ip_addresses', accessor: x => renderArray(x.ip_addresses)},
+ {Header: 'Exploits', id: 'exploits', accessor: x => renderArray(x.exploits)}
+ ]
+ }
];
const pageSize = 10;
diff --git a/monkey_island/cc/ui/src/components/report-components/ScannedBreachedChart.js b/monkey_island/cc/ui/src/components/report-components/ScannedBreachedChart.js
new file mode 100644
index 000000000..fcfd8fcf2
--- /dev/null
+++ b/monkey_island/cc/ui/src/components/report-components/ScannedBreachedChart.js
@@ -0,0 +1,49 @@
+import React from 'react'
+import PieChart from 'react-svg-piechart'
+
+class ScannedBreachedChartComponent extends React.Component {
+ constructor() {
+ super();
+
+ this.state = {
+ expandedSector: null,
+ };
+
+ this.handleMouseEnterOnSector = this.handleMouseEnterOnSector.bind(this);
+ }
+
+ handleMouseEnterOnSector(sector) {
+ this.setState({expandedSector: sector});
+ }
+
+ render() {
+ const data = [
+ {label: 'Scanned', value: 4, color: '#f0ad4e'},
+ {label: 'Exploited', value: 2, color: '#d9534f'}
+ ];
+
+ return (
+
+
+
+ {
+ data.map((element, i) => (
+
+
+ {element.label} : {element.value}
+
+
+ ))
+ }
+
+
+ )
+ }
+}
+
+export default ScannedBreachedChartComponent;
diff --git a/monkey_island/cc/ui/src/components/report-components/ScannedServers.js b/monkey_island/cc/ui/src/components/report-components/ScannedServers.js
index 9ae1b5135..b598ab537 100644
--- a/monkey_island/cc/ui/src/components/report-components/ScannedServers.js
+++ b/monkey_island/cc/ui/src/components/report-components/ScannedServers.js
@@ -9,10 +9,15 @@ let renderArray = function(val) {
};
const columns = [
- { Header: 'Machine', accessor: 'label'},
- { Header: 'IP Addresses', id: 'ip_addresses', accessor: x => renderArray(x.ip_addresses)},
- { Header: 'Accessible From', id: 'accessible_from_nodes', accessor: x => renderArray(x.accessible_from_nodes)},
- { Header: 'Services', id: 'services', accessor: x => renderArray(x.services)}
+ {
+ Header: 'Scanned Servers',
+ columns: [
+ { Header: 'Machine', accessor: 'label'},
+ { Header: 'IP Addresses', id: 'ip_addresses', accessor: x => renderArray(x.ip_addresses)},
+ { Header: 'Accessible From', id: 'accessible_from_nodes', accessor: x => renderArray(x.accessible_from_nodes)},
+ { Header: 'Services', id: 'services', accessor: x => renderArray(x.services)}
+ ]
+ }
];
const pageSize = 10;
diff --git a/monkey_island/cc/ui/src/components/report-components/StolenPasswords.js b/monkey_island/cc/ui/src/components/report-components/StolenPasswords.js
index c34d51bed..754b51f92 100644
--- a/monkey_island/cc/ui/src/components/report-components/StolenPasswords.js
+++ b/monkey_island/cc/ui/src/components/report-components/StolenPasswords.js
@@ -2,10 +2,15 @@ import React from 'react';
import ReactTable from 'react-table'
const columns = [
- { Header: 'Username', accessor: 'username'},
- { Header: 'Password/Hash', accessor: 'password'},
- { Header: 'Type', accessor: 'type'},
- { Header: 'Origin', accessor: 'origin'}
+ {
+ Header: 'Stolen Credentials',
+ columns: [
+ { Header: 'Username', accessor: 'username'},
+ { Header: 'Password/Hash', accessor: 'password'},
+ { Header: 'Type', accessor: 'type'},
+ { Header: 'Origin', accessor: 'origin'}
+ ]
+ }
];
const pageSize = 10;