据我所知,从用户态角度来说,是不可能的。
网上流传的两个提升权限API :公开的AdjustTokenPrivileges or 未公开的RtlAdjustPrivliege 其实只是将进程(线程)Access Token中已经拥有的特权(Previlege)从Disable改为Enable。
未公开的RtlAdjustPrivilege在内部也是通过调用AdjustTokenPrivileges。而MSDN对AdjustTokenPrivileges的说明如下:
1、The AdjustTokenPrivileges function cannot add new privileges to the access token. It can only enable or disable the token's existing privileges.
2、The NewState parameter can specify privileges that the token does not have, without causing the function to fail. In this case, the function adjusts the privileges that the token does have and ignores the other privileges so that the function succeeds.
网上给的例子之所以成功,原因是:运行“提升权限”程序的Access Token本身就是系统管理员;系统管理员的特权最高。所以,AdjustTokenPrivileges总是成功。