Skip to content

Commit 61f6ee1

Browse files
committed
Less verbose output and fix formating
1 parent 8b78206 commit 61f6ee1

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

nxc/protocols/smb.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1188,7 +1188,7 @@ def output(sessions):
11881188
for row in result:
11891189
self.logger.highlight(row)
11901190
else:
1191-
self.logger.fail("No active session found for specified user(s) using the Remote Registry service.")
1191+
self.logger.info(f"No active session found for specified user(s) using the Remote Registry service on {self.hostname}.")
11921192

11931193
# Bind to the Remote Registry Pipe
11941194
rpctransport = transport.SMBTransport(self.conn.getRemoteName(), self.conn.getRemoteHost(), filename=r"\winreg", smb_connection=self.conn)
@@ -1201,9 +1201,9 @@ def output(sessions):
12011201
dce.bind(rrp.MSRPC_UUID_RRP)
12021202
break
12031203
except Exception as e:
1204-
self.logger.debug(f"Could not bind to the Remote Registry: {e}")
1204+
self.logger.debug(f"Could not bind to the Remote Registry on {self.hostname}: {e}")
12051205
if binding_attempts == 1:
1206-
self.logger.fail("The Remote Registry service seems to be disabled.")
1206+
self.logger.info(f"The Remote Registry service seems to be disabled on {self.hostname}.")
12071207
return
12081208

12091209
# STATUS_PIPE_NOT_AVAILABLE : Waiting 1 second for the service to start (if idle and set to 'Automatic' startup type)
@@ -1215,12 +1215,12 @@ def output(sessions):
12151215
resp = rrp.hOpenUsers(dce)
12161216
except DCERPCException as e:
12171217
if "rpc_s_access_denied" in str(e).lower():
1218-
self.logger.fail("Access denied while enumerating session using the Remote Registry")
1218+
self.logger.info(f"Access denied while enumerating session using the Remote Registry on {self.hostname}.")
12191219
return
12201220
else:
1221-
self.logger.debug("Exception connecting to RPC: %s", e)
1221+
self.logger.debug(f"Exception connecting to RPC on {self.hostname}: {e}")
12221222
except Exception as e:
1223-
self.logger.debug("Exception connecting to RPC: %s", e)
1223+
self.logger.debug(f"Exception connecting to RPC on {self.hostname}: {e}")
12241224

12251225
# Enumerate HKU subkeys and recover SIDs
12261226
sid_filter = "^S-1-.*\d$"
@@ -1245,7 +1245,7 @@ def output(sessions):
12451245
dce.disconnect()
12461246

12471247
if not sessions:
1248-
self.logger.fail("No sessions found via the Remote Registry service.")
1248+
self.logger.info(f"No sessions found via the Remote Registry service on {self.hostname}.")
12491249
return
12501250

12511251
# Bind to the LSARPC Pipe for SID resolution
@@ -1255,7 +1255,7 @@ def output(sessions):
12551255
dce.connect()
12561256
dce.bind(lsat.MSRPC_UUID_LSAT)
12571257
except Exception as e:
1258-
self.logger.debug(f"Failed to connect to LSARPC for SID resolution : {e}")
1258+
self.logger.debug(f"Failed to connect to LSARPC for SID resolution on {self.hostname}: {e}")
12591259
output(sessions)
12601260
return
12611261

0 commit comments

Comments
 (0)