diff --git a/monkey/monkey_island/cc/ui/src/components/report-components/RansomwareReport.js b/monkey/monkey_island/cc/ui/src/components/report-components/RansomwareReport.js index 8d7e76c0c..1f5f9b0d7 100644 --- a/monkey/monkey_island/cc/ui/src/components/report-components/RansomwareReport.js +++ b/monkey/monkey_island/cc/ui/src/components/report-components/RansomwareReport.js @@ -22,9 +22,23 @@ class RansomwareReport extends React.Component { getExploitationStats() { let num_scanned = this.props.report.propagation_stats.num_scanned_nodes; let num_exploited = this.props.report.propagation_stats.num_exploited_nodes; + + return ( +
+

+ The Monkey discovered {num_scanned} machines + and successfully breached {num_exploited} of them. +

+ {this.getExploitationStatsPerExploit()} +
+ ) + } + + getExploitationStatsPerExploit() { let exploit_counts = this.props.report.propagation_stats.num_exploited_per_exploit; let exploitation_details = []; + for (let exploit in exploit_counts) { let count = exploit_counts[exploit]; if (count === 1) { @@ -33,7 +47,7 @@ class RansomwareReport extends React.Component { {count} machine was exploited by the {exploit}. - ) + ); } else { exploitation_details.push( @@ -41,19 +55,11 @@ class RansomwareReport extends React.Component { {count} machines were exploited by the {exploit}. - ) + ); } } - return ( -
-

- The Monkey discovered {num_scanned} machines - and successfully breached {num_exploited} of them. -

- {exploitation_details} -
- ) + return exploitation_details; } render() {