Change report structure

Add tables for shared admins, strong users, shared creds.
This commit is contained in:
Itay Mizeretz 2018-07-22 18:49:51 +03:00
parent 800e337f6f
commit eb79499e80
6 changed files with 161 additions and 22 deletions

View File

@ -7,8 +7,11 @@ import {edgeGroupToColor, options} from 'components/map/MapOptions';
import StolenPasswords from 'components/report-components/StolenPasswords'; import StolenPasswords from 'components/report-components/StolenPasswords';
import CollapsibleWellComponent from 'components/report-components/CollapsibleWell'; import CollapsibleWellComponent from 'components/report-components/CollapsibleWell';
import {Line} from 'rc-progress'; import {Line} from 'rc-progress';
import AuthComponent from '../AuthComponent'; import AuthComponent from 'components/AuthComponent';
import PassTheHashMapPageComponent from "./PassTheHashMapPage"; 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 guardicoreLogoImage = require('../../images/guardicore-logo.png');
let monkeyLogoImage = require('../../images/monkey-icon.svg'); let monkeyLogoImage = require('../../images/monkey-icon.svg');
@ -130,7 +133,6 @@ class ReportPageComponent extends AuthComponent {
{this.generateReportFindingsSection()} {this.generateReportFindingsSection()}
{this.generateReportRecommendationsSection()} {this.generateReportRecommendationsSection()}
{this.generateReportGlanceSection()} {this.generateReportGlanceSection()}
{this.generateReportPthSection()}
{this.generateReportFooter()} {this.generateReportFooter()}
</div> </div>
<div className="text-center no-print" style={{marginTop: '20px'}}> <div className="text-center no-print" style={{marginTop: '20px'}}>
@ -415,14 +417,40 @@ class ReportPageComponent extends AuthComponent {
<div style={{marginBottom: '20px'}}> <div style={{marginBottom: '20px'}}>
<ScannedServers data={this.state.report.glance.scanned}/> <ScannedServers data={this.state.report.glance.scanned}/>
</div> </div>
<div> {this.generateReportPthMap()}
<div style={{marginBottom: '20px'}}>
<StolenPasswords data={this.state.report.glance.stolen_creds}/> <StolenPasswords data={this.state.report.glance.stolen_creds}/>
</div> </div>
<div style={{marginBottom: '20px'}}>
{ /* TODO: use dynamic data */}
<SharedCreds data = {[{cred_group: ['MyDomain\\user1', 'user2', 'user3']}, {cred_group: ['user2', 'user4']}]} />
</div>
<div style={{marginBottom: '20px'}}>
{ /* TODO: use dynamic data */}
<SharedAdmins data = {[
{
username: 'SharedLocalAdmin',
domain: 'MyDomain',
machines: ['hello : 1.2.3.4']
}
]} />
</div>
<div>
{ /* TODO: use dynamic data */}
<StrongUsers data = {[
{
username: 'SharedLocalAdmin',
domain: 'MyDomain',
machines: ['hello : 1.2.3.4'],
services: ['DC', 'DNS']
}
]} />
</div>
</div> </div>
); );
} }
generateReportPthSection() { generateReportPthMap() {
// TODO: remove this and use updateMapFromSerever to get actual map data. // TODO: remove this and use updateMapFromSerever to get actual map data.
const my_map = { const my_map = {
nodes: [ nodes: [
@ -447,20 +475,11 @@ class ReportPageComponent extends AuthComponent {
return ( return (
<div id="pth"> <div id="pth">
<h3> <h3>
Pass The Hash !!!!!TODO: change this!!!!!!!! Credential Map
</h3> </h3>
<div style={{position: 'relative', height: '100vh'}}> <div style={{position: 'relative', height: '100vh'}}>
<PassTheHashMapPageComponent graph={my_map} /> <PassTheHashMapPageComponent graph={my_map} />
</div> </div>
<div>
TODO: put relevant tables and stuff here...
</div>
<div>
TODO: put relevant tables and stuff here...
</div>
<div>
TODO: put relevant tables and stuff here...
</div>
<br /> <br />
</div> </div>
); );

View File

@ -2,10 +2,7 @@ import React from 'react';
import ReactTable from 'react-table' import ReactTable from 'react-table'
let renderArray = function(val) { let renderArray = function(val) {
if (val.length === 0) { return <div>{val.map(x => <div>{x}</div>)}</div>;
return '';
}
return val.reduce((total, new_str) => total + ', ' + new_str);
}; };
const columns = [ const columns = [

View File

@ -2,10 +2,7 @@ import React from 'react';
import ReactTable from 'react-table' import ReactTable from 'react-table'
let renderArray = function(val) { let renderArray = function(val) {
if (val.length === 0) { return <div>{val.map(x => <div>{x}</div>)}</div>;
return '';
}
return val.reduce((total, new_str) => total + ', ' + new_str);
}; };
const columns = [ const columns = [

View File

@ -0,0 +1,42 @@
import React from 'react';
import ReactTable from 'react-table'
let renderArray = function(val) {
return <div>{val.map(x => <div>{x}</div>)}</div>;
};
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 (
<div className="data-table-container">
<ReactTable
columns={columns}
data={this.props.data}
showPagination={showPagination}
defaultPageSize={defaultPageSize}
/>
</div>
);
}
}
export default SharedAdminsComponent;

View File

@ -0,0 +1,41 @@
import React from 'react';
import ReactTable from 'react-table'
let renderArray = function(val) {
console.log(val);
return <div>{val.map(x => <div>{x}</div>)}</div>;
};
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 (
<div className="data-table-container">
<ReactTable
columns={columns}
data={this.props.data}
showPagination={showPagination}
defaultPageSize={defaultPageSize}
/>
</div>
);
}
}
export default SharedCredsComponent;

View File

@ -0,0 +1,43 @@
import React from 'react';
import ReactTable from 'react-table'
let renderArray = function(val) {
return <div>{val.map(x => <div>{x}</div>)}</div>;
};
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 (
<div className="data-table-container">
<ReactTable
columns={columns}
data={this.props.data}
showPagination={showPagination}
defaultPageSize={defaultPageSize}
/>
</div>
);
}
}
export default StrongUsersComponent;