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 86ba1ebf4..bb24dcaa1 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 @@ -2,6 +2,7 @@ import React from 'react'; import ReportHeader, {ReportTypes} from './common/ReportHeader'; import ReportLoader from './common/ReportLoader'; +import pluralize from 'pluralize' class RansomwareReport extends React.Component { stillLoadingDataFromServer() { @@ -10,21 +11,63 @@ class RansomwareReport extends React.Component { generateReportContent() { return ( -
-

- This report shows information about the ransomware simulation run by Infection Monkey. -

-
+
+ {this.getExploitationStats()} +
) } + getExploitationStats() { + return ( +
+

+ Propagation +

+ {this.getScannedVsExploitedStats()} + {this.getExploitationStatsPerExploit()} +
+ ) + } + + getScannedVsExploitedStats() { + 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. +

+ ) + } + + 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]; + exploitation_details.push( +
+ {count}  + {pluralize('machine', count)} {pluralize('was', count)} exploited by the  + {exploit}. +
+ ); + } + + return exploitation_details; + } + render() { let content = {}; if (this.stillLoadingDataFromServer()) { content = ; } else { - content =
{this.generateReportContent()}
; + content = this.generateReportContent(); } + return (