def test_loginHashes(self): lmhash, nthash = self.hashes.split(':') smb = SMBConnection('*SMBSERVER', self.machine, preferredDialect = self.dialects) smb.login(self.username, '', self.domain, lmhash, nthash) credentials = smb.getCredentials() self.assertTrue( credentials == (self.username, '', self.domain, lmhash.decode('hex'), nthash.decode('hex')) ) smb.logoff()
def test_connection(self): smb = SMBConnection('*SMBSERVER', self.machine, preferredDialect = self.dialects) smb.login(self.username, self.password, self.domain) credentials = smb.getCredentials() self.assertTrue( credentials == (self.username, self.password, self.domain, '','')) smb.logoff() del(smb)
def test_loginHashes(self): lmhash, nthash = self.hashes.split(':') smb = SMBConnection('*SMBSERVER', self.machine, preferredDialect = self.dialects) smb.login(self.username, '', self.domain, lmhash, nthash) credentials = smb.getCredentials() self.assertTrue( credentials == (self.username, '', self.domain, lmhash.decode('hex'), nthash.decode('hex'), '', None, None) ) smb.logoff()
def test_connection(self): smb = SMBConnection('*SMBSERVER', self.machine, preferredDialect = self.dialects) smb.login(self.username, self.password, self.domain) credentials = smb.getCredentials() self.assertTrue( credentials == (self.username, self.password, self.domain, '','','', None, None)) smb.logoff() del(smb)
def test_loginKerberosAES(self): lmhash, nthash = self.hashes.split(':') smb = SMBConnection('*SMBSERVER', self.machine, preferredDialect = self.dialects) smb.kerberosLogin(self.username, '', self.domain, '', '', self.aesKey) credentials = smb.getCredentials() self.assertTrue( credentials == (self.username, '', self.domain, '','',self.aesKey, None, None) ) UNC = '\\\\%s\\%s' % (self.machine, self.share) tid = smb.connectTree(UNC) smb.logoff()