Malware and protecting your devices: types of malware, how infections happen, signs, removal and hardening phones and PCs
Malware (malicious software) is any program designed to harm you or your device: stealing passwords and M-Pesa details, spying through your camera, encrypting your files for ransom, showing endless ads, or using your computer to attack others. Your phone and laptop hold your money apps, photos, documents, email and work access, so keeping them clean is one of the most important things you can do. This unit explains the main types of malware, how infections happen (especially in Kenya: cyber cafés, flash disks, "modded" APKs, pirated software), how to spot and remove an infection, and how to harden Android, iPhone, Windows and macOS devices.
Types of malware
| Type | What it does | Example effect |
|---|---|---|
| Virus | Attaches to files/programs and spreads when they run | Corrupts files, spreads via flash disks |
| Worm | Spreads by itself across networks, no user action needed | Infects every PC on a school network |
| Trojan | Pretends to be useful software but carries malware | A "free" cracked Office or a fake "WhatsApp Gold" app |
| Ransomware | Encrypts your files and demands payment | All business documents locked; ransom note demands crypto |
| Spyware | Secretly collects information | Reads messages, tracks location |
| Stalkerware | Spyware installed by someone you know | A partner monitoring your chats and location |
| Banking trojan / SMS stealer | Steals banking/mobile money logins and OTP SMS | Empties accounts using intercepted codes |
| Keylogger | Records keystrokes | Captures passwords typed at a cyber café |
| Adware | Floods you with ads, redirects browsers | Pop-ups everywhere, fake "virus detected" pages |
| Rootkit | Hides deep in the system to avoid detection | Hard to remove; may need reinstall |
| Botnet bot | Lets criminals control your device remotely | Your PC sends spam or joins DDoS attacks |
| Cryptominer | Uses your CPU/GPU to mine cryptocurrency | Device hot, slow, battery drains fast |
| Remote access trojan (RAT) | Gives attackers full control | Camera, files and screen accessible to them |
How infections happen
| Route | Example |
|---|---|
| Fake or "modded" apps | APKs from websites, Telegram or WhatsApp groups promising free premium features |
| Pirated software and games | Cracked Windows, Office, Adobe or games with hidden trojans |
| Email attachments and links | Fake invoices, delivery notices, CVs, "payment proof" documents |
| Malicious ads and fake downloads | "Download" buttons on free movie/software sites |
| USB flash disks | Shared at cyber cafés, schools and printing shops |
| Unpatched software | Old browsers, old Windows, outdated plugins exploited automatically |
| Fake updates | "Your Chrome/Flash is out of date, click to update" pop-ups |
| Social engineering | Someone asks you to install a "support" app (AnyDesk/TeamViewer) and then takes control |
| Physical access | Someone installs stalkerware on your unlocked phone |
Warning signs
Phone
- Battery drains much faster; phone gets hot when idle.
- Unusual data usage.
- Apps you didn't install; an app has no icon but appears in Settings → Apps.
- Pop-up ads everywhere, even on the home screen.
- Unknown SMS sent, or OTP codes you didn't request.
- Accessibility or "device admin" permissions given to an app you don't recognise.
- Friends say you sent them strange messages.
Computer
- Very slow, fans running constantly, high CPU in Task Manager.
- Browser homepage or search engine changed; new toolbars or extensions.
- Pop-ups and fake virus warnings.
- Antivirus disabled and won't turn on.
- Files renamed with strange extensions, or a ransom note.
- Unknown programs starting with Windows; accounts logging in from strange places.
Not every slow device is infected (old hardware, a full disk or too many apps also cause slowness), but these signs deserve a check.
Removing malware
On a computer (Windows)
- Disconnect from the internet (and the office network) to stop data theft and spreading.
- Back up important documents (not programs) to an external drive; scan them later.
- Run a full scan with Microsoft Defender (Windows Security → Virus & threat protection → Scan options → Full scan), then an offline scan (Microsoft Defender Offline) which runs before Windows starts.
- Get a second opinion with a reputable on-demand scanner (e.g. Malwarebytes free).
- Remove unknown programs (Settings → Apps) and browser extensions; reset browsers.
- Check startup items (Task Manager → Startup).
- Change passwords from a clean device afterwards (email first), and turn on 2FA.
- If problems continue, or it's ransomware or a rootkit, back up data and reinstall Windows (Settings → System → Recovery → Reset this PC, or a fresh install).
On Android
- Restart in Safe mode (hold power, then long-press "Power off"; varies by phone) so third-party apps don't run.
- Settings → Apps: uninstall unknown or suspicious apps. If you can't, first remove its Device admin permission (Settings → Security → Device admin apps) and check Accessibility settings.
- Run Google Play Protect (Play Store → profile → Play Protect → Scan).
- Change important passwords and PINs; check M-Pesa/bank activity.
- If it persists: back up photos/contacts and factory reset.
On iPhone
iPhones are rarely infected without jailbreaking. Update iOS, remove unknown profiles (Settings → General → VPN & Device Management), delete suspicious apps, and change your Apple ID password. For high-risk people (journalists, activists), Apple's Lockdown Mode adds protection.
Ransomware
Disconnect immediately, don't pay without expert advice (payment doesn't guarantee recovery and funds criminals), report it, and restore from clean offline backups (see the backups and ransomware lesson).
Hardening phones
Android
- Install apps only from Google Play (or trusted stores); keep "Install unknown apps" off.
- Keep Play Protect on; update Android and apps.
- Review app permissions (Settings → Privacy → Permission manager); deny SMS, accessibility and admin rights to apps that don't need them.
- Screen lock with a strong PIN/biometric; SIM PIN; encrypted storage (default on modern phones).
- Enable Find My Device.
- Avoid rooting.
iPhone
- Keep iOS updated; don't jailbreak.
- App Store only; review permissions (Settings → Privacy & Security).
- Face ID/Touch ID with a strong passcode; Find My on; Stolen Device Protection where available.
Hardening computers
Windows
- Turn on automatic updates (Windows Update) and update apps (browsers, Office, PDF readers).
- Keep Microsoft Defender and the firewall on (you don't need several antivirus programs at once).
- Use a standard user account for daily work; use an admin account only for installs.
- Turn on BitLocker or device encryption (where available) so a stolen laptop's data is safe.
- Use Windows Hello or a strong password; lock the screen when away (Windows + L).
- Avoid pirated software: use free legal alternatives (LibreOffice, GIMP, VLC, Microsoft 365 Education where eligible).
- Uninstall software you don't use.
macOS: automatic updates, App Store or identified developers only, FileVault encryption, firewall on, strong login password.
USB drives, cyber cafés and public Wi-Fi
- Scan flash disks before opening files; disable autorun (Windows does by default now). Don't open
.exeor shortcut files that appear on a flash disk unexpectedly. - At cyber cafés: avoid logging in to banking or email; if you must, use private/incognito mode, never save passwords, log out, and change passwords later from your own device. Keyloggers are common on shared PCs.
- On public Wi-Fi: use HTTPS sites only, avoid sensitive transactions, or use mobile data/a reputable VPN. Turn off auto-join for open networks.
If your device is lost or stolen
- Use Find My Device / Find My to locate, lock or erase it.
- Call your provider to block the SIM (prevents SIM-based fraud) and get a replacement.
- Change passwords for email, M-Pesa-linked apps, bank and social media; sign out of other devices from account settings.
- Report to the police (an OB number may be needed for insurance or SIM replacement).
- Blacklist the phone's IMEI through your provider/police procedures where available.
Think about it: A student downloads a "Spotify Premium modded APK" from a Telegram group. A week later the phone is slow, shows ads on the lock screen, and the student gets OTP SMS for a bank they don't use. What happened and what should they do?Show answer
The APK was a trojan (adware plus an SMS stealer, possibly attempting account takeovers). They should boot into safe mode, remove the app and any admin/accessibility permissions it has, run Play Protect, factory reset if it persists, change passwords and PINs from a clean device, enable 2FA, check M-Pesa and bank activity, and only install apps from Google Play in future.
Summary
- Malware includes viruses, worms, trojans, ransomware, spyware/stalkerware, banking trojans, keyloggers, adware, rootkits, bots and miners.
- Infections come from modded APKs, pirated software, attachments, fake downloads/updates, USB drives, unpatched systems and social engineering.
- Watch for battery drain, heat, pop-ups, unknown apps, strange SMS/OTPs, changed browsers and disabled antivirus.
- Remove: disconnect, scan (Defender, offline scan, Play Protect), uninstall, reset browsers, change passwords; reinstall/factory reset if needed.
- Harden devices: official app stores, updates, permissions review, Defender and firewall, standard accounts, encryption, screen locks and Find My Device.
Check yourself
Which malware encrypts your files and demands payment?
Show answer
ransomware
What is the backup rule with the numbers 3, 2 and 1 called?
Show answer
3-2-1
Is it safe to install "modded" APKs from random websites? (yes/no)
Show answer
no
Malware disguised as a useful program is called a what?
Show answer
trojan
Which Windows feature encrypts the whole drive?
Show answer
BitLocker
Which Google feature scans Android apps for malware? (two words)
Show answer
Play Protect