Skip to content

Commit 9e6ba5a

Browse files
fix: check if status is 13 and print out permission denied for share
1 parent 3e5d825 commit 9e6ba5a

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

nxc/protocols/nfs.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,15 @@ def enum_shares(self):
224224
for share, network in zip(shares, networks):
225225
try:
226226
mount_info = self.mount.mnt(share, self.auth)
227-
contents = self.list_dir(mount_info["mountinfo"]["fhandle"], share, self.args.enum_shares)
227+
self.logger.debug(f"Mounted {share} - {mount_info}")
228+
if mount_info["status"] != 0: # noqa: SIM102
229+
if mount_info["status"] == 13:
230+
self.logger.fail(f"{share} - Permission Denied")
231+
continue
232+
# check for other error codes here
233+
234+
fhandle = mount_info["mountinfo"]["fhandle"]
235+
contents = self.list_dir(fhandle, share, self.args.enum_shares)
228236

229237
self.logger.success(share)
230238
if contents:

0 commit comments

Comments
 (0)