Security

Trojan horse

A Trojan horse is a type of malware that poses as a legitimate program, file or app so that the victim installs it, and once inside it opens remote access, steals data or downloads other malware.

In this post

A Trojan horse is a harmful program that poses as something useful or harmless so that the user installs it or opens it. Once inside, it carries out hidden actions, such as stealing data, opening a way in for attackers or installing other programs. The name comes from the Trojan horse of Greek mythology, the poisoned gift with which the Greeks got into a city they had been unable to take by force.

The story of the Trojan horse is known to almost everyone. After years of siege, the Greeks pretended to withdraw and left a large wooden horse at the gates of Troy as an offering. The Trojans brought it inside the city. That night, the soldiers hidden in its belly came out, opened the gates and let the army in. A Trojan program works the same way. It presents itself as a gift, and the victim carries it into their own computer.

A Trojan horse is a gift with a surprise inside. It looks like a useful program, but it hides something that opens the door to attackers.

What is a Trojan horse?

The essential feature of a Trojan horse is deception. It does not need to find a technical flaw or spread on its own. It only needs to convince a person to run it. It can be disguised as a free game, a pirated version of a paid program, an invoice attached to an email, a browser update, a torch app or a video file. The more attractive the bait, the easier it is for someone to install it.

How a Trojan horse differs from a virus or a worm

All three are malware, but they behave differently. A virus attaches itself to other files and spreads when they are run. A worm copies itself across networks without any human intervention. A Trojan does not replicate. It depends on the victim installing it voluntarily, fooled by its appearance as a useful program, and that is where the name from the Greek legend comes from. That reliance on deception means the defence focuses on people as much as on technology. A Trojan does not need to exploit any technical flaw, it only needs someone to trust it. That is why fake free programs, fake updates and attachments that look like invoices work so well.

Difference between virus, worm and Trojan

Types of Trojan horse

The types of Trojan horse are classified by what they do once inside. The same Trojan can combine several functions and receive new modules over time, so an infection that starts as a simple downloader can end in data theft or in ransomware.

Remote access Trojan

A remote access Trojan, or RAT, gives the attacker control of the computer as if they were sitting in front of it, with access to the files, the camera, the microphone and the keyboard. Families such as njRAT or DarkComet spread for years in pirated programs and email attachments, and inside a company they make it possible to move through the network and copy documents without anyone noticing.

Downloader or loader

The downloader, or loader, does hardly anything by itself. Its job is to install itself, check the computer and then download other harmful programs depending on what it finds, which is why families such as Qakbot or Emotet ended up becoming the gateway for other groups, who bought access to the infected computers to launch their ransomware.

Banking Trojan

A banking Trojan specialises in stealing financial credentials and manipulating transactions. On a computer it injects fake fields into the bank’s website to ask for confirmation codes, and on Android it overlays fake screens on the banking app when the user opens it, abusing accessibility permissions.

SMS malware

SMS Trojans send messages to premium-rate numbers or intercept incoming ones that contain confirmation codes. FakePlayer, discovered in 2010 and considered the first Trojan for Android, posed as a video player and sent paid messages without the user knowing.

Backdoor Trojan

A backdoor Trojan opens a hidden entrance so that the attacker can come back whenever they want, even if the passwords are changed. On web servers it usually takes the form of a small file hidden among the template files, the extensions or the custom code, which accepts commands from the attacker.

How to recognize an intruder file in a theme folder

Fake antivirus

A fake antivirus shows made-up alerts about serious infections and charges for a useless clean-up. It was a plague at the end of the 2000s, with programs whose names resembled real products and that filled the screen with red warnings until the victim paid.

Account stealer

Some Trojans focus on stealing specific accounts, such as those for video games, social networks or instant messaging, in order to sell them or use them as bait. A stolen messaging account is then used to send the same Trojan to all the victim’s contacts, who trust the sender.

How a Trojan horse disguises itself and what it does

The disguise

The success of a Trojan depends on the bait. Criminals study what is attractive at any given moment. Free versions of expensive programs, trending content, miracle tools, current news, notices about supposed deliveries or taxes. Sometimes the Trojan travels inside a legitimate program that has been tampered with, which makes it even harder to detect, because the user believes they are installing something genuine from a trusted supplier.

Trojans also like to hide inside documents that seem completely harmless. An office file that asks you to enable content to view it properly is a classic tactic that runs a harmful program. Or they hide in browser extensions and mobile apps that appear useful and then change their behaviour after an update. It is wise to be suspicious of any disproportionate request for permissions, such as a torch app asking for access to your messages.

The hidden payload of the Trojan

Once installed, the Trojan quietly carries out its real function. Banking Trojans, for example, watch for when the user visits their bank’s website and capture what they type, or modify the page they see to display fake data while making transfers in the background.

Remote access Trojans let the attacker see the screen, the keyboard and the files. Downloaders prepare the ground for more harmful programs.

Many include techniques to hide themselves, such as concealing their files and processes, restarting when the computer boots or disabling protections. That is why detection is not always easy. Modern security tools look for suspicious behaviour and not just known signatures, which helps detect new variants. Keeping them updated and scanning the computer regularly is part of any user’s routine.

Trojans as a service

Crime has turned the Trojan business into a profession. Some groups develop Trojans and rent them out to others, with technical support, updates and control panels. The customer only has to send the program to their victims and collect the results. This has multiplied the number of people able to launch attacks, and it explains why the same Trojan can appear in very different campaigns. It also explains why police operations against the authors do not end the problem. The code is usually leaked or sold, and variants emerge. Even so, dismantling the networks and arresting those responsible reduces activity and sends a deterrent message. It also gives security companies valuable information about how these organisations work, which translates into better defences for everyone.

Malicious apps disguised on mobile phones

Phones suffer from them too, especially Android devices that install apps outside the official store. A mobile banking Trojan usually arrives disguised as a PDF reader, a system update or a messaging app, and asks for accessibility services to be enabled, which allow it to read the screen and tap on the user’s behalf.

With that permission it overlays fake screens on the banking app, intercepts verification codes sent by SMS and can make transfers. On the iPhone they are much rarer because of the system’s restrictions, although cases have been seen through beta testing programs and configuration profiles installed by deception.

Trojans and websites

For a website, Trojans show up in several ways. They can infect the administrator’s computer, stealing the passwords for the dashboard and the hosting. They can hide in pirated templates, extensions and modules, which are downloaded for free and come with malicious code included. And they can be used to distribute harmful content to visitors, if the website has been compromised. Each of these routes can be closed with simple habits.

The most important habit is never to use premium templates or extensions downloaded from unofficial sites. It is one of the most frequent sources of infection, because the modified code installs backdoors and hidden programs that criminals exploit later. Saving the price of a licence can cost you the entire website. Free extensions from the official repositories and premium ones bought from the vendor are the only safe option.

The computer used to manage the website also has to be protected. A clean, updated system, an everyday account without administrator privileges, active protection and a second factor on every important account. If the administrator’s computer is infected, all the other defences of the website become useless, because the attacker gets in with the legitimate keys.

Avoiding a Trojan horse and detecting whether you already have one

How to avoid falling for one

The main rule is to install only what is necessary and only from official sources. Pirated programs, key generators and updates that appear in pop-up windows are a common route. Being wary of unexpected attachments, even if they look like invoices or delivery notices, and checking the sender through another channel greatly reduces the risk.

Protective technology also helps a great deal to keep a Trojan out. Keeping the system and apps up to date, using up-to-date endpoint protection and working with an account without administrator privileges prevent many Trojans from installing or doing damage. Companies add application allow-listing, so that only what has been authorised can run.

How to remove a Trojan

The first step is to disconnect the computer from the network to cut off communication with the attacker. Then it is scanned with an up-to-date security tool, preferably in safe mode or from a rescue boot disk, because some Trojans defend themselves while the system is running normally.

Passwords are changed from another clean device, starting with email and banking, and the bank is alerted if there have been unusual transactions. If the Trojan gave remote access or the clean-up does not inspire confidence, the safest option is to reinstall the system from scratch and restore only the documents. To clean up a hacked website it is not enough to delete what you can see, you also have to find the backdoors.

How to tell whether you have installed a disguised malicious program

The symptoms of a Trojan are varied and discreet. A slower computer, programs you do not remember installing, pop-up windows, changes in the browser, accounts with strange activity or warnings from your bank. A well-made Trojan gives no signs, so the absence of symptoms is no guarantee. That is why it is worth scanning the computer from time to time with an up-to-date security tool, even if everything looks normal.

Also review the programs you have installed recently. Where did you download them from? Was it the official source? Did they ask for disproportionate permissions? Uninstall whatever you do not recognise or do not need. Look at the browser extensions and the apps on your phone as well. A quick review every few months removes a lot of accumulated risk. And when in doubt, restore the computer after saving what matters in a safe backup.

And finally, adopt the golden rule that works against every Trojan. When something is too good to be true, it is probably bait. An expensive program for free, a miracle offer, a file that arrives out of the blue. Pausing before installing or opening, checking the source and asking someone you trust are habits that have prevented millions of infections. As in the legend, the best defence against the wooden horse is not to open the gates to an unexpected gift.

The origin of the term Trojan horse in computing

The term Trojan horse applied to programs appears in a 1972 security report prepared for the United States Air Force. ANIMAL, an animal guessing game written by John Walker in 1975, is often cited as one of the first, because it copied itself into other folders while the user played.

In 1989, the AIDS Trojan was distributed on some twenty thousand floppy disks that promised information about AIDS and ended up encrypting file names to demand a payment, the forerunner of ransomware. In 1998, Back Orifice showed how easy it was to control a Windows machine remotely, and it opened the era of remote access Trojans.

The twenty-first century brought the business on a large scale, with Zeus from 2007 and Emotet from 2014. In January 2021, an operation coordinated by Europol dismantled the Emotet infrastructure, and in 2023 the FBI did the same with Qakbot, although the gangs tend to reappear with new tools.

A network of money mules that moved cash stolen with banking malware

Zeus, also known as Zbot, appeared around 2007 and became one of the most profitable banking Trojans in history. It infected the computers of individuals and small businesses through emails with attachments and compromised websites. Once inside, it watched for visits to bank websites and captured the credentials. With them, the criminals got into the accounts and transferred money to intermediary accounts.

The police investigation began in May 2009, when FBI agents in Omaha detected suspicious payments to dozens of bank accounts. In a case called Operation Trident Breach, which was made public on 1 October 2010, the authorities of the United States, the United Kingdom, the Netherlands and Ukraine arrested several dozen people. Many of them were so-called mules, people who received stolen money and passed it on in exchange for a commission. Those behind the network stole around 70 million dollars.

Experts warned at the time that the arrests would not end the fraud. The Zeus code had been leaked and sold, and variants emerged that continued for years. In fact, the group reorganised after the arrests, and a more sophisticated evolution of the Trojan appeared. Even so, the operation showed that it is possible to dismantle international criminal organisations through cooperation between countries, something that would be repeated in later cases.

The lesson for users is that this kind of threat works on people and their habits. Those affected were mostly individuals and small businesses with unprotected computers who opened an attachment or visited a compromised website. With updates, protection, caution and a second factor on banking, many of those thefts would not have succeeded. It is a reminder that the basics are still the most effective defence.

Frequently asked questions

Frequently asked questions about Trojan horse

What is a Trojan horse?

It is a harmful program disguised as something useful or harmless, such as a game, an invoice or an update, so that the user installs or opens it. Once inside, it carries out hidden actions, such as stealing data, opening a way in for attackers or installing other programs.

Where does the name Trojan horse come from?

From the Trojan horse of Greek mythology. According to the classical story, the Greeks gave the city of Troy a huge wooden horse with soldiers hidden inside. The Trojans brought it into the city and at night the soldiers came out and opened the gates. Today it refers to any deception that carries danger inside.

Does a Trojan horse replicate like a virus?

No. Unlike viruses and worms, a Trojan does not copy itself. It depends on someone installing it, fooled by its disguise. That makes the defence different, since it relies more on people's caution than on stopping automatic spread.

What types of Trojan horse are there?

Remote access Trojans, which give control from a distance. Banking Trojans, which steal credentials. Downloaders, which install other programs. Those that form part of botnets. Password stealers and ransom Trojans. Many combine several functions, and they are rented out to other criminals.

How does a Trojan horse infect a computer?

It usually arrives disguised as a useful program, an attachment, a crack, a fake update or an app downloaded outside the official stores. The user runs it voluntarily believing it is legitimate, and that is when the Trojan installs its malicious payload without drawing attention.

What can a Trojan horse do on an infected computer?

Depending on the type, it can steal passwords and banking details, open a backdoor so the attacker can control the computer, install other malicious programs, turn the computer into part of a network of zombie machines or encrypt files to demand a ransom. The most dangerous part is that it usually does so silently for a long time.

How do I protect myself from a Trojan horse?

By downloading programs only from official sources, being wary of unexpected attachments and links, keeping the system up to date, using protection on your devices, using accounts without administrator privileges for everyday work and having a second factor on banking and important services.

What should I do if I think I have a Trojan horse?

Disconnect the computer from the internet, scan it with an up-to-date security tool and change your important passwords from another clean device. If money is involved, warn your bank. If you cannot be sure the clean-up worked, the safest option is to restore the computer from scratch.

I identify and remove Trojans and hidden malware

If your website has been infected by a Trojan horse disguised as a legitimate file, I can identify it and remove it completely.

About the author

Javier Afán

WordPress developer specialised in security, WooCommerce, and hacked website recovery.

I work on WordPress from a technical angle focused on security, architecture, and the decisions that really affect a project's continuity.