Most computers get infected when someone opens a file that looks harmless, such as a cracked program, a fake update or an email attachment. Bundled installers, browser extensions, notification permissions and USB drives are the other common ways in, and the steps below find what came in.
Jump to: Downloads · Email · Fake updates · Installers · Browser · USB drives · Mac · Android
How malware gets onto a Windows PC
Almost every infection needs you to run something or to allow something, so each source below comes with the habit that blocks it.
Cracked software, key generators and fake download sites
Cracked games, key generators and “free” versions of paid programs are the most common way that trojans and password stealers reach a PC. The file often works as promised, so nothing looks wrong while the hidden part installs itself in the background.
Fake download sites copy the look of real ones and buy search ads, so check the address bar before you click a download button. Download programs only from the website of the company that makes them, or from the Microsoft Store.
Email attachments and links
Malicious emails pose as invoices, delivery notices, tax letters or shared documents, and they ask you to open an attachment or a link. Archives, documents that ask you to enable editing or macros, and links to “view the file” are the usual traps.
If you did not expect the email, do not open the attachment, even from a familiar name, because sender names are easy to fake. Contact the sender another way, by phone or a new message, and ask whether they really sent it.
Fake updates and fake “verify you are human” pages
Some websites claim that your browser, video player or driver is out of date and offer a download that installs malware instead. Real browser updates come from the browser’s own menu, and Windows updates come only from Windows Update in Settings.
A newer trick is a fake CAPTCHA page that asks you to press Windows + R, paste a command and press Enter. No real website asks for this, and the pasted command downloads malware, so close the page as soon as you see such a request.

Extra programs bundled in free installers
Free programs sometimes come with offers for other software, and the box that installs them is ticked unless you choose otherwise. Pick Custom or Advanced on every installer, untick the offers you did not ask for, and read each screen before you click Next.
Windows Security can block potentially unwanted apps, such as bundled toolbars and coupon helpers, before they install themselves on your computer. The setting is built into Windows 11 and Windows 10, but it is not always turned on, so check it with the steps below.
-
Open Windows Security
Click the Start button, type Windows Security, and then click Windows Security under Best match to open the app.

-
Open App & browser control
In the left sidebar of Windows Security, click App & browser control, which holds the settings that check the apps, files and websites you open.

-
Open the reputation-based protection settings
Under Reputation-based protection, click the Reputation-based protection settings link to open the page that holds the blocking options.

-
Turn on Potentially unwanted app blocking
Scroll down to Potentially unwanted app blocking, click the switch so it shows On, and click Yes if Windows asks for permission. On some versions of Windows, two boxes named Block apps and Block downloads appear under the switch, and both of them should stay ticked.

Browser notifications, pop-ups and extensions
A site that asks you to click Allow to watch a video or prove you are not a robot wants permission to send notifications. Those notifications then show fake virus alerts and links to scam pages, even when the browser shows another site or seems closed.
Browser extensions can also turn bad, either from the start or after a popular extension is sold to someone who adds ads. Keep only the extensions you use, and remove any that you do not remember adding.
USB drives and shared files
A USB drive from a friend or a public computer can carry malware that its owner never noticed, and so can shared files. Scan every drive with your antivirus before you open files from it, and never run a program from a drive that you found.
Outdated programs and Windows versions
Old browsers, unpatched programs and versions of Windows that no longer get security updates let some attacks work without any click from you. Keep Windows Update turned on, update your browser when it asks, and remove programs that you no longer use.
If you found something you cannot remove yourself, follow our full guide to removing malware from Windows.
How malware gets onto a Mac
Mac malware arrives the same way as on Windows, through files you open yourself, so the built-in protection helps only if you heed it. These are the usual sources, along with the habit that keeps each one out:
- Fake browser or video player updates offer a disk image that installs adware, so get updates only from System Settings or the App Store.
- Cracked Mac apps and games often contain password stealers, so download paid software only from the App Store or its maker.
- Some installers ask you to override the Mac’s security warning or type your password, which you should refuse for unexpected files.
- Safari extensions and websites allowed to send notifications cause most Mac pop-ups, so check Safari, Settings, Extensions and Websites.
To remove what is there, follow our guide to removing malware from a Mac, which checks the apps, login items and profiles.
How malware gets onto an Android phone
Android malware almost always comes from an app you installed or a permission you granted, and these are the sources we see most often:
- Apps installed from a link in a text message or on a website, after you turned on Install unknown apps for it.
- Cleaner, battery, flashlight and free game apps from the Play Store that start showing full-screen ads a few days after you install them.
- Websites that ask you to tap Allow and then send fake virus alerts and prize offers through Chrome’s notifications.
- Apps that ask for accessibility or device admin rights that they do not need, which lets them read the screen or resist removal.
To remove such an app, follow our guide to removing malware from Android, which also shows a Play Protect scan.
How to tell which source infected your computer
The install date of an unknown program is usually the best clue, because it points to what you downloaded or opened that day. Compare it with your browser’s download list, which you open with Ctrl + J in Chrome and Edge.
Windows Security also keeps a record of what it blocked or removed, under Virus & threat protection, Protection history. The detection names and dates there often name the file that brought the infection, which tells you which habit to change.
Knowing the source matters, because the same habit will bring the next infection if nothing changes. A cracked program that installed a password stealer also means you should change your passwords from a clean device, starting with email and banking.
Malware sources FAQ
Can you get a virus just by visiting a website?
It is rare on an updated browser, because the attack needs a security hole that has not been fixed yet. Most website infections still need you to download a file, allow notifications or paste a command, so stop and think at those moments.
Can opening an email infect my computer?
Reading an email in an updated mail app or webmail is generally safe, but opening its attachment or clicking its link can be dangerous. Treat unexpected attachments as suspicious, especially archives, documents that ask to enable macros, and files that end in .exe or .js.
Can a USB drive infect my computer?
Yes, a USB drive can carry infected files, and a program on it can infect the PC as soon as you run it. Current versions of Windows do not run programs from a USB drive on their own, so a scan before you open files protects you.
Is scareware a virus?
Scareware is a fake security warning or fake antivirus program that claims your computer is infected, so that you pay or call. It is often only a web page, and closing the browser and blocking the site’s notifications removes it.
Does antivirus stop all of these infections?
Antivirus stops many known threats, including the built-in Microsoft Defender, but it cannot stop you from allowing a program that you chose to run. New malware also gets past it for a while, so careful downloads matter as much as the scanner.
The bottom line
Most infections come in through a file you opened, a program you installed or a permission you allowed, not through some hidden attack. Check what you installed around the day the problem began, remove it, and change the habit that let it in. If you need help with a cleanup, ask the volunteers in our free malware removal forum.
Join the discussion
0 commentsShare your experience or ask a question about this article.
Discussion
Start the conversation
Have a question or something useful to share? Add the first comment.