Search code examples
powershellmoduleprivileges

Is the class Carbon.Security.Privilege source code easaly extractable to my own code in PowerShell?


I've been looking around a while for a code snippet that shows all of the privileges for a user, including SeBatchLogonRight (even for local accounts). And so far, the only way I found that fulfill all my desires is Get-CPrivileges of the module Carbon.
But I'd prefer not to use SecEdit as I don't want to output security related data to file.

However, Carbon is a pretty hefty module with way too much functionality, that I will never use. And that is a bad security practice.

I started poking around in the source code at GitHub - Carbon and was able to deduce that some kind of class is built to handle user privileges Carbon.Security.Privilege, but I never found the source of that class and whether it has many dependencies or even requires a DLL to be able to work.
(I've got a feeling that advapi32.dll is involved.)

I have noticed that Carbon vNext is getting split up in submodules, which would suite me very well. But as far as I can tell, Get-CPrivilege hasn't been migrated yet :/

Is this doable in a simple manner, to extract all the source needed for that command?


Solution

  • Never mind.

    The separate module Carbon.Security was actually released 3 days ago 👍