Skip to content

Commit c4bf023

Browse files
committed
Improve logging output of --shares
1 parent 493b12e commit c4bf023

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

nxc/protocols/smb.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -1086,6 +1086,7 @@ def shares(self):
10861086
try:
10871087
self.conn.createDirectory(share_name, temp_dir)
10881088
write_dir = True
1089+
self.logger.debug(f"WRITE access with DIR creation on share: {share_name}")
10891090
try:
10901091
self.conn.deleteDirectory(share_name, temp_dir)
10911092
except SessionError as e:
@@ -1096,13 +1097,14 @@ def shares(self):
10961097
self.logger.debug(f"Error DELETING created temp dir {temp_dir} on share {share_name}: {error}")
10971098
except SessionError as e:
10981099
error = get_error_string(e)
1099-
self.logger.debug(f"Error checking WRITE access on share {share_name}: {error}")
1100+
self.logger.debug(f"Error checking WRITE access with DIR creation on share {share_name}: {error}")
11001101

11011102
try:
11021103
tid = self.conn.connectTree(share_name)
11031104
fid = self.conn.createFile(tid, temp_file, desiredAccess=FILE_SHARE_WRITE, shareMode=FILE_SHARE_DELETE)
11041105
self.conn.closeFile(tid, fid)
11051106
write_file = True
1107+
self.logger.debug(f"WRITE access with FILE creation on share: {share_name}")
11061108
try:
11071109
self.conn.deleteFile(share_name, temp_file)
11081110
except SessionError as e:
@@ -1113,7 +1115,7 @@ def shares(self):
11131115
self.logger.debug(f"Error DELETING created temp file {temp_file} on share {share_name}")
11141116
except SessionError as e:
11151117
error = get_error_string(e)
1116-
self.logger.debug(f"Error checking WRITE access with file on share {share_name}: {error}")
1118+
self.logger.debug(f"Error checking WRITE access with FILE creation on share {share_name}: {error}")
11171119

11181120
# If we either can create a file or a directory we add the write privs to the output. Agreed on in https://github.com/Pennyw0rth/NetExec/pull/404
11191121
if write_dir or write_file:

0 commit comments

Comments
 (0)