diff --git a/monkey_island/cc/ui/src/components/pages/ReportPage.js b/monkey_island/cc/ui/src/components/pages/ReportPage.js index 3d4945dcd..528092523 100644 --- a/monkey_island/cc/ui/src/components/pages/ReportPage.js +++ b/monkey_island/cc/ui/src/components/pages/ReportPage.js @@ -45,6 +45,36 @@ class ReportPageComponent extends React.Component { this.interval = setInterval(this.updateMapFromServer, 1000); } + componentWillUnmount() { + clearInterval(this.interval); + } + + render() { + let content; + if (Object.keys(this.state.report).length === 0) { + if (this.state.runStarted) { + content = (
+ + You have to run a monkey before generating a report! +
; + } + } else { + content = this.generateReportContent(); + } + + return ( ++ + Critical security issues were detected! +
) : + (+ + No critical security issues were detected. +
) + } + { + this.state.allMonkeysAreDead ? + '' + : + (+ + Some monkeys are still running. To get the best report it's best to wait for all of them to finish + running. +
) + } + { + this.state.report.glance.exploited.length > 0 ? + '' + : ++ + To improve the monkey's detection rates, try adding users and passwords and enable the "Local + network + scan" config value under Basic - Network. +
+ } ++ The first monkey run was started on {this.state.report.overview.monkey_start_time}. After {this.state.report.overview.monkey_duration}, all monkeys finished + propagation attempts. +
++ The monkey started propagating from the following machines where it was manually installed: +
+ The monkeys were run with the following configuration: +
+ { + this.state.report.overview.config_users.length > 0 ? ++ Usernames used for brute-forcing: +
+ Brute forcing uses stolen credentials only. No credentials were supplied during Monkey’s + configuration. +
+ } + { + this.state.report.overview.config_exploits.length > 0 ? + ( + this.state.report.overview.config_exploits[0] === 'default' ? + '' + : ++ The Monkey uses the following exploit methods: +
+ No exploits are used by the Monkey. +
+ } + { + this.state.report.overview.config_ips.length > 0 ? ++ The Monkey scans the following IPs: +
+ Note: Monkeys were configured to avoid scanning of the local network. +
+ } ++ The Monkey discovered {this.state.report.glance.scanned.length} machines and + successfully breached {this.state.report.glance.exploited.length} of them. +
++ From the attacker's point of view, the network looks like this: +
+- - You have to run a monkey before generating a report! -
; - } - } else { - let exploitPercentage = - (100 * this.state.report.glance.exploited.length) / this.state.report.glance.scanned.length; - content = - ( -- - Critical security issues were detected! -
) : - (- - No critical security issues were detected. -
) - } - { - this.state.allMonkeysAreDead ? - '' - : - (- - Some monkeys are still running. To get the best report it's best to wait for all of them to finish - running. -
) - } - { - this.state.report.glance.exploited.length > 0 ? - '' - : -- - To improve the monkey's detection rates, try adding users and passwords and enable the "Local - network - scan" config value under Basic - Network. -
- } -- The first monkey run was started on {this.state.report.overview.monkey_start_time}. After {this.state.report.overview.monkey_duration}, all monkeys finished - propagation attempts. -
-- The monkey started propagating from the following machines where it was manually installed: -
- The monkeys were run with the following configuration: -
- { - this.state.report.overview.config_users.length > 0 ? -- Usernames used for brute-forcing: -
- Brute forcing uses stolen credentials only. No credentials were supplied during Monkey’s - configuration. -
- } - { - this.state.report.overview.config_exploits.length > 0 ? - ( - this.state.report.overview.config_exploits[0] === 'default' ? - '' - : -- The Monkey uses the following exploit methods: -
- No exploits are used by the Monkey. -
- } - { - this.state.report.overview.config_ips.length > 0 ? -- The Monkey scans the following IPs: -
- Note: Monkeys were configured to avoid scanning of the local network. -
- } -- The Monkey discovered {this.state.report.glance.scanned.length} machines and - successfully breached {this.state.report.glance.exploited.length} of them. -
-- From the attacker's point of view, the network looks like this: -
-