What Is a Trojan Horse? Examples and Protection

By George Bailey   Published: 12/04/26   5 min read

What is a trojan horse?

A trojan horse, or trojan, is malware that disguises itself as a legitimate program or file. It looks useful or harmless, but it also carries a hidden harmful function. Unlike a virus, a trojan cannot spread on its own, so it relies on you or other malware to install it (Microsoft Learn).

The name comes from the Greek story of a wooden horse that carried soldiers into a city. In computing, the “gift” is usually a free tool, a game, a document or an app, and the harmful part is hidden inside. Trojans are one type of malware. See also the trojan horse glossary entry.

Trojan vs virus vs worm

TypeHow it gets onto a deviceSpreads by itself?
TrojanYou install it believing it is something else, or other malware installs itNo
VirusAttaches to a file or program and runs when that file is opened. See virus explainedSpreads when infected files are shared or run
WormCopies itself across networks. See worm explainedYes

Microsoft states that trojans, unlike viruses, cannot spread on their own: they must be downloaded manually or installed by other malware, and they often use the same file names as real apps (Microsoft Learn).

How trojans are delivered

Many of these start with a convincing message. Our phishing quiz is a quick way to practice spotting them.

What a trojan can do

Microsoft lists what trojans generally do after installation (Microsoft Learn):

That list is why a trojan can lead to account takeover, stolen money or a later ransomware attack. See what spyware is and what ransomware is for what often comes next.

How to spot and remove a trojan

A trojan is built to look normal, so signs are often indirect: unknown programs, a sluggish device, security software that turns itself off, or accounts that show sign-ins you did not make. If you suspect one:

  1. Disconnect the device from the internet and avoid typing passwords on it.
  2. Run a full scan. Microsoft recommends its free Microsoft Defender Antivirus on Windows 10 and 11 and Microsoft Safety Scanner to detect and remove trojans (Microsoft Learn).
  3. Uninstall anything you do not recognize and install all pending updates.
  4. Change your important passwords from a different, clean device and turn on multi-factor authentication.
  5. If the scan cannot clean the device, restore from a clean backup or reset it.

How to stay safer

For a bigger picture of the threat family, read what malware is.

Frequently asked questions

What is a trojan horse in cybersecurity?

It is malware that pretends to be a legitimate program or file while carrying a hidden harmful function. Source: Microsoft Learn.

Is a trojan a virus?

No. Both are malware, but a virus spreads by attaching itself to files, while a trojan cannot spread on its own and depends on someone installing it.

What can a trojan do to my computer?

It can install other malware, record keystrokes, steal passwords and browsing history, use the device for fraud and give an attacker control. Source: Microsoft Learn.

How do trojans get onto devices?

Mostly through things people choose to open or install: fake downloads, email attachments, fake updates, look-alike apps, or as a second stage from other malware.

How do I remove a trojan?

Disconnect, run a full scan with trusted software such as Microsoft Defender Antivirus or Microsoft Safety Scanner on Windows, remove unknown programs, change passwords from a clean device, and restore from backup if needed. Source: Microsoft Learn.

Can a phone get a trojan?

Yes. Look-alike or malicious apps, and links in texts, can install trojan-style malware on phones. Use official app stores, review app permissions and keep the phone updated.

Sources

George Bailey

George Bailey is the byline of the CyberExperts editorial desk, the team behind the CyberExperts Daily Brief. The desk covers vulnerabilities, breaches and security news from vendor advisories, CISA alerts and other primary sources, and links those sources in every story. Questions or corrections: [email protected].