Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Did you check out the example at <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/aa390429%28v=vs.85%29.aspx" rel="nofollow">Executing Privileged Operations Using C++</a> ? Seems like you just need to figure out which tokens are which after using the GetTokenInformation() function, and then disable some of them.</p> <p>[EDIT] Explaining in a bit more detail.</p> <ul> <li>The first call to GetTokenInformation() gets you the length of your token priveledge info object, in bytes.</li> <li>Then you actually build a buffer of that size on the heap.</li> <li>The second call retrieves the token information object and stores it in your buffer.</li> <li>Then you re-cast your buffer to TOKEN_PRIVILEGES*, which allows you to interpret it correctly.</li> <li>Then you loop through the Privileges member of this object and set the different attributes to allowed.</li> </ul> <p>Here are <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/aa379630%28v=vs.85%29.aspx" rel="nofollow">specifics about the TOKEN_PRIVILEDGES structure</a>. For each member of Priviledges array, you can look up the name of the priviledge using <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/aa379176%28v=vs.85%29.aspx" rel="nofollow">LookupPrivilegeName</a>.</p> <p>Here is a list of <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/bb530716%28v=vs.85%29.aspx" rel="nofollow">Priviledge names and descriptions</a>.</p> <p>After you know what priviledge it is (i.e. by checking the name), you can set the Attributes of the Priviledges[i] member to one of </p> <ul> <li>SE_PRIVILEGE_ENABLED </li> <li>SE_PRIVILEGE_ENABLED_BY_DEFAULT</li> <li>SE_PRIVILEGE_REMOVED </li> <li>SE_PRIVILEGE_USED_FOR_ACCESS</li> </ul> <p>In your case, I recon it will be mostly the third.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload