Skip to content

Commit e6ce6da

Browse files
author
Aurélien CHALOT
committed
Patches the --filter-shares so that it correctly finds READ,WRITE perm
1 parent 991f871 commit e6ce6da

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

nxc/protocols/smb.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1203,10 +1203,10 @@ def shares(self):
12031203
for share in permissions:
12041204
name = share["name"]
12051205
remark = share["remark"]
1206-
perms = share["access"]
1206+
perms = ",".join(share["access"])
12071207
if self.args.filter_shares and not any(x in perms for x in self.args.filter_shares):
12081208
continue
1209-
self.logger.highlight(f"{name:<15} {','.join(perms):<15} {remark}")
1209+
self.logger.highlight(f"{name:<15} {perms:<15} {remark}")
12101210
return permissions
12111211

12121212
def dir(self):

nxc/protocols/smb/proto_args.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def proto_args(parser, parents):
4141
mapping_enum_group.add_argument("--dir", nargs="?", type=str, const="", help="List the content of a path (default path: '%(const)s')")
4242
mapping_enum_group.add_argument("--interfaces", action="store_true", help="Enumerate network interfaces")
4343
mapping_enum_group.add_argument("--no-write-check", action="store_true", help="Skip write check on shares (avoid leaving traces when missing delete permissions)")
44-
mapping_enum_group.add_argument("--filter-shares", nargs="+", help="Filter share by access, option 'read' 'write' or 'read,write'")
44+
mapping_enum_group.add_argument("--filter-shares", nargs="+", help="Filter share by access, option 'READ' 'WRITE' or 'READ,WRITE'")
4545
mapping_enum_group.add_argument("--smb-sessions", action="store_true", help="Enumerate active smb sessions")
4646
mapping_enum_group.add_argument("--disks", action="store_true", help="Enumerate disks")
4747
mapping_enum_group.add_argument("--loggedon-users-filter", action="store", help="only search for specific user, works with regex")

0 commit comments

Comments
 (0)