本文整理匯總了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