During an audit I needed a tool to enumerate the permissions for all shared file ressources within a large client network. Although there are several tools to enumerate client shares (e.g. nmap), I have found none for enumerating the permissions in detail.

The python script is basically a wrapper for "rpcclient" from the samba client package. This is not an attack tool, you will need to have proper administrative rights to read the share permissions (see line "RPCCommand = ..." in the source). In addition to enumerating the share permissions, the script also enumerates the local groups (e.g. local administrators).

Example log file content:  netshareenum  netname: SecretShare  remark: (null)  path: C:\  password: (null) ...  netsharegetinfo  netname: SecretShare ... Permissions: 0x1f01ff: ... SID: S-1-1-0:\Everybody ...  querydominfo  Domain: PC01  Server: ...  enumalsgroups_builtin  group:[Administrators] rid:[0x220]  group:[Backup Operators] rid:[0x227]...  queryaliasmem 0x220 S-...-500:PC01\Administrator  S-...-...:DOM\SecretAdmin