Created
April 15, 2019 13:58
-
-
Save chrismaddalena/869566a45f87f8ec5d56c1d6bf544f07 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from neo4j import GraphDatabase | |
def setup_database_conn(): | |
"""Function to setup the database connection to the Neo4j project containing the BloodHound data.""" | |
try: | |
database_uri = 'bolt://localhost:7687' | |
database_user = 'neo4j' | |
database_pass = 'bloodhound' | |
print("[!] Attempting to connect to your Neo4j project using {}:{} @ {}.".format(database_user, database_pass, database_uri)) | |
neo4j_driver = GraphDatabase.driver(database_uri, auth=(database_user, database_pass)) | |
print("[+] Success!") | |
return neo4j_driver | |
except: | |
neo4j_driver = None | |
print("[X] Database connection failed!") | |
exit() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment