Island: change island report to only send exploited machine count to UI instead of whole machine list

This commit is contained in:
VakarisZ 2021-07-28 15:58:17 +03:00
parent 15fad50393
commit 4c1747d2e6
2 changed files with 6 additions and 6 deletions

View File

@ -610,7 +610,7 @@ class ReportService:
monkey_latest_modify_time = Monkey.get_latest_modifytime()
scanned_nodes = ReportService.get_scanned()
exploited_nodes = get_monkey_exploited()
exploited_cnt = len(get_monkey_exploited())
report = {
"overview": {
"manual_monkeys": ReportService.get_manual_monkey_hostnames(),
@ -628,7 +628,7 @@ class ReportService:
},
"glance": {
"scanned": scanned_nodes,
"exploited": exploited_nodes,
"exploited_cnt": exploited_cnt,
"stolen_creds": ReportService.get_stolen_creds(),
"azure_passwords": ReportService.get_azure_creds(),
"ssh_keys": ReportService.get_ssh_keys(),

View File

@ -288,9 +288,9 @@ class ReportPageComponent extends AuthComponent {
<h2>
Overview
</h2>
<SecurityIssuesGlance issuesFound={this.state.report.glance.exploited.length > 0}/>
<SecurityIssuesGlance issuesFound={this.state.report.glance.exploited_cnt > 0}/>
{
this.state.report.glance.exploited.length > 0 ?
this.state.report.glance.exploited_cnt > 0 ?
''
:
<p className='alert alert-info'>
@ -524,7 +524,7 @@ class ReportPageComponent extends AuthComponent {
generateReportGlanceSection() {
let exploitPercentage =
(100 * this.state.report.glance.exploited.length) / this.state.report.glance.scanned.length;
(100 * this.state.report.glance.exploited_cnt) / this.state.report.glance.scanned.length;
return (
<div id='glance'>
<h3>
@ -535,7 +535,7 @@ class ReportPageComponent extends AuthComponent {
The Monkey discovered <span
className='badge badge-warning'>{this.state.report.glance.scanned.length}</span> machines and
successfully breached <span
className='badge badge-danger'>{this.state.report.glance.exploited.length}</span> of them.
className='badge badge-danger'>{this.state.report.glance.exploited_cnt}</span> of them.
</p>
<div className='text-center' style={{margin: '10px'}}>
<Line style={{width: '300px', marginRight: '5px'}} percent={exploitPercentage} strokeWidth='4'