@@ -70,11 +70,7 @@ def create_db(local_admins, dbconnection, cursor):
7070
7171
7272def 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" )
@@ -202,7 +198,7 @@ def run_lsassy(self, context, connection, cursor): # copied and pasted from lsa
202198 if file is None :
203199 context .log .fail ("Unable to dump lsass" )
204200 return False
205- credentials , tickets , masterkeys = Parser (file ).parse ()
201+ credentials , tickets , masterkeys = Parser (host , file ).parse ()
206202 file .close ()
207203 ImpacketFile .delete (session , file .get_file_path ())
208204 if credentials is None :
0 commit comments