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


Python dtypes.NULL属性代码示例

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


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

示例1: test_NetrFileGetInfo

# 需要导入模块: from impacket.dcerpc.v5 import dtypes [as 别名]
# 或者: from impacket.dcerpc.v5.dtypes import NULL [as 别名]
def test_NetrFileGetInfo(self):
        dce, rpctransport = self.connect()
        request = srvs.NetrFileEnum()
        request['ServerName'] = '\\\\%s\x00' % self.machine
        request['BasePath'] = NULL
        request['UserName'] = NULL
        request['InfoStruct']['Level'] = 2
        request['InfoStruct']['FileInfo']['tag'] = 2
        request['PreferedMaximumLength'] = 8192
        resp = dce.request(request)
        resp.dump()

        request = srvs.NetrFileGetInfo()
        request['ServerName'] = '\\\\%s\x00' % self.machine
        request['FileId'] = resp['InfoStruct']['FileInfo']['Level2']['Buffer'][0]['fi2_id']
        request['Level'] = 2
        resp = dce.request(request)
        resp.dump()

        request['Level'] = 3
        resp = dce.request(request)
        resp.dump() 
开发者ID:joxeankoret,项目名称:CVE-2017-7494,代码行数:24,代码来源:test_srvs.py

示例2: test_hNetrSessionEnum

# 需要导入模块: from impacket.dcerpc.v5 import dtypes [as 别名]
# 或者: from impacket.dcerpc.v5.dtypes import NULL [as 别名]
def test_hNetrSessionEnum(self):
        dce, rpctransport = self.connect()
        resp = srvs.hNetrSessionEnum(dce, NULL, NULL, 0)
        resp.dump()

        resp = srvs.hNetrSessionEnum(dce, NULL, NULL, 1)
        resp.dump()

        resp = srvs.hNetrSessionEnum(dce, NULL, NULL, 2)
        resp.dump()

        resp = srvs.hNetrSessionEnum(dce, NULL, NULL, 10)
        resp.dump()

        resp = srvs.hNetrSessionEnum(dce, NULL, NULL, 502)
        resp.dump() 
开发者ID:joxeankoret,项目名称:CVE-2017-7494,代码行数:18,代码来源:test_srvs.py

示例3: test_NetrSessionDel

# 需要导入模块: from impacket.dcerpc.v5 import dtypes [as 别名]
# 或者: from impacket.dcerpc.v5.dtypes import NULL [as 别名]
def test_NetrSessionDel(self):
        dce, rpctransport = self.connect()
        request = srvs.NetrSessionEnum()
        request['ServerName'] = NULL
        request['ClientName'] = NULL
        request['UserName'] = NULL
        request['InfoStruct']['Level'] = 502
        request['InfoStruct']['SessionInfo']['tag'] = 502
        request['InfoStruct']['SessionInfo']['Level502']['Buffer'] = NULL
        request['PreferedMaximumLength'] = 0xffffffff
        request['ResumeHandle'] = NULL
        resp = dce.request(request)
        resp.dump()

        request = srvs.NetrSessionDel()
        request['ServerName'] = NULL
        request['ClientName'] = resp['InfoStruct']['SessionInfo']['Level502']['Buffer'][0]['sesi502_cname']
        request['UserName'] = resp['InfoStruct']['SessionInfo']['Level502']['Buffer'][0]['sesi502_username']
        try:
            resp = dce.request(request)
            resp.dump()
        except Exception, e:
            if e.get_error_code() != 0x908:
                raise 
开发者ID:joxeankoret,项目名称:CVE-2017-7494,代码行数:26,代码来源:test_srvs.py

示例4: tes_NetrShareEnumSticky

# 需要导入模块: from impacket.dcerpc.v5 import dtypes [as 别名]
# 或者: from impacket.dcerpc.v5.dtypes import NULL [as 别名]
def tes_NetrShareEnumSticky(self):
        dce, rpctransport = self.connect()
        request = srvs.NetrShareEnumSticky()
        request['ServerName'] = NULL
        request['PreferedMaximumLength'] = 0xffffffff
        request['ResumeHandle'] = NULL
        request['InfoStruct']['ShareInfo']['tag'] = 502
        request['InfoStruct']['ShareInfo']['Level502']['Buffer'] = NULL
        request['InfoStruct']['Level'] = 502
        resp = dce.request(request)
        resp.dump()

        request['InfoStruct']['ShareInfo']['tag'] = 503
        request['InfoStruct']['ShareInfo']['Level503']['Buffer'] = NULL
        request['InfoStruct']['Level'] = 503
        resp = dce.request(request)
        resp.dump() 
开发者ID:joxeankoret,项目名称:CVE-2017-7494,代码行数:19,代码来源:test_srvs.py

示例5: test_NetrShareDelStart_NetrShareDelCommit

# 需要导入模块: from impacket.dcerpc.v5 import dtypes [as 别名]
# 或者: from impacket.dcerpc.v5.dtypes import NULL [as 别名]
def test_NetrShareDelStart_NetrShareDelCommit(self):
        dce, rpctransport = self.connect()
        request = srvs.NetrShareAdd()
        request['ServerName'] = NULL
        request['Level'] = 2
        request['InfoStruct']['tag'] = 2
        request['InfoStruct']['ShareInfo2']['shi2_netname'] = 'BETUSHARE\x00'
        request['InfoStruct']['ShareInfo2']['shi2_type'] = 0
        request['InfoStruct']['ShareInfo2']['shi2_remark'] = 'My Remark\x00'
        request['InfoStruct']['ShareInfo2']['shi2_max_uses'] = 0xFFFFFFFF
        request['InfoStruct']['ShareInfo2']['shi2_path'] = 'c:\\\x00'
        request['InfoStruct']['ShareInfo2']['shi2_passwd'] = NULL
        resp = dce.request(request)
        resp.dump()

        request = srvs.NetrShareDelStart()
        request['ServerName'] = NULL
        request['NetName'] = 'BETUSHARE\x00'
        resp = dce.request(request)
        resp.dump()

        request = srvs.NetrShareDelCommit()
        request['ContextHandle'] = resp['ContextHandle']
        resp = dce.request(request)
        resp.dump() 
开发者ID:joxeankoret,项目名称:CVE-2017-7494,代码行数:27,代码来源:test_srvs.py

示例6: test_hNetrShareDelStart_hNetrShareDelCommit

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

        shareInfo = srvs.SHARE_INFO_2()
        shareInfo['shi2_netname'] = 'BETUSHARE\x00'
        shareInfo['shi2_type'] = 0
        shareInfo['shi2_remark'] = 'My Remark\x00'
        shareInfo['shi2_max_uses'] = 0xFFFFFFFF
        shareInfo['shi2_path'] = 'c:\\\x00'
        shareInfo['shi2_passwd'] = NULL
        resp = srvs.hNetrShareAdd(dce, 2, shareInfo)
        resp.dump()

        resp = srvs.hNetrShareDelStart(dce, 'BETUSHARE\x00')
        resp.dump()

        resp = srvs.hNetrShareDelCommit(dce, resp['ContextHandle'])
        resp.dump() 
开发者ID:joxeankoret,项目名称:CVE-2017-7494,代码行数:20,代码来源:test_srvs.py

示例7: test_NetrServerTransportEnum

# 需要导入模块: from impacket.dcerpc.v5 import dtypes [as 别名]
# 或者: from impacket.dcerpc.v5.dtypes import NULL [as 别名]
def test_NetrServerTransportEnum(self):
        dce, rpctransport = self.connect()
        request = srvs.NetrServerTransportEnum()
        request['ServerName'] = NULL
        request['PreferedMaximumLength'] = 0xffffffff
        request['ResumeHandle'] = NULL
        request['InfoStruct']['Level'] = 0
        request['InfoStruct']['XportInfo']['tag'] = 0
        request['InfoStruct']['XportInfo']['Level0']['Buffer'] = NULL
        resp = dce.request(request)
        resp.dump()

        request['InfoStruct']['Level'] = 1
        request['InfoStruct']['XportInfo']['tag'] = 1
        request['InfoStruct']['XportInfo']['Level1']['Buffer'] = NULL
        resp = dce.request(request)
        resp.dump()

        request['InfoStruct']['Level'] = 2
        request['InfoStruct']['XportInfo']['tag'] = 2
        request['InfoStruct']['XportInfo']['Level2']['Buffer'] = NULL
        resp = dce.request(request)
        resp.dump() 
开发者ID:joxeankoret,项目名称:CVE-2017-7494,代码行数:25,代码来源:test_srvs.py

示例8: test_NetrpGetFileSecurity_NetrpSetFileSecurity

# 需要导入模块: from impacket.dcerpc.v5 import dtypes [as 别名]
# 或者: from impacket.dcerpc.v5.dtypes import NULL [as 别名]
def test_NetrpGetFileSecurity_NetrpSetFileSecurity(self):
        dce, rpctransport = self.connect()
        request = srvs.NetrpGetFileSecurity()
        request['ServerName'] = NULL
        request['ShareName'] = 'C$\x00'
        request['lpFileName'] = '\\Windows\x00'
        request['RequestedInformation'] = OWNER_SECURITY_INFORMATION
        resp = dce.request(request)
        resp.dump()

        req = srvs.NetrpSetFileSecurity()
        req['ServerName'] = NULL
        req['ShareName'] = 'C$\x00'
        req['lpFileName'] = '\\Windows\x00'
        req['SecurityInformation'] = OWNER_SECURITY_INFORMATION
        req['SecurityDescriptor'] = resp['SecurityDescriptor']
        resp = dce.request(req)
        resp.dump() 
开发者ID:joxeankoret,项目名称:CVE-2017-7494,代码行数:20,代码来源:test_srvs.py

示例9: test_NetrDfsFixLocalVolume

# 需要导入模块: from impacket.dcerpc.v5 import dtypes [as 别名]
# 或者: from impacket.dcerpc.v5.dtypes import NULL [as 别名]
def test_NetrDfsFixLocalVolume(self):
        # This one I cannot make it work. It's only supported on w2k and xp
        dce, rpctransport = self.connect()
        request = srvs.NetrDfsFixLocalVolume()
        request['ServerName'] = NULL
        request['VolumeName'] = r'\??\C:\DfsShare'
        request['EntryType'] = srvs.PKT_ENTRY_TYPE_LEAFONLY
        request['ServiceType'] = srvs.DFS_SERVICE_TYPE_LOCAL
        request['StgId'] = 'NONE\x00'
        request['EntryPrefix'] = 'c:\\\x00'
        request['RelationInfo']['Buffer']  = NULL
        request['CreateDisposition'] = srvs.FILE_SUPERSEDE
        try:
            resp = dce.request(request)
            resp.dump()
        except Exception, e:
            if str(e) != 'rpc_x_bad_stub_data':
                raise 
开发者ID:joxeankoret,项目名称:CVE-2017-7494,代码行数:20,代码来源:test_srvs.py

示例10: test_NetrServerAliasAdd_NetrServerAliasDel

# 需要导入模块: from impacket.dcerpc.v5 import dtypes [as 别名]
# 或者: from impacket.dcerpc.v5.dtypes import NULL [as 别名]
def test_NetrServerAliasAdd_NetrServerAliasDel(self):
        dce, rpctransport = self.connect()
        request = srvs.NetrServerAliasAdd()
        request['ServerName'] = NULL
        request['Level'] = 0
        request['InfoStruct']['tag'] = 0
        request['InfoStruct']['ServerAliasInfo0']['srvai0_alias'] = 'BETOALIAS\x00'
        request['InfoStruct']['ServerAliasInfo0']['srvai0_target'] = '%s\x00' % self.machine
        request['InfoStruct']['ServerAliasInfo0']['srvai0_default'] = 0
        resp = dce.request(request)
        resp.dump()

        request = srvs.NetrServerAliasDel()
        request['ServerName'] = NULL
        request['Level'] = 0
        request['InfoStruct']['tag'] = 0
        request['InfoStruct']['ServerAliasInfo0']['srvai0_alias'] = 'BETOALIAS\x00'
        request['InfoStruct']['ServerAliasInfo0']['srvai0_target'] = '%s\x00' % self.machine
        request['InfoStruct']['ServerAliasInfo0']['srvai0_default'] = 0
        resp = dce.request(request)
        resp.dump() 
开发者ID:joxeankoret,项目名称:CVE-2017-7494,代码行数:23,代码来源:test_srvs.py

示例11: ttt_NetrServerTransportAdd_NetrServerTransportDel

# 需要导入模块: from impacket.dcerpc.v5 import dtypes [as 别名]
# 或者: from impacket.dcerpc.v5.dtypes import NULL [as 别名]
def ttt_NetrServerTransportAdd_NetrServerTransportDel(self):
        dce, rpctransport = self.connect()
        request = srvs.NetrServerTransportAdd()
        request['ServerName'] = NULL
        request['Level'] = 0
        request['Buffer']['svti0_numberofvcs'] = 0
        request['Buffer']['svti0_transportname'] = '\\Device\\NetbiosSmb\x00'
        request['Buffer']['svti0_transportaddress'] = list('%s'% self.machine)
        request['Buffer']['svti0_transportaddresslength'] = len(request['Buffer']['svti0_transportaddress'])
        request['Buffer']['svti0_networkaddress'] = '%s\x00' % self.machine
        resp = dce.request(request)
        resp.dump()

        req = srvs.NetrServerTransportDel()
        req['ServerName'] = NULL
        req['Level'] = 0
        req['Buffer'] = request['Buffer']
        resp = dce.request(req)
        resp.dump() 
开发者ID:joxeankoret,项目名称:CVE-2017-7494,代码行数:21,代码来源:test_srvs.py

示例12: ttt_NetrServerTransportAddEx_NetrServerTransportDelEx

# 需要导入模块: from impacket.dcerpc.v5 import dtypes [as 别名]
# 或者: from impacket.dcerpc.v5.dtypes import NULL [as 别名]
def ttt_NetrServerTransportAddEx_NetrServerTransportDelEx(self):
        dce, rpctransport = self.connect()
        request = srvs.NetrServerTransportAddEx()
        request['ServerName'] = NULL
        request['Level'] = 0
        request['Buffer']['tag'] = 0
        request['Buffer']['Transport0']['svti0_numberofvcs'] = 0
        request['Buffer']['Transport0']['svti0_transportname'] = '\\Device\\NetbiosSmb\x00'
        request['Buffer']['Transport0']['svti0_transportaddress'] = list('%s'% self.machine)
        request['Buffer']['Transport0']['svti0_transportaddresslength'] = len(request['Buffer']['Transport0']['svti0_transportaddress'])
        request['Buffer']['Transport0']['svti0_networkaddress'] = '%s\x00' % self.machine
        resp = dce.request(request)
        resp.dump()

        req = srvs.NetrServerTransportDelEx()
        req['ServerName'] = NULL
        req['Level'] = 0
        req['Buffer']['tag'] = 0
        req['Buffer']['Transport0']  = request['Buffer']['Transport0']
        resp = dce.request(req)
        resp.dump() 
开发者ID:joxeankoret,项目名称:CVE-2017-7494,代码行数:23,代码来源:test_srvs.py

示例13: test_NetrDfsCreateLocalPartition

# 需要导入模块: from impacket.dcerpc.v5 import dtypes [as 别名]
# 或者: from impacket.dcerpc.v5.dtypes import NULL [as 别名]
def test_NetrDfsCreateLocalPartition(self):
        dce, rpctransport = self.connect()
        request = srvs.NetrDfsCreateLocalPartition()
        request['ServerName'] = NULL
        request['ShareName'] = 'C$\x00'
        #request['EntryUid'] = 0
        request['EntryPrefix'] = 'c:\\\x00'
        request['ShortName'] = 'c:\\betus\x00'
        request['RelationInfo']['Buffer'] = NULL
        request['Force'] = 0
        try:
            resp = dce.request(request)
            resp.dump()
        except Exception, e:
            if str(e).find('ERROR_NOT_SUPPORTED') < 0:
                raise 
开发者ID:joxeankoret,项目名称:CVE-2017-7494,代码行数:18,代码来源:test_srvs.py

示例14: test_IWbemServices_ExecQuery

# 需要导入模块: from impacket.dcerpc.v5 import dtypes [as 别名]
# 或者: from impacket.dcerpc.v5.dtypes import NULL [as 别名]
def test_IWbemServices_ExecQuery(self):
        dcom = DCOMConnection(self.machine, self.username, self.password, self.domain, self.lmhash, self.nthash)
        iInterface = dcom.CoCreateInstanceEx(wmi.CLSID_WbemLevel1Login,wmi.IID_IWbemLevel1Login)
        iWbemLevel1Login = wmi.IWbemLevel1Login(iInterface)
        iWbemServices= iWbemLevel1Login.NTLMLogin('\\\\%s\\root\\cimv2' % self.machine, NULL, NULL)
        classes = [ 'Win32_Account', 'Win32_UserAccount', 'Win32_Group', 'Win32_SystemAccount', 'Win32_Service']
        for classn in classes:
            print "Reading %s " % classn
            try:
                iEnumWbemClassObject = iWbemServices.ExecQuery('SELECT * from %s' % classn)
                done = False
                while done is False:
                    try:
                        iEnumWbemClassObject.Next(0xffffffff,1)
                    except Exception, e:
                        if str(e).find('S_FALSE') < 0:
                            print e
                        else:
                            done = True
                            pass
            except Exception, e:
                if str(e).find('S_FALSE') < 0:
                    print e 
开发者ID:joxeankoret,项目名称:CVE-2017-7494,代码行数:25,代码来源:test_wmi.py

示例15: test_hNetrJobAdd_hNetrJobEnum_hNetrJobDel

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

        atInfo = AT_INFO()
        atInfo['JobTime'] = NULL
        atInfo['DaysOfMonth'] = 0
        atInfo['DaysOfWeek'] = 0
        atInfo['Flags'] = 0
        atInfo['Command'] = '%%COMSPEC%% /C dir > %%SYSTEMROOT%%\\Temp\\BTO\x00'

        resp = atsvc.hNetrJobAdd(dce, NULL, atInfo)
        resp.dump()

        resp = atsvc.hNetrJobEnum(dce)
        resp.dump()

        for job in resp['pEnumContainer']['Buffer']:
            resp = atsvc.hNetrJobDel(dce, NULL, job['JobId'], job['JobId'] )
            resp.dump() 
开发者ID:joxeankoret,项目名称:CVE-2017-7494,代码行数:21,代码来源:test_tsch.py


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