Skip to content
This repository was archived by the owner on Dec 6, 2023. It is now read-only.

Commit f50b5fe

Browse files
author
mpgn
authored
Merge pull request #677 from juliourena/master
Fix #676 - bh_owned module output always returning false
2 parents 39fe536 + a5c3085 commit f50b5fe

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

cme/modules/bh_owned.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,11 @@ def on_admin_login(self, context, connection):
7474
with session.begin_transaction() as tx:
7575
result = tx.run(
7676
"MATCH (c:Computer {{name:\"{}\"}}) SET c.owned=True RETURN c.name AS name".format(host_fqdn))
77-
if len(result.value()) > 0:
77+
record = result.single()
78+
value = record.value()
79+
if len(value) > 0:
7880
context.log.success("Node {} successfully set as owned in BloodHound".format(host_fqdn))
7981
else:
8082
context.log.error(
8183
"Node {} does not appear to be in Neo4J database. Have you imported correct data?".format(host_fqdn))
82-
driver.close()
84+
driver.close()

0 commit comments

Comments
 (0)