No navigation frame on the left?  Click here.

Security

 

Security is fun. But not as much fun as it could be, were it only documented in a more extensive fashion.

This site cannot even begin to give a comprehensive treatment on the subject, but from time to time, I'll post a sample highlighting a specific aspect of NT security.

For additional samples related to NT security, see the LSA page and midlbug (authenticated RPC, only indirectly related to NT security).

Update 13 Jan 00: Slava M. Usov is offering security-related samples, for your amusement and especially enlightenment, too.  Please take a peek!

The samples:

bulletcheckacl.cpp processes ACLs on NTFS files
bulletdumpacl is a clean, neat SECURITY_DESCRIPTOR and ACL dumper, which I recommend over checkacl.cpp for readability
bulletfksec is a set of classes to avoid buggy NT security APIs while offering reasonable comfort
bulletis_admin.cpp determines whether it is running with admin rights
bulletis_svc.txt shows how to find out whether the process is a service
bulletlu_cpau_gui.cpp demos the launch of a process in another user's context, with access to the interactive window station
bulletopt_gti.cpp demonstrates how to exploit process tokens for fun and profit; here, we try to determine the identity of the interactive user with OpenProcessToken() and GetTokenInformation().
bulletownership.cpp uses the fksec classes to take the pain out of taking ownership of a file etc.
bulletprinter_sd.cpp demonstrates how to successfully set security on a printer object.  This sample requires the fksec classes, but the principle should be clear even without them.
bulletshowpriv.cpp lists all available privileges and shows how to enable one
bulletSSPI shows how to authenticate a client against a server, as long as you have some way of transmitting data back and forth