Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
raise Exception('Unsupported etype 0x%x' % cipher.enctype)
# 7.2. GSS-API MIC Semantics
class GSSAPI_RC4:
# 1.2.1. Per-message Tokens - MIC
class MIC(Structure):
structure = (
('TOK_ID','
)
class LSARPCCloseResponse(Structure):
structure = (
('ContextHandle','20s'),
('ErrorCode','
# 2.2.10.1 USER_PROPERTIES
class USER_PROPERTIES(Structure):
structure = (
('Reserved1','
('Unknown','12s=b""'),
('_Secret','_-Secret','self["Length"]'),
('Secret',':'),
('Remaining',':'),
)
class LSA_SECRET(Structure):
structure = (
('Version','
class SMB2Read_Response(Structure):
structure = (
('StructureSize','
def fromString(self, data):
Structure.fromString(self, data)
if self['HostNameLength'] > 0:
self['HostName'] = data[self['HostNameOffset']:][:self['HostNameLength']*2]
if self['UserNameLength'] > 0:
self['UserName'] = data[self['UserNameOffset']:][:self['UserNameLength']*2]
if self['PasswordLength'] > 0:
self['Password'] = data[self['PasswordOffset']:][:self['PasswordLength']*2]
if self['AppNameLength'] > 0:
self['AppName'] = data[self['AppNameOffset']:][:self['AppNameLength']*2]
if self['ServerNameLength'] > 0:
self['ServerName'] = data[self['ServerNameOffset']:][:self['ServerNameLength']*2]
if self['CltIntNameLength'] > 0:
structure = (
('StructureSize','
class SRV_READ_HASH(Structure):
structure = (
('HashType','
octetString = CountedOctetString()
octetString['length'] = len(principal.realm)
octetString['data'] = principal.realm
self.realm = octetString
self.components = []
for c in principal.components:
octetString = CountedOctetString()
octetString['length'] = len(c)
octetString['data'] = c
self.components.append(octetString)
def toPrincipal(self):
return types.Principal(self.prettyPrint(), type=self.header['name_type'])
class Credential:
class CredentialHeader(Structure):
structure = (
('client',':', Principal),
('server',':', Principal),
('key',':', KeyBlock),
('time',':', Times),
('is_skey','B=0'),
('tktflags','!L=0'),
('num_address','!L=0'),
)
def __init__(self, data=None):
self.addresses = ()
self.authData = ()
self.header = None
self.ticket = None
self.secondTicket = None
self.fromString(data)
else:
self.data = None
# 2.2.57 InstanceQualifierSet
class INSTANCE_QUALIFIER_SET(Structure):
structure = (
('QualifierSet', ':', QUALIFIER_SET),
('InstancePropQualifierSet', ':', INSTANCE_PROP_QUALIFIER_SET),
)
# 2.2.58 InstanceHeap
INSTANCE_HEAP = HEAP
# 2.2.53 InstanceType
class INSTANCE_TYPE(Structure):
commonHdr = (
('CurrentClass', ':', CURRENT_CLASS_NO_METHODS),
('EncodingLength', ENCODING_LENGTH),
('InstanceFlags', INSTANCE_FLAGS),
('InstanceClassName', INSTANCE_CLASS_NAME),
('_NdTable_ValueTable', '_-NdTable_ValueTable',
'self["CurrentClass"]["ClassPart"]["ClassHeader"]["NdTableValueTableLength"]'),
('NdTable_ValueTable',':'),
('InstanceQualifierSet', ':', INSTANCE_QUALIFIER_SET),
('InstanceHeap', ':', INSTANCE_HEAP),
)
def __init__(self, data = None, alignment = 0):
Structure.__init__(self, data, alignment)
self.structure = ()
if data is not None: