Skip to content

Commit 34c3c29

Browse files
committed
Remove hash_spider setting logging attributes (they are wrong anyway)
1 parent 730b572 commit 34c3c29

1 file changed

Lines changed: 3 additions & 7 deletions

File tree

nxc/modules/hash_spider.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,7 @@ def create_db(local_admins, dbconnection, cursor):
7070

7171

7272
def process_creds(context, connection, credentials_data, dbconnection, cursor, driver):
73-
if connection.args.local_auth:
74-
context.log.extra["host"] = connection.conn.getServerDNSDomainName()
75-
else:
76-
context.log.extra["host"] = connection.domain
77-
context.log.extra["hostname"] = connection.host.upper()
73+
domain = connection.conn.getServerDNSDomainName() if connection.args.local_auth else connection.domain
7874
for result in credentials_data:
7975
username = result["username"].upper().split("@")[0]
8076
nthash = result["nthash"]
@@ -85,7 +81,7 @@ def process_creds(context, connection, credentials_data, dbconnection, cursor, d
8581
"UPDATE admin_users SET password = ? WHERE username LIKE '" + username + "%'",
8682
[password],
8783
)
88-
username = f"{username.upper()}@{context.log.extra['host'].upper()}"
84+
username = f"{username.upper()}@{domain.upper()}"
8985
dbconnection.commit()
9086
session = driver.session()
9187
session.run('MATCH (u) WHERE (u.name = "' + username + '") SET u.owned=True RETURN u,u.name,u.owned')
@@ -99,7 +95,7 @@ def process_creds(context, connection, credentials_data, dbconnection, cursor, d
9995
[nthash],
10096
)
10197
dbconnection.commit()
102-
username = f"{username.upper()}@{context.log.extra['host'].upper()}"
98+
username = f"{username.upper()}@{domain.upper()}"
10399
session = driver.session()
104100
session.run('MATCH (u) WHERE (u.name = "' + username + '") SET u.owned=True RETURN u,u.name,u.owned')
105101
path_to_da = session.run("MATCH p=shortestPath((n)-[*1..]->(m)) WHERE n.owned=true AND m.name=~ '.*DOMAIN ADMINS.*' RETURN p")

0 commit comments

Comments
 (0)