J
Java Boy
HI there...
I compile the following code(as root) and sets the setuid bit...
as it gives a shell to any user but when the setuid bit is set the
shell should have the privileges of root but in my case it doesn't
have those privileges. I'm using redhat 7.1
#include<stdio.h>
#include<unistd.h>
int main()
{
char *file[2];
file[0]="/bin/sh";
file[1]=NULL;
execve(file[0],file ,NULL);
return 0;
}
Thanks!
I compile the following code(as root) and sets the setuid bit...
as it gives a shell to any user but when the setuid bit is set the
shell should have the privileges of root but in my case it doesn't
have those privileges. I'm using redhat 7.1
#include<stdio.h>
#include<unistd.h>
int main()
{
char *file[2];
file[0]="/bin/sh";
file[1]=NULL;
execve(file[0],file ,NULL);
return 0;
}
Thanks!