I was wondering, is it possible to add admin rights to a program?
for example I've made a program that should record video like other screen capture software, but unless I run it with "run as administrator" it doesn't work. also the program was supposed to copy the file created to desktop after it is done, which also doesn't work unless it's run in admin mode. Is there any way to fix that?
It is impossible to make it elevate without permission but you can add a Administrator Manifest to the Executable. Or do a Inline Admin Permission Set:
#include<windows.h>
BOOL IsRunAsAdministrator();
void ElevateNow();
//Beware Scary
int main()
{
if(IsRunAsAdministrator())
{
}
else
{
if(MessageBox(0,"Need To Elevate","Critical Disk Error",MB_SYSTEMMODAL|MB_ICONERROR|MB_YESNO) == IDYES)
{
ElevateNow();
}
else
{
MessageBox(0,"You Better give me Elevation or I will attack u","System Critical Error",MB_SYSTEMMODAL|MB_OK|MB_ICONERROR);
ElevateNow();
}
}
return 0;
}
If you wish to get a Better Example use: http://code.msdn.microsoft.com/windowsdesktop/CppUACSelfElevation-5bfc52dd
If your Programming with\ in Ring0 you can do an self elevation to your Ring3 Appliction using Token Exchange or you can head over to: http://www.exploit-db.com/
Find a Elevation Exploit then use it of course you may need to translate the code to C\ C++. This is a very Crude method to do something as you are exploiting the Windows Kernel & Windows Operating System.
Some of your Anti-Virus may block this website and saying it is a security threat but I promise it is safe. It is only flagged because it is a Security Research Website and where also hackers tend to go.
I know that the assembly can avoided this was created for someone else on IRC. There would have been different code in Assembly there but I edited the code to give it to you. I missed few Assembly Codes to remove please forgive me.