Add run info under overview section including zero-patients, interesting config values, and config recommendations.

This commit is contained in:
Itay Mizeretz 2017-12-05 16:29:18 +02:00
parent 013e29b76b
commit f14dc8e2fb
2 changed files with 238 additions and 109 deletions

View File

@ -1,6 +1,7 @@
import ipaddress import ipaddress
from cc.database import mongo from cc.database import mongo
from cc.services.config import ConfigService
from cc.services.edge import EdgeService from cc.services.edge import EdgeService
from cc.services.node import NodeService from cc.services.node import NodeService
from cc.utils import local_ip_addresses, get_subnets from cc.utils import local_ip_addresses, get_subnets
@ -260,12 +261,57 @@ class ReportService:
issues_dict[machine].append(issue) issues_dict[machine].append(issue)
return issues_dict return issues_dict
@staticmethod
def get_manual_monkeys():
return [monkey['hostname'] for monkey in mongo.db.monkey.find({}, {'hostname': 1, 'parent': 1, 'guid': 1}) if
NodeService.get_monkey_manual_run(monkey)]
@staticmethod
def get_config_users():
return ConfigService.get_config_value(['basic', 'credentials', 'exploit_user_list'])
@staticmethod
def get_config_passwords():
return ConfigService.get_config_value(['basic', 'credentials', 'exploit_password_list'])
@staticmethod
def get_config_exploits():
exploit_display_dict = \
{
'SmbExploiter': 'SMB Exploiter',
'WmiExploiter': 'WMI Exploiter',
'SSHExploiter': 'SSH Exploiter',
'RdpExploiter': 'RDP Exploiter',
'SambaCryExploiter': 'SambaCry Exploiter',
'ElasticGroovyExploiter': 'Elastic Groovy Exploiter',
'Ms08_067_Exploiter': 'Conficker Exploiter',
'ShellShockExploiter': 'ShellShock Exploiter',
}
return [exploit_display_dict[exploit] for exploit in
ConfigService.get_config_value(['exploits', 'general', 'exploiter_classes'])]
@staticmethod
def get_config_ips():
if ConfigService.get_config_value(['basic_network', 'network_range', 'range_class']) != 'FixedRange':
return []
return ConfigService.get_config_value(['basic_network', 'network_range', 'range_fixed'])
@staticmethod
def get_config_scan():
return ConfigService.get_config_value(['basic_network', 'general', 'local_network_scan'])
@staticmethod @staticmethod
def get_report(): def get_report():
return \ return \
{ {
'overview': 'overview':
{ {
'manual_monkeys': ReportService.get_manual_monkeys(),
'config_users': ReportService.get_config_users(),
'config_passwords': ReportService.get_config_passwords(),
'config_exploits': ReportService.get_config_exploits(),
'config_ips': ReportService.get_config_ips(),
'config_scan': ReportService.get_config_scan(),
'monkey_start_time': ReportService.get_first_monkey_time().strftime("%d/%m/%Y %H:%M:%S"), 'monkey_start_time': ReportService.get_first_monkey_time().strftime("%d/%m/%Y %H:%M:%S"),
'monkey_duration': ReportService.get_monkey_duration(), 'monkey_duration': ReportService.get_monkey_duration(),
'issues': [False, True, True, True, False, True], 'issues': [False, True, True, True, False, True],

View File

@ -337,23 +337,99 @@ class ReportPageComponent extends React.Component {
} else { } else {
let exploitPercentage = let exploitPercentage =
(100 * this.state.report.glance.exploited.length) / this.state.report.glance.scanned.length; (100 * this.state.report.glance.exploited.length) / this.state.report.glance.scanned.length;
content = content =
( (
<div>
<div className="text-center no-print" style={{marginBottom: '20px'}}>
<Button bsSize="large" onClick={() => {
print();
}}><i className="glyphicon glyphicon-print"/> Print Report</Button>
</div>
<div className="report-page"> <div className="report-page">
<div id="overview"> <div id="overview">
<div className="text-center no-print">
<Button bsSize="large" onClick={() => {print();}}><i className="glyphicon glyphicon-print"/> Print Report</Button>
</div>
<h1> <h1>
Overview Overview
</h1> </h1>
{
this.state.report.glance.exploited.length > 0 ?
(<p className="alert alert-danger">
<i className="glyphicon glyphicon-exclamation-sign" style={{'marginRight': '5px'}}/>
Critical security issues found by Infection Monkey!
</p>) :
(<p className="alert alert-success">
<i className="glyphicon glyphicon-ok-sign" style={{'marginRight': '5px'}}/>
Infection Monkey did not find any critical security issues.
</p>)
}
<p className="alert alert-info">
<i className="glyphicon glyphicon-ok-sign" style={{'marginRight': '5px'}}/>
To improve the monkey's success rate, try adding users and passwords, and enabling the "Local
network scan" config value under "Basic - Network"
</p>
<p> <p>
The first monkey run was started on <span The first monkey run was started on <span
className="label label-info">{this.state.report.overview.monkey_start_time}</span>. After <span className="label label-info">{this.state.report.overview.monkey_start_time}</span>. After <span
className="label label-info">{this.state.report.overview.monkey_duration}</span>, all monkeys finished className="label label-info">{this.state.report.overview.monkey_duration}</span>, all monkeys finished
propagation attempts. propagation attempts.
</p> </p>
<p>
The monkey started propagating from the following machines where it was manually installed:
<ul>
{this.state.report.overview.manual_monkeys.map(x => <li>{x}</li>)}
</ul>
</p>
<p>
The monkeys were run with the following configuration:
</p>
{
this.state.report.overview.config_users.length > 0 ?
<p>
Users to try:
<ul>
{this.state.report.overview.config_users.map(x => <li>{x}</li>)}
</ul>
Passwords to try:
<ul>
{this.state.report.overview.config_passwords.map(x => <li>{x.substr(0, 3) + '******'}</li>)}
</ul>
</p>
:
<p>
No Users and Passwords were provided for the monkey.
</p>
}
{
this.state.report.overview.config_exploits.length > 0 ?
<p>
Use the following exploit methods:
<ul>
{this.state.report.overview.config_exploits.map(x => <li>{x}</li>)}
</ul>
</p>
:
<p>
Don't use any exploit.
</p>
}
{
this.state.report.overview.config_ips.length > 0 ?
<p>
Scan the following IPs:
<ul>
{this.state.report.overview.config_ips.map(x => <li>{x}</li>)}
</ul>
</p>
:
''
}
{
this.state.report.overview.config_scan ?
''
:
<p>
Monkeys were configured to not scan local network
</p>
}
<p> <p>
A full report of the Monkeys activities follows. A full report of the Monkeys activities follows.
</p> </p>
@ -456,8 +532,15 @@ class ReportPageComponent extends React.Component {
</div> </div>
</div> </div>
</div> </div>
<div className="text-center no-print" style={{marginTop: '20px'}}>
<Button bsSize="large" onClick={() => {
print();
}}><i className="glyphicon glyphicon-print"/> Print Report</Button>
</div>
</div>
); );
} }
return ( return (
<Col xs={12} lg={8}> <Col xs={12} lg={8}>
<h1 className="page-title">4. Security Report</h1> <h1 className="page-title">4. Security Report</h1>