Sunday 25 November 2012

MAKE TROJAN

How to Make a Trojan Horse


______________________________________________________________________TROJAN HORSE


Most of you may be curious to know about how to make a Trojan or Virus on your own. Here is an answer for your curiosity. In this post I’ll show you how to make a simple Trojan on your own using C programming language. This Trojan when executed will eat up the hard disk space on the root drive (The drive on which Windows is installed, usually C: Drive) of the computer on which it is run.  Also this Trojan works pretty quickly and is capable of eating up approximately 1 GB of hard disk space for every minute it is run. So, I’ll call this as Space Eater Trojan. Since this Trojan is written using a high level programming language it is often undetected by antivirus. The source code for this Trojan is available for download at the end of this post. Let’s see how this Trojan works…

Before I move to explain the features of this Trojan you need to know what exactly is a Trojan horse and how it works. As most of us think a Trojan or a Trojan horse is not a virus. In simple words a Trojan horse is a program that appears to perform a desirable function but in fact performs undisclosed malicious functions that allow unauthorized access to the host machine or create a damage to the computer.

Now lets move to the working of our Trojan


The Trojan horse which I have made appears itself as an antivirus program that scans the computer and removes the threats. But in reality it does nothing but occupy the hard disk space on the root drive by just filling it up with a huge junk file. The rate at which it fills up the hard disk space it too high. As a result the the disk gets filled up to 100% with in minutes of running this Trojan. Once the disk space is full, the Trojan reports that the scan is complete. The victim will not be able to clean up the hard disk space using any cleanup program. This is because the Trojan intelligently creates a huge file in the WindowsSystem32 folder with the .dll extension. Since the junk file has the .dll extention it is often ignored by disk cleanup softwares. So for the victim, there is now way to recover the hard disk space unless reformatting his drive.

The algorithm of the Trojan is as follows





  1. Search for the root drive

  2. Navigate to WindowsSystem32 on the root drive

  3. Create the file named “spceshot.dll”

  4. Start dumping the junk data onto the above file and keep increasing it’s size until the drive is full

  5. Once the drive is full, stop the process.



You can download the Trojan source code HERE. Please note that I have not included the executabe for security reasons. You need to compile it to obtain the executable.

How to compile, test and remove the damage?


______________________________________________________________________


  Compilation


How to Compile C Programs


If you’re new to C programming and find it difficult to compile the C source codes then this post is for you. Here is a step-by-step procedure to install Borland C++ compiler 5.5 and compile C programs.

HOW TO INSTALL BORLAND C++ COMPILER




  1. Download Borland C++ compiler 5.5 (for Windows platform).

  2. After you download, run freecommandlinetools.exe. The default installation path would be C:\Borland\BCC55



______________________________________________________________________



How to configure Borland C++ compiler



  • After you install Borland C++ compier, create two new Text Documents

  • Open the first New Text Document.txt file and add the following two lines into it


-I”c:\Borland\Bcc55\include”

-L”c:\Borland\Bcc55\lib”


  • Save changes and close the file. Now rename the file from New Text Document.txt to bcc32.cfg.

  • Open the second New Text Document (2).txt file and add the following line into it


-L”c:\Borland\Bcc55\lib”


  • Save changes and close the file. Now rename the file from New Text Document (2).txt to ilink32.cfg.

  • Now copy the two files bcc32.cfg and ilink32.cfg, navigate to C:\Borland\BCC55\Bin and paste them.


______________________________________________________________________



How to compile the C source code (.C files)



  • You need to place the .C (example.c) file to be compiled in the following location


C:\Borland\BCC55\Bin


  • Now goto command prompt (Start->Run->type cmd->Enter)

  • Make the following path as the present working directory (use CD command)


C:\Borland\BCC55\Bin


  • To compile the file (example.c) use the following command


bcc32 example.c


  • Now if there exists no error in the source code you’ll get an executable file (example.exe) in the same location (C:\Borland\BCC55\Bin).

  • Now you have successfully compiled the source code into an executable file(.exe file).


NOTE: The above tutorial assumes that you’ve installed the compiler onto the C: drive (by default).

______________________________________________________________________


 Testing


To test the Trojan,  just run the SpaceEater.exe file on your computer. It’ll generate a warning message at the beginning. Once you accept it, the Trojan runs and eats up hard disk space.

NOTE: To remove the warning message you’ve to edit the source code and then re-compile it.


______________________________________________________________________


How to remove the Damage and free up the space?


To remove the damage and free up the space, just type the following in the “run” dialog box.
%systemroot%system32

Now search for the file “spceshot.dll“. Just delete it and you’re done. No need to re-format the hard disk.

 NOTE: You can also change the ICON of the virus to make it look like a legitimate program. This method is described in the post: How to Change the ICON of an EXE file ?

______________________________________________________________________


How to Change the ICON of an EXE file


Some times it becomes necessary to change the ICON of an executable(.exe) file so that the exe file get’s a new appearence.Many of the Tools such as TuneUP Winstyler does this job by adjusting the Windows to display a custom icon to the user.But in reality when the file is carried to a different computer, then it shows it’s original ICON itself.This means that inorder to permanantly change the ICON, it is necessary to modify the executable file and embed the ICON inside the file itself.Now when this is done the exe file’s ICON is changed permanantly so that even if you take file to a different computer it show’s a new icon.

For this purpose I have found a nice tool which modifies the exe file and will embed the ICON of your choice into the file itself. ie:The tool changes the exe ICON permanantly.

I’ll give you a step-by-step instruction on how to use this tool to change the icon.

  • Goto www.shelllabs.com and download the trial version of Icon Changer and install it (Works on both XP and Vista).

  • Right-click on the exe file whose ICON is to be changed.

  • Now you will see the option Change Icon…Click on that option.

  • Now the Icon Changer program will open up.

  • Icon changer will search for all the ICONS on your system so that you can select any one of those.

  • Now select the ICON of your choice and click on SET.

  • Now a popup window will appear and ask you to select from either of these two options.


Change embeded icon
Adjust Windows to display custom icon.


  • Select the first option (Change embeded icon).



  • You are done.The ICON get’s changed.


________________________________END________________________________

No comments:

Post a Comment