|
security
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
LsaStorePrivateData and VB .NetI'm trying to setup an automatic logon process. I've gotten this to work in
VB.Net and setting the necessary registry entries. However I don't want the password to appear in the registry and was told in another post that I should use LsaStorePrivateData (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/secauthn/security/protecting_the_automatic_logon_password.asp) Now I'm trying to access this from VB.Net and not having any success. When I try to set a reference to C:\Windows\System32\Advapi32.dll I get the following error message: A reference to c:\windows\system32\advapi32.dll could not be added. This is not a valid assemble or COM component. .... Do I need to use C# to use this function? I haven't written any C yet. Hello Larry,
don't use the LSA secrets - even Microsoft tries to kill all code that uses that. Encrypt the password with DPAPI and store it somewhere. btw - accessing LSA secrets requires local system privileges - do you really want to run with that elevated privileges?? DPAPI wrapper for .NET 1.1 (in 2.0 this is available managed using the ProtectedData class) http://www.leastprivilege.com/DPAPITools.aspx --------------------------------------- Dominick Baier - DevelopMentor http://www.leastprivilege.com Show quoteHide quote > I'm trying to setup an automatic logon process. I've gotten this to > work in VB.Net and setting the necessary registry entries. However I > don't want the password to appear in the registry and was told in > another post that I should use LsaStorePrivateData > (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/seca > uthn/security/protecting_the_automatic_logon_password.asp) > > Now I'm trying to access this from VB.Net and not having any success. > When I try to set a reference to C:\Windows\System32\Advapi32.dll I > get the following error message: > > A reference to c:\windows\system32\advapi32.dll could not be added. > This > is not a valid assemble or COM component. .... > Do I need to use C# to use this function? I haven't written any C > yet. > "Dominick Baier [DevelopMentor]" wrote: I noticed this but they don't specify where to store the logon password if > Hello Larry, > > don't use the LSA secrets - even Microsoft tries to kill all code that uses > that. you uses CryptProtectData. > I would need to know where to store it so the autologon continues to work.> Encrypt the password with DPAPI and store it somewhere. > I assume that storing it to the registry under "DefaultPassword" wounldn't work because the system would have no way of knowing its been encrypted. > btw - accessing LSA secrets requires local system privileges - do you really I assume an administrator would have this privilege?> want to run with that elevated privileges?? > I'll check out the code to see If it helps me. Thanks for the reply.> DPAPI wrapper for .NET 1.1 (in 2.0 this is available managed using the ProtectedData > class) > http://www.leastprivilege.com/DPAPITools.aspx Show quoteHide quote > > --------------------------------------- > Dominick Baier - DevelopMentor > http://www.leastprivilege.com > > > I'm trying to setup an automatic logon process. I've gotten this to > > work in VB.Net and setting the necessary registry entries. However I > > don't want the password to appear in the registry and was told in > > another post that I should use LsaStorePrivateData > > (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/seca > > uthn/security/protecting_the_automatic_logon_password.asp) > > > > Now I'm trying to access this from VB.Net and not having any success. > > When I try to set a reference to C:\Windows\System32\Advapi32.dll I > > get the following error message: > > > > A reference to c:\windows\system32\advapi32.dll could not be added. > > This > > is not a valid assemble or COM component. .... > > Do I need to use C# to use this function? I haven't written any C > > yet. > > > > > > Hello Larry,
ok - now i get it. you want a autologon for windows...ok..no clue to be honest - i think this feature is pure evil and shouldn't be used IMHO. Why do you need that? --------------------------------------- Dominick Baier - DevelopMentor http://www.leastprivilege.com Show quoteHide quote > "Dominick Baier [DevelopMentor]" wrote: > >> Hello Larry, >> >> don't use the LSA secrets - even Microsoft tries to kill all code >> that uses that. >> > I noticed this but they don't specify where to store the logon > password if you uses CryptProtectData. > >> Encrypt the password with DPAPI and store it somewhere. >> > I would need to know where to store it so the autologon continues to > work. > > I assume that storing it to the registry under "DefaultPassword" > wounldn't work because the system would have no way of knowing its > been encrypted. > >> btw - accessing LSA secrets requires local system privileges - do you >> really want to run with that elevated privileges?? >> > I assume an administrator would have this privilege? > >> DPAPI wrapper for .NET 1.1 (in 2.0 this is available managed using >> the ProtectedData >> class) >> http://www.leastprivilege.com/DPAPITools.aspx > I'll check out the code to see If it helps me. Thanks for the reply. > >> --------------------------------------- >> Dominick Baier - DevelopMentor >> http://www.leastprivilege.com >>> I'm trying to setup an automatic logon process. I've gotten this to >>> work in VB.Net and setting the necessary registry entries. However >>> I don't want the password to appear in the registry and was told in >>> another post that I should use LsaStorePrivateData >>> (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/se >>> ca uthn/security/protecting_the_automatic_logon_password.asp) >>> >>> Now I'm trying to access this from VB.Net and not having any >>> success. When I try to set a reference to >>> C:\Windows\System32\Advapi32.dll I get the following error message: >>> >>> A reference to c:\windows\system32\advapi32.dll could not be added. >>> This >>> is not a valid assemble or COM component. .... >>> Do I need to use C# to use this function? I haven't written any C >>> yet.
Single sign on in asp.net
Questions and observations about CAS and the StrongNameIdentityPermssionAttribute. Security for a pluggable application Signed XML Private Key X509 Certificate WSE 2.0 Issue\Errors C#.NET app to run on Win 2003 from another Win2003 on the local net? SetOwner problem? Certificate Valid Date Range Providing persistent storage in a locked down environment Securing .NET Assemblies Sign with Smartcard |
|||||||||||||||||||||||