I got a modified ls:
我有一个修改过的ls:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
int main(int argc, char **argv){
char command[50];
strcpy(command,"/bin/ls ");
gid_t egid = getegid();
setregid(egid, egid);
if(argc > 1) {
if(strlen(argv[1]) > 40) {
printf("The command you have given is too long, try again.\n");
return 0;
}
strcat(command,argv[1]);
system(command);
}else{
printf("This is a special NSA-modified 'ls' program. See 'man ls' for further details on how to use it.\n");
printf("USAGE: %s [flags & files]\n",argv[0]);
}
return 0;
}
#include <