# Impacket - Collection of Python classes for working with network protocols. # # Copyright Fortra, LLC and its affiliated companies # # All rights reserved. # # This software is provided under a slightly modified version # of the Apache Software License. See the accompanying LICENSE file # for more information. from impacket.dcerpc.v5.ndr import NDRCALL, NDRPOINTER, NDRUniConformantArray from impacket.dcerpc.v5.dtypes import ULONG, PGUID, LONG, NTSTATUS, NULL from impacket.dcerpc.v5.rpcrt import DCERPCException from impacket import hresult_errors from impacket.structure import Structure from impacket.uuid import uuidtup_to_bin class DCERPCSessionError(DCERPCException): def __init__(self, error_string=None, error_code=None, packet=None): DCERPCException.__init__(self, error_string, error_code, packet) def __str__( self ): key = self.error_code if key in hresult_errors.ERROR_MESSAGES: error_msg_short = hresult_errors.ERROR_MESSAGES[key][0] error_msg_verbose = hresult_errors.ERROR_MESSAGES[key][1] return 'GKDI SessionError: code: 0x%x - %s - %s' % (self.error_code, error_msg_short, error_msg_verbose) else: return 'GKDI SessionError: unknown error code: 0x%x' % self.error_code ################################################################################ # CONSTANTS ################################################################################ MSRPC_UUID_GKDI = uuidtup_to_bin(('B9785960-524F-11DF-8B6D-83DCDED72085','1.0')) ################################################################################ # STRUCTURES ################################################################################ # 2.2.1 KDF Parameters class KDFParameter(Structure): structure = ( ('Unknown1','