Coverage for /private/tmp/im/impacket/impacket/dcerpc/v5/bkrp.py : 82%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
# SECUREAUTH LABS. Copyright 2018 SecureAuth Corporation. All rights reserved. # # This software is provided under under a slightly modified version # of the Apache Software License. See the accompanying LICENSE file # for more information. # # Author: Alberto Solino (@agsolino) # # Description: # [MS-BKRP] Interface implementation # # Best way to learn how to use these calls is to grab the protocol standard # so you understand what the call does, and then read the test case located # at https://github.com/SecureAuthCorp/impacket/tree/master/tests/SMB_RPC # # Some calls have helper functions, which makes it even easier to use. # They are located at the end of this file. # Helper functions start with "h"<name of the call>. # There are test cases for them too. # # ToDo: # [ ] 2.2.2 Client-Side-Wrapped Secret
DCERPCException.__init__(self, error_string, error_code, packet)
key = self.error_code if key in system_errors.ERROR_MESSAGES: error_msg_short = system_errors.ERROR_MESSAGES[key][0] error_msg_verbose = system_errors.ERROR_MESSAGES[key][1] return 'BKRP SessionError: code: 0x%x - %s - %s' % (self.error_code, error_msg_short, error_msg_verbose) else: return 'BKRP SessionError: unknown error code: 0x%x' % self.error_code
################################################################################ # CONSTANTS ################################################################################
################################################################################ # STRUCTURES ################################################################################
('Data', BYTE_ARRAY), )
# 2.2.4.1 Rc4EncryptedPayload Structure ('R3', '32s=""'), ('MAC', '20s=""'), ('SID', ':', RPC_SID), ('Secret', ':'), )
# 2.2.4 Secret Wrapped with Symmetric Key ('SIGNATURE', '<L=1'), ('Payload_Length', '<L=0'), ('Ciphertext_Length', '<L=0'), ('GUID_of_Wrapping_Key', '16s=""'), ('R2', '68s=""'), ('_Rc4EncryptedPayload', '_-Rc4EncryptedPayload', 'self["Payload_Length"]'), ('Rc4EncryptedPayload', ':'), )
################################################################################ # RPC CALLS ################################################################################ # 3.1.4.1 BackuprKey(Opnum 0) ('pguidActionAgent', GUID), ('pDataIn', BYTE_ARRAY), ('cbDataIn', DWORD), ('dwParam', DWORD), )
('ppDataOut', PBYTE_ARRAY), ('pcbDataOut', DWORD), ('ErrorCode', NTSTATUS), )
################################################################################ # OPNUMs and their corresponding structures ################################################################################ 0 : (BackuprKey, BackuprKeyResponse), }
################################################################################ # HELPER FUNCTIONS ################################################################################ else: |