Scanning a website for malware: what we look for and how it works
How the scan works
An infected site rarely shows malicious code to everyone. The owner and regular visitors see normal pages, while someone arriving from search on a phone is redirected to a scam site, and a search bot is served a page with spam links. That is why the tool requests the page three times — as a browser, a search bot and a mobile visitor from search — and compares the responses.
Then the code of the page and its scripts is examined: inline scripts are checked in full, external files are downloaded and checked for strong signs of infection. Each finding comes with a code fragment and the place where it was found.
What exactly is checked
Obfuscated code: a script that decodes a string and executes it right away is the main way to hide a malicious injection. Hidden iframes: an invisible iframe from another site loads foreign content for the visitor. Redirects: jumps to other sites via script or meta refresh, especially ones depending on the traffic source.
Miners that load the visitor’s CPU. SEO spam: invisible blocks with links to third-party sites. Scripts loaded from IP addresses and high-risk domain zones. Forms that send passwords to a third-party site. References to domains from known mass-infection campaigns.
What an online scan cannot see
From the outside only the response to a request is visible. Files on the server are out of reach, so a backdoor used to control the site, a spam-mailing script or a stolen database will not be detected. Nor will an infection that fires once a day, only in a certain country or after user actions.
So a “no signs of infection found” verdict is a good sign, not a guarantee. If in doubt, scan the files with your hosting’s antivirus and check the security reports in Google Search Console.