Official statement
Other statements from this video 5 ▾
- 1:08 Comment Google Safe Browsing détecte-t-il les malwares et impacte-t-il votre référencement ?
- 1:38 Pourquoi les sites légitimes redirigent-ils parfois vers des pages malveillantes sans que vous le sachiez ?
- 2:40 Comment vérifier si un site est vraiment infecté par des malwares selon Google ?
- 5:48 Wget et cURL suffisent-ils vraiment pour détecter toutes les redirections malveillantes ?
- 6:18 Comment Google Webmaster Tools détecte-t-il les malwares et faut-il vraiment compter sur sa révision ?
Google recommends never opening infected pages in a browser during a malware investigation. Examining the source code directly via server access helps understand how the malware operates without risking re-execution or spreading. This precaution reduces the risk of compromising your work environment and ensures a cleaner forensics analysis.
What you need to understand
Why does Google advise against opening infected pages in a browser?
When an SEO malware infects a site, it often executes client-side through JavaScript or server-side via injected PHP. Opening the page in a browser triggers these potentially dangerous scripts. The main risk: contaminating your own machine, capturing your session cookies, or worse, spreading the infection if you are logged into the server via FTP or SSH.
Modern SEO malwares detect user-agent and IP to adapt their behavior. When facing Googlebot, they display pharmaceutical spam or cloaking. When facing a regular visitor, they redirect to malicious sites. Analyzing via browser gives a partial view and exposes your diagnostic environment.
What investigation method does Google favor?
Direct access to the server via SSH, SFTP, or the file manager provided by your host allows you to examine the source code without executing it. You can grep the PHP files for suspicious functions like base64_decode, eval, gzinflate, or preg_replace with the /e modifier. This forensic approach reveals backdoors, hidden files, and injections in the .htaccess.
Command line tools like find, grep, and diff become your best allies. Comparing files from the infected site with a clean CMS installation quickly detects suspicious changes. This method bypasses obfuscation techniques that only trigger in a browser execution context.
How does the malware hide from investigators?
Evading techniques are sophisticated. A malware can check the HTTP referer, browsing history, or even the time of day before activating. Some scripts only inject content if the request comes from a search engine, rendering the infection invisible in direct browsing.
Database injections often escape file analysis. A malware can modify the wp_posts or wp_options tables under WordPress to inject malicious JavaScript. Examining server-side source code must therefore include a dump and analysis of the database, not just files.
- Never open a suspicious page in your main browser, even in private browsing
- Favor SSH/SFTP access to examine source files without executing them
- Use grep and find to detect dangerous PHP functions: eval, base64_decode, exec, system
- Compare site files with a clean CMS installation to identify changes
- Also analyze the database: malware often injects code into text fields
SEO Expert opinion
Is this recommendation actually followed in practice?
Let's be honest: the majority of malware audits I've observed start by opening the page in Chrome. Rushed SEOs want to see immediately what Google indexes, understand the cloaking, and check if the spam displays. However, this approach exposes them to real risks, especially if the malware targets WordPress admin accounts or FTP sessions.
Serious agencies use dedicated virtual machines or cloud sandboxes to investigate safely. But this infrastructure comes at a cost. Freelancers and small teams often navigate without a safety net. The issue: a sophisticated malware can detect a VM and remain dormant, skewing the analysis.
What limitations does command-line analysis have?
Server access requires technical skills that not all SEOs possess. Grep and regex are powerful but require practice. A polymorphic malware that changes its signature with each infection escapes classic patterns. Nested or hex-encoded obfuscated injections require multiple decoding passes.
Some shared hosts limit SSH access or prohibit executing system commands. In these cases, investigation becomes seriously complicated. GUI tools like Wordfence or Sucuri scan files but sometimes miss sophisticated injections hiding in system files or temporary directories. [To be confirmed]: Google does not specify how to proceed when server access is restricted or impossible.
When does this rule not suffice?
Pure client-side malwares, which execute only in injected JavaScript after HTML rendering, sometimes require dynamic analysis. A headless browser in a controlled environment then becomes essential. Malicious code can be injected via compromised CDNs or malicious ads, invisible in the initial source code.
Attacks by external negative SEO, such as spam backlinks or content scraping, leave no trace on your server. The investigation must then focus on Google Search Console, backlink tools, and duplicate content alerts. Google's advice strictly applies to on-site infections, not external threats.
Practical impact and recommendations
What concrete actions should be taken when malware is suspected?
First reflex: do not touch anything in a browser. Immediately access your host via the administration panel and download a complete copy of the site and database. This forensic backup will allow you to analyze at your leisure without risking worsening the situation.
Use the command line to search for suspicious patterns. A simple grep -r "eval(base64_decode" . in the root directory often reveals PHP injections. Compare file modification dates: a modified index.php from last week when your CMS hasn't been updated smells bad.
What critical mistakes must be avoided?
Never delete a suspicious file without identifying all backdoors. Modern malwares install multiple simultaneous backdoors: cleaning an infected file without removing the initial infection vector guarantees reinfection within 48 hours. I've seen sites cleaned fifteen times that reinfected because a compromised upload.php file remained active.
Avoid automatic cleaning tools without understanding what they do. Some security plugins delete legitimate files or break functionalities. Manual analysis takes time but remains the most reliable. And above all, never reconnect via FTP or WordPress admin from a potentially compromised machine.
How can you verify that the cleaning is complete and lasting?
After cleaning, change all passwords: FTP, SSH, database, CMS admin, and host. A malware may have captured your credentials. Install a monitoring plugin that alerts on any file modification. Check for suspicious cron jobs that could re-inject code at regular intervals.
Submit a reconsideration request in Google Search Console once the site is clean, documenting the corrective actions taken. Google can take several weeks to lift a manual penalty for malware. Monitor your rankings and organic traffic: a sudden drop post-cleaning may signal reinfection or collateral damage from the cleaning.
- Access the server via SSH/SFTP, never via browser for a suspicious page
- Backup the entire site and database before any intervention
- Use grep to search for eval, base64_decode, gzinflate, preg_replace in PHP files
- Compare files with a clean CMS installation to identify changes
- Change all passwords after cleaning: FTP, SSH, database, admin
- Submit a reconsideration request in Google Search Console with detailed documentation
❓ Frequently Asked Questions
Peut-on utiliser un navigateur en mode navigation privée pour investiguer un malware ?
Quels sont les fichiers PHP les plus souvent ciblés par les malwares SEO ?
Comment différencier un fichier légitime obfusqué d'un malware ?
Un malware peut-il survivre à une réinstallation complète du CMS ?
Combien de temps Google met-il à lever une pénalité après nettoyage d'un malware ?
🎥 From the same video 5
Other SEO insights extracted from this same Google Search Central video · duration 7 min · published on 30/10/2013
🎥 Watch the full video on YouTube →
💬 Comments (0)
Be the first to comment.