Skip to content

Commit 600abd6

Browse files
authored
Merge pull request Pennyw0rth#1179 from azoxlpf/fix/mssql-fix-infinite-loop
abort rid_brute on invalid connection after failed login
2 parents 4a5cbf6 + 8a0957e commit 600abd6

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

nxc/protocols/mssql.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -423,6 +423,9 @@ def handle_mssql_reply(self):
423423

424424
def rid_brute(self, max_rid=None):
425425
entries = []
426+
if self.conn.lastError:
427+
self.logger.fail(f"Cannot perform RID bruteforce due to invalid connection: {self.conn.lastError}")
428+
return entries
426429
if not max_rid:
427430
max_rid = int(self.args.rid_brute)
428431

@@ -435,6 +438,7 @@ def rid_brute(self, max_rid=None):
435438
domain_sid = SID(bytes.fromhex(raw_domain_sid.decode())).formatCanonical()[:-4]
436439
except Exception as e:
437440
self.logger.fail(f"Error parsing SID. Not domain joined?: {e}")
441+
return entries
438442

439443
so_far = 0
440444
simultaneous = 1000

0 commit comments

Comments
 (0)