使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
防止感染恶意软件
要想避免遭受恶意软件的侵害,就需要时刻保持警惕。本文中包含关于防止感染恶意软件的提示和建议。但是,这些提示和建议并非面面俱到,因此 Google 建议网站所有者进行更彻底全面的研究。
监控网站的运行状况
Search Console 中的许多功能可以帮助您发现潜在问题。例如:
-
使用
site:
搜索运算符在 Google 上进行搜索,可以查看 Google 在您的网站上发现了哪些网页。建议定期执行此操作,了解是否有人暗中在您的网站上插入了非预期的网页或内容。如果您发现网站上有未知网页或并非自己创作的内容,表明网站可能已遭到黑客入侵。如果您不熟悉 site:
搜索运算符,就只要知道使用该运算符可将搜索范围限制为搜索特定网站。例如,执行 site:developers.google.com
搜索将只返回来自 Google Developers 网站的结果。
-
“安全问题”报告会显示 Google 在您网站上发现的任何被黑网页,以及有关如何解决该问题的说明。
-
如果 Google 在您的网站上检测到恶意软件,您将会在 Search Console 的消息面板中看到通知。为了确保您能及时收到通知,您可以进行设置,让系统将消息转发到您的电子邮件账号中。
安全核查清单
除了定期监控您的网站,我们还建议:
所有网站所有者
-
选用安全的密码。Google 账号指南非常有用。
-
选择第三方内容提供方时要非常谨慎。确保您网站上的第三方应用和广告来自可信和合法的来源。可信和合法的来源会在其网站上提供支持和联系信息。
-
与您的托管公司或发布平台联系以获取支持。
大多数公司都有反应迅速的支持团队和/或安全性网页可提供帮助。如果安全网页或网站提供 RSS Feed,请订阅这些 Feed,以确保您了解最新情况。
-
确保所有计算机安全无虞。尤其是在创建网站时,请确保本地工作站安装了最新版本的软件,没有受到病毒、特洛伊木马或类似恶意软件的感染,并且安装了最新版本的防病毒软件。
有权访问服务器的网站所有者
如果您是 Search Console 用户,并且您的网站存在持续出现或无法解决的安全问题,请告诉我们。
报告安全问题
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-08-04。
[null,null,["最后更新时间 (UTC):2025-08-04。"],[[["\u003cp\u003eThis guide offers essential tips and best practices for preventing malware infection on your website.\u003c/p\u003e\n"],["\u003cp\u003eGoogle Search Console provides valuable tools, such as the Security Issues report, for monitoring your site's health and identifying potential problems.\u003c/p\u003e\n"],["\u003cp\u003eImplementing strong security measures like choosing robust passwords, carefully selecting third-party content, and regularly updating software is crucial for website owners.\u003c/p\u003e\n"],["\u003cp\u003eFor website owners with server access, securing server configurations, monitoring log files, and staying informed about the latest security updates are vital steps in safeguarding your site.\u003c/p\u003e\n"],["\u003cp\u003eIf you encounter persistent security issues despite implementing these recommendations, Google provides a channel to report them.\u003c/p\u003e\n"]]],["To prevent malware, website owners should monitor site health using Search Console features like the `site:` operator and Security Issues report. Key actions include choosing strong passwords, carefully vetting third-party content, and contacting hosting support. For those with server access, regular software updates, server configuration checks, log file monitoring, and vulnerability checks are crucial. Utilizing secure protocols like SSH/SFTP and staying informed on the latest security news are also recommended.\n"],null,["# How To Prevent Malware Infection | Google Search Central\n\nPreventing malware infection\n============================\n\n\nThe price of freedom from malware is eternal vigilance. This article contains tips and\npointers for preventing malware infection. However, it is by no means exhaustive, and Google\nencourages website owners to conduct more thorough research as well.\n\nMonitoring your site health\n---------------------------\n\n\nMany of the features of Search Console can help you identify potential problems. For example:\n\n- Try a search on Google with the [`site:` search operator](https://support.google.com/websearch/answer/2466433) to see what pages Google has found on your site. It's always a good idea to do this periodically to see whether anyone has snuck unexpected pages or content on your site. If you see unknown pages on your site, or topics that you didn't write, you may have been hacked. If you're not already familiar with the `site:` search operator, it's a way for you to restrict your search to a specific site. For example, the search [`site:developers.google.com`](https://www.google.com/search?q=site%3Asite:developers.google.com) will return results only from the Google Developers site.\n- The [Security Issues report](https://support.google.com/webmasters/answer/9044101) shows any hacked pages that Google has identified on your site, and instructions on how to fix the problem.\n- If Google detects malware on your site, you'll see a notification in the [message panel in\n Search Console](https://support.google.com/webmasters/answer/9388335). To ensure that you're notified quickly, you can have your messages [forwarded to your email account](https://support.google.com/webmasters/answer/140528).\n\nSecurity checklist\n------------------\n\nIn addition to monitoring your site regularly, we also recommend the following:\n\n### All website owners\n\n- **Choose good passwords.** The [Google account guidelines](https://support.google.com/accounts/answer/32040) are helpful.\n- **Pick third-party content providers very carefully.** Make sure that third-party apps and ads on your site are from trusted and legitimate sources. A trusted and legitimate source provides support and contact information on their website.\n- **Contact your hosting company or publishing platform for support.** Most companies have helpful and responsive support groups and/or security pages. If a security page or site has an RSS feed, subscribe to it to make sure you stay up to date.\n- Keep all of your computers safe. Especially when working on a website, make sure that your local workstation has up-to-date software, is clean from viruses, trojans, or similar malware and has recently updated anti-virus software installed.\n\n### Website owners with server access\n\n- **Check your server configuration.** Apache has some [security configuration tips](https://httpd.apache.org/docs/2.4/misc/security_tips.html) on their site and Microsoft has some [tech center resources for IIS](https://www.google.com/search?q=microsoft+iis+security+best+practices) on theirs. Some of these tips include information on directory permissions, server-side includes, authentication, and encryption.\n- **Make a backup copy of your `.htaccess` file** (or other access control mechanisms depending on your website platform). Use your backup file to recover if the following fails. Be sure to delete the backup file once you are finished.\n- **Stay up-to-date with the latest software updates and patches.** There are lots of tools that make building a website easy, but each one adds some risk of being exploited. A common pitfall for many website owners is to install a forum or blog on their website and then forget about it. Much like taking your car in for a tune-up, it's important to make sure you have all the latest updates for any software program you have installed. Make a list of all the software and plug-ins used for your website, and keep track of the version numbers and updates. Even if you're diligent and keep all your website components updated, you may still be vulnerable if your web hoster has not installed the most recent operating system patches. This problem affects not only small sites; there have been warnings on the websites of banks, sports teams, and corporate and government websites.\n- **Keep an eye on your log files.** Making this a habit has many great benefits, one of which is added security. For example, unfamiliar URL parameters (like `=http:` or `=//`) or spikes in traffic to redirect URLs on your site may indicate that a hacker is exploiting [open redirects](/search/docs/advanced/guidelines/sneaky-redirects). Also, bear in mind that hackers often try to alter log files. Take measures to protect these files from attack. For example, you can move these files from their default location, making it harder for hackers to find them.\n- **Check your site for common vulnerabilities.** Avoid having directories with open permissions. This is like leaving the front door to your home wide open.\n\n\n Also check for any\n [XSS](https://www.owasp.org/index.php/Cross_Site_Scripting)\n (cross-site scripting) and\n [SQL injection](https://owasp.org/www-community/attacks/SQL_Injection) vulnerabilities.\n- **Use secure protocols.** Google recommends using SSH and SFTP for data transfer, rather than plain text protocols such as telnet or FTP. SSH and SFTP use encryption and are much safer.\n- **Keep up to date on the latest security news.** The [Google Security Blog](https://security.googleblog.com/) provides useful information about online security and safety, as well as pointers to other resources. The government site [US-CERT](https://us-cert.cisa.gov/) (United States Computer Emergency Readiness Team) provides technical security alerts and tips.\n\n\nIf you're a Search Console user and are having trouble with persistent or unfixable security issues on your site, you can let us know.\n\n[Report a security issue](https://support.google.com/webmasters/contact/report_security_issues)"]]