Skip to content

Commit

Permalink
slight data format changes, bump version to v6 as expected
Browse files Browse the repository at this point in the history
  • Loading branch information
dirkjanm committed Feb 25, 2024
1 parent 2e6b149 commit 093be56
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
2 changes: 2 additions & 0 deletions bloodhound/enumeration/acls.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ def parse_binary_acl(entry, entrytype, acl, objecttype_guid_map):

# Check for protected DACL flag
entry['IsACLProtected'] = sd.has_control(sd.PD)
# BloodHound wants this twice for some reason
entry['Properties']['isaclprotected'] = sd.has_control(sd.PD)
relations = []

# Parse owner
Expand Down
3 changes: 2 additions & 1 deletion bloodhound/enumeration/domains.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def dump_domain(self, collect, timestamp="", filename='domains.json', fileNamePr
"meta": {
"type": "domains",
"count": 0,
"version":5
"version":6
}
}
# Get functional level
Expand All @@ -112,6 +112,7 @@ def dump_domain(self, collect, timestamp="", filename='domains.json', fileNamePr
"description": ADUtils.get_entry_property(domain_object, 'description', ''),
"functionallevel": functional_level,
"highvalue": True,
"isaclprotected": False,
"collected": True,
'whencreated': whencreated
},
Expand Down
8 changes: 4 additions & 4 deletions bloodhound/enumeration/outputworker.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def write_worker(result_q, computers_filename):
# Loop file if it gets too big
if num_computers % MAX_ENTRIES == 0 and num_computers > 0:
logging.debug('Rotating output file %s', computers_filename)
computers_out.write('],"meta":{"methods":0,"type":"computers","count":%d, "version":5}}' % current_num_computers)
computers_out.write('],"meta":{"methods":0,"type":"computers","count":%d, "version":6}}' % current_num_computers)
computers_out.close()
filenumber += 1
new_filename = computers_filename.replace('.json', '_%02d.json' % filenumber)
Expand All @@ -87,7 +87,7 @@ def write_worker(result_q, computers_filename):

logging.debug('Write worker is done, closing files')
# Write metadata manually
computers_out.write('],"meta":{"methods":0,"type":"computers","count":%d, "version":5}}' % current_num_computers)
computers_out.write('],"meta":{"methods":0,"type":"computers","count":%d, "version":6}}' % current_num_computers)
computers_out.close()
result_q.task_done()

Expand Down Expand Up @@ -136,7 +136,7 @@ def membership_write_worker(result_q, enumtype, filename):
# Loop file if it gets too big
if num_members % MAX_ENTRIES == 0 and num_members > 0:
logging.debug('Rotating output file %s', filename)
membership_out.write('],"meta":{"methods":0,"type":"%s","count":%d, "version":5}}' % (enumtype, current_num_members))
membership_out.write('],"meta":{"methods":0,"type":"%s","count":%d, "version":6}}' % (enumtype, current_num_members))
membership_out.close()
filenumber += 1
new_filename = filename.replace('.json', '_%02d.json' % filenumber)
Expand All @@ -146,6 +146,6 @@ def membership_write_worker(result_q, enumtype, filename):

logging.info('Found %d %s', num_members, enumtype)
# Write metadata manually
membership_out.write('],"meta":{"methods":0,"type":"%s","count":%d, "version":5}}' % (enumtype, current_num_members))
membership_out.write('],"meta":{"methods":0,"type":"%s","count":%d, "version":6}}' % (enumtype, current_num_members))
membership_out.close()
result_q.task_done()

0 comments on commit 093be56

Please sign in to comment.