bloodhoundad / bloodhound-tools Goto Github PK
View Code? Open in Web Editor NEWMiscellaneous tools for BloodHound
License: GNU Lesser General Public License v3.0
Miscellaneous tools for BloodHound
License: GNU Lesser General Public License v3.0
clear
then generate
commands work as expected but clear_and_generate
command always fails.
Tested with :
neo4j-driver-1.6.2 neotime-1.0.0
095fb82181a28b51fb1cfeda9f852524061a0649
Test 1
$ python DBCreator.py
================================================================
BloodHound Sample Database Creator
================================================================
Documented commands (type help <topic>):
========================================
clear_and_generate cleardb connect dbconfig exit generate help setnodes
(Cmd) dbconfig
Current Settings:
DB Url: bolt://localhost:7687
DB Username: neo4j
DB Password: neo4jj
Enter DB URL [bolt://localhost:7687]
Enter DB Username [neo4j]
Enter DB Password [neo4jj] BloodHound
New Settings:
DB Url: bolt://localhost:7687
DB Username: neo4j
DB Password: BloodHound
Testing DB Connection
Database Connection Successful!
(Cmd) connect
Database Connection Successful!
(Cmd) cleardb
Clearing Database
Resetting Schema
DB Cleared and Schema Set
(Cmd) generate
Starting data generation with nodes=500
Populating Standard Nodes
Adding Standard Edges
Generating Computer Nodes
Creating Domain Controllers
Generating User Nodes
Generating Group Nodes
Adding Domain Admins to Local Admins of Computers
Creating 25 Domain Admins (5% of users capped at 30)
Applying random group nesting
Adding users to groups
Calculated 7 groups per user with a variance of - 6
Adding local admin rights
Adding RDP/ExecuteDCOM/AllowedToDelegateTo
Adding sessions
Adding Domain Admin ACEs
Creating OUs
Creating GPOs
Adding outbound ACLs to 3 objects
Marking some users as Kerberoastable
Adding unconstrained delegation to a few computers
Database Generation Finished!
(Cmd) clear_and_generate
Database Connection Successful!
Clearing Database
Resetting Schema
DB Cleared and Schema Set
Starting data generation with nodes=500
Populating Standard Nodes
Adding Standard Edges
Traceback (most recent call last):
File "DBCreator.py", line 692, in <module>
MainMenu().cmdloop()
File "DBCreator.py", line 56, in cmdloop
cmd.Cmd.cmdloop(self)
File "/usr/lib/python2.7/cmd.py", line 142, in cmdloop
stop = self.onecmd(line)
File "/usr/lib/python2.7/cmd.py", line 221, in onecmd
return func(arg)
File "DBCreator.py", line 166, in do_clear_and_generate
self.generate_data()
File "DBCreator.py", line 231, in generate_data
'MERGE (n:Domain {name:"TESTLAB.LOCAL"}) MERGE (m:Group {name:"ENTERPRISE [email protected]"}) MERGE (m)-[:GenericAll {isacl:true}]->(n)')
File "/usr/local/lib/python2.7/dist-packages/neo4j/v1/api.py", line 331, in run
self._connection.fetch()
File "/usr/local/lib/python2.7/dist-packages/neo4j/bolt/connection.py", line 287, in fetch
return self._fetch()
File "/usr/local/lib/python2.7/dist-packages/neo4j/bolt/connection.py", line 327, in _fetch
response.on_failure(summary_metadata or {})
File "/usr/local/lib/python2.7/dist-packages/neo4j/v1/result.py", line 70, in on_failure
raise CypherError.hydrate(**metadata)
neo4j.exceptions.TransientError: Database constraints have changed (txId=849) after this transaction (txId=848) started, which is not yet supported. Please retry your transaction to ensure all constraints are executed.
Test 2
$ python DBCreator.py
================================================================
BloodHound Sample Database Creator
================================================================
Documented commands (type help <topic>):
========================================
clear_and_generate cleardb connect dbconfig exit generate help setnodes
(Cmd) connect
Database Connection Failed. Check your settings.
(Cmd) dbconfig
Current Settings:
DB Url: bolt://localhost:7687
DB Username: neo4j
DB Password: neo4jj
Enter DB URL [bolt://localhost:7687]
Enter DB Username [neo4j]
Enter DB Password [neo4jj] BloodHound
New Settings:
DB Url: bolt://localhost:7687
DB Username: neo4j
DB Password: BloodHound
Testing DB Connection
Database Connection Successful!
(Cmd) connect
Database Connection Successful!
(Cmd) cleardb
Clearing Database
Resetting Schema
DB Cleared and Schema Set
(Cmd) generate
Starting data generation with nodes=500
Populating Standard Nodes
Adding Standard Edges
Generating Computer Nodes
Creating Domain Controllers
Generating User Nodes
Generating Group Nodes
Adding Domain Admins to Local Admins of Computers
Creating 20 Domain Admins (4% of users capped at 30)
Applying random group nesting
Adding users to groups
Calculated 7 groups per user with a variance of - 6
Adding local admin rights
Adding RDP/ExecuteDCOM/AllowedToDelegateTo
Adding sessions
Adding Domain Admin ACEs
Creating OUs
Creating GPOs
Adding outbound ACLs to 2 objects
Marking some users as Kerberoastable
Adding unconstrained delegation to a few computers
Database Generation Finished!
(Cmd) cleardb
Clearing Database
Resetting Schema
DB Cleared and Schema Set
(Cmd) clear_and_generate
Database Connection Successful!
Clearing Database
Resetting Schema
DB Cleared and Schema Set
Starting data generation with nodes=500
Populating Standard Nodes
Traceback (most recent call last):
File "DBCreator.py", line 692, in <module>
MainMenu().cmdloop()
File "DBCreator.py", line 56, in cmdloop
cmd.Cmd.cmdloop(self)
File "/usr/lib/python2.7/cmd.py", line 142, in cmdloop
stop = self.onecmd(line)
File "/usr/lib/python2.7/cmd.py", line 221, in onecmd
return func(arg)
File "DBCreator.py", line 166, in do_clear_and_generate
self.generate_data()
File "DBCreator.py", line 210, in generate_data
session.run("MERGE (n:Group {name:'ENTERPRISE READ-ONLY DOMAIN [email protected]'})")
File "/usr/local/lib/python2.7/dist-packages/neo4j/v1/api.py", line 331, in run
self._connection.fetch()
File "/usr/local/lib/python2.7/dist-packages/neo4j/bolt/connection.py", line 287, in fetch
return self._fetch()
File "/usr/local/lib/python2.7/dist-packages/neo4j/bolt/connection.py", line 327, in _fetch
response.on_failure(summary_metadata or {})
File "/usr/local/lib/python2.7/dist-packages/neo4j/v1/result.py", line 70, in on_failure
raise CypherError.hydrate(**metadata)
neo4j.exceptions.TransientError: Database constraints have changed (txId=1100) after this transaction (txId=1099) started, which is not yet supported. Please retry your transaction to ensure all constraints are executed.
Hi,
openpyxl==2.6.1
bloodhoundanalytics.py
def save_workbook(self):
for worksheet in self.workbook._sheets:
for col in worksheet.columns:
max_length = 0
column = col[0].column # Get the column name
for cell in col:
try: # Necessary to avoid error on empty cells
if len(str(cell.value)) > max_length:
max_length = len(cell.value)
except:
pass
adjusted_width = (max_length + 2) * 1.2
worksheet.column_dimensions[column].width = adjusted_width
self.workbook.save("BloodHoundAnalytics.xlsx")
This line column = col[0].column # Get the column name
returns the column number (1, 2, ...) instead of its name.
Use from openpyxl.utils import get_column_letter
to get the column's letter
A pull request was made
Error:
Failed to establish secure connection to u'EOF occurred in violation of protocol (_ssl.c:727)'
Database Connection Failed. Check your settings.
Does anyone know how to fix this error?
I just downloaded fresh new Kali Virtual Machine (VM)
Installed Bloodhound and decided to generate some data to play with it.
the following command (dbconfig, connect, setnodes , setdomain works perfectly) but command such as (clear_and_generate, cleardb, generate) doesn't works and it throws this error.
┌──(root💀kali)-[/home/kali/BloodHound_DB_Generator/BloodHound-Tools/DBCreator]
└─# python3 DBCreator.py 1 ⨯
================================================================
BloodHound Sample Database Creator
================================================================
Documented commands (type help <topic>):
========================================
clear_and_generate connect exit help setnodes
cleardb dbconfig generate setdomain
(Cmd) dbconfig
Current Settings:
DB Url: bolt://localhost:7687
DB Username: neo4j
DB Password: neo4jj
Use encryption: False
Enter DB URL [bolt://localhost:7687]
Enter DB Username [neo4j]
Enter DB Password [neo4jj] password
Use encryption? y/N n
New Settings:
DB Url: bolt://localhost:7687
DB Username: neo4j
DB Password: password
Use encryption: False
Testing DB Connection
Database Connection Successful!
(Cmd) cleardb
Clearing Database
Resetting Schema
Traceback (most recent call last):
File "/home/kali/BloodHound_DB_Generator/BloodHound-Tools/DBCreator/DBCreator.py", line 806, in <module>
MainMenu().cmdloop()
File "/home/kali/BloodHound_DB_Generator/BloodHound-Tools/DBCreator/DBCreator.py", line 69, in cmdloop
cmd.Cmd.cmdloop(self)
File "/usr/lib/python3.9/cmd.py", line 138, in cmdloop
stop = self.onecmd(line)
File "/usr/lib/python3.9/cmd.py", line 217, in onecmd
return func(arg)
File "/home/kali/BloodHound_DB_Generator/BloodHound-Tools/DBCreator/DBCreator.py", line 172, in do_cleardb
for constraint in session.run("CALL db.constraints"):
File "/usr/lib/python3/dist-packages/neo4j/__init__.py", line 503, in run
self._connection.fetch()
File "/usr/lib/python3/dist-packages/neobolt/direct.py", line 419, in fetch
return self._fetch()
File "/usr/lib/python3/dist-packages/neobolt/direct.py", line 461, in _fetch
response.on_failure(summary_metadata or {})
File "/usr/lib/python3/dist-packages/neobolt/direct.py", line 755, in on_failure
raise CypherError.hydrate(**metadata)
neobolt.exceptions.ClientError: Supplied bookmark [FB:kcwQ2pBhTb3xSHGSufncKQOQBUmQ] does not conform to pattern neo4j:bookmark:v1:tx
Hi
I generate a set of data using your script and it works fine, now I try to export the data using neo4j but I cannot find the name of the database used.
Any idea on how can I export the data ?
Best regards
Tried DBCreator in WIN10, Kali, and on a MAC. All 3 trails produce similar issue.
Generate:
raise Neo4jError.hydrate(**metadata)
neo4j.exceptions.ConstraintError: {code: Neo.ClientError.Schema.ConstraintValidationFailed} {message: Node(9) already exists with label Base
and property objectid
= 'bc40b5a8-8a0b-4f7f-90ed-916aac46a4d6'}
ClearDB:
File "/home/kali/.local/lib/python3.8/site-packages/neo4j/data.py", line 141, in index
raise KeyError(key)
KeyError: 'description'
clear_and_generate:
File "/home/kali/.local/lib/python3.8/site-packages/neo4j/data.py", line 141, in index
raise KeyError(key)
KeyError: 'description'
Hi,
neo4j-driver==1.7.2
bloodhoundanalytics.py
_values
attribute doesn't seem to exist for Result
neo4j class.
value(<int>)
method could be used instead. (https://neo4j.com/docs/api/python-driver/current/results.html#neo4j.neo4j.BoltStatementResult.BoltStatementResult.value)
A pull request was made
Installed the lastest Python 3.7 and install dependencies using pip3.7 install -r req.txt
I then launch DBCreator and get the following :
$ python3.7 DBCreator.py
================================================================
BloodHound Sample Database Creator
================================================================
Documented commands (type help <topic>):
========================================
clear_and_generate connect exit help setnodes
cleardb dbconfig generate setdomain
(Cmd) connect
Database Connection Successful!
(Cmd) generate
Starting data generation with nodes=500
Populating Standard Nodes
Traceback (most recent call last):
File "DBCreator.py", line 806, in <module>
MainMenu().cmdloop()
File "DBCreator.py", line 69, in cmdloop
cmd.Cmd.cmdloop(self)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/cmd.py", line 138, in cmdloop
stop = self.onecmd(line)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/cmd.py", line 217, in onecmd
return func(arg)
File "DBCreator.py", line 200, in do_generate
self.generate_data()
File "DBCreator.py", line 256, in generate_data
sid=cs(512), gname=cn("DOMAIN ADMINS"))
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/neo4j/work/simple.py", line 217, in run
self._autoResult._run(query, parameters, self._config.database, self._config.default_access_mode, self._bookmarks, **kwparameters)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/neo4j/work/result.py", line 101, in _run
self._attach()
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/neo4j/work/result.py", line 202, in _attach
self._connection.fetch_message()
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/neo4j/io/_bolt4x0.py", line 330, in fetch_message
response.on_failure(summary_metadata or {})
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/neo4j/io/_bolt4x0.py", line 518, in on_failure
raise Neo4jError.hydrate(**metadata)
neo4j.exceptions.ConstraintError: Node(0) already exists with label `Base` and property `objectid` = 'S-1-5-21-883232822-274137685-4173207997-512'
I am getting the below error when running generate on Kali using DBCreator_update.zip. Please advise.
I first run this command in CMD: C:> SharpHound.exe --CollectionMethod Session --Loop
Then I upload the collected data into the Bloodhound GUI in Linux.
An error message occurred: (version 2 data not compatible with bloodhound 3),
The imported files are not usable and the query don't work
I am using the following versions:
Using sharphound 3.0
Latest neo4j 3.5.3
Latest bloodhound GUI 3.0.4
How to solve this issue?
I had encoding issues, I added a small block, but I know this method is discouraged in python so I didnt pull request it, its up to you.
if sys.version_info < (3, 0): reload(sys) sys.setdefaultencoding('utf-8')
Been a few years since the last update. Tools fail on Bloodhound 4.0 and no tooling for azurehound either. Just curious.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.