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
| Type | How it gets onto a device | Spreads by itself? |
|---|---|---|
| Trojan | You install it believing it is something else, or other malware installs it | No |
| Virus | Attaches to a file or program and runs when that file is opened. See virus explained | Spreads when infected files are shared or run |
| Worm | Copies itself across networks. See worm explained | Yes |
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).
Get the free 5-minute weekday brief
Scam alerts you can act on, major breaches, and our free Scam Survival Kit (PDF). Free, every weekday.
By subscribing you agree to our Privacy Policy.
For everyday readers, small businesses and security teams. Unsubscribe anytime.
How trojans are delivered
- Fake downloads. A cracked game, a “free” version of paid software or a fake installer from an unofficial site.
- Email attachments and links. An invoice, shipping notice or document that asks you to enable content or run a file.
- Fake updates and pop-ups. A warning that your browser or computer is out of date, with a “fix” to download.
- Look-alike apps. Apps in or outside app stores that copy the name and icon of a popular tool.
- Other malware. One infection can download and install a trojan as a second stage.
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):
- Download and install other malware, such as viruses or worms.
- Use the infected device for fraud.
- Record keystrokes and the websites you visit.
- Send information about the device to an attacker, including passwords, website sign-in details and browsing history.
- Give an attacker control over the infected device.
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:
- Disconnect the device from the internet and avoid typing passwords on it.
- 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).
- Uninstall anything you do not recognize and install all pending updates.
- Change your important passwords from a different, clean device and turn on multi-factor authentication.
- If the scan cannot clean the device, restore from a clean backup or reset it.
How to stay safer
- Download software only from the publisher or an official app store.
- Do not run attachments you did not expect, even from familiar names. Confirm through another channel.
- Keep your operating system, browser and apps updated. Microsoft covers more habits in its guide to preventing malware infection (Microsoft Learn).
- Use reputable security software and keep it on.
- Skip cracked or pirated programs. They are a common carrier for trojans.
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
- Microsoft Learn: Trojan malware
- Microsoft Learn: Prevent malware infection
- NIST CSRC Glossary: Trojan horse
Start your morning with the signal that matters.
Get the biggest cybersecurity developments, why they matter, and where to go deeper on CyberExperts.
By subscribing you agree to our Privacy Policy.
For everyday readers, small businesses and security teams. Unsubscribe anytime.