当前位置: 首页>>代码示例>>Python>>正文


Python ndr.NULL属性代码示例

本文整理汇总了Python中impacket.dcerpc.v5.ndr.NULL属性的典型用法代码示例。如果您正苦于以下问题:Python ndr.NULL属性的具体用法?Python ndr.NULL怎么用?Python ndr.NULL使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在impacket.dcerpc.v5.ndr的用法示例。


在下文中一共展示了ndr.NULL属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_hNetrUseAdd_hNetrUseDel_hNetrUseGetInfo_hNetrUseEnum

# 需要导入模块: from impacket.dcerpc.v5 import ndr [as 别名]
# 或者: from impacket.dcerpc.v5.ndr import NULL [as 别名]
def test_hNetrUseAdd_hNetrUseDel_hNetrUseGetInfo_hNetrUseEnum(self):
        dce, rpctransport = self.connect()

        info1 = wkst.LPUSE_INFO_1()

        info1['ui1_local'] = 'Z:\x00'
        info1['ui1_remote'] = '\\\\127.0.0.1\\c$\x00'
        info1['ui1_password'] = NULL
        resp = wkst.hNetrUseAdd(dce, 1, info1)
        resp.dump()

        # We're not testing this call with NDR64, it fails and I can't see the contents
        if self.ts == ('71710533-BEBA-4937-8319-B5DBEF9CCC36', '1.0'):
            return

        resp = wkst.hNetrUseEnum(dce, 2)
        resp.dump()

        resp2 = wkst.hNetrUseGetInfo(dce, 'Z:', 3)
        resp2.dump()

        resp = wkst.hNetrUseDel(dce,'Z:')
        resp.dump() 
开发者ID:joxeankoret,项目名称:CVE-2017-7494,代码行数:25,代码来源:test_wkst.py

示例2: test_NetrJoinDomain2

# 需要导入模块: from impacket.dcerpc.v5 import ndr [as 别名]
# 或者: from impacket.dcerpc.v5.ndr import NULL [as 别名]
def test_NetrJoinDomain2(self):
        dce, rpctransport = self.connect()

        req = wkst.NetrJoinDomain2()
        req['ServerName'] = '\x00'*10
        req['DomainNameParam'] = '172.16.123.1\\FREEFLY\x00'
        req['MachineAccountOU'] = 'OU=BETUS,DC=FREEFLY\x00'
        req['AccountName'] = NULL
        req['Password']['Buffer'] = '\x00'*512
        req['Options'] = wkst.NETSETUP_DOMAIN_JOIN_IF_JOINED
        #req.dump()
        try:
            resp2 = dce.request(req)
            resp2.dump()
        except Exception, e:
            if str(e).find('ERROR_INVALID_PASSWORD') < 0:
                raise 
开发者ID:joxeankoret,项目名称:CVE-2017-7494,代码行数:19,代码来源:test_wkst.py

示例3: test_NetrRenameMachineInDomain2

# 需要导入模块: from impacket.dcerpc.v5 import ndr [as 别名]
# 或者: from impacket.dcerpc.v5.ndr import NULL [as 别名]
def test_NetrRenameMachineInDomain2(self):
        dce, rpctransport = self.connect()

        req = wkst.NetrRenameMachineInDomain2()
        req['ServerName'] = '\x00'*10
        req['MachineName'] = 'BETUS\x00'
        req['AccountName'] = NULL
        req['Password']['Buffer'] = '\x00'*512
        #req['Password'] = NULL
        req['Options'] = wkst.NETSETUP_ACCT_CREATE
        try:
            resp2 = dce.request(req)
            resp2.dump()
        except Exception, e:
            if str(e).find('ERROR_INVALID_PASSWORD') < 0:
                raise 
开发者ID:joxeankoret,项目名称:CVE-2017-7494,代码行数:18,代码来源:test_wkst.py

示例4: test_LsarRetrievePrivateData_LsarStorePrivateData

# 需要导入模块: from impacket.dcerpc.v5 import ndr [as 别名]
# 或者: from impacket.dcerpc.v5.ndr import NULL [as 别名]
def test_LsarRetrievePrivateData_LsarStorePrivateData(self):
        dce, rpctransport, policyHandle = self.connect()

        request = lsad.LsarRetrievePrivateData()
        request['PolicyHandle'] = policyHandle
        request['KeyName'] = 'DPAPI_SYSTEM'
        resp0 = dce.request(request)
        resp0.dump()

        request = lsad.LsarStorePrivateData()
        request['PolicyHandle'] = policyHandle
        request['KeyName'] = 'BETUS'
        request['EncryptedData'] = resp0['EncryptedData']
        resp = dce.request(request)
        resp.dump()

        request = lsad.LsarStorePrivateData()
        request['PolicyHandle'] = policyHandle
        request['KeyName'] = 'BETUS'
        request['EncryptedData'] = NULL
        resp = dce.request(request)
        resp.dump() 
开发者ID:joxeankoret,项目名称:CVE-2017-7494,代码行数:24,代码来源:test_lsad.py

示例5: test_REnumServicesStatusExW

# 需要导入模块: from impacket.dcerpc.v5 import ndr [as 别名]
# 或者: from impacket.dcerpc.v5.ndr import NULL [as 别名]
def test_REnumServicesStatusExW(self):
        dce, rpctransport, scHandle  = self.connect()

        request = scmr.REnumServicesStatusExW()
        request['hSCManager'] = scHandle
        request['InfoLevel'] = scmr.SC_STATUS_PROCESS_INFO
        request['dwServiceType'] = scmr.SERVICE_WIN32_OWN_PROCESS
        request['dwServiceState'] = scmr.SERVICE_STATE_ALL
        request['lpResumeIndex'] = NULL
        request['pszGroupName'] = NULL
        request['cbBufSize'] = 0
        #request.dump()
        #print "\n"

        # Request again with the right bufSize
        try:
            resp = dce.request(request)
        except Exception, e:
            if str(e).find('ERROR_MORE_DATA') <= 0:
                raise
            else: 
                resp = e.get_packet() 
开发者ID:joxeankoret,项目名称:CVE-2017-7494,代码行数:24,代码来源:test_scmr.py

示例6: te_RControlServiceExW

# 需要导入模块: from impacket.dcerpc.v5 import ndr [as 别名]
# 或者: from impacket.dcerpc.v5.ndr import NULL [as 别名]
def te_RControlServiceExW(self):
        dce, rpctransport, scHandle  = self.connect()
        lpServiceName = 'PlugPlay\x00'
        desiredAccess = scmr.SERVICE_START | scmr.SERVICE_STOP | scmr.SERVICE_CHANGE_CONFIG | scmr.SERVICE_QUERY_CONFIG | scmr.SERVICE_QUERY_STATUS | scmr.SERVICE_ENUMERATE_DEPENDENTS

        resp = scmr.hROpenServiceW(dce, scHandle, lpServiceName, desiredAccess )
        resp.dump()
        serviceHandle = resp['lpServiceHandle']

        request = scmr.RControlServiceExW()
        request['hService'] = serviceHandle
        request['dwControl'] = scmr.SERVICE_CONTROL_STOP
        request['dwInfoLevel'] = 1
        # This is not working, don't know exactly why
        request['pControlInParams']['dwReason'] = 0x20000000
        request['pControlInParams']['pszComment'] = 'nada\x00'
        request['pControlInParams'] = NULL

        resp = dce.request(request)

        resp.dump()

    # ToDo 
开发者ID:joxeankoret,项目名称:CVE-2017-7494,代码行数:25,代码来源:test_scmr.py

示例7: test_NetrJoinDomain2

# 需要导入模块: from impacket.dcerpc.v5 import ndr [as 别名]
# 或者: from impacket.dcerpc.v5.ndr import NULL [as 别名]
def test_NetrJoinDomain2(self):
        dce, rpctransport = self.connect()

        req = wkst.NetrJoinDomain2()
        req['ServerName'] = '\x00'*10
        req['DomainNameParam'] = '172.16.123.1\\FREEFLY\x00'
        req['MachineAccountOU'] = 'OU=BETUS,DC=FREEFLY\x00'
        req['AccountName'] = NULL
        req['Password']['Buffer'] = '\x00'*512
        req['Options'] = wkst.NETSETUP_DOMAIN_JOIN_IF_JOINED
        #req.dump()
        try:
            resp2 = dce.request(req)
            resp2.dump()
        except Exception as e:
            if str(e).find('ERROR_INVALID_PASSWORD') < 0:
                raise 
开发者ID:Coalfire-Research,项目名称:Slackor,代码行数:19,代码来源:test_wkst.py

示例8: test_NetrRenameMachineInDomain2

# 需要导入模块: from impacket.dcerpc.v5 import ndr [as 别名]
# 或者: from impacket.dcerpc.v5.ndr import NULL [as 别名]
def test_NetrRenameMachineInDomain2(self):
        dce, rpctransport = self.connect()

        req = wkst.NetrRenameMachineInDomain2()
        req['ServerName'] = '\x00'*10
        req['MachineName'] = 'BETUS\x00'
        req['AccountName'] = NULL
        req['Password']['Buffer'] = '\x00'*512
        #req['Password'] = NULL
        req['Options'] = wkst.NETSETUP_ACCT_CREATE
        try:
            resp2 = dce.request(req)
            resp2.dump()
        except Exception as e:
            if str(e).find('ERROR_INVALID_PASSWORD') < 0:
                raise 
开发者ID:Coalfire-Research,项目名称:Slackor,代码行数:18,代码来源:test_wkst.py

示例9: test_NetrGetJoinableOUs2

# 需要导入模块: from impacket.dcerpc.v5 import ndr [as 别名]
# 或者: from impacket.dcerpc.v5.ndr import NULL [as 别名]
def test_NetrGetJoinableOUs2(self):
        dce, rpctransport = self.connect()

        req = wkst.NetrGetJoinableOUs2()
        req['ServerName'] = '\x00'*10
        req['DomainNameParam'] = 'FREEFLY\x00'
        req['AccountName'] = NULL
        req['Password'] = NULL
        req['OUCount'] = 0
        #req.dump()
        try:
            resp2 = dce.request(req)
            resp2.dump()
        except Exception as e:
            if str(e).find('0x8001011c') < 0:
                raise 
开发者ID:Coalfire-Research,项目名称:Slackor,代码行数:18,代码来源:test_wkst.py

示例10: test_NetrSetPrimaryComputerName

# 需要导入模块: from impacket.dcerpc.v5 import ndr [as 别名]
# 或者: from impacket.dcerpc.v5.ndr import NULL [as 别名]
def test_NetrSetPrimaryComputerName(self):
        dce, rpctransport = self.connect()

        req = wkst.NetrSetPrimaryComputerName()
        req['ServerName'] = '\x00'*10
        req['PrimaryName'] = 'FREEFLY\x00'
        req['DomainAccount'] = NULL
        req['EncryptedPassword'] = NULL
        #req.dump()
        try:
            resp2 = dce.request(req)
            resp2.dump()
        except Exception as e:
            if str(e).find('ERROR_NOT_SUPPORTED') < 0:
                if str(e).find('ERROR_INVALID_PARAMETER') < 0:
                    raise 
开发者ID:Coalfire-Research,项目名称:Slackor,代码行数:18,代码来源:test_wkst.py

示例11: test_LsarQuerySecret

# 需要导入模块: from impacket.dcerpc.v5 import ndr [as 别名]
# 或者: from impacket.dcerpc.v5.ndr import NULL [as 别名]
def test_LsarQuerySecret(self):
        dce, rpctransport, policyHandle = self.connect()

        request = lsad.LsarOpenSecret()
        request['PolicyHandle'] = policyHandle
        request['SecretName'] = 'DPAPI_SYSTEM'
        request['DesiredAccess'] = MAXIMUM_ALLOWED
        resp0 = dce.request(request)
        resp0.dump()

        request = lsad.LsarQuerySecret()
        request['SecretHandle'] = resp0['SecretHandle']
        request['EncryptedCurrentValue']['Buffer'] = NULL
        request['EncryptedOldValue']['Buffer'] = NULL
        request['OldValueSetTime'] = NULL
        resp = dce.request(request)
        resp.dump() 
开发者ID:Coalfire-Research,项目名称:Slackor,代码行数:19,代码来源:test_lsad.py

示例12: test_NetrWkstaTransportEnum

# 需要导入模块: from impacket.dcerpc.v5 import ndr [as 别名]
# 或者: from impacket.dcerpc.v5.ndr import NULL [as 别名]
def test_NetrWkstaTransportEnum(self):
        dce, rpctransport = self.connect()
        request = wkst.NetrWkstaTransportEnum()
        request['ServerName'] = '\x00'*10
        request['TransportInfo']['Level'] = 0
        request['TransportInfo']['WkstaTransportInfo']['tag'] = 0
        request['PreferredMaximumLength'] = 500
        request['ResumeHandle'] = NULL
        resp = dce.request(request)
        resp.dump() 
开发者ID:joxeankoret,项目名称:CVE-2017-7494,代码行数:12,代码来源:test_wkst.py

示例13: test_NetrUseAdd_NetrUseDel_NetrUseGetInfo_NetrUseEnum

# 需要导入模块: from impacket.dcerpc.v5 import ndr [as 别名]
# 或者: from impacket.dcerpc.v5.ndr import NULL [as 别名]
def test_NetrUseAdd_NetrUseDel_NetrUseGetInfo_NetrUseEnum(self):
        dce, rpctransport = self.connect()

        req = wkst.NetrUseAdd()
        req['ServerName'] = '\x00'*10
        req['Level'] = 1
        req['InfoStruct']['tag'] = 1
        req['InfoStruct']['UseInfo1']['ui1_local'] = 'Z:\x00'
        req['InfoStruct']['UseInfo1']['ui1_remote'] = '\\\\127.0.0.1\\c$\x00'
        req['InfoStruct']['UseInfo1']['ui1_password'] = NULL
        resp2 = dce.request(req)
        resp2.dump()

        # We're not testing this call with NDR64, it fails and I can't see the contents
        if self.ts == ('71710533-BEBA-4937-8319-B5DBEF9CCC36', '1.0'):
            return

        req = wkst.NetrUseEnum()
        req['ServerName'] = NULL
        req['InfoStruct']['Level'] = 2
        req['InfoStruct']['UseInfo']['tag'] = 2
        req['InfoStruct']['UseInfo']['Level2']['Buffer'] = NULL
        req['PreferredMaximumLength'] = 0xffffffff
        req['ResumeHandle'] = NULL
        resp2 = dce.request(req)
        resp2.dump()

        req = wkst.NetrUseGetInfo()
        req['ServerName'] = '\x00'*10
        req['UseName'] = 'Z:\x00'
        req['Level'] = 3
        resp2 = dce.request(req)
        resp2.dump()

        req = wkst.NetrUseDel()
        req['ServerName'] = '\x00'*10
        req['UseName'] = 'Z:\x00'
        req['ForceLevel'] = wkst.USE_LOTS_OF_FORCE
        resp2 = dce.request(req)
        resp2.dump() 
开发者ID:joxeankoret,项目名称:CVE-2017-7494,代码行数:42,代码来源:test_wkst.py

示例14: test_hNetrJoinDomain2

# 需要导入模块: from impacket.dcerpc.v5 import ndr [as 别名]
# 或者: from impacket.dcerpc.v5.ndr import NULL [as 别名]
def test_hNetrJoinDomain2(self):
        dce, rpctransport = self.connect()

        try:
            resp = wkst.hNetrJoinDomain2(dce,'172.16.123.1\\FREEFLY\x00','OU=BETUS,DC=FREEFLY\x00',NULL,'\x00'*512, wkst.NETSETUP_DOMAIN_JOIN_IF_JOINED)
            resp.dump()
        except Exception, e:
            if str(e).find('ERROR_INVALID_PASSWORD') < 0:
                raise 
开发者ID:joxeankoret,项目名称:CVE-2017-7494,代码行数:11,代码来源:test_wkst.py

示例15: test_hNetrUnjoinDomain2

# 需要导入模块: from impacket.dcerpc.v5 import ndr [as 别名]
# 或者: from impacket.dcerpc.v5.ndr import NULL [as 别名]
def test_hNetrUnjoinDomain2(self):
        dce, rpctransport = self.connect()

        try:
            resp = wkst.hNetrUnjoinDomain2(dce, NULL, '\x00'*512, wkst.NETSETUP_ACCT_DELETE)
            resp.dump()
        except Exception, e:
            if str(e).find('ERROR_INVALID_PASSWORD') < 0:
                raise 
开发者ID:joxeankoret,项目名称:CVE-2017-7494,代码行数:11,代码来源:test_wkst.py


注:本文中的impacket.dcerpc.v5.ndr.NULL属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。