diff --git a/smbclientng/core/SMBSession.py b/smbclientng/core/SMBSession.py index 25a772f..e79190b 100644 --- a/smbclientng/core/SMBSession.py +++ b/smbclientng/core/SMBSession.py @@ -921,7 +921,14 @@ def set_share(self, shareName): """ if shareName is not None: - self.smb_share = shareName + self.list_shares() + if shareName.lower() in self.available_shares.keys(): + # Doing this in order to keep the case of the share adevertised by the remote machine + self.smb_share = self.available_shares[shareName.lower()] + else: + print("[!] Could not set share '%s', it does not exist remotely." % shareName) + + def set_cwd(self, path=None): """