Skip to content

Commit

Permalink
adding opnum and reorganizing structures
Browse files Browse the repository at this point in the history
  • Loading branch information
ShutdownRepo committed Jan 14, 2024
1 parent 35b8333 commit b4174f1
Showing 1 changed file with 46 additions and 40 deletions.
86 changes: 46 additions & 40 deletions impacket/dcerpc/v5/drsuapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,40 +346,6 @@ class DRS_EXTENSIONS_INT(Structure):
('dwExtCaps', '<L=0'),
)


# 4.1.1.1.1 DRS_MSG_ADDENTRYREQ
class DRS_MSG_ADDENTRYREQ():
commonHdr = (
('tag', DWORD),
)
union = {
1: ('V1', DRS_MSG_ADDENTRYREQ_V1),
2: ('V2', DRS_MSG_ADDENTRYREQ_V2),
3: ('V3', DRS_MSG_ADDENTRYREQ_V3),
}

# 4.1.1.1.2 DRS_MSG_ADDENTRYREQ_V1
class DRS_MSG_ADDENTRYREQ_V1(NDRSTRUCT):
structure = (
('pObject', PDSNAME),
('AttrBlock', ATTRBLOCK),
)

# 4.1.1.1.2 DRS_MSG_ADDENTRYREQ_V2
class DRS_MSG_ADDENTRYREQ_V2(NDRSTRUCT):
structure = (
('EntInfList', ENTINFLIST),
)


# 4.1.1.1.2 DRS_MSG_ADDENTRYREQ_V3
class DRS_MSG_ADDENTRYREQ_V3(NDRSTRUCT):
structure = (
('EntInfList', ENTINFLIST),
('pClientCreds', PDRS_SecBufferDesc),
)


# 4.1.5.1.2 DRS_MSG_DCINFOREQ_V1
class DRS_MSG_DCINFOREQ_V1(NDRSTRUCT):
structure = (
Expand Down Expand Up @@ -694,11 +660,17 @@ class DRS_SecBuffer(NDRSTRUCT):
('pvBuffer', PBYTE_ARRAY),
)

class PDRS_SecBufferDesc(NDRPOINTER):

class DRS_SecBuffer_ARRAY(NDRUniConformantArray):
item = DRS_SecBuffer


class PDRS_SecBuffer_ARRAY(NDRPOINTER):
referent = (
('Data', DRS_SecBufferDesc)
('Data', DRS_SecBuffer_ARRAY)
)


# 5.44 DRS_SecBufferDesc
class DRS_SecBufferDesc(NDRSTRUCT):
structure = (
Expand All @@ -707,13 +679,12 @@ class DRS_SecBufferDesc(NDRSTRUCT):
('Buffers', PDRS_SecBuffer_ARRAY)
)

class PDRS_SecBuffer_ARRAY(NDRPOINTER):

class PDRS_SecBufferDesc(NDRPOINTER):
referent = (
('Data', DRS_SecBuffer_ARRAY)
('Data', DRS_SecBufferDesc)
)

class DRS_SecBuffer_ARRAY(NDRUniConformantArray):
item = DRS_SecBuffer

# 5.50 DSNAME
class WCHAR_ARRAY(NDRUniConformantArray):
Expand Down Expand Up @@ -1403,6 +1374,40 @@ class DRS_MSG_NT4_CHGLOG_REPLY(NDRUNION):
}


# 4.1.1.1.2 DRS_MSG_ADDENTRYREQ_V1
class DRS_MSG_ADDENTRYREQ_V1(NDRSTRUCT):
structure = (
('pObject', PDSNAME),
('AttrBlock', ATTRBLOCK),
)


# 4.1.1.1.2 DRS_MSG_ADDENTRYREQ_V2
class DRS_MSG_ADDENTRYREQ_V2(NDRSTRUCT):
structure = (
('EntInfList', ENTINFLIST),
)


# 4.1.1.1.2 DRS_MSG_ADDENTRYREQ_V3
class DRS_MSG_ADDENTRYREQ_V3(NDRSTRUCT):
structure = (
('EntInfList', ENTINFLIST),
('pClientCreds', PDRS_SecBufferDesc),
)


# 4.1.1.1.1 DRS_MSG_ADDENTRYREQ
class DRS_MSG_ADDENTRYREQ(NDRUNION):
commonHdr = (
('tag', DWORD),
)
union = {
1: ('V1', DRS_MSG_ADDENTRYREQ_V1),
2: ('V2', DRS_MSG_ADDENTRYREQ_V2),
3: ('V3', DRS_MSG_ADDENTRYREQ_V3),
}

################################################################################
# RPC CALLS
################################################################################
Expand Down Expand Up @@ -1555,6 +1560,7 @@ class DRSAddEntryResponse(NDRCALL):
3: (DRSGetNCChanges, DRSGetNCChangesResponse),
12: (DRSCrackNames, DRSCrackNamesResponse),
16: (DRSDomainControllerInfo, DRSDomainControllerInfoResponse),
17: (DRSAddEntry, DRSAddEntryResponse),
}


Expand Down

0 comments on commit b4174f1

Please sign in to comment.