How to Make a Trojan





Introduction: How to Make a Trojan

How to make a trojan horse is for beginners, is really easy. I'm brazilian and have 13 years old, if a have problems with vocabulary... i'm sorry!

This is my first instructables, after i will go make a video, is very simple you can make in 10 minutes, in the first time you can make with 20 minutes is too easy. With this instructables you can joke your friends but this program works with virus but not a keylogger , only cd prank. How to make a Trojan is only for study not for malicious software. Let's go.

Step 1: You Need...

For make the trojan horse you need Borland Delphi 7 you can donwload trial version and complete version ( but you need to pay ) , under you have Borland web site link.

For donwload in this page you need a account

After you Join you can go to donwload page clicking here


This is Borland Web Site

Step 2: How To... Client

First we start with Client.


3 Buttons
1 Label
1 Edit

2- Go to menu Component on Menu Tab
You can see the picture in the finish of the page.
- Install Package
- Add...
- Go to folder bin
- and open the file dclsockets70.bpl

3- Go to internet tab
And Select ClientSocket and make on the form. Click on ClientSocket picture
In Object Inspector at Properties tab click on Port form and write 80

4- Now is easy, go to Events tab.
Click 2 times on "OnConnect" form

You need write

Now click on "OnConnecting"
you write:

label1.caption:='Wait... Connecting...';

Now click on "OnDisconnect" and write:


Now click on "OnError" and write:

label1.caption:='Fatal Error!! Oh my god!';

5- In the Connect button do 2 clicks.
and write:

Now look on Object Inspector and click on Propeties tab.

In Caption write: Connect

This makes the button in the program if to call to connect , make this with anothers buttons.

6- In the Open CD button write:
ClientSocket1.Socket.Sendtext ('opencd');

7- In the Close CD button write:
ClientSocket1.Socket.Sendtext ('closecd');

8- Now , all is ok! Go to file, save all and select one folder.
After go to play ( play button ) in the Delphi to compile.
And let's go to make the Server

Step 3: How To... Server!

9- Go to File>Close ALL
Go to File>New
And you have a new form.

10- Go in Internet Tab and click in Server Socket

11- Put the port 80 and go to tab Events in Object

12- In OnClientRead click 2 times.

13- Write
if Socket.ReceiveText='opencd' then begin
MciSendString('Set CdAudio Door Open',nil,0,Handle);
if Socket.ReceiveText='closecd' then begin
MciSendString('Set CdAudio Door Closed',nil,0,Handle);

The Error??? Yes, go in uses and put MMSystem

14- Now go File>Save as
And save in one folder, now click in the play button for

15- And now test!



    • Science of Cooking

      Science of Cooking
    • Pocket-Sized Contest

      Pocket-Sized Contest
    • Paper Contest 2018

      Paper Contest 2018

    We have a be nice policy.
    Please be positive and constructive.




    This actually is a Trojan or rather a RAT, but dont waste your time making this kind of stuff

    it is only program that can remotely open or close cd rom (why you putting comments like this when it is only a prank)

    Stay calm. This code would not do any harm. Not a Tojan. It only open and close your Cd Rom.
    To be a Tronjan takes much more than that.

    yeah that´s true

    totaly illegal. gekkazoid is right

    why is everyone sayng it´s illegal it can only open and close the cd rom!!!!!!!!!!!!!! it is like you are sayng that having a vase in the home is illegal

    can you send to me a package thet is called: dclsockets70.bpl i haven´t got it on my delphi my email address is thanks for sending the package

    This isn't illegal or malicious imo. I could write one to put on my son's computer which I bought him, so that I can control his internet access when he needs to be doing homework or to make sure he's not doing drugs. This instructable is useful and if you're going to stereotypically label this as malicious/illegal then you might as well do the same for hundreds of other instructables here. Just saying...

    This is the first time I've heard of a parent using a trojan to monitor children's internet activities. Everyone else uses a filter. I'm sorry but the majority of the time a trojan is mentioned it is being used for hacking/illegal purposes.