Lines Matching refs:SMB
696 …return (self['Command'] in [SMB.SMB_COM_TRANSACTION, SMB.SMB_COM_READ_ANDX, SMB.SMB_COM_READ_RAW] …
712 …'ErrorClass'] + (self['_reserved'] << 8), self['ErrorCode'], self['Flags2'] & SMB.FLAGS2_NT_STATUS)
742 if flags & SMB.FLAGS2_UNICODE:
2183 class SMB: class
2374 self.__flags1 = SMB.FLAGS1_PATHCASELESS | SMB.FLAGS1_CANONICALIZED_PATHS
2375 self.__flags2 = SMB.FLAGS2_EXTENDED_SECURITY | SMB.FLAGS2_NT_STATUS | SMB.FLAGS2_LONG_NAMES
2407 …if (self._dialects_parameters['SecurityMode'] & SMB.SECURITY_SHARE_MASK) == SMB.SECURITY_SHARE_SHA…
2415 …if (self._dialects_parameters['SecurityMode'] & SMB.SECURITY_SHARE_MASK) == SMB.SECURITY_SHARE_SHA…
2540 smb['Flags2'] |= SMB.FLAGS2_SMB_SECURITY_SIGNATURE
2553 …rror_class()+ (s.get_reserved() << 8), s.get_error_code() , s.get_flags2() & SMB.FLAGS2_NT_STATUS )
2560 if smb.isValidAnswer(SMB.SMB_COM_NEGOTIATE):
2566 if self._dialects_parameters['Capabilities'] & SMB.CAP_EXTENDED_SECURITY:
2571 if self._dialects_parameters['SecurityMode'] & SMB.SECURITY_SIGNATURES_REQUIRED:
2593 negSession = SMBCommand(SMB.SMB_COM_NEGOTIATE)
2596 self.set_flags(flags2=flags2|SMB.FLAGS2_EXTENDED_SECURITY)
2598 self.set_flags(flags2=flags2 & (~SMB.FLAGS2_EXTENDED_SECURITY))
2628 treeConnect = SMBCommand(SMB.SMB_COM_TREE_CONNECT)
2639 if smb.isValidAnswer(SMB.SMB_COM_TREE_CONNECT):
2681 path = path.upper().encode('utf-16le') if self.__flags2 & SMB.FLAGS2_UNICODE else path
2683 treeConnect = SMBCommand(SMB.SMB_COM_TREE_CONNECT_ANDX)
2691 if self.__flags2 & SMB.FLAGS2_UNICODE:
2712 if smb.isValidAnswer(SMB.SMB_COM_TREE_CONNECT_ANDX):
2755 smb.addCommand(SMBCommand(SMB.SMB_COM_TREE_DISCONNECT))
2762 filename = filename.encode('utf-16le') if self.__flags2 & SMB.FLAGS2_UNICODE else filename
2767 openFile = SMBCommand(SMB.SMB_COM_OPEN)
2775 if self.__flags2 & SMB.FLAGS2_UNICODE:
2783 if smb.isValidAnswer(SMB.SMB_COM_OPEN):
2798 filename = filename.encode('utf-16le') if self.__flags2 & SMB.FLAGS2_UNICODE else filename
2803 openFile = SMBCommand(SMB.SMB_COM_OPEN_ANDX)
2811 if self.__flags2 & SMB.FLAGS2_UNICODE:
2819 if smb.isValidAnswer(SMB.SMB_COM_OPEN_ANDX):
2840 closeFile = SMBCommand(SMB.SMB_COM_CLOSE)
2847 if smb.isValidAnswer(SMB.SMB_COM_CLOSE):
2855 transCommand = SMBCommand(SMB.SMB_COM_TRANSACTION)
2886 transCommand = SMBCommand(SMB.SMB_COM_TRANSACTION2)
2924 …self.send_trans2(tid, SMB.TRANS2_QUERY_FILE_INFORMATION, '\x00', pack('<HH', fid, fileInfoClass), …
2927 if resp.isValidAnswer(SMB.SMB_COM_TRANSACTION2):
2934 …if (self._dialects_parameters['Capabilities'] & SMB.CAP_LARGE_READX) and self._SignatureEnabled is…
2947 …if (self._dialects_parameters['Capabilities'] & SMB.CAP_LARGE_WRITEX) and self._SignatureEnabled i…
2991 …return (self._dialects_parameters['SecurityMode'] & SMB.SECURITY_SHARE_MASK) == SMB.SECURITY_SHARE…
3012 if flags2 & SMB.FLAGS2_UNICODE:
3013 self.__flags2 = flags2 & (flags2 ^ SMB.FLAGS2_UNICODE)
3063 smb['Flags2'] |= SMB.FLAGS2_SMB_SECURITY_SIGNATURE
3066 sessionSetup = SMBCommand(SMB.SMB_COM_SESSION_SETUP_ANDX)
3074 …']['Capabilities'] = SMB.CAP_EXTENDED_SECURITY | SMB.CAP_USE_NT_ERRORS | SMB.CAP_UNICODE |…
3134 if smb.isValidAnswer(SMB.SMB_COM_SESSION_SETUP_ANDX):
3147 if self._dialects_parameters['SecurityMode'] & SMB.SECURITY_SIGNATURES_REQUIRED:
3153 if flags2 & SMB.FLAGS2_UNICODE:
3154 self.__flags2 |= SMB.FLAGS2_UNICODE
3165 if flags2 & SMB.FLAGS2_UNICODE:
3166 self.__flags2 = flags2 & (flags2 ^ SMB.FLAGS2_UNICODE)
3172 smb['Flags2'] |= SMB.FLAGS2_SMB_SECURITY_SIGNATURE
3174 sessionSetup = SMBCommand(SMB.SMB_COM_SESSION_SETUP_ANDX)
3182 …']['Capabilities'] = SMB.CAP_EXTENDED_SECURITY | SMB.CAP_USE_NT_ERRORS | SMB.CAP_UNICODE |…
3207 if smb.isValidAnswer(SMB.SMB_COM_SESSION_SETUP_ANDX):
3259 smb['Flags2'] |= SMB.FLAGS2_SMB_SECURITY_SIGNATURE
3277 if smb.isValidAnswer(SMB.SMB_COM_SESSION_SETUP_ANDX):
3284 if self._dialects_parameters['SecurityMode'] & SMB.SECURITY_SIGNATURES_REQUIRED:
3289 if flags2 & SMB.FLAGS2_UNICODE:
3290 self.__flags2 |= SMB.FLAGS2_UNICODE
3309 …if (self._dialects_parameters['Capabilities'] & SMB.CAP_LARGE_READX) and self._SignatureEnabled is…
3338 if self._dialects_parameters['Capabilities'] & SMB.CAP_EXTENDED_SECURITY:
3359 if flags2 & SMB.FLAGS2_UNICODE:
3360 self.__flags2 = flags2 & (flags2 ^ SMB.FLAGS2_UNICODE)
3382 sessionSetup = SMBCommand(SMB.SMB_COM_SESSION_SETUP_ANDX)
3392 …Setup['Parameters']['Capabilities'] = SMB.CAP_RAW_MODE | SMB.CAP_USE_NT_ERRORS | SMB.CAP_LARGE…
3405 if smb.isValidAnswer(SMB.SMB_COM_SESSION_SETUP_ANDX):
3430 if flags2 & SMB.FLAGS2_UNICODE:
3431 self.__flags2 |= SMB.FLAGS2_UNICODE
3440 transCommand = SMBCommand(SMB.SMB_COM_TRANSACTION)
3470 if smb.isValidAnswer(SMB.SMB_COM_TRANSACTION):
3483 read = SMBCommand(SMB.SMB_COM_READ)
3495 if ans.isValidAnswer(SMB.SMB_COM_READ):
3505 …if (self._dialects_parameters['Capabilities'] & SMB.CAP_LARGE_READX) and self._SignatureEnabled is…
3516 readAndX = SMBCommand(SMB.SMB_COM_READ_ANDX)
3531 if ans.isValidAnswer(SMB.SMB_COM_READ_ANDX):
3548 if ans.isValidAnswer(SMB.SMB_COM_READ_ANDX):
3565 readRaw = SMBCommand(SMB.SMB_COM_READ_RAW)
3586 write = SMBCommand(SMB.SMB_COM_WRITE)
3600 if smb.isValidAnswer(SMB.SMB_COM_WRITE):
3609 writeAndX = SMBCommand(SMB.SMB_COM_WRITE_ANDX)
3636 smbResp.isValidAnswer(SMB.SMB_COM_WRITE_ANDX)
3648 smbResp.isValidAnswer(SMB.SMB_COM_WRITE_ANDX)
3661 if smb.isValidAnswer(SMB.SMB_COM_WRITE_ANDX):
3670 writeRaw = SMBCommand(SMB.SMB_COM_WRITE_RAW)
3684 if smb.isValidAnswer(SMB.SMB_COM_WRITE_RAW):
3694 if smb.isValidAnswer(SMB.SMB_COM_TRANSACTION):
3702 if s.isValidAnswer(SMB.SMB_COM_TRANSACTION):
3710 filename = filename.encode('utf-16le') if self.__flags2 & SMB.FLAGS2_UNICODE else filename
3719 ntCreate = SMBCommand(SMB.SMB_COM_NT_CREATE_ANDX)
3730 if self.__flags2 & SMB.FLAGS2_UNICODE:
3741 if smb.isValidAnswer(SMB.SMB_COM_NT_CREATE_ANDX):
3752 logOff = SMBCommand(SMB.SMB_COM_LOGOFF_ANDX)
3763 path = path.encode('utf-16le') if self.__flags2 & SMB.FLAGS2_UNICODE else path
3775 …findFirstParameter['FileName'] = path + ('\x00\x00' if self.__flags2 & SMB.FLAGS2_UNICODE else '\x…
3776 self.send_trans2(tid, SMB.TRANS2_FIND_FIRST2, '\x00', findFirstParameter, '')
3785 if resp.isValidAnswer(SMB.SMB_COM_TRANSACTION2):
3799 …shortname = record['ShortName'].decode('utf-16le') if self.__flags2 & SMB.FLAGS2_UNICODE else reco…
3800 …filename = record['FileName'].decode('utf-16le') if self.__flags2 & SMB.FLAGS2_UNICODE else record…
3818 …xtParameter['FileName'] = resume_filename + ('\x00\x00' if self.__flags2 & SMB.FLAGS2_UNICODE else…
3819 self.send_trans2(tid, SMB.TRANS2_FIND_NEXT2, '\x00', findNextParameter, '')
3826 if resp.isValidAnswer(SMB.SMB_COM_TRANSACTION2):
3892 cmd = SMBCommand(SMB.SMB_COM_CHECK_DIRECTORY)
3895 …cmd['Data']['DirectoryName'] = path.encode('utf-16le') if self.__flags2 & SMB.FLAGS2_UNICODE else …
3902 if s.isValidAnswer(SMB.SMB_COM_CHECK_DIRECTORY):
3918 cmd = SMBCommand(SMB.SMB_COM_DELETE)
3922 …cmd['Data']['FileName'] = (path + '\x00').encode('utf-16le') if self.__flags2 & SMB.FLAGS2_UNICODE…
3929 if s.isValidAnswer(SMB.SMB_COM_DELETE):
3941 path = path.encode('utf-16le') if self.__flags2 & SMB.FLAGS2_UNICODE else path
3945 createDir = SMBCommand(SMB.SMB_COM_DELETE_DIRECTORY)
3954 if s.isValidAnswer(SMB.SMB_COM_DELETE_DIRECTORY):
3963 path = path.encode('utf-16le') if self.__flags2 & SMB.FLAGS2_UNICODE else path
3969 createDir = SMBCommand(SMB.SMB_COM_CREATE_DIRECTORY)
3977 if smb.isValidAnswer(SMB.SMB_COM_CREATE_DIRECTORY):
3992 renameCmd = SMBCommand(SMB.SMB_COM_RENAME)
3996 …renameCmd['Data']['OldFileName'] = old_path.encode('utf-16le') if self.__flags2 & SMB.FLAGS2_UNICO…
3997 …renameCmd['Data']['NewFileName'] = new_path.encode('utf-16le') if self.__flags2 & SMB.FLAGS2_UNICO…
4003 if smb.isValidAnswer(SMB.SMB_COM_RENAME):
4010 …if (self._dialects_parameters['Capabilities'] & SMB.CAP_LARGE_WRITEX) and self._SignatureEnabled i…