本文整理汇总了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'
示例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()
示例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"])
示例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
示例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
示例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
示例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
示例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
示例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
示例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