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


Python uuid.bin_to_string方法代码示例

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


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

示例1: DiscoverDNSport

# 需要导入模块: from impacket import uuid [as 别名]
# 或者: from impacket.uuid import bin_to_string [as 别名]
def DiscoverDNSport(target):
	trans = transport.SMBTransport(target, 139, 'epmapper')
	trans.connect()
	dce = dcerpc.DCERPC_v5(trans)
	dce.bind(uuid.uuidtup_to_bin(('E1AF8308-5D1F-11C9-91A4-08002B14A0FA','3.0')))
	pm = epm.DCERPCEpm(dce)
	handle = '\x00'*20
	while 1:
		dump = pm.portmap_dump(handle)
		if not dump.get_entries_num():
			break
		handle = dump.get_handle()
		entry = dump.get_entry().get_entry()
		if(uuid.bin_to_string(entry.get_uuid()) == '50ABC2A4-574D-40B3-9D66-EE4FD5FBA076'):
			port = entry.get_string_binding().split('[')[1][:-1]
			return int(port)

	print '[-] Could not locate DNS port; Target might not be running DNS' 
开发者ID:knightmare2600,项目名称:d4rkc0de,代码行数:20,代码来源:070415.py

示例2: dump

# 需要导入模块: from impacket import uuid [as 别名]
# 或者: from impacket.uuid import bin_to_string [as 别名]
def dump(self):
        print("[BLOB]")
        print("Version          : %8x (%d)" % (self['Version'], self['Version']))
        print("Guid Credential  : %s" % bin_to_string(self['GuidCredential']))
        print("MasterKeyVersion : %8x (%d)" % (self['MasterKeyVersion'], self['MasterKeyVersion']))
        print("Guid MasterKey   : %s" % bin_to_string(self['GuidMasterKey']))
        print("Flags            : %8x (%s)" % (self['Flags'], getFlags(FLAGS, self['Flags'])))
        print("Description      : %s" % (self['Description'].decode('utf-16le')))
        print("CryptAlgo        : %.8x (%d) (%s)" % (self['CryptAlgo'], self['CryptAlgo'], ALGORITHMS(self['CryptAlgo']).name))
        print("Salt             : %s" % (hexlify(self['Salt'])))
        print("HMacKey          : %s" % (hexlify(self['HMacKey'])))
        print("HashAlgo         : %.8x (%d) (%s)" % (self['HashAlgo'], self['HashAlgo'], ALGORITHMS(self['HashAlgo']).name))
        print("HMac             : %s" % (hexlify(self['HMac'])))
        print("Data             : %s" % (hexlify(self['Data'])))
        print("Sign             : %s" % (hexlify(self['Sign'])))
        print() 
开发者ID:Coalfire-Research,项目名称:Slackor,代码行数:18,代码来源:dpapi.py

示例3: __str__

# 需要导入模块: from impacket import uuid [as 别名]
# 或者: from impacket.uuid import bin_to_string [as 别名]
def __str__(self):
        aUuid = bin_to_string(self["InterfaceUUID"])
        return "%s v%d.%d" % (aUuid,self["MajorVersion"],self["MinorVersion"]) 
开发者ID:joxeankoret,项目名称:CVE-2017-7494,代码行数:5,代码来源:epm.py

示例4: aceApplies

# 需要导入模块: from impacket import uuid [as 别名]
# 或者: from impacket.uuid import bin_to_string [as 别名]
def aceApplies(ace, objectClasses):
        '''
        Checks if an ACE applies to this object (based on object classes).
        Note that this function assumes you already verified that InheritedObjectType is set (via the flag).
        If this is not set, the ACE applies to all object types.
        '''
        objectTypeGuid = bin_to_string(ace['Ace']['InheritedObjectType']).lower()
        for objectType, guid in OBJECTTYPE_GUID_MAP.iteritems():
            if objectType in objectClasses and objectTypeGuid:
                return True
        # If none of these match, the ACE does not apply to this object
        return False 
开发者ID:Ridter,项目名称:Exchange2domain,代码行数:14,代码来源:ldapattack.py

示例5: can_create_users

# 需要导入模块: from impacket import uuid [as 别名]
# 或者: from impacket.uuid import bin_to_string [as 别名]
def can_create_users(ace):
    createprivs = ace['Ace']['Mask'].hasPriv(ACCESS_ALLOWED_OBJECT_ACE.ADS_RIGHT_DS_CREATE_CHILD)
    if ace['AceType'] != ACCESS_ALLOWED_OBJECT_ACE.ACE_TYPE or ace['Ace']['ObjectType'] == '':
        return False
    userprivs = bin_to_string(ace['Ace']['ObjectType']).lower() == 'bf967aba-0de6-11d0-a285-00aa003049e2'
    return createprivs and userprivs

# Check if an ACE allows for adding members 
开发者ID:Ridter,项目名称:Exchange2domain,代码行数:10,代码来源:ldapattack.py

示例6: can_add_member

# 需要导入模块: from impacket import uuid [as 别名]
# 或者: from impacket.uuid import bin_to_string [as 别名]
def can_add_member(ace):
    writeprivs = ace['Ace']['Mask'].hasPriv(ACCESS_ALLOWED_OBJECT_ACE.ADS_RIGHT_DS_WRITE_PROP)
    if ace['AceType'] != ACCESS_ALLOWED_OBJECT_ACE.ACE_TYPE or ace['Ace']['ObjectType'] == '':
        return writeprivs
    userprivs = bin_to_string(ace['Ace']['ObjectType']).lower() == 'bf9679c0-0de6-11d0-a285-00aa003049e2'
    return writeprivs and userprivs 
开发者ID:Ridter,项目名称:Exchange2domain,代码行数:8,代码来源:ldapattack.py

示例7: can_create_users

# 需要导入模块: from impacket import uuid [as 别名]
# 或者: from impacket.uuid import bin_to_string [as 别名]
def can_create_users(ace):
    createprivs = ace['Ace']['Mask'].hasPriv(ACCESS_ALLOWED_OBJECT_ACE.ADS_RIGHT_DS_CREATE_CHILD)
    if ace['AceType'] != ACCESS_ALLOWED_OBJECT_ACE.ACE_TYPE or ace['Ace']['ObjectType'] == b'':
        return False
    userprivs = bin_to_string(ace['Ace']['ObjectType']).lower() == 'bf967aba-0de6-11d0-a285-00aa003049e2'
    return createprivs and userprivs

# Check if an ACE allows for adding members 
开发者ID:Coalfire-Research,项目名称:Slackor,代码行数:10,代码来源:ldapattack.py

示例8: can_add_member

# 需要导入模块: from impacket import uuid [as 别名]
# 或者: from impacket.uuid import bin_to_string [as 别名]
def can_add_member(ace):
    writeprivs = ace['Ace']['Mask'].hasPriv(ACCESS_ALLOWED_OBJECT_ACE.ADS_RIGHT_DS_WRITE_PROP)
    if ace['AceType'] != ACCESS_ALLOWED_OBJECT_ACE.ACE_TYPE or ace['Ace']['ObjectType'] == b'':
        return writeprivs
    userprivs = bin_to_string(ace['Ace']['ObjectType']).lower() == 'bf9679c0-0de6-11d0-a285-00aa003049e2'
    return writeprivs and userprivs 
开发者ID:Coalfire-Research,项目名称:Slackor,代码行数:8,代码来源:ldapattack.py

示例9: get_object_type

# 需要导入模块: from impacket import uuid [as 别名]
# 或者: from impacket.uuid import bin_to_string [as 别名]
def get_object_type(self):
        if self.has_flag(self.ACE_OBJECT_TYPE_PRESENT):
            return bin_to_string(self.data.ObjectType)
        return None 
开发者ID:fox-it,项目名称:BloodHound.py,代码行数:6,代码来源:acls.py

示例10: get_inherited_object_type

# 需要导入模块: from impacket import uuid [as 别名]
# 或者: from impacket.uuid import bin_to_string [as 别名]
def get_inherited_object_type(self):
        if self.has_flag(self.ACE_INHERITED_OBJECT_TYPE_PRESENT):
            return bin_to_string(self.data.InheritedObjectType)
        return None 
开发者ID:fox-it,项目名称:BloodHound.py,代码行数:6,代码来源:acls.py


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