fortra / impacket

Impacket is a collection of Python classes for working with network protocols.
https://www.coresecurity.com
Other
13.31k stars 3.54k forks source link

How can I use impacket to test whether a Windows share is accessible? #1521

Open CaledoniaProject opened 1 year ago

CaledoniaProject commented 1 year ago

I'd like to know how can I check if a share is writable.

In smbcilent.py I can tell if a share is accessible by checking the exceptions in smbClient.login method, aka https://github.com/fortra/impacket/blob/master/examples/smbclient.py#L98

How can I check if a share is writable?

XiaoliChan commented 1 year ago

@CaledoniaProject Here is what you want: https://github.com/Porchetta-Industries/CrackMapExec/blob/master/cme/protocols/smb.py#L716

Try to create and delete a directory to check permissions.