Fixed bug related to '-' and displaying scanned servers

This commit is contained in:
VakarisZ 2019-01-28 12:01:56 +02:00
parent bf26ed8881
commit d028c70738
4 changed files with 13 additions and 4 deletions

View File

@ -6,7 +6,6 @@ from abc import ABCMeta, abstractmethod
import ipaddress import ipaddress
from six import text_type from six import text_type
import logging import logging
import re
__author__ = 'itamar' __author__ = 'itamar'

View File

@ -131,7 +131,8 @@ class ReportService:
list((x['hostname'] for x in list((x['hostname'] for x in
(NodeService.get_displayed_node_by_id(edge['from'], True) (NodeService.get_displayed_node_by_id(edge['from'], True)
for edge in EdgeService.get_displayed_edges_by_to(node['id'], True)))), for edge in EdgeService.get_displayed_edges_by_to(node['id'], True)))),
'services': node['services'] 'services': node['services'],
'domain_name': node['domain_name']
}) })
logger.info('Scanned nodes generated for reporting') logger.info('Scanned nodes generated for reporting')
@ -151,6 +152,7 @@ class ReportService:
{ {
'label': monkey['label'], 'label': monkey['label'],
'ip_addresses': monkey['ip_addresses'], 'ip_addresses': monkey['ip_addresses'],
'domain_name': node['domain_name'],
'exploits': list(set( 'exploits': list(set(
[ReportService.EXPLOIT_DISPLAY_DICT[exploit['exploiter']] for exploit in monkey['exploits'] if [ReportService.EXPLOIT_DISPLAY_DICT[exploit['exploiter']] for exploit in monkey['exploits'] if
exploit['result']])) exploit['result']]))

View File

@ -5,13 +5,17 @@ let renderArray = function(val) {
return <div>{val.map(x => <div>{x}</div>)}</div>; return <div>{val.map(x => <div>{x}</div>)}</div>;
}; };
let renderIpAddresses = function (val) {
return <div>{renderArray(val.ip_addresses)} {(val.domain_name ? " (".concat(val.domain_name, ")") : "")} </div>;
};
const columns = [ const columns = [
{ {
Header: 'Breached Servers', Header: 'Breached Servers',
columns: [ columns: [
{Header: 'Machine', accessor: 'label'}, {Header: 'Machine', accessor: 'label'},
{Header: 'IP Addresses', id: 'ip_addresses', {Header: 'IP Addresses', id: 'ip_addresses',
accessor: x => renderArray(x.ip_addresses)+(x.domain_name ? " ("+x.domain_name+")" : "")}, accessor: x => renderIpAddresses(x)},
{Header: 'Exploits', id: 'exploits', accessor: x => renderArray(x.exploits)} {Header: 'Exploits', id: 'exploits', accessor: x => renderArray(x.exploits)}
] ]
} }

View File

@ -5,13 +5,17 @@ let renderArray = function(val) {
return <div>{val.map(x => <div>{x}</div>)}</div>; return <div>{val.map(x => <div>{x}</div>)}</div>;
}; };
let renderIpAddresses = function (val) {
return <div>{renderArray(val.ip_addresses)} {(val.domain_name ? " (".concat(val.domain_name, ")") : "")} </div>;
};
const columns = [ const columns = [
{ {
Header: 'Scanned Servers', Header: 'Scanned Servers',
columns: [ columns: [
{ Header: 'Machine', accessor: 'label'}, { Header: 'Machine', accessor: 'label'},
{ Header: 'IP Addresses', id: 'ip_addresses', { Header: 'IP Addresses', id: 'ip_addresses',
accessor: x => renderArray(x.ip_addresses)+(x.domain_name ? " ("+x.domain_name+")" : "")}, accessor: x => renderIpAddresses(x)},
{ Header: 'Accessible From', id: 'accessible_from_nodes', accessor: x => renderArray(x.accessible_from_nodes)}, { Header: 'Accessible From', id: 'accessible_from_nodes', accessor: x => renderArray(x.accessible_from_nodes)},
{ Header: 'Services', id: 'services', accessor: x => renderArray(x.services)} { Header: 'Services', id: 'services', accessor: x => renderArray(x.services)}
] ]