From eb79499e809c56931c21411e6057f6c6993e9883 Mon Sep 17 00:00:00 2001 From: Itay Mizeretz Date: Sun, 22 Jul 2018 18:49:51 +0300 Subject: [PATCH] Change report structure Add tables for shared admins, strong users, shared creds. --- .../cc/ui/src/components/pages/ReportPage.js | 47 +++++++++++++------ .../report-components/BreachedServers.js | 5 +- .../report-components/ScannedServers.js | 5 +- .../report-components/SharedAdmins.js | 42 +++++++++++++++++ .../report-components/SharedCreds.js | 41 ++++++++++++++++ .../report-components/StrongUsers.js | 43 +++++++++++++++++ 6 files changed, 161 insertions(+), 22 deletions(-) create mode 100644 monkey_island/cc/ui/src/components/report-components/SharedAdmins.js create mode 100644 monkey_island/cc/ui/src/components/report-components/SharedCreds.js create mode 100644 monkey_island/cc/ui/src/components/report-components/StrongUsers.js diff --git a/monkey_island/cc/ui/src/components/pages/ReportPage.js b/monkey_island/cc/ui/src/components/pages/ReportPage.js index adb024c72..7590dbcae 100644 --- a/monkey_island/cc/ui/src/components/pages/ReportPage.js +++ b/monkey_island/cc/ui/src/components/pages/ReportPage.js @@ -7,8 +7,11 @@ import {edgeGroupToColor, options} from 'components/map/MapOptions'; import StolenPasswords from 'components/report-components/StolenPasswords'; import CollapsibleWellComponent from 'components/report-components/CollapsibleWell'; import {Line} from 'rc-progress'; -import AuthComponent from '../AuthComponent'; +import AuthComponent from 'components/AuthComponent'; import PassTheHashMapPageComponent from "./PassTheHashMapPage"; +import SharedCreds from "components/report-components/SharedCreds"; +import StrongUsers from "components/report-components/StrongUsers"; +import SharedAdmins from "components/report-components/SharedAdmins"; let guardicoreLogoImage = require('../../images/guardicore-logo.png'); let monkeyLogoImage = require('../../images/monkey-icon.svg'); @@ -130,7 +133,6 @@ class ReportPageComponent extends AuthComponent { {this.generateReportFindingsSection()} {this.generateReportRecommendationsSection()} {this.generateReportGlanceSection()} - {this.generateReportPthSection()} {this.generateReportFooter()}
@@ -415,14 +417,40 @@ class ReportPageComponent extends AuthComponent {
-
+ {this.generateReportPthMap()} +
+
+ { /* TODO: use dynamic data */} + +
+
+ { /* TODO: use dynamic data */} + +
+
+ { /* TODO: use dynamic data */} + +
); } - generateReportPthSection() { + generateReportPthMap() { // TODO: remove this and use updateMapFromSerever to get actual map data. const my_map = { nodes: [ @@ -447,20 +475,11 @@ class ReportPageComponent extends AuthComponent { return (

- Pass The Hash !!!!!TODO: change this!!!!!!!! + Credential Map

-
- TODO: put relevant tables and stuff here... -
-
- TODO: put relevant tables and stuff here... -
-
- TODO: put relevant tables and stuff here... -

); 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 d8c91f5ca..d23a14c38 100644 --- a/monkey_island/cc/ui/src/components/report-components/BreachedServers.js +++ b/monkey_island/cc/ui/src/components/report-components/BreachedServers.js @@ -2,10 +2,7 @@ import React from 'react'; import ReactTable from 'react-table' let renderArray = function(val) { - if (val.length === 0) { - return ''; - } - return val.reduce((total, new_str) => total + ', ' + new_str); + return
{val.map(x =>
{x}
)}
; }; const columns = [ 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 b598ab537..9b62bbdc5 100644 --- a/monkey_island/cc/ui/src/components/report-components/ScannedServers.js +++ b/monkey_island/cc/ui/src/components/report-components/ScannedServers.js @@ -2,10 +2,7 @@ import React from 'react'; import ReactTable from 'react-table' let renderArray = function(val) { - if (val.length === 0) { - return ''; - } - return val.reduce((total, new_str) => total + ', ' + new_str); + return
{val.map(x =>
{x}
)}
; }; const columns = [ diff --git a/monkey_island/cc/ui/src/components/report-components/SharedAdmins.js b/monkey_island/cc/ui/src/components/report-components/SharedAdmins.js new file mode 100644 index 000000000..bf57065d5 --- /dev/null +++ b/monkey_island/cc/ui/src/components/report-components/SharedAdmins.js @@ -0,0 +1,42 @@ +import React from 'react'; +import ReactTable from 'react-table' + +let renderArray = function(val) { + return
{val.map(x =>
{x}
)}
; +}; + +const columns = [ + { + Header: 'Shared Admins Between Machines', + columns: [ + { Header: 'Username', accessor: 'username'}, + { Header: 'Domain', accessor: 'domain'}, + { Header: 'Machines', id: 'machines', accessor: x => renderArray(x.machines)}, + ] + } +]; + +const pageSize = 10; + +class SharedAdminsComponent extends React.Component { + constructor(props) { + super(props); + } + + render() { + let defaultPageSize = this.props.data.length > pageSize ? pageSize : this.props.data.length; + let showPagination = this.props.data.length > pageSize; + return ( +
+ +
+ ); + } +} + +export default SharedAdminsComponent; diff --git a/monkey_island/cc/ui/src/components/report-components/SharedCreds.js b/monkey_island/cc/ui/src/components/report-components/SharedCreds.js new file mode 100644 index 000000000..f42494167 --- /dev/null +++ b/monkey_island/cc/ui/src/components/report-components/SharedCreds.js @@ -0,0 +1,41 @@ +import React from 'react'; +import ReactTable from 'react-table' + +let renderArray = function(val) { + console.log(val); + return
{val.map(x =>
{x}
)}
; +}; + +const columns = [ + { + Header: 'Shared Credentials', + columns: [ + {Header: 'Credential Group', id: 'cred_group', accessor: x => renderArray(x.cred_group) } + ] + } +]; + +const pageSize = 10; + +class SharedCredsComponent extends React.Component { + constructor(props) { + super(props); + } + + render() { + let defaultPageSize = this.props.data.length > pageSize ? pageSize : this.props.data.length; + let showPagination = this.props.data.length > pageSize; + return ( +
+ +
+ ); + } +} + +export default SharedCredsComponent; diff --git a/monkey_island/cc/ui/src/components/report-components/StrongUsers.js b/monkey_island/cc/ui/src/components/report-components/StrongUsers.js new file mode 100644 index 000000000..bfb933ec1 --- /dev/null +++ b/monkey_island/cc/ui/src/components/report-components/StrongUsers.js @@ -0,0 +1,43 @@ +import React from 'react'; +import ReactTable from 'react-table' + +let renderArray = function(val) { + return
{val.map(x =>
{x}
)}
; +}; + +const columns = [ + { + Header: 'Powerful Users', + columns: [ + { Header: 'Username', accessor: 'username'}, + { Header: 'Domain', accessor: 'domain'}, + { Header: 'Machines', id: 'machines', accessor: x => renderArray(x.machines)}, + { Header: 'Services', id: 'services', accessor: x => renderArray(x.services)} + ] + } +]; + +const pageSize = 10; + +class StrongUsersComponent extends React.Component { + constructor(props) { + super(props); + } + + render() { + let defaultPageSize = this.props.data.length > pageSize ? pageSize : this.props.data.length; + let showPagination = this.props.data.length > pageSize; + return ( +
+ +
+ ); + } +} + +export default StrongUsersComponent;