How to use the impacket.dcerpc.v5.ndr.NDRCALL function in impacket

To help you get started, we’ve selected a few impacket examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github SecureAuthCorp / impacket / impacket / dcerpc / v5 / scmr.py View on Github external
structure = (
        ('lpdwTagId',LPWSTR),
        ('lpServiceHandle',SC_RPC_HANDLE),
        ('ErrorCode', DWORD),
    )

# Still not working, for some reason something changes in the way the pointer inside SC_RPC_NOTIFY_PARAMS is marshalled here
class RNotifyServiceStatusChange(NDRCALL):
    opnum = 47
    structure = (
        ('hService',SC_RPC_HANDLE),
        ('NotifyParams',SC_RPC_NOTIFY_PARAMS),
        ('pClientProcessGuid',GUID),
    )

class RNotifyServiceStatusChangeResponse(NDRCALL):
    structure = (
        ('pSCMProcessGuid',GUID),
        ('pfCreateRemoteQueue',PBOOL),
        ('phNotify',SC_NOTIFY_RPC_HANDLE),
        ('ErrorCode', DWORD),
    )

# Not working, until I don't fix the previous one
class RGetNotifyResults(NDRCALL):
    opnum = 48
    structure = (
        ('hNotify',SC_NOTIFY_RPC_HANDLE),
    )

class RGetNotifyResultsResponse(NDRCALL):
    structure = (
github SecureAuthCorp / impacket / impacket / dcerpc / v5 / wkst.py View on Github external
opnum = 6
    structure = (
       ('ServerName', LPWKSSVC_IDENTIFY_HANDLE),
       ('Level', ULONG),
       ('TransportInfo',WKSTA_TRANSPORT_INFO_0),
       ('ErrorParameter',LPULONG),
    )

class NetrWkstaTransportAddResponse(NDRCALL):
    structure = (
       ('ErrorParameter',LPULONG),
       ('ErrorCode',ULONG),
    )

# 3.2.4.7 NetrUseAdd (Opnum 8)
class NetrUseAdd(NDRCALL):
    opnum = 8
    structure = (
       ('ServerName', LPWKSSVC_IMPERSONATE_HANDLE),
       ('Level', ULONG),
       ('InfoStruct',USE_INFO),
       ('ErrorParameter',LPULONG),
    )

class NetrUseAddResponse(NDRCALL):
    structure = (
       ('ErrorParameter',LPULONG),
       ('ErrorCode',ULONG),
    )

# 3.2.4.8 NetrUseGetInfo (Opnum 9)
class NetrUseGetInfo(NDRCALL):
github SecureAuthCorp / impacket / impacket / dcerpc / v5 / tsch.py View on Github external
('pcNames', DWORD),
        ('pNames', PTASK_NAMES_ARRAY),
        ('ErrorCode',ULONG),
    )

# 3.2.5.4.8 SchRpcEnumTasks (Opnum 7)
class SchRpcEnumTasks(NDRCALL):
    opnum = 7
    structure = (
        ('path', WSTR),
        ('flags', DWORD),
        ('startIndex', DWORD),
        ('cRequested', DWORD),
    )

class SchRpcEnumTasksResponse(NDRCALL):
    structure = (
        ('startIndex', DWORD),
        ('pcNames', DWORD),
        ('pNames', PTASK_NAMES_ARRAY),
        ('ErrorCode',ULONG),
    )

# 3.2.5.4.9 SchRpcEnumInstances (Opnum 8)
class SchRpcEnumInstances(NDRCALL):
    opnum = 8
    structure = (
        ('path', LPWSTR),
        ('flags', DWORD),
    )

class SchRpcEnumInstancesResponse(NDRCALL):
github ropnop / impacket_static_binaries / impacket / dcerpc / v5 / drsuapi.py View on Github external
opnum = 3
    structure = (
        ('hDrs', DRS_HANDLE),
        ('dwInVersion', DWORD),
        ('pmsgIn', DRS_MSG_GETCHGREQ),
    )

class DRSGetNCChangesResponse(NDRCALL):
    structure = (
        ('pdwOutVersion', DWORD),
        ('pmsgOut', DRS_MSG_GETCHGREPLY),
        ('ErrorCode',DWORD),
    )

# 4.1.27 IDL_DRSVerifyNames (Opnum 8)
class DRSVerifyNames(NDRCALL):
    opnum = 8
    structure = (
        ('hDrs', DRS_HANDLE),
        ('dwInVersion', DWORD),
        ('pmsgIn', DRS_MSG_VERIFYREQ),
    )

class DRSVerifyNamesResponse(NDRCALL):
    structure = (
        ('pdwOutVersion', DWORD),
        ('pmsgOut', DRS_MSG_VERIFYREPLY),
        ('ErrorCode',DWORD),
    )
# 4.1.11 IDL_DRSGetNT4ChangeLog (Opnum 11)
class DRSGetNT4ChangeLog(NDRCALL):
    opnum = 11
github SecureAuthCorp / impacket / impacket / dcerpc / v5 / mimilib.py View on Github external
class MIMI_PUBLICKEY(NDRSTRUCT):
    structure =  (
        ('sessionType',ALG_ID),
        ('cbPublicKey',DWORD),
        ('pbPublicKey',PBYTE_ARRAY),
    )

class PMIMI_PUBLICKEY(NDRPOINTER):
    referent = (
        ('Data',MIMI_PUBLICKEY),
    )

################################################################################
# RPC CALLS
################################################################################
class MimiBind(NDRCALL):
    opnum = 0
    structure = (
       ('clientPublicKey',MIMI_PUBLICKEY),
    )

class MimiBindResponse(NDRCALL):
    structure = (
       ('serverPublicKey',MIMI_PUBLICKEY),
       ('phMimi',MIMI_HANDLE),
       ('ErrorCode',ULONG),
    )

class MimiUnbind(NDRCALL):
    opnum = 1
    structure = (
       ('phMimi',MIMI_HANDLE),
github Coalfire-Research / Slackor / impacket / impacket / dcerpc / v5 / samr.py View on Github external
)

class SamrSetInformationUser(NDRCALL):
    opnum = 37
    structure = (
       ('UserHandle',SAMPR_HANDLE),
       ('UserInformationClass', USER_INFORMATION_CLASS ),
       ('Buffer',SAMPR_USER_INFO_BUFFER),
    )

class SamrSetInformationUserResponse(NDRCALL):
    structure = (
       ('ErrorCode',ULONG),
    )

class SamrChangePasswordUser(NDRCALL):
    opnum = 38
    structure = (
       ('UserHandle',SAMPR_HANDLE),
       ('LmPresent', UCHAR ),
       ('OldLmEncryptedWithNewLm',PENCRYPTED_LM_OWF_PASSWORD),
       ('NewLmEncryptedWithOldLm',PENCRYPTED_LM_OWF_PASSWORD),
       ('NtPresent', UCHAR),
       ('OldNtEncryptedWithNewNt',PENCRYPTED_NT_OWF_PASSWORD),
       ('NewNtEncryptedWithOldNt',PENCRYPTED_NT_OWF_PASSWORD),
       ('NtCrossEncryptionPresent',UCHAR),
       ('NewNtEncryptedWithNewLm',PENCRYPTED_NT_OWF_PASSWORD),
       ('LmCrossEncryptionPresent',UCHAR),
       ('NewLmEncryptedWithNewNt',PENCRYPTED_NT_OWF_PASSWORD),
    )

class SamrChangePasswordUserResponse(NDRCALL):
github ropnop / impacket_static_binaries / impacket / dcerpc / v5 / srvs.py View on Github external
('Level', DWORD),
       ('DiskInfoStruct', DISK_ENUM_CONTAINER),
       ('PreferedMaximumLength', DWORD),
       ('ResumeHandle', LPLONG),
    )

class NetrServerDiskEnumResponse(NDRCALL):
    structure = (
       ('DiskInfoStruct', DISK_ENUM_CONTAINER),
       ('TotalEntries', DWORD),
       ('ResumeHandle', LPLONG),
       ('ErrorCode',ULONG),
    )

# 3.1.4.20 NetrServerStatisticsGet (Opnum 24)
class NetrServerStatisticsGet(NDRCALL):
    opnum = 24
    structure = (
       ('ServerName', PSRVSVC_HANDLE),
       ('Service', LPWSTR),
       ('Level', DWORD),
       ('Options', DWORD),
    )

class NetrServerStatisticsGetResponse(NDRCALL):
    structure = (
       ('InfoStruct', LPSTAT_SERVER_0),
       ('ErrorCode',ULONG),
    )

# 3.1.4.21 NetrRemoteTOD (Opnum 28)
class NetrRemoteTOD(NDRCALL):
github SecureAuthCorp / impacket / impacket / dcerpc / v5 / tsch.py View on Github external
structure = (
        ('pActualPath', LPWSTR),
        ('pErrorInfo', PTASK_XML_ERROR_INFO),
        ('ErrorCode',ULONG),
    )

# 3.2.5.4.3 SchRpcRetrieveTask (Opnum 2)
class SchRpcRetrieveTask(NDRCALL):
    opnum = 2
    structure = (
        ('path', WSTR),
        ('lpcwszLanguagesBuffer', WSTR),
        ('pulNumLanguages', DWORD),
    )

class SchRpcRetrieveTaskResponse(NDRCALL):
    structure = (
        ('pXml', LPWSTR),
        ('ErrorCode',ULONG),
    )

# 3.2.5.4.4 SchRpcCreateFolder (Opnum 3)
class SchRpcCreateFolder(NDRCALL):
    opnum = 3
    structure = (
        ('path', WSTR),
        ('sddl', LPWSTR),
        ('flags', DWORD),
    )

class SchRpcCreateFolderResponse(NDRCALL):
    structure = (
github SecureAuthCorp / impacket / impacket / dcerpc / v5 / nrpc.py View on Github external
('NegotiateFlags',ULONG),
       ('ErrorCode',NTSTATUS),
    )

# 3.5.4.4.4 NetrServerAuthenticate (Opnum 5)
class NetrServerAuthenticate(NDRCALL):
    opnum = 5
    structure = (
       ('PrimaryName',PLOGONSRV_HANDLE),
       ('AccountName',WSTR),
       ('SecureChannelType',NETLOGON_SECURE_CHANNEL_TYPE),
       ('ComputerName',WSTR),
       ('ClientCredential',NETLOGON_CREDENTIAL),
    )

class NetrServerAuthenticateResponse(NDRCALL):
    structure = (
       ('ServerCredential',NETLOGON_CREDENTIAL),
       ('ErrorCode',NTSTATUS),
    )

# 3.5.4.4.5 NetrServerPasswordSet2 (Opnum 30)

# 3.5.4.4.6 NetrServerPasswordSet (Opnum 6)

# 3.5.4.4.7 NetrServerPasswordGet (Opnum 31)
class NetrServerPasswordGet(NDRCALL):
    opnum = 31
    structure = (
       ('PrimaryName',PLOGONSRV_HANDLE),
       ('AccountName',WSTR),
       ('AccountType',NETLOGON_SECURE_CHANNEL_TYPE),
github Coalfire-Research / Slackor / impacket / impacket / dcerpc / v5 / dhcpm.py View on Github external
('SubnetAddress', DHCP_IP_ADDRESS),
        ('EnumElementType', DHCP_SUBNET_ELEMENT_TYPE),
        ('ResumeHandle', LPDWORD),
        ('PreferredMaximum', DWORD),
    )

class DhcpEnumSubnetElementsV5Response(NDRCALL):
    structure = (
        ('ResumeHandle', DWORD),
        ('EnumElementInfo', LPDHCP_SUBNET_ELEMENT_INFO_ARRAY_V5),
        ('ElementsRead', DWORD),
        ('ElementsTotal', DWORD),
        ('ErrorCode', ULONG),
    )

class DhcpEnumSubnetClientsVQ(NDRCALL):
    opnum = 47
    structure = (
        ('ServerIpAddress', DHCP_SRV_HANDLE),
        ('SubnetAddress', DHCP_IP_ADDRESS),
        ('ResumeHandle', LPDWORD),
        ('PreferredMaximum', DWORD),
    )

class DhcpEnumSubnetClientsVQResponse(NDRCALL):
    structure = (
        ('ResumeHandle', LPDWORD),
        ('ClientInfo', LPDHCP_CLIENT_INFO_ARRAY_VQ),
        ('ClientsRead', DWORD),
        ('ClientsTotal', DWORD),
        ('ErrorCode', ULONG),
    )