Python impacket.dcerpc.v5.samr.hSamrQueryInformationDomain() Examples
The following are 3
code examples of impacket.dcerpc.v5.samr.hSamrQueryInformationDomain().
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example.
You may also want to check out all available functions/classes of the module
impacket.dcerpc.v5.samr
, or try the search function
.
Example #1
Source File: test_samr.py From CVE-2017-7494 with GNU General Public License v3.0 | 5 votes |
def test_hSamrQueryInformationDomain_hSamrSetInformationDomain(self): dce, rpctransport, domainHandle = self.connect() resp = samr.hSamrQueryInformationDomain(dce, domainHandle, samr.DOMAIN_INFORMATION_CLASS.DomainPasswordInformation) resp.dump() resp['Buffer']['Password']['MaxPasswordAge']['LowPart'] = 11 resp = samr.hSamrSetInformationDomain(dce, domainHandle, resp['Buffer']) resp.dump() resp2 = samr.hSamrQueryInformationDomain(dce, domainHandle, samr.DOMAIN_INFORMATION_CLASS.DomainPasswordInformation) resp2.dump() self.assertTrue( 11 == resp2['Buffer']['Password']['MaxPasswordAge']['LowPart'] ) resp2['Buffer']['Password']['MaxPasswordAge']['LowPart'] = 0 resp = samr.hSamrSetInformationDomain(dce, domainHandle, resp2['Buffer']) resp.dump() ################################################################################ resp = samr.hSamrQueryInformationDomain(dce, domainHandle, samr.DOMAIN_INFORMATION_CLASS.DomainGeneralInformation) resp.dump() resp['Buffer']['General']['ReplicaSourceNodeName'] = 'BETUS' try: resp = samr.hSamrSetInformationDomain(dce, domainHandle, resp['Buffer']) except Exception, e: if str(e).find('STATUS_INVALID_INFO_CLASS') < 0: raise ################################################################################
Example #2
Source File: test_samr.py From cracke-dit with MIT License | 5 votes |
def test_hSamrQueryInformationDomain_hSamrSetInformationDomain(self): dce, rpctransport, domainHandle = self.connect() resp = samr.hSamrQueryInformationDomain(dce, domainHandle, samr.DOMAIN_INFORMATION_CLASS.DomainPasswordInformation) resp.dump() resp['Buffer']['Password']['MaxPasswordAge']['LowPart'] = 11 resp = samr.hSamrSetInformationDomain(dce, domainHandle, resp['Buffer']) resp.dump() resp2 = samr.hSamrQueryInformationDomain(dce, domainHandle, samr.DOMAIN_INFORMATION_CLASS.DomainPasswordInformation) resp2.dump() self.assertTrue( 11 == resp2['Buffer']['Password']['MaxPasswordAge']['LowPart'] ) resp2['Buffer']['Password']['MaxPasswordAge']['LowPart'] = 0 resp = samr.hSamrSetInformationDomain(dce, domainHandle, resp2['Buffer']) resp.dump() ################################################################################ resp = samr.hSamrQueryInformationDomain(dce, domainHandle, samr.DOMAIN_INFORMATION_CLASS.DomainGeneralInformation) resp.dump() resp['Buffer']['General']['ReplicaSourceNodeName'] = 'BETUS' try: resp = samr.hSamrSetInformationDomain(dce, domainHandle, resp['Buffer']) except Exception, e: if str(e).find('STATUS_INVALID_INFO_CLASS') < 0: raise ################################################################################
Example #3
Source File: test_samr.py From PiBunny with MIT License | 5 votes |
def test_hSamrQueryInformationDomain_hSamrSetInformationDomain(self): dce, rpctransport, domainHandle = self.connect() resp = samr.hSamrQueryInformationDomain(dce, domainHandle, samr.DOMAIN_INFORMATION_CLASS.DomainPasswordInformation) resp.dump() resp['Buffer']['Password']['MaxPasswordAge']['LowPart'] = 11 resp = samr.hSamrSetInformationDomain(dce, domainHandle, resp['Buffer']) resp.dump() resp2 = samr.hSamrQueryInformationDomain(dce, domainHandle, samr.DOMAIN_INFORMATION_CLASS.DomainPasswordInformation) resp2.dump() self.assertTrue( 11 == resp2['Buffer']['Password']['MaxPasswordAge']['LowPart'] ) resp2['Buffer']['Password']['MaxPasswordAge']['LowPart'] = 0 resp = samr.hSamrSetInformationDomain(dce, domainHandle, resp2['Buffer']) resp.dump() ################################################################################ resp = samr.hSamrQueryInformationDomain(dce, domainHandle, samr.DOMAIN_INFORMATION_CLASS.DomainGeneralInformation) resp.dump() resp['Buffer']['General']['ReplicaSourceNodeName'] = 'BETUS' try: resp = samr.hSamrSetInformationDomain(dce, domainHandle, resp['Buffer']) except Exception, e: if str(e).find('STATUS_INVALID_INFO_CLASS') < 0: raise ################################################################################