Skip to content
Snippets Groups Projects
Commit fe8c9793 authored by Dawes's avatar Dawes
Browse files

First.

parents
No related branches found
No related tags found
No related merge requests found
#include <stdio.h>
#include <sys/types.h>
#include <unistd.h>
int main(int argc, char *argv[],char *envp[]) {
char **new_argv = malloc((argc-1) * sizeof(char*));
for (int i = 0; i < argc - 1; i++) new_argv[i] = argv[i+1];
if (setuid(0))
{
perror("setuid");
return 1;
}
execve(new_argv[0], &new_argv[0], envp);
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment