forked from p15670423/monkey
Some bug fixes and CR after shocks
This commit is contained in:
parent
17b344f62f
commit
b85fb8c94a
|
@ -328,4 +328,4 @@ class NodeService:
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def get_hostname_by_id(node_id):
|
def get_hostname_by_id(node_id):
|
||||||
NodeService.get_node_hostname(mongo.db.monkey.find_one({'_id': node_id}, {'hostname': 1}))
|
return NodeService.get_node_hostname(mongo.db.monkey.find_one({'_id': node_id}, {'hostname': 1}))
|
||||||
|
|
|
@ -70,8 +70,7 @@ class PTHReportService(object):
|
||||||
{
|
{
|
||||||
'username': user['name'],
|
'username': user['name'],
|
||||||
'domain_name': user['domain_name'],
|
'domain_name': user['domain_name'],
|
||||||
'hostname': NodeService.get_hostname_by_id(ObjectId(user['machine_id']))
|
'hostname': NodeService.get_hostname_by_id(ObjectId(user['machine_id'])) if user['machine_id'] else None
|
||||||
if user['machine_id'] else None
|
|
||||||
} for user in doc['Docs']
|
} for user in doc['Docs']
|
||||||
]
|
]
|
||||||
users_cred_groups.append({'cred_groups': users_list})
|
users_cred_groups.append({'cred_groups': users_list})
|
||||||
|
|
|
@ -159,7 +159,7 @@ class ReportService:
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def get_stolen_creds():
|
def get_stolen_creds():
|
||||||
PASS_TYPE_DICT = {'password': 'Clear Password', 'lm_hash': 'LM hash', 'ntlm_hash': 'NTLM hash'}
|
PASS_TYPE_DICT = {'password': 'Clear Password', 'lm_hash': 'LM hash', 'ntlm_hash': 'NTLM hash'}
|
||||||
creds = set()
|
creds = []
|
||||||
for telem in mongo.db.telemetry.find(
|
for telem in mongo.db.telemetry.find(
|
||||||
{'telem_type': 'system_info_collection', 'data.credentials': {'$exists': True}},
|
{'telem_type': 'system_info_collection', 'data.credentials': {'$exists': True}},
|
||||||
{'data.credentials': 1, 'monkey_guid': 1}
|
{'data.credentials': 1, 'monkey_guid': 1}
|
||||||
|
@ -176,9 +176,10 @@ class ReportService:
|
||||||
'type': PASS_TYPE_DICT[pass_type],
|
'type': PASS_TYPE_DICT[pass_type],
|
||||||
'origin': origin
|
'origin': origin
|
||||||
}
|
}
|
||||||
creds.add(cred_row)
|
if cred_row not in creds:
|
||||||
|
creds.append(cred_row)
|
||||||
logger.info('Stolen creds generated for reporting')
|
logger.info('Stolen creds generated for reporting')
|
||||||
return list(creds)
|
return creds
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def get_ssh_keys():
|
def get_ssh_keys():
|
||||||
|
@ -560,7 +561,7 @@ class ReportService:
|
||||||
issues_dict = {}
|
issues_dict = {}
|
||||||
for issue in issues:
|
for issue in issues:
|
||||||
if issue.get('is_local', True):
|
if issue.get('is_local', True):
|
||||||
machine = issue.get('machine').upper()
|
machine = issue.get('machine', '').upper()
|
||||||
if machine not in issues_dict:
|
if machine not in issues_dict:
|
||||||
issues_dict[machine] = []
|
issues_dict[machine] = []
|
||||||
issues_dict[machine].append(issue)
|
issues_dict[machine].append(issue)
|
||||||
|
|
|
@ -22,7 +22,7 @@ class MimikatzSecrets(object):
|
||||||
users_dict[username] = {}
|
users_dict[username] = {}
|
||||||
|
|
||||||
ntlm = sam_user.get("NTLM")
|
ntlm = sam_user.get("NTLM")
|
||||||
if "[hashed secret]" not in ntlm:
|
if not ntlm or "[hashed secret]" not in ntlm:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
users_dict[username]['SAM'] = ntlm.replace("[hashed secret]", "").strip()
|
users_dict[username]['SAM'] = ntlm.replace("[hashed secret]", "").strip()
|
||||||
|
|
|
@ -29,7 +29,7 @@ class WMIHandler(object):
|
||||||
self.update_critical_services()
|
self.update_critical_services()
|
||||||
|
|
||||||
def update_critical_services(self):
|
def update_critical_services(self):
|
||||||
critical_names = ("W3svc", "MSExchangeServiceHost", "MSSQLServer", "dns", 'MSSQL$SQLEXPRESS', 'SQL')
|
critical_names = ("W3svc", "MSExchangeServiceHost", "dns", 'MSSQL$SQLEXPRES')
|
||||||
mongo.db.monkey.update({'_id': self.monkey_id}, {'$set': {'critical_services': []}})
|
mongo.db.monkey.update({'_id': self.monkey_id}, {'$set': {'critical_services': []}})
|
||||||
|
|
||||||
services_names_list = [str(i['Name'])[2:-1] for i in self.services]
|
services_names_list = [str(i['Name'])[2:-1] for i in self.services]
|
||||||
|
|
Loading…
Reference in New Issue