fox-it / aclpwn.py

Active Directory ACL exploitation with BloodHound
MIT License
681 stars 106 forks source link

Neo4j-driver 4+ issues #6

Open mox1 opened 3 years ago

mox1 commented 3 years ago

Attempting to install / run this on current versions of neo4j / neo4j-driver presents a host of issues. Unfortunately its not a super quick fix.

neo4j-driver (python package) has removed the neo4j.v1 package. This is relatively easy to fix. simply change from neo4j.v1 import GraphDatabase to from neo4j import GraphDatabase

The next issue is that the {arg} format of passing variables in database queries has been depreciated. We need to use $arg.

This needs to be fixed in multiple places, but as an example (init.py line ~106):

q = "MATCH (n:%s {name: {name}}) RETURN n"
with database.driver.session() as session:
   fromres = session.run(q % args.from_type.capitalize(), name=from_object)

Must change to;

q = "MATCH (n:%s {name: $name}) RETURN n"
with database.driver.session() as session:
   fromres = session.run(q % args.from_type.capitalize(), name=from_object)

Finally, the REST API has been removed. This is the tough one, as I'm not sure how to fix. See pathfinding.py:dijkstra_find()

This is just an FYI for anyone attempting to install using recent packages / versions of things.

mox1 commented 3 years ago

Update, the following lines will install the correct versions of things to get aclpwn to run. Note that this isn't always going to work as other pip packages (crackmapexec for example) require neo4j-driver > 4.0.0. I recommend running these commands in a fresh virtualenv.

ALSO, you need to have your actual databse of neo4j < version 4 or this won't work.

python -m pip install 'neo4j-driver==1.7.0' --force-reinstall
python -m pip install 'neo4j==1.7.0' --force-reinstall
python -m pip install -U ldap3  
python -m pip install aclpwn