From 2c8b510b0c16e42ab73b8f31e25c8c2dbf38ac86 Mon Sep 17 00:00:00 2001
From: Itay Mizeretz
Date: Tue, 12 Dec 2017 12:45:53 +0200
Subject: [PATCH] Exploits used are listed only if they're not the default
configuration. Suggestion to improve monkey success rate appears only if no
critical issues were found
---
monkey_island/cc/services/report.py | 11 ++++-
.../cc/ui/src/components/pages/ReportPage.js | 45 ++++++++++++++-----
2 files changed, 43 insertions(+), 13 deletions(-)
diff --git a/monkey_island/cc/services/report.py b/monkey_island/cc/services/report.py
index 048e2fb12..6b0e408ce 100644
--- a/monkey_island/cc/services/report.py
+++ b/monkey_island/cc/services/report.py
@@ -276,6 +276,15 @@ class ReportService:
@staticmethod
def get_config_exploits():
+ exploits_config_value = ['exploits', 'general', 'exploiter_classes']
+ default_exploits = ConfigService.get_default_config()
+ for namespace in exploits_config_value:
+ default_exploits = default_exploits[namespace]
+ exploits = ConfigService.get_config_value(exploits_config_value)
+
+ if exploits == default_exploits:
+ return ['default']
+
exploit_display_dict = \
{
'SmbExploiter': 'SMB Exploiter',
@@ -288,7 +297,7 @@ class ReportService:
'ShellShockExploiter': 'ShellShock Exploiter',
}
return [exploit_display_dict[exploit] for exploit in
- ConfigService.get_config_value(['exploits', 'general', 'exploiter_classes'])]
+ exploits]
@staticmethod
def get_config_ips():
diff --git a/monkey_island/cc/ui/src/components/pages/ReportPage.js b/monkey_island/cc/ui/src/components/pages/ReportPage.js
index f1daa6d3c..2a12587f6 100644
--- a/monkey_island/cc/ui/src/components/pages/ReportPage.js
+++ b/monkey_island/cc/ui/src/components/pages/ReportPage.js
@@ -330,7 +330,7 @@ class ReportPageComponent extends React.Component {
generateIssues = (issues) => {
let issuesDivArray = [];
- for (var machine of Object.keys(issues)) {
+ for (let machine of Object.keys(issues)) {
issuesDivArray.push(
{machine}
@@ -343,6 +343,17 @@ class ReportPageComponent extends React.Component {
return ;
};
+ didMonkeyFindIssues = () => {
+ for (let issue of Object.keys(this.state.report.overview.issues)) {
+ if (this.state.report.overview.issues[issue]) {
+ return true;
+ }
+ }
+ return false;
+ };
+
+
+
render() {
let content;
if (Object.keys(this.state.report).length === 0) {
@@ -384,11 +395,16 @@ class ReportPageComponent extends React.Component {
running.
)
}
-
-
- To improve the monkey's detection rates, try adding users and passwords and enable the "Local network
- scan" config value under Basic - Network.
-
+ {
+ this.didMonkeyFindIssues() ?
+ ''
+ :
+
+
+ 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 0 ?
-
- Used the following exploit methods:
-
- {this.state.report.overview.config_exploits.map(x => - {x}
)}
-
-
+ (
+ this.state.report.overview.config_exploits[0] === 'default' ?
+ ''
+ :
+
+ Used the following exploit methods:
+
+ {this.state.report.overview.config_exploits.map(x => - {x}
)}
+
+
+ )
:
Don't use any exploit.