Files
kefu/im/搜索引擎蜘蛛放行记录-2026-09-02.md
2026-09-03 08:38:17 +08:00

64 lines
3.2 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 搜索引擎蜘蛛放行记录
日期:2026-09-02
服务器:`47.106.181.28`
站点:`www.bchongw.com`、`m.bchongw.com`
## 处理结果
系统防火墙不再对 80/443 端口执行可能误伤搜索引擎蜘蛛的单 IP 并发连接拒绝。宝塔免费 WAF 继续拦截普通访客的攻击请求,但对已经通过 WAF IP 列表或双向 DNS 识别的搜索引擎蜘蛛直接放行。
## 已实施改动
1. 删除运行时 iptables 中以下两条临时 Web 封锁规则:
- 单 IP 同时连接超过 12 个时重置 80/443 连接的 `xxiaw-web-connlimit`。
- 使用临时 IP 集合封锁 80 端口的 `txiaw-confirmed-abuse-expiring`。
2. 检查 firewalld 永久规则和常见启动配置,以上两条规则没有持久化副本,不会在重启后恢复。
3. 保留宝塔 WAF,对真实蜘蛛使用已有 IP 库或双向 DNS 识别。动态 IP 必须先反向解析到搜索引擎官方域名,再正向解析回原始访问 IP;只有识别成功后才绕过 WAF,单独伪造 User-Agent 或 PTR 域名不能绕过攻击检测。
4. 补齐以下蜘蛛标识:
- 百度:`Baiduspider`
- 360:`360Spider`
- 好搜/so:`HaosouSpider`
- 搜狗:`Sogou web spider`、`Sogou inst spider`
- 神马:`YisouSpider`,反向域名 `crawl.sm.cn`
- 必应:`bingbot`、`msnbot`、`BingPreview`、`adidxbot`、`MicrosoftPreview`
- Google:`Googlebot`、`GoogleOther`、`Google-InspectionTool`、`AdsBot-Google`、`Storebot-Google` 等包含 Google 标识的官方抓取 UA
5. 更新桌面站和移动站的 `robots.txt`,明确允许上述搜索引擎抓取全站;继续拒绝 SemrushBot、SemrushBot-SA 和 Amazonbot 这些非搜索用途的高消耗商业爬虫。
## 验证结果
| 外网模拟抓取 UA | 首页结果 |
|---|---|
| Baiduspider | HTTP 200 |
| 360Spider | HTTP 200 |
| HaosouSpider | HTTP 200 |
| Sogou web spider | HTTP 200 |
| YisouSpider | HTTP 200 |
| bingbot | HTTP 200 |
| msnbot | HTTP 200 |
| Googlebot | HTTP 200 |
| GoogleOther | HTTP 200 |
最近各 20 MB 桌面站和移动站访问日志中,真实搜索蜘蛛的主要成功请求如下:必应 252 次、Google 90 次、百度 49 次、搜狗 11 次、神马 1 次。没有发现蜘蛛请求返回 403、429、444 或 503。日志中的少量 404 来自不存在的旧页面或静态资源,不是防火墙拦截。
普通 SQL 注入探针和伪造 Googlebot UA 的 SQL 注入探针均返回 HTTP 403,说明攻击者不能仅靠伪造蜘蛛 User-Agent 绕过 WAF。
## 回滚备份
本次修改前的 WAF 文件、robots.txt、iptables 和 firewalld 规则已备份到:
`/www/backup/search-bot-firewall-fix-20260902-090109`
双向 DNS 校验加固前的 WAF 文件已备份到:
`/www/backup/search-bot-dns-hardening-20260902-090409`
## 识别依据
- [Google 官方:验证 Googlebot](https://developers.google.com/search/docs/crawling-indexing/googlebot)
- [Bing 官方:验证 Bingbot](https://www.bing.com/webmasters/help/how-to-verify-bingbot-3905dc26)
- [百度官方:正确识别百度蜘蛛](https://ziyuan.baidu.com/college/articleinfo?id=1198)
- [搜狗官方:搜狗蜘蛛说明](https://help.sogou.com/spider.html)
- [360 官方:robots 与蜘蛛 UA](https://www.so.com/help/help_3_2.html)