# ================================================ # www.zyglz.com - Robots.txt 文件 # 基于日志分析的安全优化版 # 生成日期:2026-01-05 # 站点域名:https://www.zyglz.com(zyglz.com) # ================================================ # ================================================ # 第一部分:基础规则 - 针对正常搜索引擎 # ================================================ # 允许所有正规搜索引擎抓取 User-agent: * Disallow: /?and%2F Disallow: /?and/ Disallow: /*.php?and%2F Disallow: /*.html?and%2F Disallow: /?and%2Fmoban Disallow: /*?and%2Fmoban Disallow: /index.php?and%2F Disallow: /index.php/blog/archives/*?and%2F # ================================================ # 第二部分:敏感目录保护 # 根据日志分析,这些目录经常被扫描 # ================================================ # WordPress相关目录(虽然你的站点不是WP,但频繁被扫描) Disallow: /wp-admin/ Disallow: /wp-content/ Disallow: /wp-includes/ Disallow: /wp-login.php Disallow: /wp-config.php Disallow: /wp-config-sample.php # 管理后台和敏感目录 Disallow: /admin/ Disallow: /administrator/ Disallow: /backup/ Disallow: /database/ Disallow: /config/ Disallow: /logs/ Disallow: /tmp/ Disallow: /temp/ # 源代码和配置文件 Disallow: /.git/ Disallow: /.svn/ Disallow: /.env Disallow: /.htaccess Disallow: /.htpasswd Disallow: /web.config # 上传目录(限制爬虫抓取) Disallow: /uploads/ Disallow: /upload/ Disallow: /files/ Disallow: /images/uploads/ # ================================================ # 第三部分:针对恶意爬虫的特殊规则 # 根据日志中的恶意User-Agent制定 # ================================================ # 针对 newsai 恶意爬虫(日志中大量出现) User-agent: *newsai* User-agent: Chrome/140.0.0.0 newsai Disallow: / # 针对异常的扫描器 User-agent: sqlmap User-agent: nikto User-agent: Acunetix User-agent: Netsparker User-agent: Appscan User-agent: havij User-agent: zmeu User-agent: pangolin Disallow: / # 针对目录扫描工具 User-agent: dirbuster User-agent: gobuster User-agent: wfuzz User-agent: ffuf Disallow: / # 针对端口扫描工具 User-agent: nmap User-agent: masscan User-agent: nessus User-agent: openvas Disallow: / # ================================================ # 第四部分:特定搜索引擎优化 # ================================================ # Google Bot User-agent: Googlebot User-agent: Googlebot-Image User-agent: Googlebot-News User-agent: Googlebot-Video Disallow: /?and%2F Disallow: /?and%2Fmoban Disallow: /wp-admin/ Disallow: /wp-content/ Disallow: /wp-includes/ Disallow: /admin/ Disallow: /.git/ Crawl-delay: 2 Allow: /index.php/blog/archives/ Allow: /index.php/tag/ Allow: /index.php/category/ Allow: /index.php/author/ Allow: /index.php/feed/ Allow: /index.php/archive.html # Bing Bot User-agent: bingbot User-agent: msnbot User-agent: msnbot-media Disallow: /?and%2F Disallow: /?and%2Fmoban Disallow: /wp-admin/ Disallow: /wp-content/ Disallow: /wp-includes/ Crawl-delay: 3 Allow: /index.php/blog/archives/ Allow: /index.php/tag/ Allow: /index.php/category/ # 百度蜘蛛 User-agent: Baiduspider User-agent: Baiduspider-image User-agent: Baiduspider-video User-agent: Baiduspider-news Disallow: /?and%2F Disallow: /?and%2Fmoban Disallow: /wp-admin/ Disallow: /wp-content/ Disallow: /wp-includes/ Disallow: /admin/ Crawl-delay: 5 Allow: /index.php/blog/archives/ Allow: /index.php/tag/ Allow: /index.php/category/ # 搜狗蜘蛛 User-agent: Sogou User-agent: sogou spider User-agent: Sogou web spider Disallow: /?and%2F Disallow: /?and%2Fmoban Disallow: /wp-admin/ Disallow: /wp-content/ Disallow: /wp-includes/ Crawl-delay: 4 Allow: /index.php/blog/archives/ # 360蜘蛛 User-agent: 360Spider User-agent: HaosouSpider Disallow: /?and%2F Disallow: /?and%2Fmoban Disallow: /wp-admin/ Disallow: /wp-content/ Disallow: /wp-includes/ Crawl-delay: 4 # Yandex User-agent: Yandex User-agent: YandexBot User-agent: YandexImages Disallow: /?and%2F Disallow: /?and%2Fmoban Disallow: /wp-admin/ Disallow: /wp-content/ Disallow: /wp-includes/ Crawl-delay: 3 # ================================================ # 第五部分:其他搜索引擎和工具 # ================================================ # 必应、雅虎等 User-agent: Slurp User-agent: Yahoo! Slurp User-agent: Yahoo! Slurp China Disallow: /?and%2F Disallow: /?and%2Fmoban Disallow: /wp-admin/ Disallow: /wp-content/ Disallow: /wp-includes/ Crawl-delay: 3 # DuckDuckGo User-agent: DuckDuckBot User-agent: DuckDuckGo-Favicons-Bot Disallow: /?and%2F Disallow: /?and%2Fmoban Disallow: /wp-admin/ Disallow: /wp-content/ Disallow: /wp-includes/ # 头条字节跳动 User-agent: Bytespider Disallow: /?and%2F Disallow: /?and%2Fmoban Disallow: /wp-admin/ Disallow: /wp-content/ Disallow: /wp-includes/ Crawl-delay: 5 # SEO工具(限制频率) User-agent: AhrefsBot User-agent: SemrushBot User-agent: Mozilla/5.0 (compatible; DotBot/1.2) User-agent: DotBot User-agent: MJ12bot User-agent: megaidx Disallow: /?and%2F Disallow: /?and%2Fmoban Disallow: /wp-admin/ Disallow: /wp-content/ Disallow: /wp-includes/ Crawl-delay: 10 # AI爬虫 User-agent: ClaudeBot User-agent: anthropic User-agent: GPTBot User-agent: ChatGPT-User Disallow: /?and%2F Disallow: /?and%2Fmoban Crawl-delay: 5 # ================================================ # 第六部分:特定文件类型限制 # 根据日志中的攻击模式制定 # ================================================ # PHP文件(限制特定恶意文件) Disallow: /*.php?* Disallow: /admin.php Disallow: /file.php Disallow: /bless.php Disallow: /ioxi-o.php Disallow: /aa.php Disallow: /xmrlpc.php Disallow: /class.php Disallow: /goods.php Disallow: /info.php Disallow: /adminfuns.php Disallow: /wp-good.php # 特定目录下的PHP文件 Disallow: /wp-includes/*.php Disallow: /wp-content/*.php Disallow: /uploads/*.php Disallow: /images/*.php # 配置文件 Disallow: /*.ini Disallow: /*.conf Disallow: /*.config Disallow: /*.bak Disallow: /*.old Disallow: /*.sql Disallow: /*.log # ================================================ # 第七部分:网站地图和抓取频率 # ================================================ # 站点地图(根据你的实际sitemap调整) Sitemap: https://bxu2442210264.my3w.com/sitemap.xml Sitemap: https://zyglz.com/sitemap.xml # RSS订阅源 Sitemap: https://bxu2442210264.my3w.com/index.php/feed/rss/ Sitemap: https://zyglz.com/index.php/feed/rss/ # 网站主要入口 # 根据日志,你的主要页面是: # /index.php/blog/archives/*.html # /index.php/tag/* # /index.php/category/* # /index.php/author/* # ================================================ # 第八部分:特殊规则 - 基于日志分析 # ================================================ # 针对日志中的特定攻击模式 # 日志显示大量 ?and%2Fmoban%2F*.html= 的攻击 Disallow: /*?and%2Fmoban%2F Disallow: /*?and%2F*.html= Disallow: /*?replyTo=*and%2F # 针对特定路径的扫描 Disallow: /?and%2F072136rp9ua0ddl.html= Disallow: /?and%2F434668f00ldsw.html= Disallow: /?and%2F79862341mvkmw3.html= Disallow: /?and%2F791168d521.html= Disallow: /?and%2Fmoban%2F476332yar09.html= Disallow: /?and%2Fmoban%2F790153tjmy7ihmxu.html= # 针对特定IP的请求模式(如果知道是恶意IP) # 日志中频繁出现的恶意模式 # ================================================ # 第九部分:抓取延迟设置 # 减少服务器压力 # ================================================ # 默认抓取延迟 Crawl-delay: 3 # 针对大量请求的爬虫增加延迟 User-agent: * Disallow: Crawl-delay: 5 # ================================================ # 第十部分:注释和说明 # ================================================ # 本robots.txt基于以下日志分析结果制定: # 1. 主要攻击模式:?and%2Fmoban%2F*.html= # 2. 主要恶意爬虫:newsai (伪装为Chrome/140.0.0.0) # 3. 频繁扫描目录:/wp-admin/, /wp-content/, /wp-includes/ # 4. 频繁扫描文件:各种admin*.php文件 # 5. 源码泄露扫描:/.git/, /.env等 # 注意事项: # 1. 本配置允许正规搜索引擎抓取正常内容 # 2. 禁止恶意爬虫和扫描器访问 # 3. 设置合理的抓取延迟保护服务器 # 4. 定期根据日志分析更新本文件 # 更新建议: # 每月检查一次访问日志,更新恶意爬虫列表 # 关注阿里云流量统计,调整Crawl-delay值 # 如有新攻击模式出现,及时添加Disallow规则 # 技术支持: # 如需调整,请参考最新访问日志分析结果