Skip to content

Commit

Permalink
adding note for DRSAddEntryResponse structure
Browse files Browse the repository at this point in the history
  • Loading branch information
ShutdownRepo committed Jan 14, 2024
1 parent b4174f1 commit d11a6a6
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions impacket/dcerpc/v5/drsuapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -652,6 +652,7 @@ class USN_VECTOR(NDRSTRUCT):
('usnHighPropUpdate', USN),
)


# 5.43 DRS_SecBuffer
class DRS_SecBuffer(NDRSTRUCT):
structure = (
Expand Down Expand Up @@ -1549,6 +1550,7 @@ class DRSAddEntryResponse(NDRCALL):
('pmsgOut', DRS_MSG_DCINFOREPLY),
('ErrorCode', DWORD),
)
# TODO : this is a dummy structure that needs fixing


################################################################################
Expand Down Expand Up @@ -1614,6 +1616,24 @@ def hDRSCrackNames(dce, hDrs, flags, formatOffered, formatDesired, rpNames=()):
return dce.request(request)


def hDRSAddEntry(dce, hDrs, dwInVersion, pmsgIn):
request = DRSAddEntry()
request['hDrs'] = hDrs
request['dwInVersion'] = dwInVersion
if dwInVersion == 1:
request['pmsgIn']['tag'] = 1
request['pmsgIn']['pObject'] = pmsgIn['pObject']
request['pmsgIn']['AttrBlock'] = pmsgIn['AttrBlock']
elif dwInVersion == 2:
request['pmsgIn']['tag'] = 2
request['pmsgIn']['EntInfList'] = pmsgIn['EntInfList']
elif dwInVersion == 3:
request['pmsgIn']['tag'] = 3
request['pmsgIn']['EntInfList'] = pmsgIn['EntInfList']
request['pmsgIn']['pClientCreds'] = pmsgIn['pClientCreds']
return dce.request(request)


def deriveKey(baseKey):
# 2.2.11.1.3 Deriving Key1 and Key2 from a Little-Endian, Unsigned Integer Key
# Let I be the little-endian, unsigned integer.
Expand Down

0 comments on commit d11a6a6

Please sign in to comment.