i'm sure, because it is my telnet-server, and i can connect with it through standard telnet-client
Type: Posts; User: LuckyStr
i'm sure, because it is my telnet-server, and i can connect with it through standard telnet-client
#include <stdio.h>
#include <sys/socket.h>
#include <netdb.h>
#include <stdlib.h>
#include <string.h>
#define BUF_LEN 1024
#define PORT 23
int main (void)
My code, executing by root:
//file name is "consolka"
char buf[1024];
FILE *infile;
infile=fopen("/dev/console","a");
Thank's all, but my mistake was that i check wrong value: if setuid() finished successfully it return 0.
#include <iostream>
using namespace std;
#include <stdlib.h>
#include <sys/types.h>...
[andrew@COR up]$ id
uid=501(andrew) gid=501(andrew) группы=500(up),501(andrew),502(vboxusers) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
[andrew@COR up]$ whoami
andrew...
no, if i run by root or by user with uid=501 i get nothing.
by root:
[root@COR Release]# ./ssetu
started as uid=0, pid=9571
fork()=9572
parent uid=0
parent pid=9571
fork()=0
child print...
Excuse for unreadable.
[andrew@COR disk]$ ls -l
-rwxrwxrwx. 1 root root 6 Авг 23 18:37 log
I know that > will delete any previous contents of the file.
Before:
I want to execute shell command by user with uid 501. I run this application by root. I wrote:
#include <iostream>
using namespace std;
#include <stdlib.h>
#include <sys/types.h>
#include...