24 lines
411 B
C
24 lines
411 B
C
#define _GNU_SOURCE
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
#include <unistd.h>
|
|
|
|
int main(int ac, char **av)
|
|
{
|
|
char *cmd;
|
|
|
|
int nb = atoi(av[1]);
|
|
if (nb == 423) {
|
|
cmd = strdup("/bin/sh");
|
|
gid_t gid = getegid();
|
|
uid_t uid = geteuid();
|
|
setresgid(gid, gid, gid);
|
|
setresuid(uid, uid, uid);
|
|
execv("/bin/sh", &cmd);
|
|
} else {
|
|
fwrite("No !\n", 1, 5, (FILE *)stderr);
|
|
}
|
|
return 0;
|
|
}
|