MCPcopy Create free account
hub / github.com/CCob/lsarelayx / MapContextToClientProcess

Function MapContextToClientProcess

plugin/msv1_0.cpp:237–259  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

235}
236
237void MapContextToClientProcess(const win32_handle& token, LSA_SEC_HANDLE ContextHandle, PLSA_SEC_HANDLE NewContextHandle, ULONG ContextRequirements,
238 PULONG ContextAttributes, PSecBuffer ContextData, PBOOLEAN MappedContext, PTimeStamp ExpirationTime){
239
240 //No expiry
241 ExpirationTime->HighPart = 0x7fffffff;
242 ExpirationTime->LowPart = 0xffffffff;
243
244 //Map same input context to output
245 *ContextAttributes = ContextRequirements;
246 *NewContextHandle = (LSA_SEC_HANDLE)ContextHandle;
247
248 //Create the context that will be mapped into the client process
249 PNTLM_PACKED_CONTEXT ctxData = (PNTLM_PACKED_CONTEXT)g_FunctionTable->AllocateLsaHeap(sizeof(NTLM_PACKED_CONTEXT));
250 ContextData->BufferType = SECBUFFER_DATA;
251 ContextData->cbBuffer = sizeof(NTLM_PACKED_CONTEXT);
252 ContextData->pvBuffer = ctxData;
253
254 //Duplicate the authenticated token int the client process
255 HANDLE tmp;
256 g_FunctionTable->DuplicateHandle(token.get(), &tmp);
257 ctxData->ClientTokenHandle = (ULONG) ((ULONG_PTR) tmp) ;
258 *MappedContext = TRUE;
259}
260
261NTSTATUS msv1_0_SpAcceptLsaModeContextHook(LSA_SEC_HANDLE CredentialHandle, LSA_SEC_HANDLE ContextHandle, PSecBufferDesc InputBuffer, ULONG ContextRequirements, ULONG TargetDataRep, PLSA_SEC_HANDLE NewContextHandle,
262 PSecBufferDesc OutputBuffer, PULONG ContextAttributes, PTimeStamp ExpirationTime, PBOOLEAN MappedContext, PSecBuffer ContextData){

Callers 1

Calls 1

getMethod · 0.45

Tested by

no test coverage detected