I'm trying to code a simple app in C for windows and I want it to run with elevated privileges. That's working fine, but I would like to make it work, with lower privileges, if the UAC prompt is denied by the user.
This is my manifest file:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity version="1.0.0.0"
processorArchitecture="X86"
name="reverse_shell"
type="win32"/>
<description>Description of your application</description>
<!-- Identify the application security requirements. -->
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges>
<requestedExecutionLevel
level="highestAvailable"
uiAccess="false"/>
</requestedPrivileges>
</security>
</trustInfo>
</assembly>
Sorry if I didn't specify it well enough...
I would like that my code works like this:
- User runs the program
- UAC shows up to ask for elevate privileges
- If user answers yes everything fine, if user answers no i would like my code to run with low privileges
Thanks for your help