For a series of targets (IPs), Id like to determine which SMB shares my account has no access to, which it has read access to, and which it has read/write access to.
Currently I am using smbclient. The command I run first is
smbclient -L [targetIP] -U [user] -p 445
This gives me a list of shares. For example;
Sharename Type Comment --------- ---- ------- ADMIN$ Disk Remote Admin C$ Disk Default share IPC$ IPC Remote IPC print$ Disk Printer Drivers MySecrets Disk
I then can connect to a file share with this command
smbclient //[target]/[name_of_share_from_list] -U [user] -p 445
Which results in an SMB prompt. From the prompt I type
ls and if I see files I know I have read access. I'm guessing I have to push a file to see if I have write access.
This is tedious. How do I automate this such that for the given list of targets, I get a list of all shares, and the level of access my account has to them?