forked from p15670423/monkey
Split up Azure credential working to make it easier for the server to understand.
Fixed bugs in Azure report server side and fixed a hardcoded constant in get_issues_overview
This commit is contained in:
parent
93fee0d2c5
commit
9d7b345d1d
|
@ -125,8 +125,7 @@ class InfoCollector(object):
|
||||||
self.info["credentials"][username] = {}
|
self.info["credentials"][username] = {}
|
||||||
# we might be losing passwords in case of multiple reset attempts on same username
|
# we might be losing passwords in case of multiple reset attempts on same username
|
||||||
# or in case another collector already filled in a password for this user
|
# or in case another collector already filled in a password for this user
|
||||||
self.info["credentials"][username]['Password'] = password
|
self.info["credentials"][username]['password'] = password
|
||||||
self.info["credentials"][username]['Azure'] = True
|
|
||||||
|
|
||||||
if len(azure_creds) != 0:
|
if len(azure_creds) != 0:
|
||||||
self.info["Azure"] = True
|
self.info["Azure"] = {}
|
||||||
|
self.info["Azure"]['usernames'] = [cred[0] for cred in azure_creds]
|
||||||
|
|
|
@ -158,15 +158,15 @@ class ReportService:
|
||||||
creds = []
|
creds = []
|
||||||
for telem in mongo.db.telemetry.find(
|
for telem in mongo.db.telemetry.find(
|
||||||
{'telem_type': 'system_info_collection', 'data.Azure': {'$exists': True}},
|
{'telem_type': 'system_info_collection', 'data.Azure': {'$exists': True}},
|
||||||
{'data.credentials': 1, 'monkey_guid': 1}
|
{'data.Azure': 1, 'monkey_guid': 1}
|
||||||
):
|
):
|
||||||
monkey_creds = telem['data']['credentials']
|
azure_users = telem['data']['Azure']['usernames']
|
||||||
if len(monkey_creds) == 0:
|
if len(azure_users) == 0:
|
||||||
continue
|
continue
|
||||||
origin = NodeService.get_monkey_by_guid(telem['monkey_guid'])['hostname']
|
origin = NodeService.get_monkey_by_guid(telem['monkey_guid'])['hostname']
|
||||||
new_creds = [{'username': user.replace(',', '.'), 'type': 'Clear Password',
|
azure_leaked_users = [{'username': user.replace(',', '.'), 'type': 'Clear Password',
|
||||||
'origin': origin} for user in monkey_creds if 'Azure' in user]
|
'origin': origin} for user in azure_users]
|
||||||
creds.extend(new_creds)
|
creds.extend(azure_leaked_users)
|
||||||
return creds
|
return creds
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
@ -349,7 +349,8 @@ class ReportService:
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def get_config_ips():
|
def get_config_ips():
|
||||||
if ConfigService.get_config_value(['basic_network', 'network_range', 'range_class'], True, True) != 'FixedRange':
|
if ConfigService.get_config_value(['basic_network', 'network_range', 'range_class'], True,
|
||||||
|
True) != 'FixedRange':
|
||||||
return []
|
return []
|
||||||
return ConfigService.get_config_value(['basic_network', 'network_range', 'range_fixed'], True, True)
|
return ConfigService.get_config_value(['basic_network', 'network_range', 'range_fixed'], True, True)
|
||||||
|
|
||||||
|
@ -359,7 +360,7 @@ class ReportService:
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def get_issues_overview(issues, config_users, config_passwords):
|
def get_issues_overview(issues, config_users, config_passwords):
|
||||||
issues_byte_array = [False] * 6
|
issues_byte_array = [False] * len(ReportService.ISSUES_DICT)
|
||||||
|
|
||||||
for machine in issues:
|
for machine in issues:
|
||||||
for issue in issues[machine]:
|
for issue in issues[machine]:
|
||||||
|
|
Loading…
Reference in New Issue