Free tech learning for everyone, from basics to pro

Start hereCybersecurityBasics

Malware basics: viruses, ransomware and how to stay safe

In short: Malware is any software made to harm you or your device: to steal, spy, lock your files or take control. It usually arrives through a trick, such as a fake download or attachment, or through an unpatched flaw. Updates, care with downloads and backups stop most of it.

The simple idea

Malware is short for "malicious software": any program designed to do something to you that you would never agree to. That might be stealing passwords, spying on you, locking your files for a ransom, or quietly using your computer to attack others.

The main types

TypeWhat it doesHow it spreads
VirusAttaches itself to files or programsWhen the infected file is opened
WormCopies itself across networks on its ownThrough unpatched flaws, without anyone clicking
TrojanPretends to be something usefulFake apps, cracked software, "free" tools
RansomwareLocks your files and demands paymentPhishing, weak remote access, other malware
Spyware and infostealersSecretly collects passwords, cookies and activityBundled downloads, malicious extensions
How malware usually gets inA trickemail, ad or fakedownloadYou open itor a flaw is usedIt runson your deviceThe harmsteals, spies orlocks
Figure 1. Most infections start with a trick that persuades someone to open a file or install something, or with a security flaw that has not been patched yet.

How it gets onto devices

  • Phishing: an email or message with a harmful attachment or link. See phishing basics.
  • Fake downloads: "free" versions of paid software, fake updates, unofficial apps and browser extensions.
  • Unpatched flaws: attackers use known security holes in out-of-date software, sometimes with no click needed.
  • Infected USB drives and shared files.

Signs something is wrong

Malware tries to stay hidden, but common signs include: a sudden slowdown, pop-ups or new toolbars, a changed home page or search engine, friends receiving messages you did not send, security software turned off, or files you cannot open with strange new names.

Real-world example: the "free" video editor

A student wants a paid video editor and downloads a "cracked" copy from a forum. It installs and works perfectly, so nothing seems wrong. In the background, it is an infostealer: it copies the passwords and login cookies saved in the browser and sends them to criminals. A week later, the student's gaming and social media accounts are taken over, even though they "never gave anyone their password". Free cracked software is one of the most common sources of this kind of malware.

Habits that keep you safe

  1. Update your operating system, browser and apps, ideally automatically.
  2. Install software only from official stores and makers' websites.
  3. Be suspicious of unexpected attachments and links, even from people you know.
  4. Keep built-in protection, such as Microsoft Defender, switched on.
  5. Use multi-factor authentication, so stolen passwords alone are not enough.
  6. Keep backups, so ransomware cannot hold your files hostage.

If you think you are infected: disconnect from the internet, run a full scan, then change important passwords from a different, clean device. At work, tell IT straight away: speed matters more than embarrassment.

Key takeaways

  • Malware is software built to steal, spy, lock files or take control.
  • Main types: viruses, worms, trojans, ransomware and spyware.
  • Most infections start with a trick or an unpatched flaw.
  • Updates, official downloads, MFA and backups stop most malware.
Tracks your learning on this device only. See your progress on the learning paths.

About the author

Mohamed Fayas

Founder of FM TecHub. CCNA certified, with a BTEC HND in Network Engineering, and BEng (Hons) in Computer Networking and Cloud Security. He writes practical, plain-English guides on networking, security and cloud.

More about the author

Original content written by Mohamed Fayas for FM TecHub. © 2026 FM TecHub. You're welcome to share a link to this page; please don't copy the text elsewhere without permission.

Stay up to date by email

New notes, tools and security news from FM TecHub, explained simply. Free.

We only use your email to send these updates. See our privacy policy.