Coverage for /private/tmp/im/impacket/impacket/dcerpc/v5/atsvc.py : 81%

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-TSCH] ATSVC 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. #
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 'TSCH SessionError: code: 0x%x - %s - %s' % (self.error_code, error_msg_short, error_msg_verbose) else: return 'TSCH SessionError: unknown error code: 0x%x' % self.error_code
################################################################################ # CONSTANTS ################################################################################ # 2.3.1 Constant Values
# 2.3.7 Flags
################################################################################ # STRUCTURES ################################################################################ # 2.3.4 AT_INFO ('JobTime',DWORD), ('DaysOfMonth',DWORD), ('DaysOfWeek',UCHAR), ('Flags',UCHAR), ('Command',LPWSTR), )
('Data',AT_INFO), )
# 2.3.6 AT_ENUM ('JobId',DWORD), ('JobTime',DWORD), ('DaysOfMonth',DWORD), ('DaysOfWeek',UCHAR), ('Flags',UCHAR), ('Command',LPWSTR), )
('Data',AT_ENUM_ARRAY), )
# 2.3.5 AT_ENUM_CONTAINER ('EntriesRead',DWORD), ('Buffer',LPAT_ENUM_ARRAY), )
################################################################################ # RPC CALLS ################################################################################ # 3.2.5.2.1 NetrJobAdd (Opnum 0) ('ServerName',ATSVC_HANDLE), ('pAtInfo', AT_INFO), )
('pJobId',DWORD), ('ErrorCode',ULONG), )
# 3.2.5.2.2 NetrJobDel (Opnum 1) ('ServerName',ATSVC_HANDLE), ('MinJobId', DWORD), ('MaxJobId', DWORD), )
('ErrorCode',ULONG), )
# 3.2.5.2.3 NetrJobEnum (Opnum 2) ('ServerName',ATSVC_HANDLE), ('pEnumContainer', AT_ENUM_CONTAINER), ('PreferedMaximumLength', DWORD), ('pResumeHandle', DWORD), )
('pEnumContainer', AT_ENUM_CONTAINER), ('pTotalEntries', DWORD), ('pResumeHandle',LPDWORD), ('ErrorCode',ULONG), )
# 3.2.5.2.4 NetrJobGetInfo (Opnum 3) ('ServerName',ATSVC_HANDLE), ('JobId', DWORD), )
('ppAtInfo', LPAT_INFO), ('ErrorCode',ULONG), )
################################################################################ # OPNUMs and their corresponding structures ################################################################################ 0 : (NetrJobAdd,NetrJobAddResponse ), 1 : (NetrJobDel,NetrJobDelResponse ), 2 : (NetrJobEnum,NetrJobEnumResponse ), 3 : (NetrJobGetInfo,NetrJobGetInfoResponse ), }
################################################################################ # HELPER FUNCTIONS ################################################################################
netrJobDel = NetrJobDel() netrJobDel['ServerName'] = serverName netrJobDel['MinJobId'] = minJobId netrJobDel['MaxJobId'] = maxJobId return dce.request(netrJobDel)
netrJobGetInfo = NetrJobGetInfo() netrJobGetInfo['ServerName'] = serverName netrJobGetInfo['JobId'] = jobId return dce.request(netrJobGetInfo) |