Exemple #1
0
 def __init__(self, data = None, alignment = 0):
     self.__ctx_items = []
     Structure.__init__(self,data,alignment)
     if data is None:
         self['Pad'] = ''
         self['ctx_items'] = ''
         self['sec_trailer'] = ''
         self['auth_data'] = ''
Exemple #2
0
 def __init__(self, data=None, alignment=0):
     self.__ctx_items = []
     Structure.__init__(self, data, alignment)
     if data is None:
         self['Pad'] = ''
         self['ctx_items'] = ''
         self['sec_trailer'] = ''
         self['auth_data'] = ''
Exemple #3
0
 def __init__(self, data = None, alignment = 0):
     Structure.__init__(self, data, alignment)
     if data is None:
         self['max_tfrag'] = 4280
         self['max_rfrag'] = 4280
         self['assoc_group'] = 0
         self['ctx_num'] = 1
         self['ctx_items'] = ''
     self.__ctx_items = []
Exemple #4
0
 def __init__(self, data = None, alignment = 0):
     Structure.__init__(self,data, alignment)
     if data is None:
         self['ver_major'] = 5
         self['ver_minor'] = 0
         self['flags'] = MSRPC_FIRSTFRAG | MSRPC_LASTFRAG 
         self['type'] = MSRPC_REQUEST
         self.__frag_len_set = 0
         self['auth_len'] = 0
         self['pduData'] = ''
         self['auth_data'] = ''
         self['sec_trailer'] = ''
         self['pad'] = ''
Exemple #5
0
 def __init__(self):
     Structure.__init__(self)
     self['flags'] = (
         NTLMSSP_NEGOTIATE_128 | NTLMSSP_NEGOTIATE_KEY_EXCH |
         # NTLMSSP_LM_KEY      |
         NTLMSSP_NEGOTIATE_NTLM | NTLMSSP_NEGOTIATE_UNICODE |
         # NTLMSSP_ALWAYS_SIGN |
         NTLMSSP_NEGOTIATE_SIGN | NTLMSSP_NEGOTIATE_SEAL |
         # NTLMSSP_TARGET      |
         0)
     self['host_name'] = ''
     self['domain_name'] = ''
     self['os_version'] = ''
     self._workstation = ''
Exemple #6
0
    def __init__(self, version, revision, pageSize=8192, data=None):
        if (version < 0x620) or (version == 0x620 and revision < 0x0b):
            # For sure the old format
            self.structure = self.structure_2003_SP0 + self.common
        elif version == 0x620 and revision < 0x11:
            # Exchange 2003 SP1 and Windows Vista and later
            self.structure = self.structure_0x620_0x0b + self.common
        else:
            # Windows 7 and later
            self.structure = self.structure_win7 + self.common
            if pageSize > 8192:
                self.structure += self.extended_win7

        Structure.__init__(self, data)
Exemple #7
0
 def __init__(self,
              username='',
              password='',
              challenge='',
              lmhash='',
              nthash='',
              flags=0):
     Structure.__init__(self)
     self['session_key'] = ''
     self['user_name'] = username.encode('utf-16le')
     self['domain_name'] = ''  #"CLON".encode('utf-16le')
     self['host_name'] = ''  #"BETS".encode('utf-16le')
     self['flags'] = (  #authResp['flags']
         # we think (beto & gera) that his flags force a memory conten leakage when a windows 2000 answers using
         # uninitializaed verifiers
         NTLMSSP_NEGOTIATE_128 | NTLMSSP_NEGOTIATE_KEY_EXCH |
         # NTLMSSP_LM_KEY      |
         NTLMSSP_NEGOTIATE_NTLM | NTLMSSP_NEGOTIATE_UNICODE |
         # NTLMSSP_ALWAYS_SIGN |
         NTLMSSP_NEGOTIATE_SIGN | NTLMSSP_NEGOTIATE_SEAL |
         # NTLMSSP_TARGET      |
         0)
     # Here we do the stuff
     if username and (lmhash != '' or nthash != ''):
         self['lanman'] = get_ntlmv1_response(lmhash, challenge)
         self['ntlm'] = get_ntlmv1_response(nthash, challenge)
     elif username and password:
         lmhash = compute_lmhash(password)
         nthash = compute_nthash(password)
         self['lanman'] = get_ntlmv1_response(lmhash, challenge)
         self['ntlm'] = get_ntlmv1_response(
             nthash, challenge)  # This is not used for LM_KEY nor NTLM_KEY
     else:
         self['lanman'] = ''
         self['ntlm'] = ''
         if not self['host_name']:
             self['host_name'] = 'NULL'.encode(
                 'utf-16le')  # for NULL session there must be a hostname
Exemple #8
0
    def __init__(self, data):
        # Depending on the type of data we'll end up building a different struct
        dataType = unpack('<H', data[4:][:2])[0]
        self.structure = self.fixed

        if dataType == CATALOG_TYPE_TABLE:
            self.structure += self.other + self.table_stuff
        elif dataType == CATALOG_TYPE_COLUMN:
            self.structure += self.column_stuff
        elif dataType == CATALOG_TYPE_INDEX:
            self.structure += self.other + self.index_stuff
        elif dataType == CATALOG_TYPE_LONG_VALUE:
            self.structure += self.other + self.lv_stuff
        elif dataType == CATALOG_TYPE_CALLBACK:
            LOG.error('CallBack types not supported!')
            raise
        else:
            LOG.error('Unknown catalog type 0x%x' % dataType)
            self.structure = ()
            Structure.__init__(self, data)

        self.structure += self.common

        Structure.__init__(self, data)
 def __init__(self, data=None):
     Structure.__init__(self, data)
     if data is None:
         self['AlignPad'] = ''
 def __init__(self, data=None):
     Structure.__init__(self, data)
     if data is None:
         self['TreeID'] = 0
Exemple #11
0
 def __init__(self, result, reason, tsUUID, tsVer):
     Structure.__init__(self)
     self['Result'] = result
     self['Reason'] = reason
     self['TransferSyntaxUUID'] = tsUUID.bytes_le
     self['TransferSyntaxVer'] = tsVer
Exemple #12
0
 def __init__(self, data = None, alignment = 0):
     Structure.__init__(self,data,alignment)
     if data is None:
         self['SupportedVersions'] = ''
Exemple #13
0
 def __init__(self, result, reason, tsUUID, tsVer):
         Structure.__init__(self)
         self['Result'] = result
         self['Reason'] = reason
         self['TransferSyntaxUUID'] = tsUUID.bytes_le
         self['TransferSyntaxVer'] = tsVer
Exemple #14
0
 def __init__(self, basename):
     Structure.__init__(self, basename)
     self.flaps = []
Exemple #15
0
 def __init__(self, flags=0, **kargs):
     if flags & NTLMSSP_NEGOTIATE_EXTENDED_SESSIONSECURITY:
         self.structure = self.extendedMessageSignature
     else:
         self.structure = self.MessageSignature
     return Structure.__init__(self, **kargs)
Exemple #16
0
 def __init__(self, flags, data=None):
     if flags & TAG_COMMON > 0:
         # Include the common header
         self.structure = self.common + self.structure
     Structure.__init__(self, data)