De fleste virksomheder har efterhånden bevist, at AI virker.
Pilotprojekter leverer resultater. Medarbejdere bruger generative AI-værktøjer. Nye use cases dukker op på tværs af organisationen.
Hvis nu der er en windows NT domæne tilrådighed i dit netværk kan du lade det chekke dine passwords for dine brugere. Således at forstå at man skal bruge samme brugernavn og password for at komme ind på dit system som man skal til det windows NT domæne.
det har selvfølgelig den udlæmpe at man skal være bruger på det domæne, men er det tilfældet synes jeg det er den besdste løsning.
const head : TNode = (dwKey:$ffffffff; pData:Nil; pNext:Nil);
function GetEntry (dwKey : DWORD; var pData : pointer) : boolean; var pCurrent : PNode; begin result := False; pCurrent := Head.pNext; while Assigned (pCurrent) do begin if pCurrent^.dwKey = dwKey then begin pData := pCurrent^.pData; result := True; break end;
pCurrent := pCurrent^.pNext end end;
function AddEntry (dwKey : DWORD; pData : pointer) : boolean; var pTemp : PNode;
begin GetMem (pTemp, sizeof (TNode)); if Assigned (pTemp) then begin pTemp^.dwKey := dwKey; pTemp^.pData := pData; pTemp^.pNext := Head.pNext; Head.pNext := pTemp;
result := True end else result := False end;
function DeleteEntry (dwKey : DWORD; var ppData : pointer) : boolean; var pCurrent, pTemp : PNode;
begin result := False; pTemp := @head; pCurrent := Head.pNext;
while pCurrent <> Nil do begin if dwKey = pCurrent^.dwKey then begin pTemp^.pNext := pCurrent^.pNext; ppData := pCurrent^.pData; FreeMem (pCurrent); result := True; break end else begin pTemp := pCurrent; pCurrent := pCurrent^.pNext end end end;
function InitSession (dwKey : DWORD) : boolean; var pAS : PAuthSeq; begin result := False; GetMem (pAS, sizeof (TAuthSeq));
if Assigned (pAS) then try pAS^._fNewConversation := TRUE; pAS^._fHaveCredHandle := FALSE; pAS^._fHaveCtxtHandle := FALSE;
if not AddEntry (dwKey, pAS) then FreeMem (pAS) else result := True except FreeMem (pAS); raise end end;
function InitPackage (var cbMaxMessage : DWORD; var funcs : PSecurityFunctionTable) : THandle; type INIT_SECURITY_ENTRYPOINT_FN_A = function : PSecurityFunctionTable; var pInit : INIT_SECURITY_ENTRYPOINT_FN_A; ss : TSecurityStatus; pkgInfo : PSecPkgInfo;
begin result := LoadLibrary (\'security.dll\'); // *** Secur32.dll for Windows 95
if result <> 0 then try pInit := GetProcAddress (result, \'InitSecurityInterfaceA\');
if not Assigned (pInit) then raise Exception.CreateFmt (\'Couldn\'\'t get sec init routine: %d\', [GetLastError]);
funcs := pInit;
if not Assigned (funcs) then raise Exception.Create (\'Couldn\'\'t init package\');
ss := funcs^.QuerySecurityPackageInfoA (\'NTLM\', pkgInfo); if ss < 0 then raise Exception.CreateFmt (\'Couldn\'\'t query package info for NTLM, error %d\\n\', [ss]);
cbMaxMessage := pkgInfo^.cbMaxToken;
funcs^.FreeContextBuffer (pkgInfo) except if result <> 0 then FreeLibrary (result); raise end end;
function GenClientContext ( funcs : PSecurityFunctionTable; dwKey : DWORD; Auth : PSecWINNTAuthIdentity; pIn : PBYTE; cbIn : DWORD; pOut : PBYTE; var cbOut : DWORD; var fDone : boolean) : boolean; var ss : TSecurityStatus; lifeTime : TTimeStamp; OutBuffDesc : TSecBufferDesc; OutSecBuff : TSecBuffer; InBuffDesc : TSecBufferDesc; InSecBuff : TSecBuffer; ContextAttributes : DWORD; pAS : PAuthSeq; phctxt : PCtxtHandle; pBuffDesc : PSecBufferDesc;
begin result := False; if GetEntry (dwKey, pointer (pAS)) then try if pAS^._fNewConversation then begin ss := funcs^.AcquireCredentialsHandleA ( Nil, // principal \'NTLM\', SECPKG_CRED_OUTBOUND, Nil, // LOGON id Auth, // auth data Nil, // get key fn Nil, // get key arg pAS^._hcred, Lifetime );
if ss < 0 then raise Exception.CreateFmt (\'AquireCredentials failed %d\', [ss]);
if ss < 0 then raise Exception.CreateFmt (\'Init context failed: %d\', [ss]);
pAS^._fHaveCtxtHandle := TRUE;
if (ss = SEC_I_COMPLETE_NEEDED) or (ss = SEC_I_COMPLETE_AND_CONTINUE) then begin if Assigned (funcs^.CompleteAuthToken) then begin ss := funcs^.CompleteAuthToken (@pAS^._hctxt, @OutBuffDesc); if ss < 0 then raise Exception.CreateFmt (\'Complete failed: %d\', [ss]) end end;
cbOut := OutSecBuff.cbBuffer;
if pAS^._fNewConversation then pAS^._fNewConversation := FALSE;
fDone := (ss <> SEC_I_CONTINUE_NEEDED) and (ss <> SEC_I_COMPLETE_AND_CONTINUE);
result := True except end end;
function GenServerContext (funcs : PSecurityFunctionTable; dwKey : DWORD; pIn : PByte; cbIn : DWORD; pOut : PByte; var cbOut : DWORD; var fDone : boolean) : boolean; var ss : TSecurityStatus; Lifetime : TTimeStamp; OutBuffDesc, InBuffDesc : TSecBufferDesc; InSecBuff, OutSecBuff : TSecBuffer; ContextAttributes : DWORD; pAS : PAuthSeq; phctxt : PCtxtHandle;
begin result := False;
if GetEntry (dwKey, pointer (pAS)) then try if pAS^._fNewConversation then begin ss := funcs^.AcquireCredentialsHandleA ( Nil, \'NTLM\', SECPKG_CRED_INBOUND, Nil, Nil, Nil, Nil, pAS^._hcred, Lifetime);
if ss < 0 then raise Exception.CreateFmt (\'AcquireCreds failed %d\', [ss]);
if pAS^._fNewConversation then phctxt := Nil else phctxt := @pAS^._hctxt;
ss := funcs^.AcceptSecurityContext (@pAS^._hcred, phctxt, @InBuffDesc, 0, SECURITY_NATIVE_DREP, @pAS^._hctxt, @OutBuffDesc, ContextAttributes, Lifetime); if ss < 0 then raise Exception.CreateFmt (\'init context failed: %d\', [ss]);
pAS^._fHaveCtxtHandle := TRUE;
// Complete token -- if applicable // if (ss = SEC_I_COMPLETE_NEEDED) or (ss = SEC_I_COMPLETE_AND_CONTINUE) then begin if Assigned (funcs^.CompleteAuthToken) then begin ss := funcs^.CompleteAuthToken (@pAS^._hctxt, @OutBuffDesc); if ss < 0 then raise Exception.CreateFmt (\'complete failed: %d\', [ss]); end else raise Exception.Create (\'Complete not supported.\'); end;
cbOut := OutSecBuff.cbBuffer;
if pAS^._fNewConversation then pAS^._fNewConversation := FALSE;
fDone := (ss <> SEC_I_CONTINUE_NEEDED) and (ss <> SEC_I_COMPLETE_AND_CONTINUE);
result := True except end end;
function TermSession (funcs : PSecurityFunctionTable; dwKey : DWORD) : boolean; var pAS : PAuthSeq; begin result := False; if DeleteEntry (dwKey, pointer (pAS)) then begin if pAS^._fHaveCtxtHandle then funcs^.DeleteSecurityContext (@pAS^._hctxt);
if pAS^._fHaveCredHandle then funcs^.FreeCredentialHandle (@pAS^._hcred);
if session0OK and session1OK and (packageHandle <> 0) then begin GetMem (pClientBuf, cbMaxMessage); GetMem (pServerBuf, cbMaxMessage); FillChar (AuthIdentity, sizeof(AuthIdentity), 0);
if DomainName <> \'\' then begin AuthIdentity.Domain := PChar (DomainName); AuthIdentity.DomainLength := Length (DomainName) end;
if UserName <> \'\' then begin AuthIdentity.User := PChar (UserName); AuthIdentity.UserLength := Length (UserName); end;
if Password <> \'\' then begin AuthIdentity.Password := PChar (Password); AuthIdentity.PasswordLength := Length (Password) end;
Borrisholt> Da var da urolig - der var den sgu\' igen (altså HEST\'en). Er din favorit film \"De røde heste\" eller hvor er vi henne :-)
Synes godt om
Ny brugerNybegynder
Din løsning...
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.