Git Product home page Git Product logo

bloodhound-tools's People

Contributors

andyrobbins avatar ciyi avatar hackndo avatar peterhgombos avatar rootlo0p avatar rvazarkar avatar thomai avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bloodhound-tools's Issues

DBCreator.py clear_and_generate command fails

clear then generate commands work as expected but clear_and_generate command always fails.

Tested with :

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.

Column is an INT instead of a STRING (column letter)

Hi,

Version

openpyxl==2.6.1

File

bloodhoundanalytics.py

Error

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.

Recommandation

Use from openpyxl.utils import get_column_letter to get the column's letter

Fix

A pull request was made

Database Connection Failed

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?

Error while generating data for BloodHound (Resolved)

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

Database name to export neo4j data

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

DBCreator.py fails during generate, cleardb, etc.

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'

DBCreator.py crash using Python3.7 on OSX

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'

Version 2 data not compatible with bloodhound 3

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?

Encoding Issues

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')

Is this project dead?

Been a few years since the last update. Tools fail on Bloodhound 4.0 and no tooling for azurehound either. Just curious.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.