<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <title>沙尘612</title>
  
  <subtitle>记录技术、软件与日常</subtitle>
  <link href="https://zhaogb612.github.io/atom.xml" rel="self"/>
  
  <link href="https://zhaogb612.github.io/"/>
  <updated>2026-11-22T13:55:00.000Z</updated>
  <id>https://zhaogb612.github.io/</id>
  
  <author>
    <name>沙尘612</name>
    
  </author>
  
  <generator uri="https://hexo.io/">Hexo</generator>
  
  <entry>
    <title>黎曼猜想获 Lean 社区认证：Claude 参与的人机合作证明</title>
    <link href="https://zhaogb612.github.io/posts/b7e9d2f4.html"/>
    <id>https://zhaogb612.github.io/posts/b7e9d2f4.html</id>
    <published>2026-11-22T13:40:00.000Z</published>
    <updated>2026-11-22T13:55:00.000Z</updated>
    
    <content type="html"><![CDATA[<h1 id="黎曼猜想获-Lean-社区认证：Claude-参与的人机合作证明，24-小时通过四道关卡">黎曼猜想获 Lean 社区认证：Claude 参与的人机合作证明，24 小时通过四道关卡</h1><p>数学界的十一月末，被一份 61.6GB 的代码点燃了。</p><p>故事的起因只有四页纸。11 月 20 日，Anthropic 的数学家 Levent Alpöge 在自己主页贴出几页说明（<a href="http://alpo.ge/remark.pdf%EF%BC%89%EF%BC%8C%E5%AE%A3%E5%B8%83%E4%BB%96%E4%B8%8E">alpo.ge/remark.pdf），宣布他与</a> AI 模型 Claude 合作找到了黎曼猜想的证明，完整证明以约 1700 万行 Lean 形式化代码的形式公开。</p><p>随后发生的事情，比证明本身更让人吃惊：24 小时内，Lean 与 Mathlib 社区发布联合声明，白纸黑字地写道——“我们完全确信 Alpöge 对黎曼猜想的证明是正确的，并祝贺他取得这一成就。”</p><p>这是数学史上第一次，一个千禧年难题级别的结论，在&quot;人类审稿&quot;之前先被机器判了&quot;通过&quot;。这篇文章按新闻的要素把来龙去脉拆开讲，也会告诉你哪些部分其实还没有完成。</p><h2 id="一、事件全貌：一条新闻需要的七要素">一、事件全貌：一条新闻需要的七要素</h2><table><thead><tr><th>要素</th><th>内容</th></tr></thead><tbody><tr><td>谁 (Who)</td><td>Levent Alpöge，土耳其裔美国数学家，供职于 AI 公司 Anthropic</td></tr><tr><td>何时 (When)</td><td>2026-11-20 公开证明；2026-11-21 Lean/Mathlib 社区发出联合认证声明</td></tr><tr><td>何地 (Where)</td><td>说明发布在个人主页 <a href="http://alpo.ge">alpo.ge</a>，配套代码托管在 GitHub（Deicyde/riemann-hypothesis）</td></tr><tr><td>何事 (What)</td><td>黎曼猜想的完整证明，以约 1700 万行 Lean 形式化代码呈现</td></tr><tr><td>如何 (How)</td><td>人类确定研究方向，Claude 推进证明，Lean 证明内核逐行核验</td></tr><tr><td>为什么 (Why)</td><td>1859 年提出的百年级难题，与素数分布直接相关，2000 年列入千禧年七大难题</td></tr><tr><td>然后呢</td><td>克雷数学研究所尚未认定；数学界公认仍需多年消化理解</td></tr></tbody></table><h2 id="二、一条-24-小时的完整时间线">二、一条 24 小时的完整时间线</h2><table><thead><tr><th>时间</th><th>事件</th></tr></thead><tbody><tr><td>2026-09-17</td><td>黎曼诞辰 200 周年</td></tr><tr><td>2026-11-20</td><td>Alpöge 在个人主页发布 remark.pdf 与 Lean 证明代码</td></tr><tr><td>2026-11-20</td><td>科学美国人、The Verge、Science、卫报、SiliconANGLE 等外媒密集报道</td></tr><tr><td>2026-11-20</td><td>陶哲轩当天发布博客：数学界消化这份证明仍需相当长时间</td></tr><tr><td>2026-11-20 至 21</td><td>社区数十人独立复现编译，导出的证明文件完全一致</td></tr><tr><td>2026-11-21 13:55 (UTC)</td><td>Lean 与 Mathlib 社区发布联合声明，宣布命题表述与证明均正确</td></tr><tr><td>2026-11-22 04:35 (UTC)</td><td>MIT 教授 Andrew Sutherland 更新独立核验页，全部检查通过</td></tr><tr><td>2026-11-22</td><td>澎湃新闻、第一财经等国内媒体跟进报道</td></tr></tbody></table><p>另注：11 月 20 日至 23 日，&quot;Riemann 200&quot;黎曼诞辰 200 周年学术研讨会正在深圳举行，Alpöge 的发布恰好落在会议期间。</p><h2 id="三、黎曼猜想是什么：一个-167-年的老问题">三、黎曼猜想是什么：一个 167 年的老问题</h2><p>1859 年，德国数学家波恩哈德·黎曼发表了一篇不到 10 页的论文《论小于给定数值的素数个数》。论文里他顺手提出了一个猜想，关于黎曼 ζ 函数非平凡零点的分布——从此&quot;顺手&quot;折磨了数学界 167 年。</p><p>看不懂定义没关系，先看一张速查表：</p><table><thead><tr><th>概念</th><th>一句话解释</th></tr></thead><tbody><tr><td>黎曼 ζ 函数</td><td>由无穷级数定义、再解析延拓到整个复平面的复变函数</td></tr><tr><td>零点</td><td>使 ζ(s) = 0 的复数 s</td></tr><tr><td>平凡零点</td><td>负偶数 -2、-4、-6……，早就被证明，不构成难点</td></tr><tr><td>非平凡零点</td><td>其余零点，全部落在带状区域 0 小于 Re(s) 小于 1 内</td></tr><tr><td>临界线</td><td>实部等于 1/2 的那条直线</td></tr><tr><td>黎曼猜想</td><td>所有非平凡零点的实部都等于 1/2，即全部落在临界线上</td></tr><tr><td>为什么重要</td><td>零点的分布直接决定素数的分布规律，牵动数论、密码学等一大片领域</td></tr></tbody></table><p>它的地位有多高：2000 年，克雷数学研究所把它列入&quot;千禧年七大难题&quot;，悬赏 100 万美元。一个多世纪里，数学家攻克了大量局部问题（证明非平凡零点无穷多、计算海量零点、证明临界带内的零点占比等），但没有任何一个完整证明获得广泛认可。</p><h2 id="四、主角：Levent-Alpoge-是谁">四、主角：Levent Alpöge 是谁</h2><p>Alpöge 是土耳其裔美国数学家，研究方向是数论。他目前供职于 Anthropic——没错，就是 Claude 背后的那家公司。外媒（科学美国人、卫报）都特意强调了他的双重身份：既是受过严格训练的数学家，又是 AI 公司的研究员。</p><p>这个身份在新闻里是最容易被误读的一点：这并非&quot;Anthropic 官方宣布攻克黎曼猜想&quot;。Anthropic 公司层面没有发布任何公告，也没有参与核验流程；一切声明都来自 Alpöge 个人以及独立的数学社区。</p><h2 id="五、证明是怎么-做-出来的：人类定方向，Claude-补盲区">五、证明是怎么&quot;做&quot;出来的：人类定方向，Claude 补盲区</h2><p>Alpöge 此前披露过与 Claude 的协作方式，和&quot;让 AI 写代码&quot;完全是两回事（据第一财经报道）：</p><table><thead><tr><th>环节</th><th>主导者</th><th>具体内容</th></tr></thead><tbody><tr><td>研究方向</td><td>人类</td><td>Alpöge 引导模型寻找合适的数学切入方向</td></tr><tr><td>证明推进</td><td>人类 + Claude</td><td>Claude 在推进过程中展现出让他惊讶的能力</td></tr><tr><td>收尾阶段</td><td>Claude</td><td>接近终点时，Claude 的进展速度远远超过了他本人</td></tr><tr><td>最终核验</td><td>机器</td><td>全部推理写成 Lean 代码，由证明内核逐行检查</td></tr></tbody></table><p>一个关键事实是：目前公开的人机协作记录，无法准确区分哪些思想是 Claude 独立提出的、哪些来自数学家的指导。这个问题短时间内不会有明确答案。</p><p>从数学内容上看，陶哲轩 11 月 20 日的博客初步判断：证明可能运用了朗兰兹纲领、算术几何等现代数学的重要成果。也就是说，这不是&quot;旧方法的堆砌&quot;，很可能包含此前人类没有找到的新思想——这也是后续最值得关注的部分。</p><h2 id="六、Lean-是什么：为什么-机器说对-权重这么高">六、Lean 是什么：为什么&quot;机器说对&quot;权重这么高</h2><p>要理解这次认证的分量，得先分清两件事：AI 生成一段自然语言&quot;证明&quot;（看起来合理，但可能全错），和 AI 生成一段能被证明内核逐行检查的形式化代码（原则上不可能蒙混过关）。</p><p>Lean 是一种交互式定理证明器。数学定义、定理、推导全部写成形式化代码，由 Lean 的证明内核按形式逻辑规则逐步验证。任何一步推导不成立，代码就无法通过编译。换句话说：<strong>机器验证的不是&quot;输出像不像论文&quot;，而是&quot;每一步是否严格成立&quot;</strong>。</p><p>Lean/Mathlib 社区的联合声明（已获 Lean 基金会和 Mathlib 计划背书）给出了四条认证标准，并确认全部满足：</p><table><thead><tr><th>关卡</th><th>核验内容</th><th>结果</th></tr></thead><tbody><tr><td>第一关：命题表述正确</td><td>代码证明的正是 Mathlib 库中经过数论专家审核的黎曼猜想标准定义</td><td>通过</td></tr><tr><td>第二关：代码可编译</td><td>数十位研究者独立编译，全部无报错，导出的原始证明文件完全一致</td><td>通过</td></tr><tr><td>第三关：证明对象无误</td><td>用 comparator 与 con-leche 两套独立工具比对，确认证明的定理与标准命题完全一致</td><td>通过</td></tr><tr><td>第四关：推导逻辑有效</td><td>导出证明经 Lean 官方内核、con-leche、con-ron 及多个第三方独立检查器验证</td><td>通过</td></tr></tbody></table><p>第三关专门排除形式化验证最著名的坑：“机器验证了一个很长的推导，但它证的根本不是黎曼猜想”。社区专门构建了一个只依赖 Mathlib 的隔离文件，用两套实现互相独立的比对工具确认——证明的结论就是标准命题。</p><p>第四关同样重要：con-leche 与 con-ron 自带&quot;相对集合论的形式化正确性保证&quot;，即它们在机制上不可能放行一个假证明；核验还在&quot;惰性导出&quot;（inert export）上进行，隔离了源码中任何潜在恶意代码的影响。</p><h2 id="七、独立核验：麻省理工把-检查员-也检查了一遍">七、独立核验：麻省理工把&quot;检查员&quot;也检查了一遍</h2><p>除了社区声明，MIT 教授 Andrew Sutherland 搭建了公开的核验追踪页（<a href="http://math.mit.edu/~drew/grh/">math.mit.edu/~drew/grh/</a> ，注明用 Claude Code 辅助完成检查），截至 11 月 22 日凌晨的关键结果：</p><table><thead><tr><th>检查项</th><th>结果</th><th>关键数字</th></tr></thead><tbody><tr><td>全部模块编译（Lean v4.33.1 / Mathlib v4.33.1）</td><td>通过</td><td>175,187 个模块，零报错</td></tr><tr><td>五项主定理依赖的公理</td><td>仅有三条</td><td>propext、Classical.choice、Quot.sound</td></tr><tr><td>Mathlib 文件与官方缓存一致性</td><td>逐字节一致</td><td>8,322 个 Mathlib 文件 + 378 个依赖文件</td></tr><tr><td>沙箱独立重建（无网络、只读源码、另一台机器）</td><td>通过</td><td>与发布版本逐字节一致</td></tr><tr><td>导出文件与发布版比对</td><td>完全一致</td><td>61,570,595,788 字节（约 61.6GB），SHA256 一致</td></tr><tr><td>leanchecker 内核逐模块回放</td><td>通过</td><td>175,187 / 175,187，零拒绝</td></tr><tr><td>nanoda（独立 Rust 内核）</td><td>接受</td><td>80 线程 27 分 42 秒</td></tr><tr><td>con-leche / con-ron（独立比对）</td><td>接受</td><td>五项主定理全部&quot;由解法证得&quot;</td></tr><tr><td>lean4lean 模块级检查</td><td>通过</td><td>175,187 / 175,187</td></tr></tbody></table><p>看懂这几行数字的意义：这不是&quot;一个人说没问题&quot;，而是多个团队、用不同语言实现的独立检查器各自验证，且验证对象是一份经得起逐字节比对的导出文件——这个过程在数学史上没有先例。</p><p>顺带说一句：导出文件用 SHA256 保证&quot;一字未改&quot;，这和上次写压缩软件时说的&quot;发布方给了哈希，解压前先核对&quot;是同一套思路，只是这次核对的对象是 61.6GB 的数学证明。</p><h2 id="八、冷静看：还有哪些没有完成">八、冷静看：还有哪些没有完成</h2><p>媒体标题很热闹，但严谨地说，目前&quot;已被证明&quot;的适用范围有明确边界：</p><table><thead><tr><th>未完成/未覆盖项</th><th>现状</th></tr></thead><tbody><tr><td>克雷数学研究所认定</td><td>仍将黎曼猜想列为未解决问题，未启动认定程序</td></tr><tr><td>千禧年奖金评审</td><td>按规则需正式发表、至少两年检验、学界广泛接受后才进入评审</td></tr><tr><td>传统同行评议</td><td>此次是形式化核验，不等同于人类审稿</td></tr><tr><td>广义黎曼猜想</td><td>认证对象是 Mathlib 版本的黎曼猜想命题，广义版本未走此路径</td></tr><tr><td>可读性</td><td>文字版证明估计超过 25 万页，未公开；公开的只有 4 页说明与代码</td></tr><tr><td>数学共识</td><td>陶哲轩、梅纳德等均表示：理解证明内部的思想仍需相当长时间</td></tr></tbody></table><p>梅纳德（菲尔兹奖得主、牛津大学教授）的说法很有代表性：如果证明经得起检验，这将是数学史上的里程碑；他倾向于认为证明成立，但其中的数学思想仍需时间理解。</p><h2 id="九、学界与媒体反应一览">九、学界与媒体反应一览</h2><table><thead><tr><th>来源</th><th>时间</th><th>态度/角度</th></tr></thead><tbody><tr><td>Lean/Mathlib 社区联合声明</td><td>11-21</td><td>“完全确信证明正确”，四关全过</td></tr><tr><td>科学美国人（第一波）</td><td>11-20</td><td>Anthropic 数学家称用 Claude 攻克最著名的数学难题</td></tr><tr><td>科学美国人（第二波）</td><td>11-20 至 21</td><td>独立数学家确认证明&quot;几乎肯定为真&quot;</td></tr><tr><td>卫报</td><td>11-21</td><td>两组团队独立验证了这一声明</td></tr><tr><td>Science（AAAS）</td><td>11-20</td><td>AI 或已解最伟大的谜题，但人类读懂可能要数年</td></tr><tr><td>The Verge</td><td>11-20</td><td>强调尚未被独立验证、克雷未接受、仅发布在个人网站</td></tr><tr><td>澎湃新闻</td><td>11-22</td><td>AI 攻克黎曼猜想获认证，但读懂仍需时日</td></tr><tr><td>第一财经</td><td>11-22</td><td>认证基于形式化核验，不等同人工审稿</td></tr></tbody></table><p>注意一个反差：11-20 当天的报道（Verge、Science）都在强调&quot;尚未独立验证&quot;，11-21 之后（卫报、科学美国人第二波、印度 Today）口径变成&quot;已获确认&quot;。新闻的生命周期在 48 小时内走完了一轮&quot;质疑到确认&quot;，这在数学史和新闻史上都不常见。</p><h2 id="十、这件事的真正意义">十、这件事的真正意义</h2><p>第一层，数学史。如果最终成立，这是 167 年来黎曼猜想的第一个完整证明，也是千禧年难题第一次被形式化验证的方式&quot;认证&quot;。</p><p>第二层，AI 与数学协作的范式。此前的里程碑（AI 在国际数学奥赛拿金牌、辅助解决局部问题）和这次有本质区别：人机合作完成的证明，通过了最严格的形式化检验，触及了&quot;长期被认为需要顶尖人类创造力&quot;的基础数学问题。Claude 在这里的作用不是&quot;搜索引擎&quot;，而是研究协作者。</p><p>第三层，AI 的双面性——这正好能接上之前几篇文章。银狐木马那篇里讲过，AI 把搜索引擎仿冒站点的成本压到了接近零，是攻击者的放大器；而这次，同一个技术路线上的 AI 在帮人类解决千禧年难题。工具本身不分善恶，看握在谁手里、用在哪个方向。</p><p>第四层，可复现的工程标准。1700 万行代码、61.6GB 导出、多内核交叉验证、逐字节比对——这套&quot;形式化验证&quot;流水线未来会成为数学论文的新常态之一，也可能进入你日常接触的软件与安全领域（比如正规软件发布时给出的哈希与签名，本质是同一种信任模型）。</p><h2 id="十一、你可以自己跟进：五个去处">十一、你可以自己跟进：五个去处</h2><p>不用懂高等数学，也能跟踪这件事的后续：</p><table><thead><tr><th>去处</th><th>看什么</th></tr></thead><tbody><tr><td>GitHub：Deicyde/riemann-hypothesis</td><td>证明代码仓库本体，可看编译状态与发布说明</td></tr><tr><td><a href="http://math.mit.edu/~drew/grh/">math.mit.edu/~drew/grh/</a></td><td>MIT 核验追踪页，剩余检查完成情况会持续更新</td></tr><tr><td>Lean 社区博客（<a href="http://leanprover-community.github.io">leanprover-community.github.io</a>）</td><td>联合声明原文与四条认证标准</td></tr><tr><td>Mathlib 文档中的 RiemannHypothesis 定义</td><td>看看被证明的命题到底长什么样</td></tr><tr><td>克雷数学研究所官网</td><td>千禧年问题状态页，认定流程的官方信源</td></tr></tbody></table><p>想看门道又不想啃代码，可以对照本文第六节的&quot;四道关卡&quot;和第七节的核验表，逐条看官方页面的更新状态。</p><h2 id="十二、总结">十二、总结</h2><p>把这条新闻压缩成三句话：</p><ol><li>一位人类数学家与 AI 合作，给出了黎曼猜想的证明，全程以形式化代码呈现；</li><li>证明在 24 小时内通过了 Lean/Mathlib 社区的联合认证和 MIT 的独立复验，这是形式化验证领域的历史性时刻；</li><li>但&quot;机器验证正确&quot;不等于&quot;数学界已经理解&quot;——克雷研究所未认定、广义猜想未覆盖、25 万页的思想仍需多年消化。</li></ol><p>对普通读者，最值得记住的不是&quot;黎曼猜想被证明了&quot;，而是&quot;人类第一次拥有了一条让 AI 的数学成果接受严格检验的流水线&quot;。这条流水线会带数学家走多远，比单次证明更值得期待。</p><p>(๑•̀ㅂ•́)و✧</p><h2 id="参考来源">参考来源</h2><h3 id="一手来源">一手来源</h3><ul><li>Lean 与 Mathlib 社区联合声明（2026-11-21）：<a href="https://leanprover-community.github.io/blog/posts/riemann-hypothesis/">Lean verification of the Riemann Hypothesis</a></li><li>MIT Andrew Sutherland 核验文件页（2026-11-22 更新）：<a href="https://math.mit.edu/~drew/grh/">RH Lean proof: verification files</a></li><li>原始公告（2026-11-20）：<a href="https://alpo.ge/remark.pdf">alpo.ge/remark.pdf</a></li><li>代码仓库：<a href="https://github.com/Deicyde/riemann-hypothesis">GitHub Deicyde/riemann-hypothesis</a></li><li>Mathlib 中的黎曼猜想定义：<a href="https://leanprover-community.github.io/mathlib4_docs/Mathlib/NumberTheory/LSeries/RiemannZeta.html">RiemannHypothesis</a></li></ul><h3 id="媒体报道（按时间）">媒体报道（按时间）</h3><ul><li>Scientific American（2026-11-20）：<a href="https://www.scientificamerican.com/article/anthropic-mathematician-claims-to-prove-riemann-hypothesis-most-famous-problem-in-all-of-math/">Anthropic mathematician claims to prove Riemann hypothesis</a></li><li>Scientific American（2026-11-20 至 21）：<a href="https://www.scientificamerican.com/article/the-ai-riemann-hypothesis-proof-is-almost-certainly-true-independent-mathematicians-attest/">The AI Riemann hypothesis proof is almost certainly true, independent mathematicians attest</a></li><li>Science / AAAS（2026-11-20）：<a href="https://www.science.org/content/article/ai-may-have-solved-math-s-greatest-mystery-can-humans-understand-answer">AI may have solved math’s greatest mystery. Can humans understand the answer?</a></li><li>The Verge（2026-11-20）：<a href="https://www.theverge.com/ai-artificial-intelligence/1010051/anthropic-riemann-hypothesis-millennium-prize-problem">Anthropic mathematician claims to have solved Millennium Prize problem with Claude</a></li><li>SiliconANGLE（2026-11-20）：<a href="https://siliconangle.com/2026/11/20/anthropic-researcher-claims-to-have-proven-riemann-hypothesis-using-claude/">Anthropic researcher claims proof using Claude</a></li><li>The Guardian（2026-11-21）：<a href="https://www.theguardian.com/technology/2026/nov/21/anthropic-riemann-hypothesis-solved-claude-ai">Two groups verify mathematician’s claim that Claude helped prove mathematics problem</a></li><li>India Today（2026-11-22）：<a href="https://www.indiatoday.in/technology/news/story/riemann-hypothesis-proof-declared-correct-claude-ai-helps-mathematician-make-history-3044287-2026-11-22">Riemann Hypothesis proof declared correct, Claude AI helps mathematician make history</a></li><li>澎湃新闻（2026-11-22）：<a href="https://www.thepaper.cn/newsDetail_forward_34534422">AI攻克黎曼猜想获Lean数学社区认证，但读懂它仍需时日</a></li><li>第一财经（2026-11-22）：<a href="https://www.yicai.com/news/103449169.html">黎曼猜想证明获认证：Claude参与攻克百年数学难题</a></li><li>腾讯新闻（2026-11-21）：<a href="https://news.qq.com/rain/a/20261121A07NPX00">黎曼猜想被证明了？是Claude与数学家联手，还是纯手工？</a></li></ul><h3 id="背景参考">背景参考</h3><ul><li>陶哲轩博客（2026-11-20，经腾讯新闻转载报道）：对证明可能使用朗兰兹纲领、算术几何的判断</li><li>Kevin Buzzard / Xena 项目（2026-11-12）：<a href="https://xenaproject.wordpress.com/2026/11/12/and-the-proof-is-checked-in-lean/">And the proof is checked in Lean（四条认证标准出处）</a></li></ul><h3 id="引用说明">引用说明</h3><p>本文核心事实（发布日期、代码规模、声明全文口径、核验数字、克雷规则）均以上述一手来源与权威媒体报道交叉核对为准；陶哲轩、梅纳德的表述取自澎湃新闻与第一财经的转述。烈度较高的断言（如&quot;数学史上首次&quot;）限定在可检索的事实范围内，学界最终评价以克雷研究所及正式期刊发表为准。</p>]]></content>
    
    
    <summary type="html">2026 年 11 月 20 日，Anthropic 数学家 Levent Alpöge 公开了一份与 Claude 合作完成的黎曼猜想证明，约 1700 万行 Lean 形式化代码；24 小时后 Lean/Mathlib 社区联合声明&quot;完全确信证明正确&quot;。本文按新闻要素拆解事件全貌：黎曼猜想起底、Lean 核验的四道关卡、MIT 独立复验清单、尚未被证实的部分、学界反应，以及普通读者可以自己跟进的地方。</summary>
    
    
    
    <category term="时事新闻" scheme="https://zhaogb612.github.io/categories/%E6%97%B6%E4%BA%8B%E6%96%B0%E9%97%BB/"/>
    
    
    <category term="黎曼猜想" scheme="https://zhaogb612.github.io/tags/%E9%BB%8E%E6%9B%BC%E7%8C%9C%E6%83%B3/"/>
    
    <category term="数学" scheme="https://zhaogb612.github.io/tags/%E6%95%B0%E5%AD%A6/"/>
    
    <category term="Lean" scheme="https://zhaogb612.github.io/tags/Lean/"/>
    
    <category term="Claude" scheme="https://zhaogb612.github.io/tags/Claude/"/>
    
  </entry>
  
  <entry>
    <title>编程语言进化史：从机器码到 AI 时代，主流语言详解与优缺点全对比</title>
    <link href="https://zhaogb612.github.io/posts/3d4e5f60.html"/>
    <id>https://zhaogb612.github.io/posts/3d4e5f60.html</id>
    <published>2026-11-21T11:20:00.000Z</published>
    <updated>2026-11-21T11:55:00.000Z</updated>
    
    <content type="html"><![CDATA[<h1 id="编程语言进化史：从机器码到-AI-时代，主流语言详解与优缺点全对比">编程语言进化史：从机器码到 AI 时代，主流语言详解与优缺点全对比</h1><p>你有没有问过程序员一个问题：<strong>“你们到底会几种编程语言？”</strong></p><p>得到的答案往往是含糊的：“会 Python、会点 Java……” 然后你转头看了一眼 GitHub 上几百种语言的名字，彻底放弃学习。</p><p>但这个问题其实值得认真回答——因为<strong>编程语言不是「越多越好」，而是「每种都对应一个时代、一类问题、一种哲学」</strong>。理解了它们为什么存在，你就不再需要背语法，而是能看懂&quot;为什么有人为 Rust 欢呼，为什么有人骂 Java 啰嗦，为什么 Python 会赢&quot;。</p><p>这篇不教你写代码，教你<strong>看懂语言的江湖</strong>：</p><ol><li>一条时间线，讲清 70 年六次技术浪潮；</li><li>主流语言逐一拆解：诞生、哲学、用途、<strong>优点和缺点</strong>；</li><li>横向大对比表 + 2026 年真实热度数据；</li><li>按你的目标（前端/后端/AI/游戏/运维……）该学哪门。</li></ol><blockquote><p>文中数据来自 Stack Overflow 2026 开发者调查（n=14,099，ODbL 授权）与 TIOBE 指数 2026 年 11 月版，均为公开一手来源，详见文末。语言热度<strong>会变</strong>：本文讲的是&quot;为什么&quot;，不是&quot;此刻谁第一&quot;。</p></blockquote><hr><h2 id="一、先学会看语言：四个维度拆穿任何一门语言">一、先学会看语言：四个维度拆穿任何一门语言</h2><p>在讲历史之前，先给你一套&quot;看语言&quot;的眼镜。任何语言都可以用这四把尺子量：</p><h3 id="1-1-编译-vs-解释：代码怎么变成机器能懂的东西">1.1 编译 vs 解释：代码怎么变成机器能懂的东西</h3><table><thead><tr><th>方式</th><th>过程</th><th>特点</th><th>代表</th></tr></thead><tbody><tr><td><strong>编译型</strong></td><td>源码 → 一次性翻译成机器码（可执行文件）</td><td>快、发布即用，但改完要重新编译</td><td>C、C++、Go、Rust</td></tr><tr><td><strong>解释型</strong></td><td>源码 → 运行时逐行翻译执行</td><td>灵活、改完即生效，但慢一点</td><td>Python、Ruby、PHP、Bash</td></tr><tr><td><strong>混合型（JIT）</strong></td><td>先编译成中间码，运行时再优化成机器码</td><td>兼顾灵活与速度</td><td>Java（JVM）、C#（.NET）、JavaScript（V8）</td></tr></tbody></table><h3 id="1-2-静态类型-vs-动态类型：变量要不要-先声明是什么">1.2 静态类型 vs 动态类型：变量要不要&quot;先声明是什么&quot;</h3><ul><li><strong>静态类型</strong>：写代码时就要说清&quot;这是整数、那是字符串&quot;，编译器帮你提前抓 bug（很多错误写的时候就被发现了）。代表：C、Java、Go、Rust、TypeScript。</li><li><strong>动态类型</strong>：运行时才确定类型，写起来自由、快，但类型错误往往要运行到那一行才爆炸。代表：Python、JavaScript、Ruby。</li></ul><p>一句话：<strong>静态类型是&quot;带红线的自由&quot;，动态类型是&quot;无拘无束但容易翻车&quot;。</strong></p><h3 id="1-3-内存管理三种流派：谁负责-用完还回去">1.3 内存管理三种流派：谁负责&quot;用完还回去&quot;</h3><table><thead><tr><th>流派</th><th>机制</th><th>代表</th><th>特点</th></tr></thead><tbody><tr><td><strong>手动管理</strong></td><td>程序员自己分配、自己释放</td><td>C</td><td>极致性能，但也最容易内存泄漏/崩溃</td></tr><tr><td><strong>垃圾回收（GC）</strong></td><td>运行时自动回收没人用的内存</td><td>Java、C#、Go、Python、JavaScript</td><td>省心，但偶有停顿、占内存</td></tr><tr><td><strong>所有权机制</strong></td><td>编译器静态分析，内存&quot;借用&quot;有规则</td><td>Rust</td><td>无 GC 也安全，学习曲线陡</td></tr></tbody></table><h3 id="1-4-编程范式：程序是-一串指令-还是-一堆对象">1.4 编程范式：程序是&quot;一串指令&quot;还是&quot;一堆对象&quot;</h3><ul><li><strong>命令式</strong>：一步一步告诉电脑做什么（C、Python 基础写法）——最贴近直觉；</li><li><strong>面向对象（OOP）</strong>：把数据和操作打包成&quot;对象&quot;（Java、C++、C#）——适合大型工程；</li><li><strong>函数式</strong>：把计算当函数嵌套，强调无副作用（Haskell、Elixir、Scala 可选）——并发友好、逻辑纯。</li></ul><blockquote><p>现代主流语言几乎都是&quot;多范式混合&quot;：Python 既是命令式也能面向对象还能函数式。<strong>别再问&quot;某某是不是面向对象语言&quot;，改为问&quot;它最擅长哪种写法&quot;。</strong></p></blockquote><hr><h2 id="二、进化时间线：70-年，六次浪潮">二、进化时间线：70 年，六次浪潮</h2><p>编程语言不是凭空冒出来的，每一代都在解决上一代的痛点：</p><table><thead><tr><th>年代</th><th>浪潮</th><th>要解决的问题</th><th>代表语言</th><th>关键人物/组织</th></tr></thead><tbody><tr><td>1940s–50s</td><td><strong>机器码与汇编</strong></td><td>用 0/1 和助记符直控硬件</td><td>汇编（Assembly）</td><td>冯·诺依曼等</td></tr><tr><td>1957–60s</td><td><strong>高级语言诞生</strong></td><td>让人读得懂、数学表达自然</td><td>Fortran、Lisp、COBOL</td><td>IBM（Backus）、McCarthy</td></tr><tr><td>1970s</td><td><strong>结构化编程</strong></td><td>取代 GOTO，代码要有结构</td><td>C、Pascal、Prolog、<strong>SQL</strong></td><td>Bell 实验室（Ritchie）</td></tr><tr><td>1980s</td><td><strong>面向对象</strong></td><td>大型软件要&quot;模块化复用&quot;</td><td>C++、Objective-C、Perl、Erlang</td><td>Stroustrup、Cox</td></tr><tr><td>1990s</td><td><strong>Web 与脚本时代</strong></td><td>网页要动起来、开发要快</td><td><strong>JavaScript</strong>、Python、Ruby、PHP、<strong>Java</strong></td><td>网景、Sun</td></tr><tr><td>2000s</td><td><strong>托管平台与类型觉醒</strong></td><td>企业级稳定 + 新类型系统</td><td>C#、Scala、<strong>Go</strong>（2009）</td><td>微软、Google</td></tr><tr><td>2010s–20s</td><td><strong>云原生与 AI 时代</strong></td><td>并发、内存安全、数据科学</td><td><strong>Rust</strong>、Kotlin、Swift、TypeScript、Dart、Julia、Zig</td><td>Mozilla、JetBrains、Apple、Google、MIT</td></tr></tbody></table><p>几个值得记住的&quot;拐点&quot;：</p><ul><li><strong>1972 年 C 语言</strong>出现后，几乎所有系统软件都用它写——操作系统、编译器、数据库，至今仍是&quot;语言的母语&quot;；</li><li><strong>1995 年 JavaScript 诞生</strong>（只用了约 10 天设计），误打误撞成了浏览器里唯一的选择，随后统治了整个 Web；</li><li><strong>1991 年 Python 诞生</strong>，最初只是&quot;给系统管理写的脚本&quot;，30 年后成为 AI 时代的第一语言；</li><li><strong>2009–2015 年 Go 与 Rust 相继登场</strong>，分别回答&quot;云原生时代要什么语言&quot;和&quot;既要性能又要内存安全怎么办&quot;。</li></ul><hr><h2 id="三、主流语言逐一拆解（重点篇）">三、主流语言逐一拆解（重点篇）</h2><p>这一章是核心。每家都按同一套模板讲：<strong>诞生 → 一句话哲学 → 谁在用 → 优点 → 缺点 → 2026 现状</strong>。</p><h3 id="3-1-C（1972）——-万语之母">3.1 C（1972）—— 万语之母</h3><ul><li><strong>诞生</strong>：贝尔实验室，Dennis Ritchie，为重写 Unix 而生。</li><li><strong>一句话哲学</strong>：<strong>“让你贴近机器，但不妨碍你表达思想。”</strong> 几乎没有运行时，编译产物直接变成指令。</li><li><strong>谁在用</strong>：操作系统（Linux/Windows 内核）、嵌入式设备、驱动、数据库、编译器等一切&quot;底层&quot;。</li><li><strong>优点</strong>：<ul><li>性能天花板级，控制力最强；</li><li>极简核心（语法规模小，学完基本就是全貌）；</li><li>生态流传 50 年，什么平台都支持。</li></ul></li><li><strong>缺点</strong>：<ul><li>内存要手动管理，<strong>容易内存泄漏、缓冲区溢出</strong>（无数漏洞的根源）；</li><li>没有面向对象、泛型等现代特性（要靠程序员自觉）；</li><li>写大型项目维护成本高。</li></ul></li><li><strong>2026 现状</strong>：依然是所有编程教育的&quot;地基&quot;（学完 C 再学别的都更快），但企业新项目很少选择它，主要用于底层与存量系统。</li></ul><h3 id="3-2-C-（1985）——-性能与抽象的-既要又要">3.2 C++（1985）—— 性能与抽象的&quot;既要又要&quot;</h3><ul><li><strong>诞生</strong>：Bjarne Stroustrup，在 C 之上加面向对象与模板，后来不断膨胀。</li><li><strong>一句话哲学</strong>：<strong>“在 C 的性能上，叠加现代工程能力。”</strong></li><li><strong>谁在用</strong>：游戏引擎（Unreal）、浏览器内核（Chromium）、高频交易、自动驾驶、大型桌面软件。</li><li><strong>优点</strong>：性能接近 C，但支持 OOP/泛型/RAII；生态庞大成熟；对硬件控制力顶级。</li><li><strong>缺点</strong>：<strong>复杂度爆炸</strong>——历史包袱 + 特性过多，学习曲线极陡；跨平台构建麻烦；Rust 正在蚕食它的领地。</li><li><strong>2026 现状</strong>：SO 使用率 24.3%（第 10 位）依旧可观，但在&quot;新写系统软件&quot;的场合正被 Rust 猛烈冲击；<strong>存量庞大、增量放缓</strong>是它的真实写照。</li></ul><h3 id="3-3-Java（1995）——-企业级的中流砥柱">3.3 Java（1995）—— 企业级的中流砥柱</h3><ul><li><strong>诞生</strong>：Sun 公司（James Gosling），口号 “<strong>Write Once, Run Anywhere</strong>”（一次编写，处处运行），靠 JVM 虚拟机跨平台。</li><li><strong>一句话哲学</strong>：“<strong>大企业的稳，比炫技更重要。</strong>”</li><li><strong>谁在用</strong>：银行/保险/证券核心系统、Android（历史原因）、电商后端、大数据（Hadoop/Spark 全是 Java 系）。</li><li><strong>优点</strong>：<ul><li>生态极其完备（Spring 全家桶），人才供给充足；</li><li>JVM 成熟稳定，性能好、垃圾回收多年打磨；</li><li>强类型 + 严格规范，适合几十上百人的团队协作。</li></ul></li><li><strong>缺点</strong>：<ul><li><strong>啰嗦</strong>：经典 Hello World 都要写类、方法、public static void main……；</li><li>启动慢、内存占用大；</li><li>「CORBA/EJB 之耻」式的历史包袱频出（不过新版本已大幅改善）。</li></ul></li><li><strong>2026 现状</strong>：Java 27（2026-09 发布），如今<strong>半年一个版本</strong>，新特性（虚拟线程等）让&quot;老 Java&quot;焕发新生；SO 使用率 27.6% 稳居前列，<strong>存量就业市场依然庞大</strong>。</li></ul><h3 id="3-4-C-（2000）——-微软的-Java-超越版">3.4 C#（2000）—— 微软的&quot;Java 超越版&quot;</h3><ul><li><strong>诞生</strong>：微软（Anders Hejlsberg），.NET 平台的核心语言。</li><li><strong>一句话哲学</strong>：“<strong>在工业级易用上做到极致，同时保持强类型与高性能。</strong>”</li><li><strong>谁在用</strong>：Windows 桌面（WPF/WinUI）、Unity/Godot 游戏、Azure 云、企业后端。</li><li><strong>优点</strong>：语法比 Java 更现代更舒服（属性、LINQ、异步一等公民）；<strong>.NET 跨平台成熟</strong>（.NET Core 之后 Mac/Linux 都能跑）；性能与生态俱佳。</li><li><strong>缺点</strong>：历史上&quot;绑定 Windows&quot;的印象难改（虽已跨平台）；开源转型后生态仍以微软系为主。</li><li><strong>2026 现状</strong>：SO 27.1%，与 Java 几乎并驾齐驱；在游戏（Unity）与微软云栈里依然强势。</li></ul><h3 id="3-5-Python（1991）——-从-胶水-到-AI-霸主">3.5 Python（1991）—— 从&quot;胶水&quot;到 AI 霸主</h3><ul><li><strong>诞生</strong>：Guido van Rossum（荷兰），取自《蒙提·派森的飞行马戏团》。</li><li><strong>一句话哲学</strong>：<strong>“简洁优雅，人人能写。”</strong> 官方 Zen of Python 第一条：Beautiful is better than ugly。</li><li><strong>谁在用</strong>：AI/机器学习、数据分析、自动化脚本、Web 后端（Django/FastAPI）、科学计算——<strong>2020s 的&quot;通用语言&quot;。</strong></li><li><strong>优点</strong>：<ul><li><strong>上手最快</strong>，读代码像读英文；</li><li>生态无敌：NumPy/Pandas/PyTorch/TensorFlow/scikit-learn 全押注 Python；</li><li>胶水能力极强，什么都能调；</li><li>就业需求爆发（AI 岗位基本都要求 Python）。</li></ul></li><li><strong>缺点</strong>：<ul><li><strong>慢</strong>：解释型 + GIL（全局解释器锁）限制多线程；纯 Python 计算密集型代码比别人慢几十倍（靠 C 扩展补救）；</li><li>动态类型在大型项目里难以维护（靠 type hint 缓解）；</li><li>包管理生态混乱（pip/conda/poetry 并存，版本地狱）。</li></ul></li><li><strong>2026 现状</strong>：SO 58.0%，稳居前三；<strong>AI 时代最大赢家</strong>——大模型训练与推理的每一环（数据清洗、训练、评估、Agent）几乎都有 Python 参与；版本节奏为每年 10 月更新一次（3.15 于 2026-10 发布）。</li></ul><h3 id="3-6-JavaScript（1995）——-Web-的唯一真神">3.6 JavaScript（1995）—— Web 的唯一真神</h3><ul><li><strong>诞生</strong>：Brendan Eich 用约 10 天设计出来给网景浏览器用，本名是 “Mocha/LiveScript”，为了蹭 Java 热度改名 JS。</li><li><strong>一句话哲学</strong>：“<strong>让网页活起来，并且无处不在。</strong>”</li><li><strong>谁在用</strong>：所有浏览器前端、Node.js 后端、Electron 桌面应用、小程序、服务器端渲染。</li><li><strong>优点</strong>：<ul><li><strong>浏览器里无可替代</strong>（唯一原生编程语言）；</li><li>全栈一体：前后端同语言，生态 npm 超大；</li><li>事件驱动 + 异步，适合高并发 I/O 场景。</li></ul></li><li><strong>缺点</strong>：<ul><li>历史包袱深（<code>==</code> 的诡异行为、全局变量混乱）；</li><li>动态类型 + 回调地狱（幸好有 TypeScript 与 async/await 救场）；</li><li><strong>&quot;是 Java 的脚本版&quot;是被名字骗了的经典误会</strong>——两者毫无血缘。</li></ul></li><li><strong>2026 现状</strong>：SO <strong>62.0% 连续第 12 年使用率第一</strong>（n=14,099），统治地位依旧牢不可破；现代工程普遍&quot;JS 打底 + TypeScript 加持&quot;。</li></ul><h3 id="3-7-TypeScript（2012）——-给-JavaScript-装上-安全带">3.7 TypeScript（2012）—— 给 JavaScript 装上&quot;安全带&quot;</h3><ul><li><strong>诞生</strong>：微软（Anders Hejlsberg），JS 的超集（合法 JS 必然是合法 TS）。</li><li><strong>一句话哲学</strong>：“<strong>保留 JS 生态，补上类型安全。</strong>”</li><li><strong>优点</strong>：类型检查把大量低级错误挡在编译期；生态与 JS 完全兼容；大型前端项目的标配。</li><li><strong>缺点</strong>：类型体操有时很折磨人；编译期有成本；并不是所有 JS 库都有完善类型定义。</li><li><strong>2026 现状</strong>：SO 43.8% 排第 6，<strong>大型前端几乎没有不用它的</strong>；Vue/React/Angular 全家推荐。</li></ul><h3 id="3-8-Go（2009）——-云原生的-混凝土">3.8 Go（2009）—— 云原生的&quot;混凝土&quot;</h3><ul><li><strong>诞生</strong>：Google（Ken Thompson、Rob Pike、Robert Griesemer），为应对&quot;大规模分布式系统&quot;而生。</li><li><strong>一句话哲学</strong>：“<strong>简单、并发、好部署，工程师看着就舒服。</strong>”</li><li><strong>谁在用</strong>：Docker、Kubernetes、etcd、Prometheus、微服务、CLI 工具——<strong>整个云原生生态几乎都是 Go 写的</strong>。</li><li><strong>优点</strong>：<ul><li><strong>并发模型一流</strong>（goroutine + channel），写并发代码像写单线程；</li><li>编译成单个静态二进制，部署零依赖；</li><li><strong>极简</strong>：语法元素少，团队上手快、代码风格统一；</li><li>内建格式化（gofmt），消灭&quot;风格之争&quot;。</li></ul></li><li><strong>缺点</strong>：<ul><li>没有泛型曾经是硬伤（Go 1.18 已补上，但体验仍在追赶）；</li><li>异常处理用 <code>if err != nil</code> 铺地板，被戏称&quot;啰嗦但诚实&quot;；</li><li>不适合 CPU 密集的算法活和 GUI 应用。</li></ul></li><li><strong>2026 现状</strong>：SO 16.5%；<strong>Go 1.27 于 2026-08-19 发布</strong>，保持一年两更。云原生岗位需求稳定，是&quot;后端第二语言&quot;的热门候选。</li></ul><h3 id="3-9-Rust（2010-2015）——-内存安全的-新希望">3.9 Rust（2010/2015）—— 内存安全的&quot;新希望&quot;</h3><ul><li><strong>诞生</strong>：Mozilla 员工 Graydon Hoare 的个人项目，2010 年公开，2015 年发布 1.0。</li><li><strong>一句话哲学</strong>：“<strong>用编译器当裁判：要么编译通过，要么内存安全。</strong>” 通过所有权/借用机制，在<strong>编译期</strong>消灭空指针、数据竞争、内存泄漏。</li><li><strong>谁在用</strong>：系统编程（内核模块、驱动）、WebAssembly、命令行工具（ripgrep、fd）、Firefox 组件、去中心化项目、嵌入式。</li><li><strong>优点</strong>：<ul><li><strong>无 GC 也内存安全</strong>——比 C/C++ 安全，比 Java/Go 快；</li><li>并发安全默认正确，编译期就抓数据竞争；</li><li>连续多年 TIOBE &quot;最受喜爱语言&quot;榜首。</li></ul></li><li><strong>缺点</strong>：<ul><li><strong>学习曲线业界公认最陡</strong>：所有权/借用检查器让新手反复撞墙；</li><li>编译慢；生态虽在飞速成长，但相比 C/C++/Java 仍年轻；</li><li>写业务 CRUD 属于&quot;杀鸡用牛刀&quot;。</li></ul></li><li><strong>2026 现状</strong>：SO 18.0%，<strong>历史上首次反超 PHP（17.7%）</strong>；Linux 内核逐步接纳 Rust 模块，被公认是&quot;下一个十年的系统语言&quot;。</li></ul><h3 id="3-10-PHP（1995）——-Web-老将，黑红并济">3.10 PHP（1995）—— Web 老将，黑红并济</h3><ul><li><strong>诞生</strong>：Rasmus Lerdorf，最初是 “Personal Home Page Tools”（个人主页工具）。</li><li><strong>一句话哲学</strong>：“<strong>让做网站像写动态 HTML 一样简单。</strong>”</li><li><strong>谁在用</strong>：WordPress 插件、传统 CMS、大量存量 Web 应用。</li><li><strong>优点</strong>：部署极简单（配好 Apache/Nginx 就能跑）；上手门槛低；WordPress 生态庞大。</li><li><strong>缺点</strong>：语言设计历史包袱深（函数命名混乱）；性能与工程规范落后于现代语言；&quot;PHP 是垃圾&quot;曾是圈内梗。</li><li><strong>2026 现状</strong>：SO 17.7% 被 Rust 反超；但 PHP 8.x 更新让性能大幅提升，<strong>存量大到不可能消失</strong>。</li></ul><h3 id="3-11-Kotlin（2011-2016）——-Android-与-JVM-的现代派">3.11 Kotlin（2011/2016）—— Android 与 JVM 的现代派</h3><ul><li><strong>诞生</strong>：JetBrains 出品，2016 年 1.0，2019 年 Google 宣布其为 <strong>Android 官方首选语言</strong>。</li><li><strong>一句话哲学</strong>：“<strong>比 Java 少写一半代码，还 100% 兼容 Java 生态。</strong>”</li><li><strong>谁在用</strong>：Android 应用（绝大多数新 app）、JVM 后端、跨平台（KMP）。</li><li><strong>优点</strong>：简洁优雅（空安全、扩展函数、协程）；与 Java 无缝互操作；Google 官方背书。</li><li><strong>缺点</strong>：编译速度一般；学习资料偏 Android 向；纯后端生态不如 Java 大。</li><li><strong>2026 现状</strong>：SO 10.8%，Android 开发事实标准，JVM 后端的&quot;新欢&quot;。</li></ul><h3 id="3-12-Swift（2014）——-苹果系新宠">3.12 Swift（2014）—— 苹果系新宠</h3><ul><li><strong>诞生</strong>：Apple（Chris Lattner），替代 Objective-C。</li><li><strong>一句话哲学</strong>：“<strong>给苹果生态一套现代、安全、快的语言。</strong>”</li><li><strong>谁在用</strong>：iOS/macOS/watchOS/tvOS 应用、苹果系服务器（Vapor）。</li><li><strong>优点</strong>：语法现代、安全（空安全/值类型）；性能好；苹果全力维护。</li><li><strong>缺点</strong>：<strong>基本绑定苹果生态</strong>；工具链只在 Apple 平台顺滑；跨平台支持弱（Linux 可用但生态小）。</li><li><strong>2026 现状</strong>：SO 5.9%，在苹果系岗位里是必学，圈外存在感有限。</li></ul><h3 id="3-13-Ruby（1995）——-魔法与优雅">3.13 Ruby（1995）—— 魔法与优雅</h3><ul><li><strong>诞生</strong>：松本行弘（Yukihiro Matsumoto），“让编程快乐”。</li><li><strong>一句话哲学</strong>：“<strong>开发者体验第一</strong>”，一切皆对象、约定优于配置。</li><li><strong>谁在用</strong>：Ruby on Rails（Web 快速开发）、自动化、脚本。</li><li><strong>优点</strong>：语法极优雅、开发效率高；Rails 生态成熟（GitHub、Shopify 都是 Rails 应用）。</li><li><strong>缺点</strong>：性能瓶颈明显；并发与规模扩张吃力；社区热度逐年走低。</li><li><strong>2026 现状</strong>：SO 5.8%，&quot;小而美&quot;的忠诚社区仍在，但新项目不再首选。</li></ul><h3 id="3-14-SQL（1974）——-数据的通用语">3.14 SQL（1974）—— 数据的通用语</h3><ul><li><strong>诞生</strong>：IBM（SEQUEL → SQL），1979 年 Oracle 商品化。</li><li><strong>一句话哲学</strong>：“<strong>用声明式的语言描述’要什么’，而不是’怎么拿’。</strong>”</li><li><strong>谁在用</strong>：关系型数据库全线（MySQL、PostgreSQL、SQLite、SQL Server、Oracle）。</li><li><strong>优点</strong>：<strong>跟语言无关、跨平台通用</strong>——会 SQL 到哪里都吃香；优化器把&quot;怎么查&quot;交给引擎；面向集合，表达数据操作极精炼。</li><li><strong>缺点</strong>：不是图灵完备的通用语言，做复杂逻辑要配合宿主语言；复杂查询性能要靠经验调优。</li><li><strong>2026 现状</strong>：SO 58.4% 排第二——<strong>几乎所有后端/数据/运维岗位都要碰</strong>，是&quot;最被低估的常青树&quot;。</li></ul><h3 id="3-15-Bash-PowerShell-——-终端世界两种哲学">3.15 Bash / PowerShell —— 终端世界两种哲学</h3><table><thead><tr><th>项目</th><th>Bash（1989）</th><th>PowerShell（2006）</th></tr></thead><tbody><tr><td>出身</td><td>GNU（Brian Fox），Unix 传统</td><td>微软，面向 Windows 管理</td></tr><tr><td>哲学</td><td>“管道传文本，一切皆文件”</td><td>“管道传对象，一切皆对象”</td></tr><tr><td>谁在用</td><td>Linux/macOS 运维、CI、脚本</td><td>Windows 运维、Exchange/Azure、办公族</td></tr><tr><td>优点</td><td>无处不在、轻快、脚本生态海量</td><td>处理结构化数据强（对象而非字符串）、自带强大 cmdlet</td></tr><tr><td>缺点</td><td>语法诡异易踩坑、难调试</td><td>启动慢、Linux 上普及度低、语法繁琐</td></tr><tr><td>2026 现状</td><td>SO 51.3%（第 5）</td><td>SO 24.6%（第 9），Windows 岗位必备</td></tr></tbody></table><blockquote><p><strong>结论：Bash 是&quot;20 年的标准&quot;，PowerShell 是&quot;Windows 世界的同款答案&quot;，两个都值得顺手会一点。</strong></p></blockquote><hr><h2 id="四、细分领域语言：一张表看懂-另类选手">四、细分领域语言：一张表看懂&quot;另类选手&quot;</h2><p>这些语言要么专精一域，要么小而美，认识它们能让你在遇到&quot;为什么用这个&quot;时秒懂：</p><table><thead><tr><th>语言</th><th>诞生</th><th>专精领域</th><th>一句话定位</th><th>优点</th><th>缺点</th></tr></thead><tbody><tr><td><strong>Lua</strong></td><td>1993</td><td>游戏脚本/嵌入式</td><td>“轻到能塞进游戏引擎”</td><td>极轻量、极快嵌入、热更新友好</td><td>生态小、库少</td></tr><tr><td><strong>R</strong></td><td>1993</td><td>统计/数据分析</td><td>“统计学家的母语”</td><td>统计函数全、学术社区强</td><td>语法怪、性能一般</td></tr><tr><td><strong>Julia</strong></td><td>2012</td><td>科学计算</td><td>“想同时要 Python 的易用和 C 的速度”</td><td>动态类型但 JIT 快、数学表达美</td><td>生态未成熟、冷启动慢</td></tr><tr><td><strong>Dart / Flutter</strong></td><td>2011 / 2017</td><td>跨平台 UI</td><td>“一套代码，iOS/Android/Web/桌面全跑”</td><td>UI 一致性好、性能不错、热重载爽</td><td>生态比原生小、包体积略大</td></tr><tr><td><strong>Zig</strong></td><td>2016</td><td>系统编程</td><td>“C 的现代继任者，但没有 C++ 的重”</td><td>无隐式内存分配、编译期执行、交叉编译爽</td><td>未到 1.0、生态早期</td></tr><tr><td><strong>Haskell</strong></td><td>1990</td><td>函数式/学术界</td><td>“纯函数式的极致”</td><td>强类型、并发安全理论优秀</td><td>学习曲线极陡、工业应用少</td></tr><tr><td><strong>Scala</strong></td><td>2004</td><td>JVM 大数据</td><td>“把函数式带进 Java 生态”</td><td>与 Java 互操作、Spark 亲儿子</td><td>复杂、编译慢</td></tr><tr><td><strong>Elixir</strong></td><td>2011</td><td>高并发后端</td><td>“Erlang 的语法友好的现代版”</td><td>电信级容错、并发模型一流</td><td>生态小、人才少</td></tr><tr><td><strong>Clojure</strong></td><td>2007</td><td>JVM 函数式</td><td>“Lisp 在 JVM 上的重生”</td><td>不可变数据、宏观抽象强</td><td>小众、语法劝退</td></tr><tr><td><strong>F#</strong></td><td>2005</td><td>.NET 函数式</td><td>“微软的函数式一等公民”</td><td>与 .NET 生态融合、类型推断强</td><td>热度低、岗位少</td></tr><tr><td><strong>COBOL</strong></td><td>1959</td><td>银行/政务存量</td><td>“老但不死，改一行都要审批”</td><td>存量系统海量、维护岗位稳定</td><td>语言陈旧、新人极少</td></tr><tr><td><strong>Fortran</strong></td><td>1957</td><td>科学计算/超算</td><td>“数值计算的老祖宗”</td><td>数组运算极致优化、超算标配</td><td>语法老、只适合算数活</td></tr><tr><td><strong>Lisp</strong></td><td>1958</td><td>AI 原教旨</td><td>“代码即数据（同像性）的先驱”</td><td>抽象能力天花板、无数语言之师</td><td>括号劝退、生态碎片</td></tr><tr><td><strong>Assembly</strong></td><td>1940s</td><td>底层/逆向</td><td>“离硬件最近的语言”</td><td>完全控制 CPU</td><td>可移植性几乎为零</td></tr><tr><td><strong>Groovy</strong></td><td>2003</td><td>JVM 脚本</td><td>“Java 的顺滑动态版”</td><td>与 Java 无缝、Gradle 用它写构建</td><td>热度走低</td></tr><tr><td><strong>MATLAB</strong></td><td>1984</td><td>数学/仿真</td><td>“工科生的矩阵计算器”</td><td>矩阵操作极方便</td><td>闭源昂贵、只适合数值</td></tr><tr><td><strong>VBA</strong></td><td>1993</td><td>Office 自动化</td><td>“Word/Excel 里的脚本”</td><td>办公自动化无敌</td><td>老旧、安全坑多</td></tr><tr><td><strong>GDScript</strong></td><td>2014</td><td>Godot 游戏</td><td>“游戏引擎的亲儿子脚本”</td><td>上手快、引擎一体化</td><td>绑定 Godot</td></tr><tr><td><strong>Solidity</strong></td><td>2014</td><td>区块链智能合约</td><td>“以太坊的合约语言”</td><td>生态垄断、就业细分</td><td>安全漏洞代价极高</td></tr><tr><td><strong>Mojo</strong></td><td>2023</td><td>AI 高性能计算</td><td>“想把 Python 生态变成 C 的速度”（Chris Lattner 参与）</td><td>兼容 Python 语法、宣称性能接近 C</td><td>太年轻、生态未成熟</td></tr><tr><td><strong>Gleam</strong></td><td>2016/2024</td><td>BEAM 函数式</td><td>“类型安全的 Elixir”</td><td>并发安全 + 类型安全</td><td>小众</td></tr></tbody></table><hr><h2 id="五、横向大对比：一张表-2026-热度数据">五、横向大对比：一张表 + 2026 热度数据</h2><h3 id="5-1-主流语言全维度对比">5.1 主流语言全维度对比</h3><table><thead><tr><th>语言</th><th>诞生</th><th>类型</th><th>内存管理</th><th>编译/解释</th><th>主要领域</th><th>学习曲线</th><th>2026 热度 (SO%)</th></tr></thead><tbody><tr><td>C</td><td>1972</td><td>静态</td><td>手动</td><td>编译</td><td>系统/嵌入式</td><td>陡</td><td>21.8%</td></tr><tr><td>C++</td><td>1985</td><td>静态</td><td>手动(+RAII)</td><td>编译</td><td>游戏/高性能</td><td>很陡</td><td>24.3%</td></tr><tr><td>Java</td><td>1995</td><td>静态</td><td>GC</td><td>JIT</td><td>企业后端/Android</td><td>中</td><td>27.6%</td></tr><tr><td>C#</td><td>2000</td><td>静态</td><td>GC</td><td>JIT</td><td>桌面/游戏/后端</td><td>中</td><td>27.1%</td></tr><tr><td>Python</td><td>1991</td><td>动态</td><td>GC</td><td>解释</td><td>AI/数据/脚本/后端</td><td>平缓</td><td>58.0%</td></tr><tr><td>JavaScript</td><td>1995</td><td>动态</td><td>GC</td><td>JIT</td><td>前端/全栈</td><td>平缓</td><td>62.0%</td></tr><tr><td>TypeScript</td><td>2012</td><td>静态</td><td>GC</td><td>编译→JS</td><td>大型前端/全栈</td><td>中</td><td>43.8%</td></tr><tr><td>Go</td><td>2009</td><td>静态</td><td>GC</td><td>编译</td><td>云原生/微服务</td><td>平缓</td><td>16.5%</td></tr><tr><td>Rust</td><td>2010</td><td>静态</td><td>所有权</td><td>编译</td><td>系统/高性能</td><td><strong>最陡</strong></td><td>18.0%</td></tr><tr><td>PHP</td><td>1995</td><td>动态</td><td>GC</td><td>解释</td><td>Web 后端存量</td><td>平缓</td><td>17.7%</td></tr><tr><td>Kotlin</td><td>2011</td><td>静态</td><td>GC</td><td>JIT</td><td>Android/JVM 后端</td><td>中</td><td>10.8%</td></tr><tr><td>Swift</td><td>2014</td><td>静态</td><td>ARC</td><td>编译</td><td>苹果生态</td><td>中</td><td>5.9%</td></tr><tr><td>Ruby</td><td>1995</td><td>动态</td><td>GC</td><td>解释</td><td>Web( Rails )</td><td>中</td><td>5.8%</td></tr><tr><td>SQL</td><td>1974</td><td>—</td><td>—</td><td>解释</td><td>数据查询</td><td>平缓</td><td>58.4%</td></tr><tr><td>Bash</td><td>1989</td><td>动态</td><td>—</td><td>解释</td><td>运维脚本</td><td>平缓</td><td>51.3%</td></tr><tr><td>PowerShell</td><td>2006</td><td>动态</td><td>GC</td><td>解释</td><td>Windows 运维</td><td>平缓</td><td>24.6%</td></tr></tbody></table><h3 id="5-2-2026-年热度数据：Stack-Overflow-开发者调查（n-14-099）">5.2 2026 年热度数据：Stack Overflow 开发者调查（n=14,099）</h3><table><thead><tr><th>排名</th><th>语言</th><th>使用率</th><th>一句话点评</th></tr></thead><tbody><tr><td>1</td><td>JavaScript</td><td>62.0%</td><td>连续 12 年第 1，浏览器唯一真神</td></tr><tr><td>2</td><td>SQL</td><td>58.4%</td><td>数据世界的通用语，人人要会</td></tr><tr><td>3</td><td>HTML/CSS</td><td>58.2%</td><td>Web 地基（严格说是标记语言）</td></tr><tr><td>4</td><td>Python</td><td>58.0%</td><td>AI 时代第一语言</td></tr><tr><td>5</td><td>Bash/Shell</td><td>51.3%</td><td>所有开发者的&quot;隐形第二语言&quot;</td></tr><tr><td>6</td><td>TypeScript</td><td>43.8%</td><td>大型前端标配</td></tr><tr><td>7</td><td>Java</td><td>27.6%</td><td>企业后端常青树</td></tr><tr><td>8</td><td>C#</td><td>27.1%</td><td>与 Java 并驾齐驱</td></tr><tr><td>9</td><td>PowerShell</td><td>24.6%</td><td>Windows 必会</td></tr><tr><td>10</td><td>C++</td><td>24.3%</td><td>高性能存量巨头</td></tr><tr><td>11</td><td>C</td><td>21.8%</td><td>万语之母</td></tr><tr><td>12</td><td><strong>Rust</strong></td><td><strong>18.0%</strong></td><td><strong>历史性反超 PHP</strong></td></tr><tr><td>13</td><td>PHP</td><td>17.7%</td><td>老将仍在</td></tr><tr><td>14</td><td>Go</td><td>16.5%</td><td>云原生混凝土</td></tr><tr><td>15</td><td>Kotlin</td><td>10.8%</td><td>Android 官方首选</td></tr></tbody></table><p>（完整 51 项数据见文末来源；TIOBE 2026-11 的另一观察：<strong>Dart 首次进入 TIOBE 前 20</strong>，此前 10 月 Julia 也重返前 20——跨平台 UI 与科学计算的关注度都在回升。）</p><hr><h2 id="六、按目标选语言：一张决策表">六、按目标选语言：一张决策表</h2><p>别再纠结&quot;学什么好&quot;——先问&quot;你要变成什么&quot;。对照下表：</p><table><thead><tr><th>你的目标</th><th>首选</th><th>第二选择</th><th>备注</th></tr></thead><tbody><tr><td>Web 前端</td><td><strong>JavaScript → TypeScript</strong></td><td>—</td><td>绕不开，直接学 TS 底座</td></tr><tr><td>Web 后端</td><td><strong>Go / Java</strong></td><td>Python、C#、Node.js</td><td>小团队快 → Python；大企业稳 → Java</td></tr><tr><td>桌面应用（Windows）</td><td><strong>C#（WPF/WinUI）</strong></td><td>Electron（JS）、Tauri（Rust）</td><td>追求体积小/内存省 → Tauri</td></tr><tr><td>移动 App</td><td><strong>Kotlin（Android）</strong> / <strong>Swift（iOS）</strong></td><td>Flutter（Dart）跨平台</td><td>只想一套代码 → Flutter</td></tr><tr><td>AI / 机器学习</td><td><strong>Python</strong></td><td>Julia（数值）、Rust（部署）</td><td>Python 生态完全垄断</td></tr><tr><td>数据分析 / 办公</td><td><strong>Python</strong></td><td>SQL、R</td><td>SQL 必学</td></tr><tr><td>游戏开发</td><td><strong>C#（Unity/Godot）</strong></td><td>C++（Unreal）</td><td>独立开发 → Godot（免费）</td></tr><tr><td>系统编程 / 高性能</td><td><strong>Rust</strong></td><td>C、C++</td><td>新项目强烈建议 Rust</td></tr><tr><td>云原生 / DevOps</td><td><strong>Go</strong></td><td>Python、Bash</td><td>Kubernetes 生态就是 Go</td></tr><tr><td>运维自动化</td><td><strong>Bash + Python</strong></td><td>PowerShell（Windows）</td><td>组合拳最实用</td></tr><tr><td>嵌入式 / 单片机</td><td><strong>C</strong></td><td>Rust（新兴）</td><td>资源极小时 C 仍是标准</td></tr><tr><td>区块链</td><td><strong>Solidity</strong></td><td>Rust（Solana 系）</td><td>细分小众</td></tr><tr><td>只想&quot;会一门&quot;</td><td><strong>Python</strong></td><td>JavaScript</td><td>通用性最强</td></tr></tbody></table><hr><h2 id="七、2026-年：几个正在发生的大势">七、2026 年：几个正在发生的大势</h2><h3 id="7-1-AI-编程助手正在改写-入门">7.1 AI 编程助手正在改写&quot;入门&quot;</h3><p>ChatGPT 类工具 + 各类 AI IDE 插件，让&quot;用自然语言写代码&quot;成为常态。带来的真实变化：</p><ul><li><strong>门槛降低</strong>：不会语法也能拼出能跑的小程序，但<strong>会阅读、会调试、会设计架构</strong>的人反而更值钱；</li><li><strong>范式转移</strong>：从&quot;写代码&quot;到&quot;审代码&quot;，代码审查与测试能力成为核心技能；</li><li><strong>语言格局</strong>：AI 生成的代码主要是主流的 Python/JS/TS/Java/Go——<strong>热度榜上的常青树反而更受益</strong>。</li></ul><h3 id="7-2-Python-的统治与-补位者">7.2 Python 的统治与&quot;补位者&quot;</h3><ul><li>Python 在 AI 全链路无可撼动（大模型训练/推理/Agent 生态都在 Python 侧）；</li><li>但它的性能短板催生了&quot;补位者&quot;：<strong>Mojo</strong>（兼容 Python 语法的编译器语言）、<strong>Rust</strong>（AI 推理引擎与工具链）、<strong>Julia</strong>（数值计算）——都在抢 Python 慢的那一部分。</li></ul><h3 id="7-3-Rust-的上升与-C-C-的守成">7.3 Rust 的上升与 C/C++ 的守成</h3><ul><li>Rust 在 SO 2026 首次反超 PHP（18.0% vs 17.7%），并在 Linux 内核、Windows、浏览器引擎里持续渗透；</li><li>但它&quot;学习曲线陡 + 编译慢&quot;的缺点也真实存在，<strong>系统编程的&quot;新项目选 Rust、存量选 C/C++&quot;格局正在成形</strong>。</li></ul><h3 id="7-4-类型系统-复辟">7.4 类型系统&quot;复辟&quot;</h3><ul><li>动态语言（Python/JS）纷纷引入类型标注（Python type hint、TS 的全面普及）；</li><li>企业级工程越来越倾向&quot;静态类型兜底&quot;——<strong>&quot;动态语言的灵活 + 静态语言的可靠&quot;是 2020s 的主流调性</strong>。</li></ul><h3 id="7-5-跨平台-UI-的春天">7.5 跨平台 UI 的春天</h3><ul><li>Flutter（Dart）首次进入 TIOBE 前 20；</li><li>Tauri（Rust）等轻量桌面方案走红——<strong>&quot;一套代码、多端运行&quot;在移动与桌面两端同时提速</strong>。</li></ul><hr><h2 id="八、总结">八、总结</h2><p>把全文压成三句话：</p><ol><li><strong>语言是时代的产物</strong>：汇编为硬件、C 为系统、Java 为企业、JS 为 Web、Python 为 AI——每门语言都在回答&quot;当时最痛的那个问题&quot;。</li><li><strong>没有唯一真理，只有场景适配</strong>：系统的快选 Rust/C++，云原生的稳选 Go，AI/数据的富选 Python，Web 的通用选 JavaScript/TypeScript，企业的稳选 Java/C#；<strong>学第二语言时，优先补&quot;不同维度&quot;的（如会 Python 再学 Rust，会 JS 再学 Go）</strong>，视野比数量重要。</li><li><strong>语言会过时，思维不会</strong>：类型系统、内存模型、并发模型、范式——这些跨语言的概念才是真正的资产；<strong>AI 时代更是如此：会&quot;读、审、测&quot;比会&quot;写&quot;更值钱。</strong></li></ol><p>最后送你一句实在话：<strong>别被&quot;几百种语言&quot;吓住——你真正需要的，是精通一门、看懂几门、剩下按需查文档</strong> (๑•̀ㅂ•́)و✧</p><hr><h2 id="参考来源">参考来源</h2><blockquote><p>本文语言发展史与特性概述为公开常识性信息整理；热度数据与&quot;反超&quot;结论来自以下一手来源，均已标注统计口径。数据会随时间变化，引用时请注明统计周期。</p></blockquote><h3 id="热度数据（一手）">热度数据（一手）</h3><ol><li><p><strong>Stack Overflow Developer Survey 2026 — Programming, scripting, and markup languages</strong>（n=14,099，ODbL 1.0 授权）<br>JavaScript 62.0%、SQL 58.4%、HTML/CSS 58.2%、Python 58.0%、Bash 51.3%、TypeScript 43.8%、Java 27.6%、C# 27.1%、PowerShell 24.6%、C++ 24.3%、C 21.8%、Rust 18.0%、PHP 17.7% 等<br><a href="https://survey.stackoverflow.co/2026/technology/data/languages">https://survey.stackoverflow.co/2026/technology/data/languages</a><br>（&quot;JavaScript 连续 12 年第一、Rust 反超 PHP&quot;之结论见同年报道：<a href="https://www.techrepublic.com/article/news-stack-overflow-2026-javascript-rust-python/">TechRepublic，2026-11-20</a>）</p></li><li><p><strong>TIOBE Index（2026 年 11 月）</strong><br>“Dart 首次进入 Top 20；10 月 Julia 重返 Top 20”<br><a href="https://www.tiobe.com/tiobe-index/">https://www.tiobe.com/tiobe-index/</a></p></li></ol><h3 id="官方站点与版本动态（一手）">官方站点与版本动态（一手）</h3><ol start="3"><li><strong>Go 1.27 Release Notes</strong>（2026-08-19 发布）— <a href="https://go.dev/blog/go1.27">https://go.dev/blog/go1.27</a></li><li><strong>Go Release History</strong> — <a href="https://go.dev/doc/devel/release">https://go.dev/doc/devel/release</a></li><li><strong><a href="http://Python.org">Python.org</a> 下载页</strong>（3.15 稳定版 / 3.16 预发布）— <a href="https://www.python.org/downloads/">https://www.python.org/downloads/</a></li><li><strong>Java 版本节奏（半年一版，Java 27 于 2026-09）</strong> — <a href="https://www.oracle.com/java/technologies/java-se-support-roadmap.html">https://www.oracle.com/java/technologies/java-se-support-roadmap.html</a></li><li><strong>7-Zip / Rust / TypeScript 等官方站</strong> —— 均在各自官网，语言特性描述以官方文档为准。</li></ol><h3 id="背景参考（二手-汇总，已交叉核对）">背景参考（二手/汇总，已交叉核对）</h3><ol start="8"><li><strong>维基百科各语言词条</strong>（Fortran/Lisp/COBOL/SQL/Java/Python/Rust 等）：诞生年份与设计哲学的背景核对 — <a href="https://en.wikipedia.org/wiki/List_of_programming_languages">https://en.wikipedia.org/wiki/List_of_programming_languages</a></li><li><strong>维基百科：编程语言时间线</strong> — <a href="https://en.wikipedia.org/wiki/Timeline_of_programming_languages">https://en.wikipedia.org/wiki/Timeline_of_programming_languages</a></li></ol><h3 id="引用说明">引用说明</h3><ul><li>SO 2026 各比例分母为全部受访者（n=14,099），可多选，故总和超 100%；与 TIOBE 的&quot;搜索热度&quot;口径<strong>不可直接比较</strong>；</li><li>语言诞生年份以公开通行说法为准（如 JavaScript 1995、Rust 2010 公开/2015 1.0、Kotlin 2011 问世/2016 1.0）；</li><li>&quot;学习曲线陡/平缓&quot;为主观定性判断，供入门参考，不构成绝对结论。</li></ul>]]></content>
    
    
    <summary type="html">为什么世界上有几百种编程语言？本文用一条时间线讲清六次技术浪潮，逐一拆解 C、C++、Java、C#、Python、JavaScript、TypeScript、Go、Rust 等主流语言的诞生背景、设计哲学、适用场景与优缺点，附横向对比表、2026 年最新热度数据与按目标选语言的决策表。</summary>
    
    
    
    <category term="技术学习" scheme="https://zhaogb612.github.io/categories/%E6%8A%80%E6%9C%AF%E5%AD%A6%E4%B9%A0/"/>
    
    
    <category term="技术学习" scheme="https://zhaogb612.github.io/tags/%E6%8A%80%E6%9C%AF%E5%AD%A6%E4%B9%A0/"/>
    
    <category term="编程语言" scheme="https://zhaogb612.github.io/tags/%E7%BC%96%E7%A8%8B%E8%AF%AD%E8%A8%80/"/>
    
    <category term="计算机基础" scheme="https://zhaogb612.github.io/tags/%E8%AE%A1%E7%AE%97%E6%9C%BA%E5%9F%BA%E7%A1%80/"/>
    
  </entry>
  
  <entry>
    <title>压缩软件是怎么运行的？一文讲清核心算法、常见格式与优缺点</title>
    <link href="https://zhaogb612.github.io/posts/1a2f3c4d.html"/>
    <id>https://zhaogb612.github.io/posts/1a2f3c4d.html</id>
    <published>2026-11-21T11:00:00.000Z</published>
    <updated>2026-11-21T11:45:00.000Z</updated>
    
    <content type="html"><![CDATA[<h1 id="压缩软件是怎么运行的？一文讲清核心算法、常见格式与优缺点">压缩软件是怎么运行的？一文讲清核心算法、常见格式与优缺点</h1><p>你有没有好奇过这件事：右键一个几百 MB 的文件夹，点一下「压缩」，几秒钟后它变成了几十 MB——<strong>这中间到底发生了什么？</strong></p><p>又有没有遇到过这种困惑：</p><ul><li>把一个视频压成 zip，体积<strong>纹丝不动</strong>，开始怀疑压缩软件是不是坏了；</li><li>同一个文件夹，Windows 自带压缩出来的比 WinRAR 大一圈；</li><li><code>.zip</code>、<code>.rar</code>、<code>.7z</code>、<code>.tar.gz</code>、<code>.xz</code>……后缀一大堆，压根不知道该用哪个。</li></ul><p>这篇就把三件事讲透：<strong>压缩的底层原理</strong>（为什么能变小）、<strong>常见格式的优缺点</strong>（凭什么价格不一样）、<strong>什么时候选哪个 + 怎么落地操作</strong>（命令和工具都给你）。</p><blockquote><p>本文全部是<strong>原理与使用</strong>向内容，不涉及任何破解、注册机或恶意用途。所有命令都是正经的日常操作。</p></blockquote><hr><h2 id="一、压缩的本质：不是-把数据变小-，是-把冗余找出来">一、压缩的本质：不是&quot;把数据变小&quot;，是&quot;把冗余找出来&quot;</h2><p>先纠正一个最常见的误解。</p><h3 id="1-1-无损压缩-vs-有损压缩：根本是两种东西">1.1 无损压缩 vs 有损压缩：根本是两种东西</h3><table><thead><tr><th>类型</th><th>能否还原</th><th>原理</th><th>典型格式</th><th>谁在用</th></tr></thead><tbody><tr><td><strong>无损压缩</strong></td><td>完全还原，一个字节都不差</td><td>消除数据里的<strong>冗余</strong></td><td>ZIP、RAR、7z、gzip、xz</td><td>压缩软件（本文主角）</td></tr><tr><td><strong>有损压缩</strong></td><td>不可还原，丢弃&quot;人感知不到&quot;的信息</td><td>牺牲细节换体积</td><td>JPEG、MP3、H.264/HEVC</td><td>图片、音乐、视频编码器</td></tr></tbody></table><p><strong>你平时用的压缩软件，全部是无损的。</strong> 它不敢丢任何一个字节——因为你压的是 Word 文档、代码、安装包，解出来错一个字都不行。</p><p>有损是另一条赛道：你看图、听歌、看视频时，编码器早就把&quot;人眼人耳察觉不到&quot;的细节扔掉了。所以图片/视频/音乐的体积<strong>已经不是&quot;原始数据&quot;了，而是&quot;压缩过之后&quot;的数据</strong>。</p><h3 id="1-2-那-冗余-到底是什么">1.2 那&quot;冗余&quot;到底是什么</h3><p>无损压缩能变小，靠的是数据里天然存在的<strong>重复和规律</strong>。三种最常见的冗余：</p><table><thead><tr><th>冗余类型</th><th>通俗解释</th><th>例子</th></tr></thead><tbody><tr><td><strong>重复字符串</strong></td><td>同样的内容出现很多次</td><td>日志里一千行 <code>ERROR: connection timeout</code></td></tr><tr><td><strong>固定模式</strong></td><td>数据按某个规律排列</td><td>纯色图片 BMP 里一大片 <code>FFFFFF</code></td></tr><tr><td><strong>概率不均</strong></td><td>有的字符出现多、有的极少</td><td>中文文本里&quot;的、了、一&quot;远多于&quot;齉、龘&quot;</td></tr></tbody></table><p>人类怎么压？“啊啊啊啊啊&quot;写成&quot;啊×7”；狗怎么压？复读机。<strong>压缩算法做的其实是同一件事，只是更聪明、更通用。</strong></p><h3 id="1-3-一句话判断-这个文件能不能压">1.3 一句话判断&quot;这个文件能不能压&quot;</h3><blockquote><p><strong>冗余越多的数据，压得越狠；已经接近&quot;信息极限&quot;（高熵）的数据，怎么压都没用。</strong></p></blockquote><ul><li><strong>能压很多</strong>：文本、代码、日志、数据库导出、未压缩图片（BMP）、未压缩音频（WAV）、Office 文档；</li><li><strong>压不动</strong>：JPEG/PNG、MP3/FLAC、MP4/MKV、PDF（本身常已压缩）、压缩包再压缩；</li><li><strong>中等</strong>：exe/dll（能压一些，但有限）。</li></ul><p>所以&quot;视频压不进 zip&quot;不是软件坏了，是视频<strong>早就被压过了</strong>。想给视频减肥，请找转码工具，而不是压缩软件。</p><hr><h2 id="二、核心算法：四个-音符-组成所有压缩软件">二、核心算法：四个&quot;音符&quot;组成所有压缩软件</h2><p>深层原理没必要懂到能写实现，但下面四个概念值得每个用压缩软件的人都认识——<strong>它们决定了&quot;率&quot;和&quot;速&quot;这对永恒的矛盾</strong>。</p><h3 id="2-1-LZ77-LZ78：字典法（滑动窗口）">2.1 LZ77 / LZ78：字典法（滑动窗口）</h3><p>这是几乎所有无损压缩的<strong>地基</strong>。</p><p>思路很简单：<strong>刚才出现过的内容，第二次出现就别再写一遍，写个&quot;引用&quot;指回去</strong>。</p><p>举个例子，原文是：</p><figure class="highlight ebnf"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="attribute">ABCABCABCXYZ</span></span><br></pre></td></tr></table></figure><p>第一次出现 <code>ABC</code> 时老老实实写出来；后面两个 <code>ABC</code> 就可以写成「<strong>往回数 3 个字节，取 3 个字节</strong>」。数据从 12 个字符变成&quot;ABC + 两个小引用 + XYZ&quot;，小了。</p><ul><li><strong>LZ77</strong>：用&quot;滑动窗口&quot;记录刚看过的内容，输出 <code>(距离, 长度)</code> 引用 —— DEFLATE、LZMA、zstd 都是它的后代；</li><li><strong>LZ78</strong>：维护一张&quot;字典表&quot;，输出&quot;字典编号&quot; —— 后来被 Gif 的 LZW 发扬光大。</li></ul><h3 id="2-2-霍夫曼编码：给常用字符发-短工号">2.2 霍夫曼编码：给常用字符发&quot;短工号&quot;</h3><p>LZ 只处理&quot;重复&quot;，处理不了&quot;某些字符天生就多&quot;。霍夫曼编码解决的是这个：</p><p><strong>出现频率越高的内容，用越短的编码；出现越少的，用越长的编码。</strong></p><table><thead><tr><th>字符</th><th>出现概率</th><th>固定编码（2 bit）</th><th>霍夫曼编码</th></tr></thead><tbody><tr><td>A</td><td>50%</td><td>00</td><td><strong>0</strong></td></tr><tr><td>B</td><td>25%</td><td>01</td><td><strong>10</strong></td></tr><tr><td>C</td><td>12.5%</td><td>10</td><td><strong>110</strong></td></tr><tr><td>D</td><td>12.5%</td><td>11</td><td><strong>111</strong></td></tr></tbody></table><p>固定编码平均每个字符 2 bit；霍夫曼只要 1.75 bit——同样是&quot;无损&quot;，平均省了 12.5%。</p><h3 id="2-3-DEFLATE：LZ77-霍夫曼，一代-万金油">2.3 DEFLATE：LZ77 + 霍夫曼，一代&quot;万金油&quot;</h3><p><strong>DEFLATE = LZ77（找重复）+ 霍夫曼编码（再压一层）</strong>，两段式流水线，1989 年由 Phil Katz 给出规范（RFC 1951）。</p><p>它的江湖地位极其夸张：</p><table><thead><tr><th>你天天在用的东西</th><th>底子是 DEFLATE</th></tr></thead><tbody><tr><td>ZIP 压缩包</td><td>是</td></tr><tr><td>gzip（<code>.gz</code>，HTTP 压缩）</td><td>是</td></tr><tr><td>PNG 图片</td><td>是</td></tr><tr><td>HTTP/1.1 的 <code>Content-Encoding: gzip/deflate</code></td><td>是</td></tr></tbody></table><p>优点：简单、可靠、解压快、<strong>实现到处都有</strong>。缺点：压缩率&quot;够用但不出众&quot;，而且单文件压缩基本是单线程。</p><h3 id="2-4-进阶选手：LZMA、Zstandard、Brotli、LZ4-各是什么">2.4 进阶选手：LZMA、Zstandard、Brotli、LZ4 各是什么</h3><table><thead><tr><th>算法</th><th>谁家的</th><th>核心卖点</th><th>典型用途</th><th>通俗类比</th></tr></thead><tbody><tr><td><strong>LZMA / LZMA2</strong></td><td>Igor Pavlov（7-Zip 作者）</td><td><strong>压缩率第一梯队</strong>，大字典 + 范围编码</td><td>7z、xz 格式</td><td>慢工出细活的&quot;档案管理员&quot;</td></tr><tr><td><strong>Zstandard (zstd)</strong></td><td>Facebook（2016）</td><td><strong>率/速可自由调节</strong>，解压极快，等级 1~22</td><td>Linux 内核、发行版、容器镜像、现代备份</td><td>有变速档的&quot;全能选手&quot;</td></tr><tr><td><strong>Brotli</strong></td><td>Google（2015）</td><td>面向<strong>文本/网页</strong>优化，同档速率下比 gzip 更小</td><td>HTTPS 网页传输（<code>br</code>）</td><td>专门给网页瘦身的&quot;营养师&quot;</td></tr><tr><td><strong>LZ4</strong></td><td>Yann Collet（LZ 家族）</td><td><strong>快到没朋友</strong>，压缩率一般</td><td>系统快照、数据库、内核/zfs</td><td>只顾速度的&quot;快递员&quot;</td></tr><tr><td><strong>bzip2</strong></td><td>Seward（1996）</td><td>BWT 变换，率不错</td><td>上世纪退役选手，仍见于旧脚本</td><td>曾经的中坚，如今被顶替</td></tr><tr><td><strong>gzip</strong></td><td>GNU（1992）</td><td>老、快、普及</td><td>网页、<code>tar.gz</code>、Unix 默认</td><td>资格最老的老黄牛</td></tr></tbody></table><p>几个值得记住的<strong>定性结论</strong>（数值随数据浮动，别死记）：</p><ul><li>压缩率大致：<strong>LZMA2（7z/xz）≥ zstd 高等级 &gt; bzip2 ≈ DEFLATE(gzip/zip) &gt; LZ4</strong>；</li><li>解压速度大致：<strong>LZ4 &gt; zstd &gt; gzip ≈ deflate &gt; LZMA2 ≈ bzip2</strong>；</li><li><strong>zstd 是近十年唯一&quot;又大又快还能调&quot;的选手</strong>，所以服务器和备份圈都在拥抱它；</li><li>LZMA 想压缩率高，就得<strong>大字典 + 长时间 + 大内存</strong>——世上没有免费的午餐。</li></ul><hr><h2 id="三、常见格式横评：优缺点一张表看懂">三、常见格式横评：优缺点一张表看懂</h2><p>格式 = <strong>容器（怎么组织文件）+ 算法（怎么压）+ 附加能力（加密/分卷/恢复）</strong>。下面按&quot;你日常会不会真的遇到&quot;来排。</p><h3 id="3-1-总表">3.1 总表</h3><table><thead><tr><th>格式</th><th>压缩率</th><th>压缩速度</th><th>解压速度</th><th>加密</th><th>分卷</th><th>固实</th><th>跨平台</th><th>开源/授权</th><th>典型场景</th></tr></thead><tbody><tr><td><strong>ZIP</strong></td><td>中</td><td>快</td><td>快</td><td>ZipCrypto（弱）/ AES</td><td>支持</td><td>标准无</td><td><strong>全员支持</strong></td><td>规范公开</td><td>日常分享、Windows 自带</td></tr><tr><td><strong>RAR</strong></td><td>高</td><td>中</td><td>中</td><td>AES-256</td><td><strong>成熟</strong></td><td>支持</td><td>中</td><td><strong>闭源专利</strong></td><td>分卷传大文件、恢复记录</td></tr><tr><td><strong>7z</strong></td><td><strong>最高档</strong></td><td>慢</td><td>中</td><td><strong>AES-256 + 头部加密</strong></td><td>支持</td><td>支持</td><td>中</td><td>开源（LGPL）</td><td>长期备份、最高压缩率</td></tr><tr><td><strong>gzip (.gz)</strong></td><td>中</td><td>快</td><td>快</td><td>无</td><td>无</td><td>单文件</td><td>全员</td><td>开源</td><td>网页、<code>tar.gz</code>、日志轮转</td></tr><tr><td><strong>bzip2 (.bz2)</strong></td><td>中高</td><td>慢</td><td>中</td><td>无</td><td>无</td><td>单文件</td><td>广</td><td>开源</td><td>老服务器、旧脚本</td></tr><tr><td><strong>xz</strong></td><td><strong>最高档</strong></td><td><strong>很慢</strong></td><td>中</td><td>无（靠外层）</td><td>无</td><td>单文件/块</td><td>广</td><td>开源</td><td>Linux 发行版、AppImage</td></tr><tr><td><strong>zstd (.zst)</strong></td><td>高（可调）</td><td><strong>极快</strong></td><td><strong>极快</strong></td><td>无</td><td>无</td><td>单文件</td><td>广</td><td>开源（BSD）</td><td>备份、容器、现代服务器</td></tr><tr><td><strong>LZ4 (.lz4)</strong></td><td>低</td><td><strong>飞</strong></td><td><strong>飞</strong></td><td>无</td><td>无</td><td>单文件</td><td>广</td><td>开源</td><td>快照、热数据、内核</td></tr><tr><td><strong>tar</strong></td><td>不压！</td><td>—</td><td>—</td><td>无</td><td>无</td><td>无</td><td>全员</td><td>开源</td><td>与上述算法叠加成 <code>.tar.gz</code> 等</td></tr></tbody></table><blockquote><p><strong>特别强调</strong>：<strong>tar 不是压缩，是&quot;打包&quot;</strong>。它把一堆文件、目录结构、Unix 权限原样装进一个文件（以前是磁带归档），本身不压缩。所以才有 <code>.tar.gz</code>、<code>.tar.xz</code>、<code>.tar.zst</code> 这种&quot;先打包再压&quot;的组合。Windows 10 1803+ 自带 tar（bsdtar），Linux/macOS 更是标配。</p></blockquote><h3 id="3-2-逐个说优缺点">3.2 逐个说优缺点</h3><p><strong>ZIP —— 兼容性之王</strong></p><ul><li>优点：<strong>是个操作系统就认</strong>（Windows 右键、macOS、手机、路由器都能解）；规范公开免费；体积小的文件秒开。</li><li>缺点：DEFLATE 压缩率一般；标准不含固实压缩；<strong>ZipCrypto 加密早已被攻破</strong>（详见第七章）；没有恢复记录，包坏了就坏了。</li><li>适合：日常发文件、给不特定的人、跨设备传输。</li></ul><p><strong>RAR —— 分卷与恢复记录的专家</strong></p><ul><li>优点：压缩率高；**恢复记录（Recovery Record）**是独门绝技——加 5% 左右冗余，坏档也能修复；分卷（<code>.part1.rar</code>…）最成熟；固实压缩可选。</li><li>缺点：<strong>格式闭源、有专利</strong>，创建 RAR 主要靠 WinRAR（收费/试用）或其授权软件；开源软件一般只能解不能压。</li><li>适合：要往网盘传大文件（分卷）、介质可能有损坏的长期保存。</li></ul><p><strong>7z —— 开源压缩率天花板</strong></p><ul><li>优点：LZMA2 压缩率常年第一档；<strong>AES-256 加密 + 头部加密</strong>（文件名都藏起来）；支持多线程、分卷、固实；完全开源免费无广告。</li><li>缺点：压缩<strong>慢、吃内存</strong>；生态窄一点（不过 Windows 11 资源管理器已能直接解压，7-Zip 本体也是装机标配了）。</li><li>适合：<strong>珍贵资料的长期归档备份</strong>，尤其是&quot;压一次，放三年&quot;的场景。</li></ul><p><strong>gzip / bzip2 / xz —— Unix 三件套</strong></p><ul><li><code>gzip</code>：老黄牛，网页压缩和 <code>.tar.gz</code> 的地基，快但率一般；</li><li><code>bzip2</code>：曾经的率之选，现在被 xz/zstd 顶替，旧脚本里还能见到；</li><li><code>xz</code>：<strong>压缩率天花板之一</strong>（LZMA2），Linux 发行版和 AppImage 的默认，代价是压缩极慢、内存占用大。</li></ul><p><strong>zstd —— 当代&quot;六边形战士&quot;</strong></p><ul><li>优点：压缩率可调（从&quot;追上 LZ4 的速度&quot;到&quot;逼近 LZMA 的压缩率&quot;），<strong>解压永远飞快</strong>，多线程友好；<code>tar --zstd</code> 一行就能用。</li><li>缺点：老系统和旧设备的工具链不认识 <code>.zst</code>，跨平台场景要小心。</li><li>适合：服务器备份、容器层、CI 缓存、以及&quot;嫌 gzip 率低、又嫌 xz 太慢&quot;的所有人。</li></ul><p><strong>LZ4 —— 快就是正义</strong></p><ul><li>适合：数据库快照、内存缓存、内核压缩（Linux 内核、ZFS 都用它）——在这些场景里，<strong>速度比压缩率值钱得多</strong>。</li></ul><hr><h2 id="四、落地第一步：按场景选格式">四、落地第一步：按场景选格式</h2><p>没有&quot;最牛的格式&quot;，只有&quot;最合适场景的格式&quot;。下面这张表可以直接照着抄：</p><table><thead><tr><th>你的场景</th><th>选它</th><th>理由</th></tr></thead><tbody><tr><td>给同事/朋友/客户发文件</td><td><strong>ZIP</strong></td><td>他们可能用手机、macOS、Windows，ZIP 谁都能开</td></tr><tr><td>重要资料<strong>长期冷备份</strong></td><td><strong>7z</strong>（<code>-mx=9</code>）+ 分卷 + 测试</td><td>压缩率最大、AES-256 可加密、可验证完整性</td></tr><tr><td>每天/每周备份大目录（要快）</td><td><strong>tar + zstd</strong>（<code>tar --zstd -cf</code>）</td><td>速度快、率不差、解压飞快</td></tr><tr><td>服务器部署、源码包发布</td><td><code>tar.gz</code>（通用）/ <code>tar.xz</code>（更小）/ <code>tar.zst</code>（现代）</td><td>保 Unix 权限，Linux 工具链直接处理</td></tr><tr><td>发布软件给全网用户</td><td>ZIP 或 7z 自解压（SFX）</td><td>打包成 exe，用户的电脑双击即解</td></tr><tr><td>传敏感文件（合同/密钥/私密照）</td><td><strong>7z AES-256 + 头部加密</strong></td><td>加密同时隐藏文件名；避免 ZipCrypto</td></tr><tr><td>网盘/邮箱体积限制</td><td><strong>RAR 或 7z 分卷</strong>（如 <code>-v100m</code>）</td><td>切成指定大小的小卷；RAR 还带恢复记录抗损坏</td></tr><tr><td>归档的是<strong>视频/图片/音乐素材</strong></td><td><strong>只打包不压缩</strong></td><td>这些已是压缩格式，强行压缩浪费时间还几乎不省空间（7z 用 <code>-m0=copy</code> 或 ZIP 的 Store）</td></tr><tr><td>内存小、追求解压快的老机器</td><td><strong>zstd 中低等级</strong> 或 gzip</td><td>解压不吃内存、不卡</td></tr></tbody></table><hr><h2 id="五、落地第二步：软件怎么选">五、落地第二步：软件怎么选</h2><h3 id="5-1-直接给结论">5.1 直接给结论</h3><table><thead><tr><th>软件</th><th>授权</th><th>广告/捆绑</th><th>建议</th></tr></thead><tbody><tr><td><strong>7-Zip</strong></td><td>开源免费</td><td>无</td><td><strong>首选，装机标配</strong>，压缩率+加密能力拉满</td></tr><tr><td><strong>NanaZip</strong></td><td>开源免费</td><td>无</td><td>7-Zip 的 Windows 11 现代化版，右键菜单更漂亮，商店可装</td></tr><tr><td><strong>WinRAR</strong></td><td>共享（试用）</td><td>有促销提示</td><td>需要&quot;恢复记录/兼容 RAR 分卷&quot;时再装；日常 7-Zip 够用</td></tr><tr><td><strong>Bandizip</strong></td><td>免费/Pro</td><td>新版带推广</td><td>界面好看，追求颜值可备选</td></tr><tr><td><strong>PeaZip</strong></td><td>开源免费</td><td>无</td><td>7-Zip 的图形增强替代，重度用户可选</td></tr><tr><td><strong>Windows 自带</strong></td><td>系统内置</td><td>无</td><td>只能创建/解压基础 ZIP，Win11 可解 7z/rar，应急够用</td></tr></tbody></table><p><strong>明确不推荐</strong>：360 压缩、好压、快压等——历史上捆绑推广、弹窗、静默安装的黑历史太多，你的压缩软件<strong>没有理由不是干净的</strong>。（还记得之前《杀毒软件运行原理与病毒拦截》里说的吗：<strong>捆绑软件是木马最爱用的跳板</strong>。）</p><h3 id="5-2-一键安装">5.2 一键安装</h3><figure class="highlight powershell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># 管理员 PowerShell 里跑，自动装好 7-Zip</span></span><br><span class="line">winget install <span class="number">7</span>zip.<span class="number">7</span>zip</span><br><span class="line"></span><br><span class="line"><span class="comment"># 想要 Windows 11 商店版（NanaZip）</span></span><br><span class="line">winget install M2Team.NanaZip</span><br></pre></td></tr></table></figure><p>装完重启资源管理器，右键菜单里就会出现「7-Zip」菜单。</p><hr><h2 id="六、落地第三步：命令行实操">六、落地第三步：命令行实操</h2><p>图形界面人人会点，真正拉开差距的是这几条命令。<strong>Windows 10/11 自带 tar，装完 7-Zip 后 <code>7z</code> 也可在终端里直接用。</strong></p><h3 id="6-1-7z：压缩-解压-测试-查看">6.1 7z：压缩 / 解压 / 测试 / 查看</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># 基本压缩（默认 7z 格式）</span></span><br><span class="line">7z a mybackup.7z <span class="string">&quot;D:\资料文件夹&quot;</span></span><br><span class="line"></span><br><span class="line"><span class="comment"># 指定格式 + 最高压缩率 + 多线程</span></span><br><span class="line">7z a -t7z -mx=9 -mmt=on mybackup.7z <span class="string">&quot;D:\资料文件夹&quot;</span></span><br><span class="line"></span><br><span class="line"><span class="comment"># 加密压缩：AES-256 + 头部加密（文件名也隐藏）+ 分卷 100MB</span></span><br><span class="line">7z a -p<span class="string">&quot;你的强密码&quot;</span> -mhe=on -v100m mybackup.7z <span class="string">&quot;D:\资料文件夹&quot;</span></span><br><span class="line"></span><br><span class="line"><span class="comment"># 解压到指定目录（x=保留目录结构；e=全部拍平到一层）</span></span><br><span class="line">7z x mybackup.7z -o<span class="string">&quot;D:\解压目标&quot;</span></span><br><span class="line"></span><br><span class="line"><span class="comment"># 测试完整性（校验 CRC，归档前必做）</span></span><br><span class="line">7z t mybackup.7z</span><br></pre></td></tr></table></figure><p>参数速查：<code>-mx=</code> 压缩等级 0~9；<code>-mmt=</code> 多线程开关；<code>-p</code> 密码；<code>-mhe=</code> 头部加密（仅 7z）；<code>-v100m</code> 按 100MB 分卷；<code>-t</code> 指定格式（zip/7z/xz/tar…）。</p><blockquote><p>给 ZIP 加密时注意：<code>7z a -tzip -mem=AES256 -p密码 out.zip ...</code> 才能启用 ZIP 的 AES 加密；默认是弱鸡 ZipCrypto（见第七章）。</p></blockquote><h3 id="6-2-tar：打包三件套（Windows-自带）">6.2 tar：打包三件套（Windows 自带）</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># 打包压缩：tar.gz（通用）/ tar.xz（更小）/ tar.zst（快）</span></span><br><span class="line">tar -czf backup.tar.gz   <span class="string">&quot;D:\资料文件夹&quot;</span></span><br><span class="line">tar -cJf backup.tar.xz   <span class="string">&quot;D:\资料文件夹&quot;</span></span><br><span class="line">tar --zstd -cf backup.tar.zst <span class="string">&quot;D:\资料文件夹&quot;</span></span><br><span class="line"></span><br><span class="line"><span class="comment"># 解压（自动识别格式）</span></span><br><span class="line">tar -xzf backup.tar.gz</span><br><span class="line"><span class="comment"># 只看里面有什么，不解压</span></span><br><span class="line">tar -tf backup.tar.gz</span><br></pre></td></tr></table></figure><h3 id="6-3-自己动手：一个可复现的格式对比测试">6.3 自己动手：一个可复现的格式对比测试</h3><p>网上到处是&quot;XX 格式比 YY 省 30%“的结论，但<strong>压缩率极度依赖数据内容</strong>。给你一段能自己在机器上复现的测试脚本，五分钟后你就有&quot;自己的结论”：</p><figure class="highlight powershell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># 1) 造一个适合压缩的测试文件（约 200MB 可压缩文本）</span></span><br><span class="line"><span class="number">1</span>..<span class="number">200000</span> | <span class="built_in">ForEach-Object</span> &#123; <span class="string">&quot;第 <span class="variable">$_</span> 行：这是一行可以被很好压缩的中文文本，&quot;</span> * <span class="number">3</span> &#125; |</span><br><span class="line">  <span class="built_in">Set-Content</span> <span class="literal">-Encoding</span> UTF8 test.txt</span><br><span class="line"></span><br><span class="line"><span class="comment"># 2) 分别用不同格式压缩并计时</span></span><br><span class="line"><span class="variable">$tests</span> = <span class="selector-tag">@</span>(</span><br><span class="line">  <span class="selector-tag">@</span>&#123;n=<span class="string">&#x27;zip(default)&#x27;</span>; a=<span class="string">&#x27;-tzip&#x27;</span>&#125;,</span><br><span class="line">  <span class="selector-tag">@</span>&#123;n=<span class="string">&#x27;7z-LZMA2-mx9&#x27;</span>; a=<span class="string">&#x27;-t7z -mx=9&#x27;</span>&#125;,</span><br><span class="line">  <span class="selector-tag">@</span>&#123;n=<span class="string">&#x27;xz-LZMA2-mx9&#x27;</span>; a=<span class="string">&#x27;-txz -mx=9&#x27;</span>&#125;</span><br><span class="line">)</span><br><span class="line"><span class="keyword">foreach</span> (<span class="variable">$t</span> <span class="keyword">in</span> <span class="variable">$tests</span>) &#123;</span><br><span class="line">  <span class="variable">$sw</span> = [<span class="type">Diagnostics.Stopwatch</span>]::StartNew()</span><br><span class="line">  <span class="number">7</span>z a <span class="variable">$t</span>.a (<span class="variable">$t</span>.n + <span class="string">&#x27;.bin&#x27;</span>) test.txt <span class="literal">-bso0</span> <span class="literal">-bsp0</span> | <span class="built_in">Out-Null</span></span><br><span class="line">  <span class="variable">$sw</span>.Stop()</span><br><span class="line">  <span class="string">&#x27;&#123;0,-14&#125; 耗时 &#123;1,6:N1&#125;s  结果 &#123;2,7:N2&#125; MB&#x27;</span> <span class="operator">-f</span> <span class="variable">$t</span>.n, <span class="variable">$sw</span>.Elapsed.TotalSeconds, ((<span class="built_in">Get-Item</span> (<span class="variable">$t</span>.n + <span class="string">&#x27;.bin&#x27;</span>)).Length / <span class="number">1</span>MB)</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure><p><strong>怎么读结果</strong>：对比&quot;压缩后体积&quot;和&quot;耗时&quot;两个数——你会发现 xz 比 zip 小得多，但慢得也多。备份可以等，办公文件不值得等。<strong>也要记住：换成二进制文件（比如把 test.txt 换成一段视频），三者的差距会瞬间缩小</strong>，因为冗余没了。</p><h3 id="6-4-完整性校验：比-能解压-更硬的证据">6.4 完整性校验：比&quot;能解压&quot;更硬的证据</h3><figure class="highlight powershell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># 发布方给了 SHA256 时，解压前先核对</span></span><br><span class="line"><span class="built_in">Get-FileHash</span> .\backup.<span class="number">7</span>z <span class="literal">-Algorithm</span> SHA256</span><br><span class="line"></span><br><span class="line"><span class="comment"># 或者归档后立刻自测：CRC 全过才算备份成功</span></span><br><span class="line"><span class="number">7</span>z t backup.<span class="number">7</span>z</span><br></pre></td></tr></table></figure><hr><h2 id="七、五个误区与坑（建议收藏）">七、五个误区与坑（建议收藏）</h2><table><thead><tr><th>#</th><th>常见说法</th><th>真相</th></tr></thead><tbody><tr><td>1</td><td>“压缩软件能把视频/图片压小”</td><td>视频图片<strong>本身已是压缩格式</strong>，无损压缩对高熵数据几乎无效；想变小请转码（有损）</td></tr><tr><td>2</td><td>“压缩级别越高越好”</td><td>级别高 = 更慢 + 更吃内存，收益却递减；备份和日常要分开定级别</td></tr><tr><td>3</td><td>“zip 加了密码就安全”</td><td><strong>ZipCrypto 早被攻破</strong>——只要知道部分明文内容，工具（如 bkcrack）就能秒破；务必用 AES（7-Zip 加 <code>-mem=AES256</code>）或直接用 7z 格式</td></tr><tr><td>4</td><td>“压缩包不会有毒，我解压而已”</td><td>毒不在压缩包里，在<strong>解压出来被你双击的那个 exe</strong>——还记得《银狐木马》里说的吗？<strong>银狐最爱的投递方式就是&quot;压缩包里套一个伪装的安装程序&quot;</strong>；密码保护的压缩包更是攻击者刻意绕扫描</td></tr><tr><td>5</td><td>“分卷文件越多越安全”</td><td>分卷只是切块，<strong>和加密、校验无关</strong>；任何一个卷损坏都可能打不开整个包（RAR 恢复记录是少数解药）</td></tr></tbody></table><p>再补一个进阶提醒：<strong>解压炸弹</strong>——一个&quot;体积很小、解出来却几百 GB&quot;的恶意压缩包，专门用来撑爆硬盘和杀软的扫描。陌生来源的压缩包，建议先 <code>7z l</code> 看看里面的文件列表和数量，再决定要不要解。</p><hr><h2 id="八、总结">八、总结</h2><p>把全文压成三句话：</p><ol><li><strong>压缩 = 找冗余</strong>：LZ77/字典法处理&quot;重复&quot;，霍夫曼处理&quot;频率不均&quot;，DEFLATE 把两者叠起来就成了 ZIP 的地基；<strong>能压多少，取决于数据本身的冗余有多少</strong>。</li><li><strong>没有万能的格式</strong>：日常分享用 ZIP（兼容）；长期备份用 7z（最率 + AES-256）；要速度用 zstd/LZ4；Linux 世界用 tar 打底。</li><li><strong>&quot;率、速、兼容、安全&quot;四选三</strong>：任何格式都是在这四个维度上做的取舍——追求极致压缩率就接受慢和内存，追求兼容就接受率一般，密码一律用 AES 别碰 ZipCrypto。</li></ol><p>最后送你一个下意识动作：<strong>归档前想三秒&quot;这个文件以后谁要开、开几次、防不防丢&quot;</strong>，格式就自己跳出来了 (๑•̀ㅂ•́)و✧</p><hr><h2 id="参考来源">参考来源</h2><blockquote><p>算法细节与格式规范均来自公开的 RFC 与官方文档；格式能力的对比基于各家官方说明整理，数值类结论因数据而异，正文已标注为&quot;定性结论&quot;。</p></blockquote><h3 id="规范与标准（RFC-官方）">规范与标准（RFC / 官方）</h3><ol><li><strong>RFC 1951：DEFLATE Compressed Data Format Specification</strong>（ZIP/gzip/PNG 的压缩算法标准）— <a href="https://www.rfc-editor.org/rfc/rfc1951">https://www.rfc-editor.org/rfc/rfc1951</a></li><li><strong>RFC 1950：ZLIB Compressed Data Format</strong>（DEFLATE 的数据包装/校验层）— <a href="https://www.rfc-editor.org/rfc/rfc1950">https://www.rfc-editor.org/rfc/rfc1950</a></li><li><strong>RFC 1952：GZIP file format specification</strong> — <a href="https://www.rfc-editor.org/rfc/rfc1952">https://www.rfc-editor.org/rfc/rfc1952</a></li><li><strong>RFC 8878：Zstandard Compression and the ‘application/zstd’ Media Type</strong> — <a href="https://www.rfc-editor.org/rfc/rfc8878">https://www.rfc-editor.org/rfc/rfc8878</a></li><li><strong>RFC 7932：Brotli Compressed Data Format</strong> — <a href="https://www.rfc-editor.org/rfc/rfc7932">https://www.rfc-editor.org/rfc/rfc7932</a></li><li><strong>PKWARE APPNOTE.TXT：ZIP File Format Specification</strong>（ZIP 格式官方规范，含加密方法定义）— <a href="https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT">https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT</a></li></ol><h3 id="实现与官方项目">实现与官方项目</h3><ol start="7"><li><strong>7-Zip 官方网站（含命令行参数 <code>-mx</code>/<code>-mmt</code>/<code>-mhe</code>/<code>-v</code> 的完整文档）</strong> — <a href="https://www.7-zip.org/">https://www.7-zip.org/</a></li><li><strong>7-Zip LZMA SDK（LZMA/LZMA2 算法作者 Igor Pavlov）</strong> — <a href="https://www.7-zip.org/sdk.html">https://www.7-zip.org/sdk.html</a></li><li><strong>xz / LZMA2 官方项目（tukaani）</strong> — <a href="https://tukaani.org/xz/">https://tukaani.org/xz/</a></li><li><strong>Zstandard 官方（Facebook，等级 1~22 与 <code>--fast</code> 说明）</strong> — <a href="https://github.com/facebook/zstd">https://github.com/facebook/zstd</a></li><li><strong>bzip2 官方项目</strong> — <a href="https://www.sourceware.org/bzip2/">https://www.sourceware.org/bzip2/</a></li><li><strong>WinRAR / RARLAB 官方（RAR 格式、恢复记录、分卷说明）</strong> — <a href="https://www.rarlab.com/">https://www.rarlab.com/</a></li><li><strong>NanaZip（Windows 11 商店版 7-Zip）</strong> — <a href="https://github.com/M2Team/NanaZip">https://github.com/M2Team/NanaZip</a></li></ol><h3 id="背景与安全参考">背景与安全参考</h3><ol start="14"><li><strong>bkcrack：ZipCrypto 已知明文攻击工具（证明 ZipCrypto 不可靠）</strong> — <a href="https://github.com/kimci86/bkcrack">https://github.com/kimci86/bkcrack</a></li><li><strong>Microsoft Learn：Windows 下的 tar 命令</strong> — <a href="https://learn.microsoft.com/zh-cn/windows-server/administration/windows-commands/tar">https://learn.microsoft.com/zh-cn/windows-server/administration/windows-commands/tar</a></li><li><strong>Wikipedia：DEFLATE、LZMA、ZIP、Zstandard、Brotli、gzip、bzip2、tar 词条</strong>（格式历史与生态背景）— <a href="https://en.wikipedia.org/wiki/DEFLATE">https://en.wikipedia.org/wiki/DEFLATE</a></li></ol><h3 id="引用说明">引用说明</h3><ul><li>文中&quot;压缩率/速度&quot;的排序为<strong>定性结论</strong>，实际数值随数据类型、字典大小、硬件差异而变化，第三节 6.3 给出了读者可自测的脚本；</li><li>&quot;Windows 资源管理器原生支持解压 7z/RAR/tar&quot;指 <strong>Windows 11 23H2 及以后版本</strong>的系统增强（基于 libarchive），创建仍以 ZIP 为主；</li><li>ZipCrypto 可被攻击的结论来自公开的已知明文攻击研究（见来源 14），7-Zip 官方对 ZIP AES-256 的支持见来源 7 的加密说明页。</li></ul>]]></content>
    
    
    <summary type="html">右键&quot;压缩&quot;到底发生了什么？本文从无损与有损的区别、LZ77 字典法与霍夫曼编码讲起，拆解 DEFLATE / LZMA / Zstandard 等核心算法，对比 ZIP、RAR、7z、gzip、xz、zstd 的真实优缺点，最后给出场景选型表、软件推荐与命令行实操。</summary>
    
    
    
    <category term="技术学习" scheme="https://zhaogb612.github.io/categories/%E6%8A%80%E6%9C%AF%E5%AD%A6%E4%B9%A0/"/>
    
    
    <category term="压缩" scheme="https://zhaogb612.github.io/tags/%E5%8E%8B%E7%BC%A9/"/>
    
    <category term="文件格式" scheme="https://zhaogb612.github.io/tags/%E6%96%87%E4%BB%B6%E6%A0%BC%E5%BC%8F/"/>
    
  </entry>
  
  <entry>
    <title>银狐木马：从底层运行原理到「搜索引擎投毒」的完整鉴别指南</title>
    <link href="https://zhaogb612.github.io/posts/f7e2b9a1.html"/>
    <id>https://zhaogb612.github.io/posts/f7e2b9a1.html</id>
    <published>2026-11-05T15:00:00.000Z</published>
    <updated>2026-11-05T15:30:00.000Z</updated>
    
    <content type="html"><![CDATA[<h1 id="银狐木马：从底层运行原理到「搜索引擎投毒」的完整鉴别指南">银狐木马：从底层运行原理到「搜索引擎投毒」的完整鉴别指南</h1><p>你有没有过这种经历：想下个 WPS，搜出来的第一个链接点进去，页面和官网一模一样，下载按钮也很&quot;官方&quot;，装完之后电脑开始莫名其妙地卡、微信自动给人发消息、任务管理器里多了几个看不懂的进程……</p><p>大概率不是你的错觉，是<strong>银狐</strong>。</p><p>这篇想干的事很具体：<strong>先把它的底层运行原理拆到能对上号的程度，再把它&quot;怎么混进搜索结果&quot;讲清楚，最后给一套普通人也能照着做的鉴别流程。</strong> 不是&quot;别乱点链接&quot;这种正确的废话，而是&quot;看哪几个字段、跑哪几条命令、出现什么就该停手&quot;。</p><blockquote><p>本文只讲<strong>防御与鉴别</strong>。文中出现的路径、注册表键、IOCTL 码、互斥体名都是<strong>检测特征</strong>，不含任何可直接复用的攻击代码。所有样本细节均来自公开的厂商分析与监管通报，来源见文末归档。</p></blockquote><hr><h2 id="一、先把对手认清楚">一、先把对手认清楚</h2><h3 id="1-1-它有一堆名字">1.1 它有一堆名字</h3><p>同一个黑产团伙，不同厂商给了不同代号，这本身就说明它被反复捕获、反复改名：</p><table><thead><tr><th>代号</th><th>使用者</th><th>备注</th></tr></thead><tbody><tr><td><strong>银狐</strong></td><td>国内通用叫法</td><td>最早由微步在线于 2023 年 3 月捕获并命名</td></tr><tr><td><strong>游蛇（SwimSnake）</strong></td><td>安天 / CNCERT</td><td>安天样本命名 <code>Trojan/Win32.SwimSnake</code></td></tr><tr><td><strong>谷堕大盗</strong></td><td>多家厂商</td><td>早期叫法</td></tr><tr><td><strong>UTG-Q-1000</strong></td><td>部分情报厂商</td><td>组织编号式命名</td></tr><tr><td><strong>Lotok</strong></td><td>火绒</td><td>家族名</td></tr><tr><td><strong>SilverFox</strong></td><td>CNCERT</td><td>风险提示文件名与线索邮箱 <code>silverfox@cert.org.cn</code></td></tr></tbody></table><p>记住一个判断：<strong>这些名字指的不是&quot;一个病毒文件&quot;，而是一条产业链。</strong> 火绒在报告里说得很直白——银狐源码已在暗网公开，任何人拿到改一改就能发起定制化攻击，地下市场甚至形成了&quot;免杀服务&quot;的分工。所以你会看到它的变种数量&quot;庞大到无法枚举&quot;，每一批的手法都不完全一样。</p><h3 id="1-2-时间线（只列有出处的节点）">1.2 时间线（只列有出处的节点）</h3><table><thead><tr><th>时间</th><th>事件</th></tr></thead><tbody><tr><td>2020 年</td><td>火绒记录银狐首次现身</td></tr><tr><td>2022 年下半年</td><td>开始频繁活跃，主攻国内用户</td></tr><tr><td>2023 年 3 月</td><td>微步在线首次捕获并命名&quot;银狐&quot;</td></tr><tr><td>2024 年 7 月</td><td>多地公安发布银狐预警</td></tr><tr><td>2024 年 9 月</td><td>火绒披露&quot;反沙箱 + 下载 TrueSightKiller 驱动关杀软&quot;变种</td></tr><tr><td>2025 年 4–5 月</td><td>日上线境内&quot;肉鸡&quot;最高超 1.7 万，累计约 12.7 万台（CNCERT + 安天）</td></tr><tr><td>2025 年 9 月</td><td>火绒披露 OLLVM + VMProtect 多层混淆变种</td></tr><tr><td>2025 年 10 月</td><td>安天发布&quot;WPS 下载站打假专辑&quot;</td></tr><tr><td>2025 年 12 月</td><td>CNCERT 通报&quot;黑猫&quot;团伙仿冒 Notepad++</td></tr><tr><td>2026 年 5 月</td><td>CNCERT 通报批量 AI 生成钓鱼站；国家计算机病毒应急处理中心发布预警</td></tr><tr><td>2026 年 6 月</td><td>多地警方公布 5 起银狐案件，涉案金额合计超 1300 万元</td></tr><tr><td>2026 年 8 月</td><td>安天披露 ChaCha20 + APC 注入 + 中文系统校验的新链路</td></tr><tr><td>2026 年 9 月</td><td>CNCERT 披露&quot;甲蚁（G01）&quot;团伙 1060 个仿冒域名、8 天控制 8708 台主机</td></tr></tbody></table><h3 id="1-3-它为什么专挑-财务、人事、运维">1.3 它为什么专挑&quot;财务、人事、运维&quot;</h3><p>不是玄学，是<strong>投入产出比</strong>。</p><ul><li><strong>财务/人事</strong>：手里有付款流程、工资表、人员名单，社工话术现成——“违纪名单”“裁员补偿”“税务稽查”“补贴通知”。北京大学计算中心的通告里列的就是这批文件名。</li><li><strong>运维/开发</strong>：CNCERT 在&quot;甲蚁&quot;报告里点明了转向原因——这类人<strong>持有高价值主机权限</strong>，一台被控就能横向移动进内网。所以仿冒目标从 WPS、Chrome 转向了 <strong>FinalShell、Xshell、SecureCRT、NexusDesk</strong>。</li></ul><p>一句话：<strong>银狐不是随机撒网，它在挑&quot;被控之后最值钱的那台机器&quot;。</strong></p><h3 id="1-4-和-Gh0st-的血缘">1.4 和 Gh0st 的血缘</h3><p>银狐的远控模块大量沿用 <strong>Gh0st</strong> 系（公开源码的经典国产远控）的通信结构，百度百科条目直接写&quot;改写自开源的 Ghost 木马，为 4.0 版本&quot;；安天 2026 年 8 月捕获的新批次里，上线模块已经换成了 <strong>Winos 4.0</strong>。</p><p>这意味着：<strong>它的&quot;远控功能&quot;不新鲜，新鲜的是&quot;怎么把远控送进去、怎么不被发现&quot;。</strong> 后面几章全部在讲这件事。</p><hr><h2 id="二、底层原理（一）：一条五段式攻击链">二、底层原理（一）：一条五段式攻击链</h2><p>先看全貌，再逐段拆。所有环节都能在公开报告里找到对应样本。</p><table><thead><tr><th>阶段</th><th>干什么</th><th>典型动作</th></tr></thead><tbody><tr><td><strong>① 投递</strong></td><td>让你主动下载/打开</td><td>搜索引擎 SEO 投毒、仿冒官网、微信群/QQ 群文件、钓鱼邮件</td></tr><tr><td><strong>② 落地</strong></td><td>在磁盘上留下&quot;看起来正常&quot;的东西</td><td>释放器把载荷写进 <code>C:\ProgramData</code>、<code>C:\Users\Public</code>、<code>%TEMP%</code></td></tr><tr><td><strong>③ 加载</strong></td><td>让合法程序去加载恶意模块</td><td><strong>白加黑</strong>（DLL 侧加载）、内存手动映射</td></tr><tr><td><strong>④ 执行</strong></td><td>在内存里跑真正的代码</td><td>Shellcode、APC 注入、线程池注入</td></tr><tr><td><strong>⑤ 驻留 + 上线</strong></td><td>活下去、连回去</td><td>计划任务、注册表、Defender 排除项、hosts 劫持 → C2</td></tr></tbody></table><p>整条链路里，<strong>只有第 ② 步会真正落一个&quot;文件&quot;到磁盘</strong>。从第 ③ 步开始，恶意逻辑基本都在内存里，这就是&quot;杀软扫不出来&quot;的结构性原因。</p><hr><h2 id="三、底层原理（二）：六个关键技术点，拆到骨头">三、底层原理（二）：六个关键技术点，拆到骨头</h2><h3 id="3-1-白加黑（DLL-侧加载）：为什么杀软会主动放行">3.1 白加黑（DLL 侧加载）：为什么杀软会主动放行</h3><p>这是银狐最核心的一招，值得单独讲透。</p><p><strong>Windows 加载一个 EXE 时，会先读它的&quot;导入表&quot;（Import Table）</strong>——一张写着&quot;我需要 xxx.dll 里的 yyy 函数&quot;的清单。加载器按固定顺序去找这些 DLL，其中**&quot;EXE 自己所在的目录&quot;排在 System32 之前**。</p><p>于是攻击者的操作极其简单：</p><ol><li>找一个<strong>带有效数字签名</strong>的合法 EXE（最好是那种本来就会去加载某个第三方 DLL 的，比如音乐播放器、输入法组件、驱动安装器）；</li><li>把<strong>同名的恶意 DLL</strong> 放到这个 EXE 旁边；</li><li>双击 EXE。系统看到签名有效 → 放行；EXE 去加载&quot;自己目录里&quot;的 DLL → 加载的是恶意那个。</li></ol><p><strong>杀软为什么放行？</strong> 因为从静态角度看，这个 EXE 是干净的、签名的、知名的；恶意 DLL 落盘时可能还套着 VMProtect 的壳，或者干脆只是一个&quot;解密器&quot;，真正的逻辑在内存里。三个条件叠起来，就是典型的&quot;信任链被借用&quot;。</p><p>公开报告里出现过的白加黑组合（可直接当检测特征用）：</p><table><thead><tr><th>白文件（合法签名）</th><th>黑 DLL</th><th>出处</th></tr></thead><tbody><tr><td><code>Murglar.exe</code>（国外音乐播放器，被篡改入口点并追加资源段）</td><td>由自身内存解出 Shellcode</td><td>火绒 2025-09</td></tr><tr><td>带白签名的任务载荷 EXE（导入表指向 <code>npwzwmc64.dll</code>）</td><td><code>npwzwmc64.dll</code>（VMProtect 保护）</td><td>火绒 2025-09</td></tr><tr><td>QQMusic 相关组件</td><td><code>QQMusic.dll</code></td><td>安天 2025-10（仿冒 WPS 案例二）</td></tr><tr><td>Philips Speech Driver 配置程序</td><td>侧加载模块</td><td>CNCERT&quot;甲蚁&quot;报告（滥用 <code>Speech Processing Solutions GmbH</code> 签名）</td></tr><tr><td><code>installer.exe</code>（白文件）</td><td><code>log.dll</code></td><td>北京大学计算中心通告（<code>C:\Program Files\Internet Explorer\</code> 下）</td></tr><tr><td><code>PACqpC.exe</code>（白文件）</td><td><code>hccutils.dll</code></td><td>火绒 2024-09</td></tr><tr><td>企业管控软件客户端（ip-guard / 固信 / 阳途）</td><td>无需黑 DLL：直接使用其<strong>合法远控能力</strong></td><td>360 报告（2024-08）</td></tr></tbody></table><p><strong>判别要点</strong>：一个带签名的 EXE，加载了一个<strong>没有签名、且位于 <code>ProgramData</code>/<code>Users\Public</code>/<code>Temp</code> 这类非常规目录</strong>的 DLL —— 这在正常软件里几乎不会发生。</p><blockquote><p>补充一个容易误解的点：<code>SafeDllSearchMode</code> 只影响&quot;当前工作目录&quot;的位置，<strong>管不到&quot;EXE 所在目录&quot;</strong>。所以&quot;把恶意 DLL 放在 EXE 旁边&quot;这一招，从 XP 时代一直有效到今天。</p></blockquote><h3 id="3-2-数字签名的三个洞">3.2 数字签名的三个洞</h3><p>很多人以为&quot;看有没有签名&quot;就够了。实际上签名能提供的保证，比想象中薄。</p><p><strong>洞一：签名块尾部可以夹带数据，签名依然有效。</strong></p><p>Windows 校验 Authenticode 时，计算摘要<strong>会跳过 PE 的证书表</strong>（可选头数据目录第 5 项指向的 <code>WIN_CERTIFICATE</code> 结构）。而 <code>WIN_CERTIFICATE</code> 的 <code>dwLength</code> 只要求是 <strong>8 的倍数</strong>。</p><p>于是：<strong>在签名数据后面追加任意内容，同时把 <code>dwLength</code> 调大，签名照样有效。</strong> 火绒在 2025 年 9 月的报告里明确写了这一点——感染载荷释放文件时改动了文件最后一个字节，签名依然有效。实战意义是：<strong>“签名有效&quot;不等于&quot;文件未被篡改”</strong>，哈希才是。</p><p><strong>洞二：签名可以伪造。</strong></p><p>直接塞一段署名&quot;某某大厂&quot;的签名记录进去，摘要对不上，Windows 会显示&quot;无效&quot;。但普通用户根本不看这个红叉。CNCERT&quot;甲蚁&quot;报告里的样本就是内嵌了署名 <strong><code>Bytedance Pte. Ltd.</code></strong> 的签名记录，<strong>摘要校验未通过</strong>。</p><p><strong>洞三：可以直接滥用别人的有效签名。</strong></p><p>拿一个真实有效的第三方签名程序当&quot;白文件&quot;（见 3.1），这是成本最低、成功率最高的一种。</p><p><strong>所以签名要&quot;三看&quot;：</strong></p><table><thead><tr><th>看什么</th><th>正常</th><th>可疑</th></tr></thead><tbody><tr><td><strong>有无签名</strong></td><td>有</td><td>无</td></tr><tr><td><strong>签名状态</strong></td><td>有效（Valid）</td><td>无效 / 不受信任 / 已吊销</td></tr><tr><td><strong>签名主体</strong></td><td>与软件厂商一致（如 <code>Zhuhai Kingsoft Office Software Co., Ltd.</code>）</td><td>主体是陌生人/无关公司（如 <code>Skutta, Kristjan</code>、<code>Blizzard Entertainment, Inc.</code> 出现在 WPS 安装包上）</td></tr></tbody></table><p>安天在&quot;WPS 打假专辑&quot;里给的正反例非常清楚：官网下的 <code>WPS_Setup_22529.exe</code> 签名是金山官方、状态正常；仿冒站下的 <code>Wjfrpsl.zip</code>、<code>Wp_s_BG.rar</code> 里那堆 exe，签名要么没有，要么是<strong>完全不相干的公司且状态无效</strong>。</p><h3 id="3-3-载荷藏在-不像载荷-的地方">3.3 载荷藏在&quot;不像载荷&quot;的地方</h3><p>银狐很少把 <code>.exe</code> 直接扔给你。它更常见的做法是：<strong>主程序干干净净，真正的载荷伪装成图片、日志、数据文件。</strong></p><table><thead><tr><th>伪装载体</th><th>真实内容</th><th>解密/加载方式</th><th>出处</th></tr></thead><tbody><tr><td><code>space.ico</code></td><td>覆盖入口点的代码</td><td>RC4 解密后 <code>WriteProcessMemory</code> 写回自身入口点</td><td>火绒 2025-09</td></tr><tr><td><code>vdi_ipc.dat</code>（6.08 MB）</td><td>远控本体</td><td>手动映射，调用导出函数 <code>KMDrvFaxGetJobStatusType</code></td><td>火绒 2025-09</td></tr><tr><td><code>security_audit_20260514.log</code></td><td>加密载荷</td><td><strong>ChaCha20</strong> 解密 → APC 注入 <code>taskhostw.exe</code></td><td>安天 2026-08</td></tr><tr><td><code>s.dat</code> / <code>s.jpg</code> / <code>a.gif</code>~<code>d.gif</code></td><td>驱动、Shellcode、加载器</td><td>尾字节当 XOR 密钥，倒数第 5~2 字节算数据偏移</td><td>火绒 2024-09</td></tr><tr><td><code>tad</code> / <code>s.dat</code> / <code>s.jpg</code>（阿里云 OSS）</td><td>配置与资源</td><td>HTTPS 拉取后内存加载</td><td>CNCERT&quot;甲蚁&quot;</td></tr><tr><td>注册表 <code>HKLM\SOFTWARE\JDBCC\data</code></td><td>32 字节随机前缀 + 标记 <code>%&amp;$6@=*</code> 之后的数据</td><td>从注册表读回并解密</td><td>火绒 2025-09</td></tr><tr><td><code>1.gif</code> / <code>2.jpg</code></td><td>入口点补丁 + 下一阶段 DLL</td><td>解密后写入自身入口点 / 手动加载</td><td>火绒 2024-09</td></tr></tbody></table><p><strong>这套设计的意图很清楚</strong>：让&quot;文件类型&quot;这个最原始的判断失效。你看到 <code>.log</code>、<code>.ico</code>、<code>.dat</code>，不会警觉；杀软的静态扫描也常常只对可执行格式做深度检查。</p><p><strong>判别要点</strong>：一个&quot;安装包&quot;释放出来的文件里，<strong>出现了 <code>.log</code>/<code>.dat</code>/<code>.jpg</code> 却体积巨大</strong>（比如日志文件 6 MB），这就非常可疑——正常日志不会长这样。</p><h3 id="3-4-内存里那一套：VirtualAlloc-→-手动映射-→-注入">3.4 内存里那一套：VirtualAlloc → 手动映射 → 注入</h3><p>一旦进了内存，动作就非常&quot;教科书&quot;：</p><p><strong>第一步：申请可执行内存。</strong> 52pojie 的分析里能看到非常典型的一行：</p><figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">v13 = VirtualAlloc(<span class="number">0</span>, <span class="number">122880</span>, <span class="number">0x3000</span> <span class="comment">/* MEM_COMMIT|MEM_RESERVE */</span>, <span class="number">0x40</span> <span class="comment">/* PAGE_EXECUTE_READWRITE */</span>);</span><br></pre></td></tr></table></figure><p><code>PAGE_EXECUTE_READWRITE</code>（RWX）是重点：<strong>正常程序几乎不会申请&quot;可读可写可执行&quot;的内存</strong>，因为编译器生成的代码段是 RX，数据段是 RW。<strong>私有提交的 RWX 内存，是内存马/Shellcode 最强的通用特征之一。</strong></p><p><strong>第二步：手动映射（Manual Map）。</strong> 不用 <code>LoadLibrary</code>，自己解析 PE 头、自己搬节区、自己修导入表、自己调 TLS 和入口点。好处是绕开&quot;DLL 加载&quot;这一类通知与钩子——<strong>在模块列表里根本看不到它</strong>。</p><p><strong>第三步：调导出函数。</strong> 手动映射后按名字取导出函数执行。公开样本里出现过的导出名：</p><ul><li><code>SyncCreate</code>（感染载荷主逻辑，火绒）</li><li><code>KMDrvFaxGetJobStatusType</code>（过程载荷，火绒）</li><li><code>RegisterTask</code>（用 RPC 建计划任务，火绒/看雪）</li><li><code>Edge</code>（后门模块导出，火绒）</li></ul><p><strong>第四步：注入到别人家里。</strong></p><table><thead><tr><th>注入方式</th><th>目标</th><th>出处</th></tr></thead><tbody><tr><td><strong>APC 注入</strong>（<code>CreateProcess</code> 挂起 → <code>QueueUserAPC</code> → <code>ResumeThread</code>）</td><td><code>taskhostw.exe</code></td><td>安天 2026-08</td></tr><tr><td><strong>线程池注入</strong>到 SYSTEM 权限进程</td><td>借 SYSTEM 身份执行 Shellcode，用来结束 360 主进程</td><td>52pojie（R3 强杀 360）</td></tr><tr><td>反射加载 DLL（Reflective Loader）</td><td>自身进程或目标进程</td><td>52pojie</td></tr></tbody></table><p><strong>为什么挑 <code>taskhostw.exe</code> 这类目标？</strong> 因为它<strong>本来就在跑、签名合法、行为白名单</strong>，杀软对&quot;往系统进程里写内存&quot;的容忍度，比对&quot;陌生 exe 申请 RWX&quot;高得多。（52pojie 那份样本里注入的是 <code>lsass.exe</code> 等 SYSTEM 权限进程，本质相同：借身份。）</p><p><strong>判别要点</strong>：</p><ul><li>进程里有<strong>私有提交的 RWX 内存</strong>（Process Hacker → Memory 页，Protection 列出现 <code>RWX</code>）；</li><li>线程的<strong>起始地址不在任何已加载模块范围内</strong>（Threads 页，Start Address 显示为裸地址）；</li><li>一个系统进程（如 <code>taskhostw.exe</code>）<strong>加载了没有签名的模块</strong>，或<strong>对外发起境外连接</strong>。</li></ul><h3 id="3-5-BYOVD：用-合法漏洞驱动-把杀软打成瞎子">3.5 BYOVD：用&quot;合法漏洞驱动&quot;把杀软打成瞎子</h3><p>BYOVD = Bring Your Own Vulnerable Driver，<strong>自带一个&quot;有正规签名但存在漏洞&quot;的内核驱动</strong>，用它去干内核才能干的事。</p><p>银狐的公开样本里，这条链是这样的：</p><ol><li>从远端下载一个<strong>带合法签名</strong>的驱动文件，落盘成 <code>C:\Users\TTruespanl.sys</code> 或 <code>C:\Windows\TEMP\ranchserv.jpg</code>；</li><li>通过 <strong>RPC</strong>（接口 <code>367abb81-9844-35f1-ad32-98f038001003</code>）创建服务 <code>TCLService</code>，把驱动加载进内核；</li><li>打开驱动的设备对象，用 <strong><code>DeviceIoControl</code></strong> 发 <strong>IOCTL <code>0x22E044</code></strong>；</li><li>驱动在内核里<strong>强制结束</strong>遍历到的杀软进程（火绒样本里那份杀软进程名清单长达 <strong>212 项</strong>，覆盖 360、火绒、腾讯、金山、McAfee、Kaspersky、Avast、Avira、Lenovo、2345……）。</li></ol><p><strong>为什么这招难防？</strong></p><ul><li>驱动<strong>有有效签名</strong>，能正常加载；</li><li>结束进程发生在<strong>内核</strong>，用户态的自我保护（<code>OpenProcess</code> 拦截、句柄保护）根本拦不住；</li><li>结束后杀软还有<strong>守护进程</strong>，于是攻击者<strong>循环结束</strong>——这就是&quot;杀软反复被杀&quot;的由来。</li></ul><p><strong>判别要点</strong>（这是主机侧最硬的信号之一）：</p><ul><li><code>C:\Windows\Temp</code>、<code>C:\Users\*</code> 下出现 <code>.sys</code> 文件（正常驱动永远在 <code>System32\drivers</code>）；</li><li>事件日志 <strong>7045</strong>（服务安装）里出现陌生服务名，<code>ImagePath</code> 指向临时目录；</li><li><code>driverquery /v</code> 里有&quot;非微软、非已知厂商、路径异常&quot;的驱动；</li><li>服务名与路径对不上（服务叫 <code>TCLService</code>，文件却在 Temp）。</li></ul><blockquote><p>顺带说一句：BYOVD 不是银狐独创，是黑产通用手法（业界叫&quot;LOLDrivers&quot;）。所以这条检测规则<strong>对别的家族同样有效</strong>。</p></blockquote><h3 id="3-6-反沙箱与反分析：它怎么知道自己在被围观">3.6 反沙箱与反分析：它怎么知道自己在被围观</h3><p>银狐的样本里有大量&quot;环境自检&quot;，一旦判断&quot;我在沙箱/分析机上&quot;，直接 <code>ExitProcess(0)</code>。整理成表，这张表本身就是很好的<strong>样本指纹库</strong>：</p><table><thead><tr><th>检测手段</th><th>判据</th><th>出处</th></tr></thead><tbody><tr><td><code>ntdll!PfxInitialize</code> 返回值</td><td><code>Table[0]</code> 在真机必为 <code>0x200</code>，模拟器实现不全</td><td>火绒</td></tr><tr><td><code>NtIsProcessInJob</code></td><td>返回 <code>0x125</code> 判定处于 Defender 模拟执行</td><td>火绒</td></tr><tr><td><code>NtCompressKey</code></td><td>特定句柄传入后返回值异常</td><td>火绒</td></tr><tr><td>ntdll 导出函数名探测</td><td>探测 <code>0x70CE7692</code> / <code>0xD4CE4554</code> / <code>0x7A99CFAE</code> 是否存在</td><td>火绒（源自 UACME 项目）</td></tr><tr><td>主机名</td><td><code>HAL9TH</code>、<code>JohnDoe</code> 直接退出</td><td>火绒</td></tr><tr><td>物理内存</td><td><code>GlobalMemoryStatusEx</code> &lt; 2 GB 判为虚拟机</td><td>火绒</td></tr><tr><td>CPU 核数</td><td>&lt; 2 判为虚拟机</td><td>火绒</td></tr><tr><td>时间流速</td><td><code>QueryPerformanceCounter</code> / <code>rdtsc</code> / 耗时循环 / 大块内存分配</td><td>火绒</td></tr><tr><td>运行路径</td><td>包含 <code>:\myapp.exe</code> 判为沙箱</td><td>火绒</td></tr><tr><td><strong>系统界面语言</strong></td><td>非中文环境<strong>直接终止全流程</strong></td><td>安天 2026-08</td></tr><tr><td>窗口标题枚举</td><td>出现 Wireshark / Fiddler / 任务管理器 / 资源监视器 → 停止后续</td><td>安天 2026-08</td></tr><tr><td>互斥体</td><td>已存在则跳过（防重复感染/多开）</td><td>火绒</td></tr><tr><td>安全软件进程</td><td>遍历 212 个进程名，命中就走 BYOVD 分支</td><td>火绒</td></tr></tbody></table><p>两条特别值得记住：</p><ol><li><strong>&quot;中文系统校验&quot;是地理围栏。</strong> 如果一个&quot;WPS 安装包&quot;在英文系统上双击后<strong>什么都不做</strong>、安静退出，那它几乎必然是定向木马——正规安装包不会挑语言。</li><li><strong>&quot;枚举窗口找分析工具&quot;是反向指纹。</strong> 它怕的不是杀软，是<strong>人</strong>。所以你在一台开着任务管理器的机器上跑它，它可能就直接装死了。</li></ol><h3 id="3-7-持久化：它把-活下去-拆成了六条腿">3.7 持久化：它把&quot;活下去&quot;拆成了六条腿</h3><p>银狐的持久化不是单点，是<strong>冗余设计</strong>——清掉一处，其余还能跑。CNCERT 在&quot;甲蚁&quot;报告里明确写了&quot;执行链共设置 <strong>6 个计划任务</strong>&quot;，且&quot;各阶段组件的存放位置、命名方式和触发机制相互独立&quot;。</p><table><thead><tr><th>位置</th><th>具体形态</th><th>出处</th></tr></thead><tbody><tr><td><strong>计划任务</strong></td><td><code>MicrosoftEdgeUpdateTaskUA Task-S-1-5-18</code> + 随机 5 字符，<strong>每分钟</strong>触发、设为隐藏</td><td>火绒 2025-09</td></tr><tr><td><strong>计划任务</strong></td><td><code>fX8Ia</code>；伪装名 <code>Our Empowering Procedure Standardization And</code>、<code>Software Business Prioritization</code>、<code>Assessment Intelligent Data Objective Seamlessly</code>，间隔 1/5/10/30 分钟</td><td>CNCERT&quot;甲蚁&quot;</td></tr><tr><td><strong>计划任务（RPC 创建）</strong></td><td>内存映射 DLL → <code>NdrClientCall3</code> 调 RPC → 再通过 <code>taskschd.dll</code> COM 校验是否创建成功（<code>CLSID_TaskScheduler &#123;0F87369F-...&#125;</code>、<code>IID_ITaskService &#123;2FABA4C7-...&#125;</code>）</td><td>火绒 / 看雪</td></tr><tr><td><strong>注册表</strong></td><td><code>HKLM\SOFTWARE\JDBCC\data</code> 藏加密载荷</td><td>火绒</td></tr><tr><td><strong>注册表</strong></td><td>Run 键指向 <code>QQMusic.dll</code> 所在的侧加载目录</td><td>安天 2025-10</td></tr><tr><td><strong>文件双份</strong></td><td><code>Documents\&lt;目录&gt;\&lt;名&gt;.exe</code> + <code>&lt;名&gt;.ico</code> 两份都在才继续</td><td>火绒 2025-09</td></tr><tr><td><strong>Defender 排除项</strong></td><td>PowerShell <code>Add-MpPreference</code> 把 <code>C:\Users</code>、<code>C:\ProgramData</code>、<code>C:\Windows\System32</code> 整片排除</td><td>火绒 / CNCERT</td></tr><tr><td><strong>hosts 劫持</strong></td><td><code>weishi.360.cn</code>、<code>www.360.cn</code>、<code>sd.360.cn</code> → <code>127.0.0.1</code>，让你<strong>打不开安全厂商官网</strong></td><td>CNCERT&quot;甲蚁&quot;</td></tr><tr><td><strong>正规管控软件</strong></td><td>静默安装 <code>ip-guard</code>、固信、阳途等企业管控客户端，借它的&quot;合法远控&quot;能力</td><td>360 2024-08</td></tr></tbody></table><p>最后一条特别阴：<strong>它不装木马，它装&quot;合法的管理软件&quot;。</strong> 这类软件本身就在杀软白名单里，还自带自我保护，普通用户&quot;发现了也卸不掉&quot;。</p><hr><h2 id="四、底层原理（三）：从-行为指纹-反推感染">四、底层原理（三）：从&quot;行为指纹&quot;反推感染</h2><p>原理讲完，落到&quot;我怎么知道自己中没中&quot;。下面每一条都对应上面某个技术点，<strong>不需要你会逆向，只需要会看</strong>。</p><h3 id="4-1-进程链：签名程序-无签名模块">4.1 进程链：签名程序 + 无签名模块</h3><p>打开 <strong>Process Explorer</strong>（微软官方 Sysinternals 工具），看这两列：</p><ul><li><strong>Image 列的颜色</strong>：未签名=红、签名但未校验=黄、已校验=绿；</li><li>展开某个进程的 <strong>DLL 列表</strong>，看每个模块的 <strong>Company Name / Verified</strong>。</li></ul><p><strong>危险组合</strong>：<code>绿名的 EXE</code> + <code>红名或黄名的 DLL</code> + <code>DLL 路径在 ProgramData / Users\Public / Temp</code>。</p><p>银狐的典型落点目录（可直接当 IOC）：</p><figure class="highlight livescript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line">C:<span class="string">\ProgramData\vconsole2\</span></span><br><span class="line">C:<span class="string">\Users\Public\SXRh6d\</span></span><br><span class="line">C:<span class="string">\ProgramData\cgL18U72\</span></span><br><span class="line">C:<span class="string">\ProgramData\cpLjQb7s\</span></span><br><span class="line">C:<span class="string">\Program</span> Files (x86)<span class="string">\VBV4HZ\</span></span><br><span class="line">C:<span class="string">\Program</span> Files (x86)<span class="string">\S7UA99K\</span></span><br><span class="line">C:<span class="string">\Windows\Temp\ranchserv.jpg</span></span><br><span class="line">C:<span class="string">\Users\&lt;用户名&gt;\Documents\&lt;随机目录&gt;\</span></span><br></pre></td></tr></table></figure><h3 id="4-2-计划任务的三个破绽">4.2 计划任务的三个破绽</h3><ol><li><strong>名字像系统，路径不像</strong>：名字里带 <code>MicrosoftEdgeUpdateTaskUA</code>，但执行程序在 <code>C:\Users\Public</code> 或 <code>C:\ProgramData</code>；</li><li><strong>频率异常</strong>：每 <strong>1 分钟</strong>重复、无限期；</li><li><strong>隐藏 + 高权限</strong>：<code>-S-1-5-18</code>（SYSTEM）身份、<code>Hidden</code> 属性。</li></ol><h3 id="4-3-Defender-排除项与-hosts">4.3 Defender 排除项与 hosts</h3><p>这两处是<strong>最容易被忽略、也最容易被检查</strong>的地方：</p><ul><li>排除项里出现 <code>C:\Users</code>、<code>C:\ProgramData</code>、<code>C:\Windows\System32</code> 这种&quot;整片目录&quot;——正常运维不会这么干；</li><li>hosts 里出现安全厂商域名指向 <code>127.0.0.1</code>。</li></ul><h3 id="4-4-文件与注册表指纹">4.4 文件与注册表指纹</h3><table><thead><tr><th>类型</th><th>特征值</th></tr></thead><tbody><tr><td>互斥体</td><td><code>dba8937c-2842-4159-9bea-56424baf5eba</code>；<code>&#123;4E062DDA-444A-A2A8-84CE-E105F66A5AB3&#125;</code>；<code>Global\8E416074-5245-AF71-E9F7-7D3194498C53</code>；<code>Global\3575D265-2C4F-5C20-EB78-D147D5670A9C</code></td></tr><tr><td>注册表</td><td><code>HKLM\SOFTWARE\JDBCC\data</code>；<code>HKLM\SOFTWARE\SysConfigDate</code></td></tr><tr><td>文件标记</td><td>文件内存中搜索 <code>%&amp;$6@=*</code>（载荷锚点）</td></tr><tr><td>落盘</td><td><code>C:\Users\Public\Music\desktopbak.ini</code>；<code>C:\Users\InstallUP.ini</code>；<code>%APPDATA%\Adobe\*.ini</code></td></tr></tbody></table><blockquote><p>提醒：互斥体名和路径会被新变种改掉，它们只能证明&quot;这一批是这个团伙&quot;，不能证明&quot;只有这些&quot;。</p></blockquote><h3 id="4-5-网络侧：心跳与非标端口">4.5 网络侧：心跳与非标端口</h3><table><thead><tr><th>特征</th><th>说明</th><th>出处</th></tr></thead><tbody><tr><td><code>156.251.17.245:8852</code></td><td>早期二次加载 Shellcode 的地址</td><td>52pojie 2025-01</td></tr><tr><td><code>duooi.com:2869</code> 等域名</td><td>硬编码在加密 Shellcode 里，<strong>域名注册后几周就换</strong></td><td>安天 2025-05</td></tr><tr><td><code>154.36.188.53:443</code></td><td>Winos 4.0 上线，<strong>每 10 秒发 <code>0xCD</code> 心跳，60 秒无活动重连</strong></td><td>安天 2026-08</td></tr><tr><td><code>14.128.53.194:80</code>、<code>47.243.152.51:18300</code></td><td>&quot;甲蚁&quot;专用 C2，<strong>非标端口直连</strong></td><td>CNCERT 2026-09</td></tr><tr><td>高频小包（44 / 136 字节）</td><td>与 C2 的保活特征</td><td>CNCERT</td></tr></tbody></table><p><strong>判别要点</strong>：一个&quot;刚装完的办公软件&quot;，<strong>主动去连境外 IP 的 443/18300/80 且持续发小包</strong>——这就是最朴素的异常。</p><h3 id="4-6-一份能直接跑的自查脚本（只读）">4.6 一份能直接跑的自查脚本（只读）</h3><p>下面全部是<strong>只读查询</strong>，不改系统任何配置。建议在<strong>确认可疑但还没断网</strong>的时候先跑一遍，留证据。</p><figure class="highlight powershell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># 1) 可疑目录里最近 7 天落地的可执行文件</span></span><br><span class="line"><span class="built_in">Get-ChildItem</span> C:\ProgramData, C:\Users\Public, <span class="variable">$env:TEMP</span> <span class="literal">-Recurse</span> <span class="literal">-Include</span> *.exe,*.dll,*.sys <span class="literal">-ErrorAction</span> SilentlyContinue |</span><br><span class="line">  <span class="built_in">Where-Object</span> &#123; <span class="variable">$_</span>.LastWriteTime <span class="operator">-gt</span> (<span class="built_in">Get-Date</span>).AddDays(<span class="literal">-7</span>) &#125; |</span><br><span class="line">  <span class="built_in">Select-Object</span> FullName, Length, LastWriteTime</span><br><span class="line"></span><br><span class="line"><span class="comment"># 2) 指向非常规目录的计划任务</span></span><br><span class="line"><span class="built_in">Get-ScheduledTask</span> | <span class="built_in">Where-Object</span> &#123;</span><br><span class="line">  <span class="variable">$_</span>.Actions.Execute <span class="operator">-match</span> <span class="string">&#x27;ProgramData|Users\\Public|Temp|AppData&#x27;</span></span><br><span class="line">&#125; | <span class="built_in">Select-Object</span> TaskName, TaskPath, State</span><br><span class="line"></span><br><span class="line"><span class="comment"># 3) Defender 排除项</span></span><br><span class="line"><span class="built_in">Get-MpPreference</span> | <span class="built_in">Select-Object</span> <span class="literal">-ExpandProperty</span> ExclusionPath</span><br><span class="line"><span class="built_in">Get-MpPreference</span> | <span class="built_in">Select-Object</span> <span class="literal">-ExpandProperty</span> ExclusionProcess</span><br><span class="line"></span><br><span class="line"><span class="comment"># 4) hosts 里指向回环的条目（先剔掉注释行）</span></span><br><span class="line"><span class="built_in">Get-Content</span> C:\Windows\System32\drivers\etc\hosts |</span><br><span class="line">  <span class="built_in">Where-Object</span> &#123; <span class="variable">$_</span> <span class="operator">-notmatch</span> <span class="string">&#x27;^\s*#&#x27;</span> &#125; | <span class="built_in">Select-String</span> <span class="string">&#x27;127\.0\.0\.1&#x27;</span></span><br><span class="line"></span><br><span class="line"><span class="comment"># 5) 非微软、路径异常的驱动服务（重点看 ImagePath 在 Temp/Users）</span></span><br><span class="line"><span class="built_in">Get-CimInstance</span> Win32_SystemDriver |</span><br><span class="line">  <span class="built_in">Where-Object</span> &#123; <span class="variable">$_</span>.PathName <span class="operator">-match</span> <span class="string">&#x27;Temp|Users\\&#x27;</span> &#125; |</span><br><span class="line">  <span class="built_in">Select-Object</span> Name, DisplayName, PathName, State</span><br><span class="line"></span><br><span class="line"><span class="comment"># 6) 最近安装的服务（事件日志 7045）</span></span><br><span class="line"><span class="built_in">Get-WinEvent</span> <span class="literal">-FilterHashtable</span> <span class="selector-tag">@</span>&#123;LogName=<span class="string">&#x27;System&#x27;</span>; Id=<span class="number">7045</span>; StartTime=(<span class="built_in">Get-Date</span>).AddDays(<span class="literal">-7</span>)&#125; |</span><br><span class="line">  <span class="built_in">Select-Object</span> TimeCreated, <span class="selector-tag">@</span>&#123;n=<span class="string">&#x27;Msg&#x27;</span>;e=&#123;<span class="variable">$_</span>.Message&#125;&#125;</span><br><span class="line"></span><br><span class="line"><span class="comment"># 7) 异常外联（排除内网与回环）</span></span><br><span class="line"><span class="built_in">Get-NetTCPConnection</span> <span class="literal">-State</span> Established |</span><br><span class="line">  <span class="built_in">Where-Object</span> &#123; <span class="variable">$_</span>.RemoteAddress <span class="operator">-notmatch</span> <span class="string">&#x27;^(127\.|10\.|172\.16|192\.168)&#x27;</span> &#125; |</span><br><span class="line">  <span class="built_in">ForEach-Object</span> &#123; [<span class="type">PSCustomObject</span>]<span class="selector-tag">@</span>&#123;</span><br><span class="line">    Remote = <span class="string">&quot;<span class="variable">$</span>(<span class="variable">$_</span>.RemoteAddress):<span class="variable">$</span>(<span class="variable">$_</span>.RemotePort)&quot;</span></span><br><span class="line">    PID    = <span class="variable">$_</span>.OwningProcess</span><br><span class="line">    Proc   = (<span class="built_in">Get-Process</span> <span class="literal">-Id</span> <span class="variable">$_</span>.OwningProcess <span class="literal">-ErrorAction</span> SilentlyContinue).ProcessName</span><br><span class="line">  &#125; &#125;</span><br></pre></td></tr></table></figure><figure class="highlight cmd"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">:: <span class="number">8</span>) 已加载驱动列表（对照 <span class="number">4</span>.<span class="number">5</span> 的异常路径）</span><br><span class="line">driverquery /v | <span class="built_in">findstr</span> /i &quot;Temp Users&quot;</span><br></pre></td></tr></table></figure><p><strong>如果 1、2、5、7 同时命中，基本可以判定&quot;已经被控&quot;，直接跳到第八章处置流程。</strong></p><hr><h2 id="五、分发层：搜索引擎投毒是怎么运作的">五、分发层：搜索引擎投毒是怎么运作的</h2><p>技术再花哨，送不进来就是零。银狐真正&quot;高效&quot;的地方，是它把<strong>分发</strong>也工业化改造了。</p><h3 id="5-1-SEO-投毒的底层逻辑">5.1 SEO 投毒的底层逻辑</h3><p>搜索引擎的排序，本质是<strong>给页面打分</strong>：内容相关性、站群结构、外链、域名年龄与权重、用户点击行为（CTR）、页面质量……</p><p>黑帽 SEO 的做法就是<strong>逐项伪造</strong>：</p><table><thead><tr><th>打分维度</th><th>攻击者怎么&quot;喂&quot;</th></tr></thead><tbody><tr><td>相关性</td><td>页面堆满品牌关键词（“wps 下载”“官方正版”“免费”）</td></tr><tr><td>域名权重</td><td><strong>批量注册高仿域名</strong>，用站群互链互相抬权重</td></tr><tr><td>点击行为</td><td>假点击、导流脚本，让&quot;这个结果很多人点&quot;</td></tr><tr><td>时效性</td><td>新站快速上线、旧站失效后立刻补新站</td></tr><tr><td>成本</td><td>廉价境外托管（CNCERT 点名香港 Cogent 节点，<strong>免备案、滥用投诉处置慢</strong>）</td></tr></tbody></table><p>结果就是你看到的：<strong>搜&quot;wps 下载&quot;，前 10 条里有 3~4 条是假的。</strong></p><p>安天 2025 年 10 月的报告写得很具体：谷歌搜索&quot;wps 下载&quot;，第 1 页第 <strong>3、5、6</strong> 位全是钓鱼站；Bing 搜&quot;wps 下载&quot;，第 1 页第 <strong>4、7、10、11</strong> 位是钓鱼站。而仿冒页面&quot;从页面上很难区分是否为官网&quot;。</p><h3 id="5-2-广告-推广-位为什么更危险">5.2 &quot;广告/推广&quot;位为什么更危险</h3><p>自然结果至少还有声誉约束，<strong>竞价广告只需要付费 + 过审</strong>。CNCERT 在&quot;甲蚁&quot;报告里直接写了手法是 <strong>“搜索引擎 SEO 投毒与关键词竞价引流”</strong> 双管齐下。</p><p>所以：<strong>&quot;标注广告&quot;的下载链接，风险等级高于自然结果</strong>，不是&quot;更官方&quot;，是&quot;更贵&quot;。</p><h3 id="5-3-CNCERT-给出的-439-个域名画像">5.3 CNCERT 给出的 439 个域名画像</h3><p>CNCERT 2026 年 5 月的通报分析了 <strong>2026-02-06 至 05-04 注册的 439 个钓鱼域名</strong>，几条结论非常有用：</p><table><thead><tr><th>观察项</th><th>数据</th><th>你能怎么用</th></tr></thead><tbody><tr><td>仿冒对象</td><td><strong>WPS + Chrome 合计 340 个，占 77.4%</strong></td><td>下载办公/浏览器软件时，警惕级别拉满</td></tr><tr><td>后缀分布</td><td><code>.hl.cn</code> 42.6%，<code>.com.cn</code> 30.8%，<strong>合计 73.4%</strong></td><td>别把 <code>.com.cn</code> 当&quot;官方认证&quot;</td></tr><tr><td>注册节奏</td><td><strong>最高峰一分钟注册 15 条</strong> letsvpn 相关域名</td><td>域名注册时间越新越可疑</td></tr><tr><td>命名模板</td><td>常见关键词 <code>zh</code>、<code>cn</code>、<code>apps</code>、<code>web</code>、<code>office</code>，大量字母重复、缺字、错拼</td><td>逐字核对域名</td></tr><tr><td><strong>反侦察</strong></td><td><strong>检测 Referer 头</strong>：直接输域名访问会跳到 <a href="http://bing.com">bing.com</a> 或无法访问的站点</td><td>见 6.3，这本身就是一个&quot;测谎仪&quot;</td></tr><tr><td>页面来源</td><td>高度标准化前端结构、规整 HTML 注释、通用技术栈，<strong>疑似 AI 批量生成</strong></td><td>见 5.6</td></tr></tbody></table><h3 id="5-4-“甲蚁（G01）”：把仿站做成了流水线">5.4 “甲蚁（G01）”：把仿站做成了流水线</h3><p>CNCERT 与天融信 2026 年 9 月的报告，是目前公开材料里<strong>最完整的一份&quot;仿站产业&quot;解剖</strong>：</p><table><thead><tr><th>维度</th><th>数据</th></tr></thead><tbody><tr><td>仿冒域名</td><td><strong>1060 个</strong>，其中 <code>.com.cn</code> <strong>1042 个（98.3%）</strong>、<code>.cn</code> 18 个</td></tr><tr><td>命名规律</td><td>固定前缀 <code>an-</code>(298)、<code>app-</code>(205)、<code>ah-</code>(203)、<code>ai-</code>(33)、<code>am-</code>(24)，<strong>合计超 70%</strong>；<strong>83.5% 以字母 a 开头</strong></td></tr><tr><td>注册</td><td>单一 Gmail 邮箱统辖数百域名；<strong>单邮箱多姓名轮换</strong>；借用<strong>真实公民身份</strong>满足 <code>.com.cn</code> 强实名；注册周期统一一年；<strong>单日最多 110 个</strong></td></tr><tr><td>托管</td><td>绝大多数在<strong>香港 Cogent</strong> 节点，同 IP 挂多个仿冒域</td></tr><tr><td>载荷托管</td><td>阿里云 OSS（北京/杭州/香港）+ <code>download.hzx.me</code> 中转</td></tr><tr><td>打包方式</td><td><strong>同一入口多次下载，同名不同哈希</strong>（服务端按次打包）</td></tr><tr><td>统计</td><td>用 <strong><a href="http://51.LA">51.LA</a></strong> 免费流量统计，按不同统计 ID 区分仿冒主题，<strong>核算投入产出比</strong></td></tr><tr><td>战果</td><td>2026-09-15 至 09-22，控制境内主机 <strong>8708 台</strong>，单日峰值 <strong>2361 台</strong></td></tr><tr><td>签名</td><td>伪造 <code>Bytedance Pte. Ltd.</code>；滥用 <code>Speech Processing Solutions GmbH</code></td></tr></tbody></table><p><strong>仿冒清单的覆盖面</strong>（这张表很有信息量，说明&quot;没有哪个软件是安全的&quot;）：</p><blockquote><p>WPS、Chrome、Telegram、汽水音乐、FinalShell、Xshell、SecureCRT、NexusDesk、SafeW、Notepad++、火绒、360 系、图吧工具箱、AIDA64、AutoCAD、Dism++、KOOK、豆包、语雀、喜马拉雅、网易云音乐、腾讯会议、雷电模拟器、7-Zip、LibreOffice、爱思助手、安兔兔、金山系、瑞星、114 查号、汇率查询……</p></blockquote><p><strong>规律</strong>：只要一个软件有&quot;下载&quot;这个动作，就有人仿。而且<strong>越是工具类、越是&quot;用户会去搜下载&quot;的软件，越容易被仿</strong>。</p><h3 id="5-5-钓鱼站的-反侦察-三件套">5.5 钓鱼站的&quot;反侦察&quot;三件套</h3><ol><li><strong>Referer 校验</strong>：只允许&quot;从搜索引擎点进来&quot;的流量，直接输域名或从书签进 → 跳走。<strong>这既是它的护身符，也是你的测谎仪。</strong></li><li><strong>按次打包</strong>：同一个下载链接，每次下载得到的压缩包 MD5 都不同 → 基于哈希的黑名单<strong>直接失效</strong>。</li><li><strong>多层跳转</strong>：<code>搜索结果 → 仿冒域 → 中转域 → 云对象存储</code>，中间插一层跳转，降低早期拦截概率，也增加溯源难度。</li></ol><h3 id="5-6-AI-把仿站成本压到接近零">5.6 AI 把仿站成本压到接近零</h3><p>CNCERT 的观察是：钓鱼页面<strong>不再是对官网的原样克隆</strong>，而是&quot;高度标准化的前端结构、清晰规整的 HTML 注释、大量通用化前端技术栈&quot;；<strong>同一仿冒主题、不同时间注册的站点，布局与内容都不统一</strong>——综合判断&quot;疑似由 AI 编码快速生成&quot;。</p><p>这带来一个很有意思的<strong>反向鉴别线索</strong>：</p><blockquote><p><strong>同一个软件的&quot;官网&quot;如果长得不一样，那就至多只有一个是真的。</strong></p></blockquote><p>真正的官网，一年到头改版也就那么几次，而且<strong>全球只有那一个域名</strong>。你搜到三个&quot;WPS 官网&quot;，页面还各不相同——这不是官网改版，这是三个仿冒站。</p><h3 id="5-7-为什么中文区搜索结果是重灾区">5.7 为什么中文区搜索结果是重灾区</h3><p>这里必须<strong>区分&quot;事实&quot;和&quot;媒体观察&quot;</strong>：</p><ul><li><strong>事实</strong>：CNCERT、安天、火绒都明确记录了&quot;攻击者针对 Bing/Google 实施 SEO 投毒&quot;“仿冒站占据搜索结果前列”。</li><li><strong>媒体观察</strong>：有技术博主统计称必应中文结果的投毒密度较高，且&quot;被举报后下架需要数日&quot;（浅淡网，2026-06）。<strong>这是媒体口径，不是官方结论</strong>，本文如实标注，不作引申。</li></ul><p>不管是哪家搜索引擎，<strong>结论都一样：搜索结果排名 ≠ 可信度排名。</strong></p><hr><h2 id="六、真假官网鉴别：一套可执行的核对流程">六、真假官网鉴别：一套可执行的核对流程</h2><p>这一章是全文最想让你带走的部分。按顺序做，<strong>任何一步不过关就停手</strong>。</p><h3 id="6-1-域名核对：四步，三十秒">6.1 域名核对：四步，三十秒</h3><p><strong>第一步：逐字读，重点看&quot;最后一个点之前的那一段&quot;。</strong></p><p>这是最容易被骗的一步。举例：</p><table><thead><tr><th>你看到的</th><th>真正的域名是</th><th>判断</th></tr></thead><tbody><tr><td><code>wps.cn.download-xyz.com</code></td><td><code>download-xyz.com</code></td><td>❌ 子域名伪装，真域名在后面</td></tr><tr><td><code>www.wps.cn</code></td><td><code>wps.cn</code></td><td>✅</td></tr><tr><td><code>www.wps1.com</code></td><td><code>wps1.com</code></td><td>❌ 多一个数字</td></tr><tr><td><code>cn-wps.com</code></td><td><code>cn-wps.com</code></td><td>❌ 加前缀</td></tr><tr><td><code>pc-wps.com.cn</code></td><td><code>pc-wps.com.cn</code></td><td>❌ 加前缀 + 换后缀</td></tr><tr><td><code>wps-zh.com.cn</code></td><td><code>wps-zh.com.cn</code></td><td>❌ 加后缀</td></tr><tr><td><code>www.kingsoftwps.com.cn</code></td><td><code>kingsoftwps.com.cn</code></td><td>❌ 品牌拼接</td></tr></tbody></table><p>安天在&quot;WPS 打假专辑&quot;里把仿冒域名的三种套路总结得很清楚：<strong>替换或增加字符</strong>（<code>wps1</code>、<code>wps2</code>、<code>wpskr</code>）、<strong>添加前后缀</strong>（<code>cn-wps</code>、<code>zhs-wps</code>、<code>wps-cn</code>）、<strong>域名伪装</strong>（<code>pc-wps.com.cn</code>、<code>www.kingsoftwps.com.cn</code>）。</p><p><strong>第二步：看后缀，但别把后缀当背书。</strong></p><p><code>.com.cn</code> / <code>.cn</code> 需要<strong>强实名</strong>，所以很多人下意识觉得&quot;更正规&quot;。CNCERT 直接打脸：攻击者<strong>借用他人真实身份</strong>完成 <code>.com.cn</code> 注册，“<strong>不要把 <code>.com.cn</code> / <code>.cn</code> 后缀等同于官方站点</strong>”。</p><p><strong>第三步：查注册时间。</strong></p><p>打开 whois（或任何域名查询工具），看 <strong>Creation Date</strong>。</p><ul><li>官网域名通常<strong>十年起步</strong>；</li><li>仿冒域名<strong>注册时间在最近几个月</strong>，而且<strong>注册周期往往统一为一年</strong>（&quot;甲蚁&quot;批次全员如此）。</li></ul><p><strong>一个 2026 年 8 月才注册的&quot;WPS 官网&quot;，不用再看别的了。</strong></p><p><strong>第四步：查备案主体（国内软件）。</strong></p><p>国内正规官网底部有 ICP 备案号。去工信部备案系统查，<strong>核对备案主体名称</strong>是否就是软件著作权人（比如 WPS 应是金山系公司）。仿冒站会直接<strong>抄一个真备案号</strong>贴上去——所以不是&quot;有备案号就行&quot;，是&quot;备案主体对得上才行&quot;。</p><h3 id="6-2-证书核对：小锁只证明-加密-，不证明-身份">6.2 证书核对：小锁只证明&quot;加密&quot;，不证明&quot;身份&quot;</h3><p>这是最普遍的误解。<strong>HTTPS 的小锁 = “这条通道是加密的”，≠ “这个网站是官方的”。</strong></p><p>一个 DV（域名验证）证书，任何人几分钟就能免费拿到（Let’s Encrypt 之类），<strong>它只验证&quot;你控制了这个域名&quot;，不验证&quot;你是谁&quot;</strong>。</p><p>所以证书要看，但只能当<strong>辅助信号</strong>：</p><table><thead><tr><th>看什么</th><th>说明</th></tr></thead><tbody><tr><td><strong>Subject 里的 O（组织）</strong></td><td>正规大厂多为 OV/EV 证书，O 字段是公司全称；DV 证书 O 字段为空或就是域名</td></tr><tr><td><strong>有效期</strong></td><td>免费 DV 通常 90 天；企业证书 1 年</td></tr><tr><td><strong>与域名是否匹配</strong></td><td>证书 CN/SAN 必须覆盖当前域名，否则浏览器会报警</td></tr><tr><td><strong>颁发者</strong></td><td>只能作弱信号，<strong>不能作判据</strong>（仿冒站也用正规 CA）</td></tr></tbody></table><p><strong>结论：证书是&quot;必要条件&quot;，域名才是&quot;充分条件&quot;。</strong> 别把顺序搞反。</p><h3 id="6-3-页面侧信号：五个-测谎仪">6.3 页面侧信号：五个&quot;测谎仪&quot;</h3><table><thead><tr><th>信号</th><th>怎么测</th><th>说明</th></tr></thead><tbody><tr><td><strong>Referer 测谎</strong></td><td><strong>手动输入域名</strong>访问（不要从搜索点进来）</td><td>若跳转到 <a href="http://bing.com/%E7%A9%BA%E7%99%BD%E9%A1%B5/%E6%97%A0%E6%B3%95%E8%AE%BF%E9%97%AE">bing.com/空白页/无法访问</a> → 典型投毒站（CNCERT 明确记录该手法）</td></tr><tr><td><strong>下载链接指向</strong></td><td>悬停下载按钮看真实 URL</td><td>官方多指向自家域名或自家 CDN；仿冒站常指向 <code>*.aliyuncs.com</code>、<code>*.r2.dev</code>、<code>*.backblazeb2.com</code>、<code>linkgodrive.icu</code>、<code>ypio.icu</code> 这类第三方存储</td></tr><tr><td><strong>页面完整度</strong></td><td>点导航、翻页、看图片</td><td>仿冒站通常<strong>只有首页</strong>：按钮响应慢、图片 404、导航死链</td></tr><tr><td><strong>版本信息</strong></td><td>看有没有版本号、更新日志、历史版本下载</td><td>官网一定有；仿冒站通常只有一个&quot;立即下载&quot;</td></tr><tr><td><strong>&quot;官网&quot;数量</strong></td><td>搜同一个软件，比对多个结果</td><td>页面各不相同 → 至多一个是真的（见 5.6）</td></tr></tbody></table><p>再补一条<strong>反常识但很好用</strong>的：</p><blockquote><p>真正的官网，<strong>不会催你&quot;关闭杀毒软件后再安装&quot;</strong>，也不会在下载前先让你装一个&quot;下载器&quot;。</p></blockquote><h3 id="6-4-下载物核对：十二项对照表">6.4 下载物核对：十二项对照表</h3><p>文件下下来了，先别双击。对着这张表过一遍：</p><table><thead><tr><th>#</th><th>核对项</th><th>正规官网</th><th>仿冒站</th></tr></thead><tbody><tr><td>1</td><td><strong>文件名</strong></td><td><code>名称 + Setup</code>，如 <code>WPS_Setup_22529.exe</code></td><td>不规则随机名，如 <code>Wjfrpsl.zip</code>、<code>tpoanse-x64.2.6.3.zip</code>、<code>wgtfdhg (2).exe</code></td></tr><tr><td>2</td><td><strong>封装形式</strong></td><td>直接 <code>.exe</code> / <code>.msi</code></td><td><strong>压缩包内套 exe</strong>（zip/rar/7z），甚至是&quot;带密码的压缩包&quot;</td></tr><tr><td>3</td><td><strong>体积</strong></td><td>与官网标注一致</td><td>异常膨胀（单个&quot;安装程序&quot; 35 MB 却只是装个 SSH 工具）或异常小</td></tr><tr><td>4</td><td><strong>图标</strong></td><td>官方图标，清晰</td><td>模糊、通用、甚至伪装成文件夹/快捷方式/回收站</td></tr><tr><td>5</td><td><strong>数字签名</strong></td><td>官方主体 + 状态有效</td><td>无签名 / 状态无效 / 主体完全不相干（如 WPS 包上出现 <code>Blizzard Entertainment</code>）</td></tr><tr><td>6</td><td><strong>版本信息</strong></td><td>CompanyName / ProductName / OriginalFilename 齐全且自洽</td><td>空白、乱码，或与产品不符</td></tr><tr><td>7</td><td><strong>时间戳</strong></td><td>合理</td><td>明显伪造（如 2025 年的文件盖 2026 年时间戳）</td></tr><tr><td>8</td><td><strong>安装界面</strong></td><td>与官网一致、单语言</td><td>自制品、简陋、多语言混杂、文案错字</td></tr><tr><td>9</td><td><strong>UAC 请求者</strong></td><td>厂商名可读</td><td>未知发布者 / 陌生公司名</td></tr><tr><td>10</td><td><strong>捆绑行为</strong></td><td>无</td><td>默认勾选、静默装其他软件</td></tr><tr><td>11</td><td><strong>联网行为</strong></td><td>只连官方更新域名</td><td>连境外 IP、云 OSS、非标端口</td></tr><tr><td>12</td><td><strong>附带安装</strong></td><td>无</td><td>悄悄装向日葵 / TeamViewer / AnyDesk / ip-guard 之类</td></tr></tbody></table><p>第 5 项有三条命令，装完系统就有：</p><figure class="highlight powershell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># 看签名（状态 + 签名者 + 证书主体）</span></span><br><span class="line"><span class="built_in">Get-AuthenticodeSignature</span> .\WPS_Setup.exe |</span><br><span class="line">  <span class="built_in">Format-List</span> Status, StatusMessage, SignerCertificate</span><br><span class="line"></span><br><span class="line"><span class="comment"># 看哈希（拿去和官网公布的值比对）</span></span><br><span class="line"><span class="built_in">Get-FileHash</span> .\WPS_Setup.exe <span class="literal">-Algorithm</span> SHA256</span><br><span class="line"></span><br><span class="line"><span class="comment"># 看版本信息（公司名/产品名/原始文件名是否自洽）</span></span><br><span class="line">(<span class="built_in">Get-Item</span> .\WPS_Setup.exe).VersionInfo | <span class="built_in">Format-List</span> CompanyName, ProductName, FileDescription, OriginalFilename</span><br></pre></td></tr></table></figure><p>如果有 Sysinternals 的 <code>sigcheck</code>，一条更省事：</p><figure class="highlight cmd"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">sigcheck -a -h -nobanner WPS_Setup.exe</span><br></pre></td></tr></table></figure><blockquote><p>提醒：VirusTotal 会把样本共享给厂商，<strong>涉密/含隐私的文件别随便上传</strong>；而且&quot;多引擎全绿&quot;从来不等于&quot;安全&quot;——银狐的免杀就是专门针对多引擎做的。</p></blockquote><h3 id="6-5-官方渠道-的正确打开方式">6.5 &quot;官方渠道&quot;的正确打开方式</h3><p>比&quot;鉴别&quot;更省事的，是<strong>根本不给仿冒站机会</strong>：</p><table><thead><tr><th>方式</th><th>说明</th></tr></thead><tbody><tr><td><strong>收藏官网</strong></td><td>常用软件官网直接加书签，<strong>下次不搜，只点书签</strong></td></tr><tr><td><strong>系统包管理器</strong></td><td><code>winget install &lt;id&gt;</code>、<code>scoop install</code>、<code>choco install</code>——源是官方维护的清单</td></tr><tr><td><strong>应用商店</strong></td><td>Microsoft Store；手机端同理，只走官方商店</td></tr><tr><td><strong>GitHub Releases</strong></td><td>开源软件只从 <strong>repo owner 名下</strong>的 Releases 下，核对 owner 名字拼写</td></tr><tr><td><strong>企业统一分发</strong></td><td>运维类工具（FinalShell/Xshell/SecureCRT）<strong>禁止员工自行下载</strong>，由 IT 统一发（CNCERT 明确建议）</td></tr><tr><td><strong>校验发布方哈希</strong></td><td>不少项目会公布 SHA256 或 GPG 签名（如 Notepad++ 提供 GPG 校验），下完对一遍</td></tr></tbody></table><hr><h2 id="七、安装与运行期的最后三道闸">七、安装与运行期的最后三道闸</h2><h3 id="7-1-第一道闸：双击之前">7.1 第一道闸：双击之前</h3><ul><li><strong>右键 → 属性 → 数字签名</strong>：无签名/无效/主体不符 → <strong>直接删，不要&quot;先试试&quot;</strong>；</li><li><strong>哈希比对</strong>：官网给了值就比；没给就 VirusTotal（注意隐私）；</li><li><strong>别用管理员权限双击来源不明的文件</strong>——很多银狐根本没做 UAC 绕过，它就等你点&quot;是&quot;；</li><li><strong>压缩包里的 exe 单独再查一遍</strong>：外壳干净不代表里面干净。</li></ul><h3 id="7-2-第二道闸：安装过程中">7.2 第二道闸：安装过程中</h3><ul><li><strong>看清 UAC 弹窗的&quot;发布者&quot;</strong>：写&quot;未知发布者&quot;的，停；</li><li><strong>选&quot;自定义安装&quot;</strong>，把所有默认勾选取消（捆绑软件是银狐的常见跳板）；</li><li><strong>拒绝任何&quot;安装前请先关闭杀毒软件&quot;的要求</strong>——这句话本身就是结论；</li><li><strong>拒绝&quot;绿色版/破解版/免安装版&quot;</strong>：这些版本没有签名、没有更新通道，是投毒重灾区。</li></ul><h3 id="7-3-第三道闸：装完的-24-小时">7.3 第三道闸：装完的 24 小时</h3><p>装完不是结束。花五分钟做四件事：</p><ol><li><strong>看任务管理器</strong>：多了哪些常驻进程？有没有你不认识的？</li><li><strong>看计划任务</strong>：跑一遍 4.6 的第 2 条命令；</li><li><strong>看网络</strong>：<code>资源监视器</code> 或 4.6 第 7 条命令，有没有陌生的境外连接；</li><li><strong>看浏览器</strong>：主页、默认搜索引擎有没有被改（银狐常顺手劫持）。</li></ol><p><strong>工具推荐</strong>（都是免费、官方、无捆绑）：</p><table><thead><tr><th>工具</th><th>用途</th></tr></thead><tbody><tr><td><strong>Process Explorer</strong></td><td>进程树 + 模块签名 + VirusTotal 集成</td></tr><tr><td><strong>Autoruns</strong></td><td>登录项、计划任务、服务、驱动，一处看全</td></tr><tr><td><strong>Process Monitor</strong></td><td>实时看文件/注册表/网络行为（进阶）</td></tr><tr><td><strong>火绒剑</strong></td><td>国内常用的行为分析工具</td></tr><tr><td><strong>TCPView</strong></td><td>看谁在连哪</td></tr></tbody></table><hr><h2 id="八、万一中招：处置流程">八、万一中招：处置流程</h2><p>先给结论：<strong>银狐是&quot;深度感染&quot;，不是&quot;删个文件就完事&quot;。</strong></p><h3 id="8-1-五步处置">8.1 五步处置</h3><table><thead><tr><th>步骤</th><th>动作</th><th>要点</th></tr></thead><tbody><tr><td><strong>① 断网</strong></td><td>拔网线/关 Wi-Fi</td><td><strong>第一优先级</strong>。切断 C2，攻击者就无法继续操作</td></tr><tr><td><strong>② 取证</strong></td><td>别急着重启</td><td>先跑 4.6 的脚本、截图进程树、导出计划任务，留证据（报案/上报要用）</td></tr><tr><td><strong>③ 改密</strong></td><td>用<strong>另一台干净设备</strong>改</td><td>邮箱、网银、社交、公司账号；<strong>全部开启两步验证</strong></td></tr><tr><td><strong>④ 通知</strong></td><td>告诉同事/客户/家人</td><td>攻击者会用你的微信/QQ 冒充你继续骗人</td></tr><tr><td><strong>⑤ 查杀</strong></td><td>专项工具 + 全盘</td><td>见下</td></tr></tbody></table><h3 id="8-2-查杀工具与专项通道">8.2 查杀工具与专项通道</h3><ul><li><strong>安天&quot;游蛇&quot;专项排查工具</strong>：可在安天垂直响应平台（<code>vs2.antiy.cn</code>）下载，专门排查游蛇投放的加载器与内存中的远控；</li><li><strong>360 安全卫士</strong>：针对被银狐滥用的企业管控软件（ip-guard 等）提供&quot;灭活/卸载&quot;能力；</li><li><strong>火绒</strong>：更新到最新病毒库后全盘查杀；</li><li><strong>上报线索</strong>：CNCERT&quot;银狐&quot;专项打击行动线索邮箱 <strong><code>silverfox@cert.org.cn</code></strong>。</li></ul><h3 id="8-3-什么时候必须重装">8.3 什么时候必须重装</h3><p>出现下面任意一条，<strong>格式化重装才是干净的选择</strong>（先备份重要数据，备份文件也要全盘扫一遍）：</p><ul><li>杀软<strong>反复被结束</strong>、防护反复变灰；</li><li>系统里有<strong>陌生内核驱动</strong>（4.6 第 5、6 条命中）；</li><li>计划任务删了又自动重建；</li><li>存在 <code>BYOVD</code> 级别的驱动对抗。</li></ul><p>因为银狐的持久化是<strong>六条腿</strong>（计划任务 × N、注册表、文件双份、排除项、hosts、管控软件），手工&quot;清理干净&quot;的概率很低。</p><h3 id="8-4-千万别做的四件事">8.4 千万别做的四件事</h3><ol><li><strong>别继续在原系统上登网银/输密码</strong>——你输一次，它记一次；</li><li><strong>别只删那个 exe</strong>——载荷在内存、在注册表、在计划任务里；</li><li><strong>别信网页弹窗&quot;你的电脑已中毒，请拨打 xxx / 下载专杀&quot;</strong>——那是另一波诈骗；</li><li><strong>别以为&quot;重装完就万事大吉&quot;</strong>——如果备份里带着安装包，重装等于重装病毒。</li></ol><hr><h2 id="九、九个常见误区">九、九个常见误区</h2><table><thead><tr><th>#</th><th>误区</th><th>事实</th></tr></thead><tbody><tr><td>1</td><td>“杀软没报就是安全的”</td><td>银狐的核心竞争力就是免杀；<strong>“扫不出来&quot;从来不等于&quot;没中”</strong></td></tr><tr><td>2</td><td>“<code>.com.cn</code> 就是官方”</td><td>CNCERT 明确：攻击者借用真实身份注册 <code>.com.cn</code> 制造可信假象</td></tr><tr><td>3</td><td>“有 HTTPS 小锁就是安全”</td><td>小锁只证明加密，DV 证书几分钟就能免费拿到</td></tr><tr><td>4</td><td>“有数字签名就是正版”</td><td>签名可伪造、可滥用、还可在签名尾部夹带数据而依然有效</td></tr><tr><td>5</td><td>“压缩包比 exe 安全”</td><td>银狐最爱压缩包内套 exe；&quot;带密码的压缩包&quot;更是刻意绕扫描</td></tr><tr><td>6</td><td>“我记住官网开头几个字母了”</td><td>仿冒正是加前后缀、换字符、玩子域名（<code>wps.cn.xxx.com</code>）</td></tr><tr><td>7</td><td>“搜索结果第一条就是官方”</td><td>SEO 投毒 + 竞价广告，<strong>排名和可信度无关</strong></td></tr><tr><td>8</td><td>“装完看着正常就没事”</td><td>银狐会<strong>主动显示正常安装界面</strong>，后台同时在侧加载</td></tr><tr><td>9</td><td>“我很小心，不会中招”</td><td>攻击者比你更懂&quot;什么时候你会放松&quot;——发工资那天、报税那周、裁员消息出来那天</td></tr></tbody></table><hr><h2 id="十、总结">十、总结</h2><p>把全文压缩成三句话：</p><p><strong>第一，银狐的&quot;底层&quot;其实只有三件事：借壳、驻内存、瞎内核。</strong></p><ul><li><strong>借壳</strong>：白加黑侧加载 + 签名伪造/滥用 + 签名块夹带数据，让&quot;合法程序&quot;替它开门；</li><li><strong>驻内存</strong>：Shellcode、手动映射、APC 注入系统进程，让磁盘上找不到&quot;病毒文件&quot;；</li><li><strong>瞎内核</strong>：BYOVD 加载合法漏洞驱动，从 Ring0 把杀软进程结束掉，让防护形同虚设。</li></ul><p><strong>第二，它的&quot;分发层&quot;是一套 SEO 工业化流水线。</strong></p><p>批量注册高仿域名（<code>.com.cn</code> 借他人实名）→ AI 批量复刻页面 → 抢搜索结果前列/买竞价广告 → 载荷放云对象存储 → 按次打包绕哈希 → Referer 校验反分析。CNCERT 披露的 439 个域名、1060 个&quot;甲蚁&quot;域名，就是这条流水线的产量证明。</p><p><strong>第三，鉴别也对应三层，而且顺序不能反。</strong></p><table><thead><tr><th>层级</th><th>你该看什么</th><th>成本</th></tr></thead><tbody><tr><td><strong>分发层</strong></td><td>域名逐字核对、注册时间、备案主体、跳过&quot;广告&quot;位</td><td>30 秒</td></tr><tr><td><strong>外壳层</strong></td><td>数字签名（状态+主体）、哈希、封装形式、文件名规律</td><td>2 分钟</td></tr><tr><td><strong>执行层</strong></td><td>计划任务、Defender 排除项、hosts、陌生驱动、境外外联</td><td>5 分钟</td></tr></tbody></table><p>三层里，<strong>分发层性价比最高</strong>——因为绝大多数人不是&quot;运行了可疑程序&quot;，而是&quot;从可疑网站下载了一个看起来正常的程序&quot;。<strong>把入口堵住，后面两层根本用不上。</strong></p><p>最后说一句可能有点扫兴的话：银狐这类黑产的技术迭代速度，已经快到&quot;记住特征&quot;本身失效的程度——互斥体名会改、路径会换、C2 每周换。所以真正可迁移的能力不是背 IOC，而是<strong>三个习惯</strong>：</p><ol><li><strong>软件只从&quot;我知道的那个地址&quot;装，不从&quot;搜出来的那个地址&quot;装</strong>；</li><li><strong>双击前看签名，装完后看计划任务</strong>；</li><li><strong>默认假设&quot;排名靠前&quot;是买来的，&quot;看起来像官网&quot;是仿出来的。</strong></li></ol><p>杀软拦得住大多数&quot;笨贼&quot;，拦不住你亲手把门打开。<strong>最好的安全措施，永远是那个会核对域名的你</strong> (๑•̀ㅂ•́)و✧</p><hr><h2 id="参考来源">参考来源</h2><blockquote><p>本文涉及的所有样本行为、域名数据、感染规模、处置建议，均来自以下公开来源。<strong>优先采信监管机构通报与厂商一线分析报告</strong>；媒体报道仅作背景与执法案例参考，涉及统计口径差异之处已在文中标注。</p></blockquote><h3 id="监管机构与官方通报（Primary-Sources）">监管机构与官方通报（Primary Sources）</h3><ol><li><p><strong>CNCERT — 关于黑产团伙批量搭建高仿真钓鱼网站大规模传播银狐木马的风险提示</strong>（2026-05-22）<br>439 个钓鱼域名画像、AI 批量生成页面、Referer 校验、<code>.hl.cn</code>/<code>.com.cn</code> 占比等数据来源<br><a href="https://www.cert.org.cn/publish/main/10/2026/20260522113326926111046/20260522113326926111046_.html">https://www.cert.org.cn/publish/main/10/2026/20260522113326926111046/20260522113326926111046_.html</a><br>报告原文 PDF：<a href="https://www.cert.org.cn/publish/main/upload/File/SilverFox.pdf">https://www.cert.org.cn/publish/main/upload/File/SilverFox.pdf</a></p></li><li><p><strong>CNCERT 与天融信 — 关于&quot;银狐&quot;木马&quot;甲蚁（G01）&quot;团伙攻击态势深入分析报告</strong>（安全内参转载，2026-09-29）<br>1060 个仿冒域名、命名模板、借用他人实名注册、6 个计划任务、Defender 排除项、hosts 劫持、8708 台被控主机、C2 与签名特征<br><a href="https://www.secrss.com/articles/94370">https://www.secrss.com/articles/94370</a><br>全量仿冒网站清单：<a href="https://www.cert.org.cn/publish/main/upload/File/silverfox-G01-list.pdf">https://www.cert.org.cn/publish/main/upload/File/silverfox-G01-list.pdf</a></p></li><li><p><strong>CNCERT 与微步在线 — 关于&quot;黑猫&quot;团伙利用搜索引擎传播仿冒 Notepad++ 下载远控后门的风险提示</strong>（2025-12-30）<br>SEO 投毒、仿冒 Chrome / AICoin / QQ 国际版 / 爱思助手的历史手法<br><a href="https://www.cert.org.cn/publish/main/10/2025/20251230153606629708787/20251230153606629708787_.html">https://www.cert.org.cn/publish/main/10/2025/20251230153606629708787/20251230153606629708787_.html</a></p></li><li><p><strong>CNCERT 与安天 — 关于&quot;游蛇&quot;黑产攻击活动的风险提示</strong>（2025-05-23）<br>伪造 Chrome 下载站、日上线肉鸡超 1.7 万、累计约 12.7 万台、<code>chromex64.zip</code> 侧加载链、IOC 清单<br><a href="https://www.cert.org.cn/publish/main/10/2025/20250523153345048656711/20250523153345048656711_.html">https://www.cert.org.cn/publish/main/10/2025/20250523153345048656711/20250523153345048656711_.html</a><br>报告 PDF：<a href="https://www.cert.org.cn/publish/main/upload/File/Colubrid%20Black%20Market%20New.pdf">https://www.cert.org.cn/publish/main/upload/File/Colubrid Black Market New.pdf</a></p></li><li><p><strong>CNCERT / CCTGA — &quot;银狐&quot;木马专项：恶意域名及恶意 IP（一）</strong>（2026-08-28）<br>团伙概述、恶意资产 TOP 10、排查方法与处置建议、线索邮箱 <code>silverfox@cert.org.cn</code><br><a href="https://www.cert.org.cn/publish/main/12/2026/20260828090839448441231/20260828090839448441231_.html">https://www.cert.org.cn/publish/main/12/2026/20260828090839448441231/20260828090839448441231_.html</a></p></li><li><p><strong>国家计算机病毒应急处理中心 — 针对我国用户的&quot;银狐&quot;系列木马病毒攻击活动预警报告</strong>（央视网，2026-05-21）<br><a href="https://news.cctv.com/2026/05/21/ARTIy7dnY6zSuPreHPSHiqLZ260521.shtml">https://news.cctv.com/2026/05/21/ARTIy7dnY6zSuPreHPSHiqLZ260521.shtml</a></p></li><li><p><strong>北京大学计算中心 — 关于防范&quot;银狐&quot;木马病毒最新变种及应急处置的通告</strong>（2026-05-22）<br>&quot;违纪名单 / 裁员补偿&quot;类诱饵文件名、<code>C:\Program Files\Internet Explorer\</code> 落点、<code>log.dll</code> 由白文件 <code>installer.exe</code> 加载<br><a href="https://cc.pku.edu.cn/notice/823.html">https://cc.pku.edu.cn/notice/823.html</a></p></li><li><p><strong>公安部网安局 / 央视新闻 — 新型&quot;银狐&quot;木马病毒犯罪……多地警方重拳出击</strong>（光明网，2026-06-16）<br>吉林、杭州、山东、广东、嘉兴 5 起案件；防范与处置指南；《刑法》第二百八十五条<br><a href="https://m.gmw.cn/2026-06/16/content_1304498009.htm">https://m.gmw.cn/2026-06/16/content_1304498009.htm</a></p></li></ol><h3 id="厂商一线技术分析（Technical-Analysis）">厂商一线技术分析（Technical Analysis）</h3><ol start="9"><li><p><strong>火绒安全 — 纯干货｜&quot;银狐&quot;变种：技术分析揭穿病毒多层混淆虚拟化伪装</strong>（2025-09-28）<br>OLLVM 不透明谓词、VMProtect OEP 定位、<code>space.ico</code> / <code>vdi_ipc.dat</code>、<code>npwzwmc64.dll</code> 白加黑、WIN_CERTIFICATE 尾部夹带数据、<code>MicrosoftEdgeUpdateTaskUA</code> 计划任务、RPC + <code>TCLService</code>、TrueSight IOCTL <code>0x22E044</code>、212 项杀软进程清单<br><a href="https://huorong.cn/document/tech/vir_report/1846">https://huorong.cn/document/tech/vir_report/1846</a></p></li><li><p><strong>火绒安全 — 反沙箱与杀软对抗双重利用，银狐新变种快速迭代</strong>（2024-09-29）<br><code>PfxInitialize</code> / <code>NtIsProcessInJob</code> / <code>NtCompressKey</code> 反沙箱、AMSI 与 ETW 打补丁、<code>s.dat</code> / <code>s.jpg</code> / <code>a.gif</code> 载荷、TrueSightKiller 驱动、<code>InstallUP.ini</code>、注册表 <code>ConsentPromptBehaviorAdmin</code> 提权绕过<br><a href="https://huorong.cn/document/tech/vir_report/1772">https://huorong.cn/document/tech/vir_report/1772</a></p></li><li><p><strong>火绒安全 — 成熟后门在野外&quot;泛滥&quot;，加载 Rootkit 对抗杀软</strong><br>后门模块（<code>Edge</code> 导出）来源分析<br><a href="https://www.huorong.cn/document/tech/vir_report/1647">https://www.huorong.cn/document/tech/vir_report/1647</a></p></li><li><p><strong>安天 — 关于&quot;游蛇&quot;黑产攻击活动的风险提示</strong>（2025-05-23，与 CNCERT 联合发布）<br><code>chromex64.zip</code>、<code>C:\Chr0me_12.1.2</code>、快捷方式伪装、Gh0st 远控、<code>duooi.com:2869</code>、域名滚动注册<br><a href="https://bbs.antiy.cn/thread-212619-1-10.html">https://bbs.antiy.cn/thread-212619-1-10.html</a></p></li><li><p><strong>安天 — 仿站投递、解密注入及中文系统校验丨游蛇（银狐）技战术追踪</strong>（2026-08-04）<br>Bing SEO 投毒仿冒&quot;汽水音乐&quot;、Go 语言释放器、<code>security_audit_20260514.log</code> + ChaCha20、APC 注入 <code>taskhostw.exe</code>、Winos 4.0、<code>154.36.188.53:443</code>、<code>0xCD</code> 心跳 / 60 秒重连、窗口标题检测 Wireshark/Fiddler<br><a href="https://bbs.antiy.cn/forum.php?mod=viewthread&amp;tid=212659">https://bbs.antiy.cn/forum.php?mod=viewthread&amp;tid=212659</a></p></li><li><p><strong>安天 — &quot;游蛇（银狐）&quot;黑产密集仿冒各类流行应用：WPS 下载站打假专辑</strong>（2025-10-10）<br>谷歌/Bing 搜索结果排位实测、钓鱼域名三种仿冒手法、文件名/图标/签名三项对照、IOC 清单<br><a href="https://www.antiy.cn/research/notice&amp;report/research_report/SwimSnake_Analysis_202510.html">https://www.antiy.cn/research/notice&amp;report/research_report/SwimSnake_Analysis_202510.html</a></p></li><li><p><strong>安天 — 游蛇（银狐）仿冒 FinalShell 管理软件的攻击手法分析</strong>（2025-09-19）<br><a href="https://www.antiy.cn/research/notice&amp;report/research_report/SwimSnake_Analysis_202509.html">https://www.antiy.cn/research/notice&amp;report/research_report/SwimSnake_Analysis_202509.html</a></p></li><li><p><strong>安天 — 多层隐匿载荷解密与驱动级致盲对抗手法分析丨游蛇（银狐）技战术追踪</strong>（2025-11-20）<br><a href="https://www.antiy.cn/research/notice&amp;report/research_report/SwimSnake_Analysis_202511.html">https://www.antiy.cn/research/notice&amp;report/research_report/SwimSnake_Analysis_202511.html</a></p></li><li><p><strong>安天 — &quot;游蛇&quot;威胁历史报告清单（2022–2026，共 20 篇）</strong><br>含 2022-10 伪造中文版 Telegram、2023-03 云笔记平台投递、2025-05 仿冒 WPS、2025-10 打假专辑等<br>索引：<a href="https://www.antiy.cn/research/notice&amp;report/research_report/index.html">https://www.antiy.cn/research/notice&amp;report/research_report/index.html</a></p></li><li><p><strong>微步在线 — 银狐 26 年全面复活，对抗强度或已超 25 年最高水平</strong>（2026-04-08）<br>春节后活跃度恢复、3 月捕获取数（原文为知乎专栏，抓取受限，仅引标题与摘要口径）<br><a href="https://zhuanlan.zhihu.com/p/2025263985218340488">https://zhuanlan.zhihu.com/p/2025263985218340488</a></p></li><li><p><strong>360 安全卫士 — 彻底查杀顽固&quot;银狐&quot;木马</strong>（2024-08-29）<br>利用 <code>ip-guard</code>、固信终端安全、阳途终端安全等正规管控软件实现长期驻留与&quot;合法远控&quot;<br><a href="https://weishi.360.cn/dnzs/12614.html">https://weishi.360.cn/dnzs/12614.html</a></p></li><li><p><strong>吾爱破解 — 【病毒分析】R3 强杀 360：银狐远控病毒再进化</strong>（2025-01-17）<br><code>VirtualAlloc(0, 122880, 0x3000, 0x40)</code>、二次远程加载 Shellcode、<code>156.251.17.245:8852</code>、反射加载 DLL、线程池注入 SYSTEM 进程结束 360tray<br><a href="https://www.52pojie.cn/thread-2000659-1-1.html">https://www.52pojie.cn/thread-2000659-1-1.html</a></p></li><li><p><strong>看雪论坛 — DEC/RPC 协议与 Windows 服务创建浅析（银狐原始进程隐匿方式之一）</strong><br>RPC 建服务 / 建计划任务的原理背景<br><a href="https://bbs.kanxue.com/thread-285258.htm">https://bbs.kanxue.com/thread-285258.htm</a></p></li><li><p><strong>瑞星 — 银狐魅影：隐藏于进程迷雾中的恶意&quot;幽灵链&quot;</strong>（2025-09）<br>传播渠道与诱饵文件名特征（站点反爬，本文仅引用检索摘要口径）<br><a href="https://rayblog.rising.com.cn/2025/09/">https://rayblog.rising.com.cn/2025/09/</a></p></li></ol><h3 id="媒体报道与背景参考（Secondary-背景）">媒体报道与背景参考（Secondary / 背景）</h3><ol start="23"><li><p><strong>浅淡网 — 中文搜索引擎必应沦陷，前 5 条基本全是病毒</strong>（2026-06-17）<br>必应中文结果投毒密度、举报下架周期、Chrome 搜索结果实测（<strong>媒体口径，非官方结论</strong>）<br><a href="https://www.qiandan.net/archives/2437.html">https://www.qiandan.net/archives/2437.html</a></p></li><li><p><strong>安全内参 — 安全预警：银狐新变种突袭国内医疗系统</strong><br><a href="https://www.secrss.com/articles/77155">https://www.secrss.com/articles/77155</a></p></li><li><p><strong>国家安全部 / 新华网 — 那些悄悄&quot;上位&quot;的链接</strong>（2026-03-28）<br><a href="http://www.xinhuanet.com/politics/20260328/af11a700d9f5487494be498623140346/c.html">http://www.xinhuanet.com/politics/20260328/af11a700d9f5487494be498623140346/c.html</a></p></li><li><p><strong>百度百科 — 银狐（木马病毒的变种）词条</strong><br>别名、时间线、Gh0st 4.0 血缘的二手汇总（仅作背景，细节以厂商报告为准）<br><a href="https://baike.baidu.com/item/%E9%93%B6%E7%8B%90/65131570">https://baike.baidu.com/item/银狐/65131570</a></p></li></ol><h3 id="引用说明">引用说明</h3><ul><li>文中&quot;日上线肉鸡超 1.7 万&quot;&quot;累计约 12.7 万台&quot;来自 CNCERT 与安天 2025-05-23 联合报告，统计区间为 <strong>2025-04-23 至 05-12</strong>；“8708 台”&quot;单日峰值 2361 台&quot;来自 CNCERT 与天融信&quot;甲蚁&quot;报告，统计区间为 <strong>2026-09-15 至 09-22</strong>。<strong>两组数字口径不同、时间不同，不可相加或横向比较。</strong></li><li>&quot;439 个钓鱼域名&quot;统计区间为 <strong>2026-02-06 至 05-04</strong> 的注册域名；&quot;1060 个仿冒域名&quot;为&quot;甲蚁&quot;团伙现有批次累计核验值。二者属于不同团伙/不同批次。</li><li>文中 <code>0x22E044</code>、<code>TCLService</code>、<code>367abb81-9844-35f1-ad32-98f038001003</code>、<code>CLSID_TaskScheduler &#123;0F87369F-...&#125;</code> 等均转引自火绒报告与看雪技术文章，<strong>仅作检测与识别用途</strong>。</li><li>&quot;必应中文结果投毒密度高、下架周期长&quot;为技术博主实测与媒体口径，<strong>CNCERT 与厂商报告只确认&quot;存在针对 Bing 的 SEO 投毒&quot;，未对各家搜索引擎做横向评级</strong>，本文如实区分。</li><li><code>.com.cn</code> 后缀与官方身份<strong>无必然关联</strong>，此结论直接来自 CNCERT&quot;甲蚁&quot;报告原文。</li><li>本文不含任何可直接运行的攻击代码；4.6 与 6.4 中的命令均为<strong>只读查询</strong>与<strong>文件校验</strong>用途。</li><li>银狐变种迭代极快（互斥体名、落点路径、C2 域名会随批次更换），文中 IOC <strong>只能证明&quot;这一批属于该团伙&quot;，不能作为完整黑名单</strong>。</li><li>§1.2 时间线中&quot;2020 年首次现身&quot;来自火绒报告，&quot;2022 年下半年开始频繁活跃&quot;来自 CNCERT 与安天，“2023 年 3 月微步在线首次捕获并命名”&quot;2024 年 7 月多地公安预警&quot;来自百度百科词条的二手汇总（<strong>未在厂商原始报告中逐条核验，仅作背景</strong>）。</li></ul>]]></content>
    
    
    <summary type="html">银狐（游蛇/谷堕大盗）为什么能绕过杀软、为什么总能排在搜索结果前排？本文从白加黑侧加载、数字签名的三个漏洞、内存加载与 APC 注入、BYOVD 内核致盲讲起，逐层拆解它的运行原理，再给出一套可执行的「真假官网 + 真假安装包」核对流程与自查脚本。</summary>
    
    
    
    <category term="技术学习" scheme="https://zhaogb612.github.io/categories/%E6%8A%80%E6%9C%AF%E5%AD%A6%E4%B9%A0/"/>
    
    
    <category term="银狐木马" scheme="https://zhaogb612.github.io/tags/%E9%93%B6%E7%8B%90%E6%9C%A8%E9%A9%AC/"/>
    
    <category term="网络安全" scheme="https://zhaogb612.github.io/tags/%E7%BD%91%E7%BB%9C%E5%AE%89%E5%85%A8/"/>
    
    <category term="木马分析" scheme="https://zhaogb612.github.io/tags/%E6%9C%A8%E9%A9%AC%E5%88%86%E6%9E%90/"/>
    
    <category term="钓鱼网站" scheme="https://zhaogb612.github.io/tags/%E9%92%93%E9%B1%BC%E7%BD%91%E7%AB%99/"/>
    
    <category term="搜索引擎投毒" scheme="https://zhaogb612.github.io/tags/%E6%90%9C%E7%B4%A2%E5%BC%95%E6%93%8E%E6%8A%95%E6%AF%92/"/>
    
  </entry>
  
  <entry>
    <title>PHP2Shell 漏洞分析：两个 9.2 分 RCE 的技术全貌</title>
    <link href="https://zhaogb612.github.io/posts/7876794c.html"/>
    <id>https://zhaogb612.github.io/posts/7876794c.html</id>
    <published>2026-10-23T15:10:00.000Z</published>
    <updated>2026-10-23T15:10:00.000Z</updated>
    
    <content type="html"><![CDATA[<h1 id="PHP2Shell-漏洞分析：两个-9-2-分-RCE-的技术全貌">PHP2Shell 漏洞分析：两个 9.2 分 RCE 的技术全貌</h1><h2 id="引言">引言</h2><p>2026 年 10 月 21 日，UTC 14:00。</p><p>PHP 官方没有像往常那样发一篇云淡风轻的 “Released!”，而是直接甩出一句：</p><blockquote><p><strong>PHP 8.5.12、8.4.27、8.3.36、8.2.35 修复两个可导致未授权远程代码执行的严重漏洞。所有 PHP 用户请立即更新。</strong></p></blockquote><p>没有&quot;建议&quot;，没有&quot;酌情&quot;，就是<strong>立即</strong>。</p><p>社区给它们起了个名字——<strong>PHP2Shell</strong>。</p><p>Wiz 研究团队在报告里写了一句话，我觉得比任何评分都更能说明问题：</p><blockquote><p>这些发现堪称 PHP 历史上最严重的漏洞之一，甚至可以说是<strong>软件史上最严重的漏洞之一</strong>。</p></blockquote><hr><h2 id="一、先把事实摆清楚">一、先把事实摆清楚</h2><h3 id="1-1-基础信息">1.1 基础信息</h3><table><thead><tr><th>项目</th><th>内容</th></tr></thead><tbody><tr><td>漏洞编号</td><td><strong>CVE-2026-109618</strong>、<strong>CVE-2026-109619</strong></td></tr><tr><td>社区代号</td><td>PHP2Shell</td></tr><tr><td>发现方</td><td>Calif（GPT-5.6 Sol）、Wiz Research（Wiz Atlas + Gemini 4 Argon + GPT-5.6 Sol）</td></tr><tr><td>披露时间</td><td>2026-10-21 14:17 UTC</td></tr><tr><td>漏洞类型</td><td>未授权远程代码执行（RCE）+ 远程进程内存泄露</td></tr><tr><td>CWE 分类</td><td><strong>CWE-416</strong>（Use After Free）、CWE-755（异常处理不当）、CWE-824（未初始化指针访问）、CWE-1325（资源锁管理不当）</td></tr><tr><td>官方修复</td><td><strong>8.2.35 / 8.3.36 / 8.4.27 / 8.5.12</strong></td></tr></tbody></table><h3 id="1-2-为什么是-两个-评分，不是-一个">1.2 为什么是&quot;两个&quot;评分，不是&quot;一个&quot;</h3><p>这一点很容易被中文二手报道写乱，我单独说明。</p><p>同一组漏洞，存在<strong>两套评分标准并存</strong>的情况：</p><table><thead><tr><th>评分来源</th><th>标准</th><th>分数</th><th>严重度</th></tr></thead><tbody><tr><td>PHP 官方（security@php.net）</td><td>CVSS <strong>v4.0</strong></td><td><strong>9.2</strong></td><td>CRITICAL</td></tr><tr><td>NVD / NIST</td><td>CVSS <strong>v3.1</strong></td><td><strong>9.8</strong>（109618）/ <strong>8.1</strong>（109619）</td><td>CRITICAL / HIGH</td></tr></tbody></table><p>两套分数不一致<strong>不是谁错了</strong>，而是算法不同、评估维度不同：</p><ul><li><strong>CVSS v4.0</strong> 引入了 <code>AT</code>（Attack Requirements，攻击前置条件）这个维度。PHP 官方给 109618 打了 <code>AC:H</code>（攻击复杂度高）+ <code>AT:P</code>（需要前置条件），这两项拉低了分数，最终算出 9.2。</li><li><strong>CVSS v3.1</strong> 没这个维度，109618 被 NIST 评为 <code>AC:L</code>（攻击复杂度低）、<code>AV:N/PR:N/UI:N</code>，直接算出 <strong>9.8</strong>。</li></ul><p>所以准确的说法是：</p><blockquote><p><strong>两个漏洞的 CVSS v4.0 评分都是 9.2（官方口径）；按 v3.1 口径，109618 是 9.8，109619 是 8.1。</strong></p></blockquote><p>不管用哪套标准，都落在&quot;严重&quot;区间。别被数字差异迷惑。</p><h3 id="1-3-影响范围有多大">1.3 影响范围有多大</h3><p>官方原话：</p><blockquote><p><strong>所有处理 Web 请求的 PHP 安装</strong>，包括 PHP-FPM、Apache with mod_php、php-cgi、FrankenPHP 和 LiteSpeed。</p></blockquote><p>Wiz 的补充更狠：</p><blockquote><p><strong>过去十年发布的每一个 PHP 版本都至少受其中一个漏洞影响，最早可追溯到 PHP 5.4。</strong></p></blockquote><p>而 NVD 的配置数据佐证了这一点——CVE-2026-109619 的受影响版本区间写的是 <code>versionStartIncluding: 5.4.0</code>。</p><p>至于覆盖面：PHP 支撑着全球约 <strong>70%</strong> 的网站，包括 WordPress、Joomla、Drupal，以及维基百科背后的 MediaWiki。</p><h3 id="1-4-官方给的两个-GHSA-编号">1.4 官方给的两个 GHSA 编号</h3><ul><li>CVE-2026-109618 → <a href="https://github.com/php/php-src/security/advisories/GHSA-w8hw-w9fx-j79w">GHSA-w8hw-w9fx-j79w</a></li><li>CVE-2026-109619 → <a href="https://github.com/php/php-src/security/advisories/GHSA-6wmf-4rv5-p3rp">GHSA-6wmf-4rv5-p3rp</a></li></ul><p>还有一句必须原样引用的话：</p><blockquote><p><strong>没有完整的缓解措施，更新是唯一安全的选择。</strong><br>（There are no complete mitigations, updating is the only safe choice.）</p></blockquote><hr><h2 id="二、底层原理：必须先把这三个概念讲透">二、底层原理：必须先把这三个概念讲透</h2><p>要看懂后面的四个 bug，得先理解 PHP 处理请求的三件事。<strong>这一节是全文的地基，建议别跳。</strong></p><h3 id="2-1-概念一：longjmp-——-PHP-是怎么-一键放弃-的">2.1 概念一：<code>longjmp()</code> —— PHP 是怎么&quot;一键放弃&quot;的</h3><p>大多数语言遇到内存不足，会抛一个异常，然后一层层往上冒泡，每层都有机会 <code>catch</code>、清理、释放资源。</p><p>PHP 不是。</p><p>PHP 处理 OOM 用的是 C 语言的 <strong><code>longjmp()</code></strong>。</p><p><code>longjmp()</code> 是什么？简单说就是一个**“跳跃式返回”<strong>——它不需要一层层退栈，可以直接从调用栈深处</strong>瞬间跳回**事先用 <code>setjmp()</code> 记下的那个位置。</p><p>NVD 对 109618 的描述第一句就是：</p><blockquote><p>PHP uses <code>longjmp()</code> for out-of-memory (OOM) errors to exit the current context and abort handling of the request.</p></blockquote><p>翻译：PHP 用 <code>longjmp()</code> 处理 OOM 错误，直接退出当前上下文、放弃处理这个请求。</p><p><strong>这个设计本身没问题</strong>，甚至是性能导向的合理选择（OOM 时栈可能已不可靠，逐层清理反而危险）。</p><p>但它带来一个致命副作用：</p><blockquote><p><strong><code>longjmp()</code> 会直接跳过你原本打算执行的清理代码。</strong></p></blockquote><p>想象你正在写文件：</p><figure class="highlight markdown"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"><span class="bullet">1.</span> 打开文件</span><br><span class="line"><span class="bullet">2.</span> 申请缓冲区        ← 这里 OOM，longjmp 飞走了</span><br><span class="line"><span class="bullet">3.</span> 写入</span><br><span class="line"><span class="bullet">4.</span> 关闭文件          ← 永远不会执行</span><br></pre></td></tr></table></figure><p>如果第 2 步 OOM，第 4 步的&quot;关闭文件&quot;就<strong>永远不会跑</strong>。</p><p>在 PHP 里，被跳过的可能是：<strong>计数递增后的状态、指针赋值、标志位设置、堆栈记录。</strong></p><p>于是——<strong>请求的内存堆被销毁了，但某些全局状态还指着它。</strong></p><p>这就是后面四个 bug 共同的根源。</p><h3 id="2-2-概念二：请求堆（request-heap）的生命周期">2.2 概念二：请求堆（request heap）的生命周期</h3><p>PHP 每个请求的内存是<strong>成批分配、成批销毁</strong>的，不是一个个 <code>malloc</code>/<code>free</code>。</p><p>请求开始时，PHP 开一个&quot;内存池&quot;（request heap）；请求结束时，<strong>整个池一次性销毁</strong>。这个设计叫 arena allocator，非常快。</p><p>好处：不用逐个释放，天然没有内存碎片。<br>坏处：<strong>只要你漏了一个指针，它就变成悬空指针（dangling pointer）</strong>，而且指向的那块内存<strong>马上会被下一个请求重新分配、重新填上别人的数据</strong>。</p><p>而 PHP 的进程模型是 <strong>worker 复用</strong>——PHP-FPM、mod_php 都是一个 worker 连续处理成百上千个请求。</p><p>这两点一叠加，就构成了经典的 <strong>跨请求 Use-After-Free（UAF）</strong>：</p><figure class="highlight css"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">请求 <span class="selector-tag">A</span>（攻击者）  → 制造 OOM → 请求堆被销毁 → 某全局指针悬空</span><br><span class="line">请求 <span class="selector-tag">B</span>（受害者）  → 复用该 worker → 那块内存已被 <span class="selector-tag">B</span> 的数据填满</span><br><span class="line">                 → PHP 用 <span class="selector-tag">A</span> 留下的旧指针去读/写 → 读到 <span class="selector-tag">B</span> 的数据</span><br></pre></td></tr></table></figure><p><strong>关键在于：攻击者不知道下一个请求是谁发的。</strong> 这正是这个漏洞&quot;脏&quot;的地方——它不只是打自己，是<strong>污染整个进程</strong>。</p><h3 id="2-3-概念三：EG-CG-BG-PS-——-那些-全局状态">2.3 概念三：<code>EG()</code> / <code>CG()</code> / <code>BG()</code> / <code>PS()</code> —— 那些&quot;全局状态&quot;</h3><p>PHP 源码里到处是这类宏，它们是<strong>进程级 / 线程级的全局变量</strong>：</p><table><thead><tr><th>宏</th><th>含义</th><th>存放什么</th></tr></thead><tbody><tr><td><code>EG(x)</code></td><td>Executor Globals</td><td>执行器全局状态，如 <code>EG(last_fatal_error_backtrace)</code></td></tr><tr><td><code>CG(x)</code></td><td>Compiler Globals</td><td>编译器全局状态，如 <code>CG(map_ptr_last)</code></td></tr><tr><td><code>BG(x)</code></td><td>Basic Globals</td><td>基础全局，如 <code>BG(unserialize)</code></td></tr><tr><td><code>PS(x)</code></td><td>PHP Session globals</td><td>会话状态，如 <code>PS(id)</code></td></tr></tbody></table><p><strong>问题在于：这些全局状态的生命周期 ≠ 请求的生命周期。</strong></p><p>设计上，它们应该在每个请求开始时被重置、请求结束时被清理。</p><p>但 <code>longjmp()</code> 会跳过清理。于是——</p><blockquote><p><strong>请求堆没了，全局状态还在指着它。</strong> 下一个请求进来，全局状态还没被重置，就会用到失效的指针。</p></blockquote><p>下面四个 bug，全是这个模式的四种变体。</p><hr><h2 id="三、四个-bug-的逐条拆解">三、四个 bug 的逐条拆解</h2><p>Wiz 一共报告了 <strong>4 个可利用的 bug</strong>，归到 <strong>2 个 CVE</strong> 下。</p><p>先看总览表：</p><table><thead><tr><th>编号</th><th>Bug</th><th>攻击者能做什么</th><th>已演示</th></tr></thead><tbody><tr><td><strong>CVE-2026-109618</strong></td><td>上传进度 unserializer UAF</td><td>破坏进程内存、执行代码</td><td>WordPress / Drupal / Joomla 未认证 RCE</td></tr><tr><td><strong>CVE-2026-109618</strong></td><td>远程进程内存泄露</td><td>未认证读取 PHP worker 内存</td><td>应用无关的内存泄露</td></tr><tr><td><strong>CVE-2026-109619</strong></td><td>致命错误回溯 UAF</td><td>破坏进程内存、执行代码</td><td>Drupal 未认证 RCE</td></tr><tr><td><strong>CVE-2026-109619</strong></td><td>OPcache 类型混淆</td><td>破坏共享 PHP 状态、执行代码</td><td>WordPress 未认证 RCE</td></tr></tbody></table><h3 id="3-1-Bug-①：上传进度-unserializer-Use-After-Free">3.1 Bug ①：上传进度 unserializer Use-After-Free</h3><p><strong>所属 CVE：109618</strong></p><p>这是最复杂、也是被用来打通 WordPress 和 Joomla 的那个。</p><p>机制拆解：</p><ol><li>PHP 的 Session 模块处理<strong>上传进度</strong>时，会在一个&quot;过早的初始化窗口&quot;里解码 session 数据。</li><li>解码器把自己需要的记录写进全局 <code>BG(unserialize)</code>。</li><li>此时如果发生<strong>致命的内存分配失败</strong>（OOM），<code>longjmp()</code> 会打断这条路径 → 请求堆被销毁 → 但 <code>BG(unserialize)</code> 这个全局状态<strong>已经被发布了</strong>，仍然指着刚被销毁的堆。</li><li>同一个 worker 处理<strong>下一个请求</strong>时，PHP 会把&quot;攻击者已经重新占用的内存&quot;当成仍然有效的 unserializer 记录来用。</li></ol><p>Wiz 的原话：</p><blockquote><p>The stale state becomes a powerful memory-corruption primitive.<br>（这个陈旧状态变成了一个强大的内存破坏原语。）</p></blockquote><p>它再把这一手和&quot;内存泄露&quot;组合起来，消除地址不确定性，最终在 <strong>WordPress、Drupal、Joomla</strong> 上都拿到了未认证 RCE。</p><p><strong>为什么这个特别吓人：</strong> 它发生在<strong>应用层之下</strong>。你的 WAF、你的入口过滤、你的框架中间件，全都在这个位置之后才轮到执行。</p><h3 id="3-2-Bug-②：远程进程内存泄露（Heartbleed-式）">3.2 Bug ②：远程进程内存泄露（Heartbleed 式）</h3><p><strong>所属 CVE：109618</strong></p><p>这个不需要 RCE，就能直接偷数据。</p><p>机制拆解：</p><ol><li>PHP 在处理请求<strong>启动阶段</strong>（正常模块初始化完成之前）就解析 RFC1867 的 multipart 请求。</li><li>上传进度处理可以在这个极早的阶段初始化 Session 状态，并把 session ID 存进 <code>PS(id)</code>。</li><li>此时 OOM 中断请求 → 清理没做完 → 请求堆被销毁 → <strong><code>PS(id)</code> 指向已被释放的内存</strong>。</li><li>同一 worker 处理下一个 multipart 请求时，会在 Session 正常初始化重置该指针<strong>之前</strong>，走到上传进度的清理路径。</li><li>PHP 把那个陈旧的指针和长度当作<strong>有效的 <code>zend_string</code></strong>，把回收后的堆内容 <strong>URL 编码后塞进 <code>PHPSESSID</code> 响应 Cookie</strong>。</li></ol><p>结果：攻击者的响应头里，带回了<strong>属于别人请求的活内存</strong>。</p><p>里面可能有：密码、认证令牌、API 密钥、证书。</p><p>Wiz 的评价（这句很关键）：</p><blockquote><p>The attack works even when the application never calls <code>session_start()</code>, making the issue application-agnostic.<br>（即使应用从不调用 <code>session_start()</code> 也能打，这让该问题与应用无关。）</p></blockquote><p>这就是它的&quot;Heartbleed 时刻&quot;——<strong>不需要应用配合，PHP 引擎自己就把内存漏出去了。</strong></p><h3 id="3-3-Bug-③：致命错误回溯-Use-After-Free">3.3 Bug ③：致命错误回溯 Use-After-Free</h3><p><strong>所属 CVE：109619</strong></p><p>机制拆解：</p><ol><li>受影响版本里，PHP 会把<strong>最近一次致命错误的回溯</strong>保留在 <code>EG(last_fatal_error_backtrace)</code>。</li><li>致命 OOM 会销毁请求堆，但<strong>没有把这个 executor 全局值取消定义</strong>。</li><li>worker 活下来了，而那个全局变量<strong>还指着上一个请求的内存</strong>。</li><li>如果同一个 worker 在下一个请求的<strong>早期</strong>产生诊断输出，就能在 executor 重新初始化之前访问到这个指针。</li><li>PHP 随后销毁 / 更新这个悬空的回溯 → <strong>顺着攻击者已经回收的内存走</strong>。</li></ol><p>产生的跨请求 UAF 可以被发展成受控的内存破坏。Wiz 用它打穿了 <strong>Drupal</strong>。</p><p><strong>一个容易被忽略的细节：</strong> 这条路径依赖&quot;请求早期就产生诊断输出&quot;。这也解释了为什么官方缓解建议里有一条是&quot;清掉那些会在初始化前产生诊断的配置&quot;——<strong>以及为什么用 <code>error_reporting</code> 或 <code>@</code> 去屏蔽报错是没用的</strong>（报错已经产生并触发了路径，只是不显示而已）。</p><h3 id="3-4-Bug-④：OPcache-类型混淆">3.4 Bug ④：OPcache 类型混淆</h3><p><strong>所属 CVE：109619</strong></p><p>这个最精妙，因为它跨的是 <strong>worker 之间</strong>，不是请求之间。</p><p>背景：OPcache 把编译好的 PHP 结构放进<strong>共享内存</strong>，并用&quot;索引&quot;指向每个 worker 私有的运行时指针表。worker 之间通过一个**共享的 frontier（前沿指针）**来协调这些索引。</p><p>机制拆解：</p><ol><li>在 <code>zend_accel_script_persist()</code> 期间，PHP 先推进<strong>进程本地</strong>的 <code>CG(map_ptr_last)</code>。</li><li>要等持久化<strong>完成之后</strong>，才发布对应的共享 frontier。</li><li>如果在这两个动作<strong>之间</strong>发生内存分配失败 → <strong>进程本地的推进留下了，但共享状态还认为那些槽位可用</strong>。</li><li>另一个 worker 后来把这些槽位复用给<strong>不同类型</strong>的运行时对象。</li><li>陈旧的共享元数据于是解析出一个<strong>类型错误</strong>的指针。</li></ol><p>结果：跨 worker 的类型混淆（type confusion），破坏共享的 OPcache 状态。Wiz 用它打通了 <strong>WordPress</strong>。</p><p><strong>为什么这个最&quot;优雅&quot;：</strong> 前三个 bug 都是同一个 worker 内的跨请求污染，这个直接跨进程共享内存。<strong>一个 worker 被污染，所有 worker 都可能中招。</strong></p><h3 id="3-5-一个重要的补充：这只是-4-个，不是全部">3.5 一个重要的补充：这只是 4 个，不是全部</h3><p>Wiz 明确说了：</p><blockquote><p>While this blog covers only four instances of exploitable bugs (grouped under two CVEs) that follow this problematic pattern, <strong>there are other tracked, and likely untracked, variants</strong> of this issue in the PHP codebase.</p></blockquote><p>翻译：这 4 个只是<strong>已报告</strong>的，代码库里还有<strong>已知的、以及尚未被发现的同类变体</strong>。</p><p>但好消息是：</p><blockquote><p>无论如何，PHP 团队提供的补丁<strong>从根源上修复了这个问题，并在打补丁的版本中消除了所有变体</strong>。</p></blockquote><p>这也是为什么官方说&quot;更新是唯一安全选择&quot;——补丁不是打补丁，是<strong>在核心层面堵死这一类模式</strong>。</p><hr><h2 id="四、为什么这次特别难修、也特别难发现">四、为什么这次特别难修、也特别难发现</h2><h3 id="4-1-难修：动了引擎">4.1 难修：动了引擎</h3><p>PHP 官方把这次修复形容为——</p><blockquote><p><strong>“需要对 PHP 引擎做一次重大改动”</strong>（a major change to the PHP engine）。</p></blockquote><p>不是加个 <code>if</code>，不是补个边界检查。是改引擎的核心内存管理逻辑。</p><p>这也解释了为什么从 8 月发现到 10 月发版，中间隔了两个月——<strong>不是拖，是真的难改</strong>。</p><h3 id="4-2-难发现：卡在-人类极限">4.2 难发现：卡在&quot;人类极限&quot;</h3><p>Wiz 有一句话说得非常克制，但信息量极大：</p><blockquote><p>这些底层缺陷已经存在了几十年，但<strong>证明其可利用性需要一条异常复杂的利用链，处于人类研究者实际能达到的边缘</strong>。</p></blockquote><p>翻译：<strong>不是没人看，是看到了也打不通。</strong></p><p>传统的&quot;叠加多个 bug + 适配每个目标的堆布局&quot;这条路，人工做起来成本极高、且几乎无法规模化。这也是为什么它能安静地躺十几年。</p><h3 id="4-3-两个独立团队、同一批漏洞">4.3 两个独立团队、同一批漏洞</h3><p>这次有个很有意思的现象——<strong>同一组漏洞被两个互不通信的团队独立挖到</strong>：</p><table><thead><tr><th>团队</th><th>工具</th><th>开始时间</th><th>首洞时间</th></tr></thead><tbody><tr><td>Calif / Ryan Austin</td><td>GPT-5.6 Sol</td><td>2026-07-30</td><td><strong>2026-08-01（2 天）</strong></td></tr><tr><td>Wiz Research</td><td>Wiz Atlas + Gemini 4 Argon + GPT-5.6 Sol</td><td>2026-08-19</td><td>当天发现，8/20 确认 Drupal RCE</td></tr></tbody></table><p>两边都在 8 月报给 PHP，10 月一起公开。</p><p><strong>这说明：不是某个模型的偶然神迹，而是&quot;AI 审计这条路&quot;已经能稳定复现了。</strong></p><h3 id="4-4-最值得记住的细节：把发现写成-SKILL-md">4.4 最值得记住的细节：把发现写成 <code>SKILL.md</code></h3><p>Calif 在挖出第一个洞之后没有收工。</p><p>他们让模型<strong>把刚刚发现的错误模式写成一份 <code>SKILL.md</code></strong>——一份可复用的审计指引——然后让 Agent 拿着它，沿着同样的线索继续扫整个代码库。</p><p>结果：<strong>在上传进度那段代码里，找到了第二个洞。</strong></p><p>这是 AI 审计和人工审计最本质的差别：</p><blockquote><p><strong>人挖到一个洞，经验留在脑子里。</strong><br><strong>AI 挖到一个洞，经验变成一份可以立刻分发给一万个 Agent 的文件。</strong></p></blockquote><p>从&quot;找到一个点&quot;，变成&quot;找到一整类&quot;。</p><p>Wiz 的说法更直接：</p><blockquote><p>借助前沿 AI 模型和合适的工具，<strong>单个研究者在一周内完成了过去世界级团队需要数月才能完成的工作</strong>。</p></blockquote><hr><h2 id="五、这套东西被做成了-一条流水线">五、这套东西被做成了&quot;一条流水线&quot;</h2><p>这次披露不像&quot;发个公告你们自己看着办&quot;，而是一次<strong>全球协同</strong>。</p><p>参与的包括：Google Cloud、Cloudflare、AWS、Microsoft、Automattic、Fastly、Akamai、Imperva、Vercel，以及政府侧的 CISA、ONCD。</p><p>OpenAI 推了一个五阶段框架（Patch the Planet）：</p><table><thead><tr><th>阶段</th><th>做什么</th></tr></thead><tbody><tr><td>1. 验证并修复上游漏洞</td><td>确认、评估、开发并测试修复，包括用前沿模型做<strong>对抗性测试</strong>（专门找绕过补丁的方法）</td></tr><tr><td>2. 给受影响组织留出行动时间</td><td>判断哪些组织需要提前获知</td></tr><tr><td>3. 与政府协同保护关键系统</td><td>让指引触达关键基础设施运营方</td></tr><tr><td>4. 在受影响产品中准备更新</td><td>发行版回补、主机商测试缓解、安全厂商准备 WAF 规则</td></tr><tr><td>5. 补丁就绪后公开并支持部署</td><td>公开披露、提供版本检查工具、指导验证</td></tr></tbody></table><p>这套流程催生了一个新概念：<strong>Defender’s Window（防御者窗口）</strong>。</p><p>传统逻辑是：发现 → 立刻公开 → 攻击者和管理员同时起跑，管理员通常输。</p><p>这次不是。<strong>8 月发现，10 月公开，中间两个月防御方全部就位。</strong></p><p>当然，同一把刀两边都能用。OpenAI 自己也很坦白：</p><blockquote><p>这凸显了 AI 如何能够发现具有互联网规模影响的安全漏洞，<strong>但同样的能力也可以帮助攻击者快速开发攻击工具和漏洞利用程序。</strong></p></blockquote><hr><h2 id="六、你的服务器该做什么">六、你的服务器该做什么</h2><h3 id="6-1-第一步：查版本">6.1 第一步：查版本</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">php -v</span><br></pre></td></tr></table></figure><p>对照下表。<strong>只要不在修复版本或以上，你就是暴露的。</strong></p><table><thead><tr><th>分支</th><th>安全线</th><th>你受影响的条件</th></tr></thead><tbody><tr><td>PHP 8.5.x</td><td><strong>8.5.12</strong></td><td><code>&lt; 8.5.12</code></td></tr><tr><td>PHP 8.4.x</td><td><strong>8.4.27</strong></td><td><code>&lt; 8.4.27</code></td></tr><tr><td>PHP 8.3.x</td><td><strong>8.3.36</strong></td><td><code>&lt; 8.3.36</code></td></tr><tr><td>PHP 8.2.x</td><td><strong>8.2.35</strong></td><td><code>&lt; 8.2.35</code></td></tr><tr><td>PHP 8.1 / 8.0 / 7.4</td><td>官方已 EOL</td><td><strong>全部受影响</strong></td></tr></tbody></table><p>发行版用户先看有没有跟进：</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># Debian / Ubuntu</span></span><br><span class="line">apt list --upgradable 2&gt;/dev/null | grep -i php</span><br><span class="line"></span><br><span class="line"><span class="comment"># RHEL / Rocky / Alma</span></span><br><span class="line">dnf list updates | grep -i php</span><br><span class="line"></span><br><span class="line"><span class="comment"># Alpine</span></span><br><span class="line">apk version -l <span class="string">&#x27;&lt;&#x27;</span> | grep php</span><br></pre></td></tr></table></figure><p>Windows 用户去 <a href="https://www.php.net/downloads.php?os=windows">php.net/downloads</a> 下新版二进制。</p><h3 id="6-2-第二步：EOL-分支怎么办">6.2 第二步：EOL 分支怎么办</h3><p><strong>注意：官方不再为 8.1 / 8.0 / 7.4 发新版。</strong></p><p>但这次 PHP 安全团队破例，提供了<strong>最小化源码回补分支</strong>，给那些自己编译或没有 LTS 供应商的人：</p><ul><li><a href="https://github.com/php/php-src/tree/PHP-7.4-CVE-2026-109618-109619">PHP-7.4-CVE-2026-109618-109619</a></li><li><a href="https://github.com/php/php-src/tree/PHP-8.0-CVE-2026-109618-109619">PHP-8.0-CVE-2026-109618-109619</a></li><li><a href="https://github.com/php/php-src/tree/PHP-8.1-CVE-2026-109618-109619">PHP-8.1-CVE-2026-109618-109619</a></li></ul><h3 id="6-2-1-用面板的：宝塔面板和-1Panel-都跟上了">6.2.1 用面板的：宝塔面板和 1Panel 都跟上了</h3><p>如果你是面板用户，这次不用自己编译。<strong>两家国内主流面板都在 1–2 天内完成了适配</strong>，而且宝塔做得比&quot;跟一下官方包&quot;还要多。</p><h4 id="宝塔面板：10-月-22-日就上线了，而且是-国内独家兼补丁包">宝塔面板：10 月 22 日就上线了，而且是&quot;国内独家兼补丁包&quot;</h4><p>宝塔在论坛置顶了一条公告（2026-10-22，PHP 官方发版次日）：</p><blockquote><p><strong>PHP国内独家兼补丁包上线，PHP 严重安全漏洞修复及防护方案</strong></p></blockquote><p>宝塔官方文档里的原话是：</p><blockquote><p><strong>宝塔是国内首家针对本次漏洞手动适配旧版 PHP 安全补丁的运维面板服务商</strong>，并提供独家修复包与面板内更新方案。</p></blockquote><p>这句话不是虚的。宝塔的覆盖范围<strong>远超 PHP 官方</strong>——官方只管 8.2 以上，宝塔一路补到了 PHP 7.0，甚至尝试了 PHP 5.6。</p><p><strong>宝塔提供的修复版本（Linux）：</strong></p><table><thead><tr><th>PHP 分支</th><th>修复版本</th><th>来源</th><th>面板内可更新</th></tr></thead><tbody><tr><td>PHP 8.5</td><td><strong>8.5.12</strong></td><td>官方安全版</td><td>✅</td></tr><tr><td>PHP 8.4</td><td><strong>8.4.27</strong></td><td>官方安全版</td><td>✅</td></tr><tr><td>PHP 8.3</td><td><strong>8.3.36</strong></td><td>官方安全版</td><td>✅</td></tr><tr><td>PHP 8.2</td><td><strong>8.2.35</strong></td><td>官方安全版</td><td>✅</td></tr><tr><td>PHP 8.1</td><td><strong>8.1.35</strong></td><td>宝塔打包</td><td>✅</td></tr><tr><td>PHP 8.0</td><td><strong>8.0.31</strong></td><td>宝塔打包</td><td>✅</td></tr><tr><td>PHP 7.4</td><td><strong>7.4.34</strong></td><td>宝塔打包</td><td>✅</td></tr><tr><td>PHP 7.3</td><td><strong>7.3.34</strong></td><td>宝塔打包（基于 7.4 补丁逐行回移）</td><td>✅</td></tr><tr><td>PHP 7.2</td><td><strong>7.2.35</strong></td><td>宝塔打包</td><td>✅</td></tr><tr><td>PHP 7.1</td><td><strong>7.1.34</strong></td><td>宝塔打包</td><td>✅</td></tr><tr><td>PHP 7.0</td><td><strong>7.0.34</strong></td><td>宝塔打包</td><td>✅</td></tr><tr><td>PHP 5.6</td><td><strong>5.6.41</strong></td><td><strong>宝塔 AI 修复版</strong></td><td>⚠️ 仅命令安装，测试阶段</td></tr></tbody></table><p>两个细节值得单独说：</p><p><strong>① PHP 7.0–7.3 的补丁是怎么来的？</strong><br>不是官方给的（官方早就 EOL 了），是宝塔<strong>基于 PHP 7.4 的官方补丁逐个函数比对、逐行回移到 7.0–7.3</strong>。这个工作量不小。</p><p><strong>② PHP 5.6.41「宝塔 AI 修复版」这个故事很有意思。</strong><br>官方从未发布过 5.6 的补丁。宝塔用 <strong>AI 辅助 + 人工代码比对</strong>的方式，在 PHP 5.6 上把这两个洞补了。因为团队缺少 5.6 的真实业务环境，所以开放测试、邀请用户反馈，装法是一条命令：</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">curl -fL -o php5_cve.sh https://download.bt.cn/install/php5_cve.sh &amp;&amp; bash php5_cve.sh install 56</span><br></pre></td></tr></table></figure><blockquote><p>⚠️ 宝塔明确标注：<strong>该版本尚未完成真实业务场景验证，请先在测试环境跑，不要直接上生产。</strong> 如果验证稳定，约半个月后才会纳入软件商店。</p></blockquote><p><strong>宝塔的升级步骤：</strong></p><ol><li>进入「软件商店」→ 「已安装」</li><li>先点右上角「<strong>更新软件列表</strong>」（很多人漏这步，导致看不到新版本）</li><li>找到网站正在用的 PHP 分支，点「更新」</li><li><strong>确认 PHP 服务已重启</strong>（没自动重启就手动重启，否则所有 worker 还在跑旧版本）</li><li>核对版本、检查扩展加载、验证登录/上传/数据库连接</li></ol><blockquote><p>⚠️ <strong>升级前务必备份或建服务器快照。</strong> 升级会重启 PHP 服务，站点会短暂不可用，建议在业务低峰期做。</p><p>如果开了「系统加固」导致更新被拦，按提示临时关闭，升级完再打开。</p></blockquote><p><strong>Windows 面板用户注意</strong>：PHP 8.2 及以上可以在软件商店更新；但 <strong>8.1 及更早版本目前只能临时缓解</strong>（改配置、禁用相关功能），需要尽快规划迁移。</p><p><strong>宝塔还给了三层&quot;兜底&quot;防护</strong>（注意：都不能替代打补丁）：</p><table><thead><tr><th>措施</th><th>要求</th><th>作用</th></tr></thead><tbody><tr><td><strong>首页风险一键加固</strong></td><td>Linux 企业版 <strong>13.1+</strong></td><td>「安全中心 → 首页风险 → 重新扫描」，找到 CVE 项点修复</td></tr><tr><td><strong>Nginx 防火墙 WAF</strong></td><td>版本 <strong>9.9.0+</strong></td><td>已内置 <code>php2shell攻击</code> 过滤器，在请求进入 PHP 前拦截</td></tr><tr><td><strong>系统加固 / 防入侵 / PHP 网站安全告警</strong></td><td>专业版/企业版</td><td>限制提权、监控一句话木马与文件包含</td></tr></tbody></table><p>宝塔自己反复强调（原文）：</p><blockquote><p><strong>补丁升级仍是必要步骤。</strong> 首页风险中的一键加固，以及 Nginx 防火墙、系统加固、防入侵、PHP 安全告警等防护措施，<strong>都不能完整替代 PHP 安全补丁</strong>。</p></blockquote><p>还有一句特别提醒，我认为是全文最容易被误读的一句：</p><blockquote><p><strong>没有产生告警，不代表 PHP 漏洞已经修复。</strong> 补丁版本、模块状态和告警记录需要分别核对。</p></blockquote><h4 id="1Panel：10-月-21-日同步完成升级">1Panel：10 月 21 日同步完成升级</h4><p>1Panel 在官方发版当天就完成了镜像封装，覆盖 8.2–8.5 四个分支，另外为 EOL 分支提供了回补镜像：</p><table><thead><tr><th>分支</th><th>1Panel 维护版本</th><th>说明</th></tr></thead><tbody><tr><td>PHP 8.2</td><td>8.2.35</td><td>基于官方安全版本</td></tr><tr><td>PHP 8.3</td><td>8.3.36</td><td>基于官方安全版本</td></tr><tr><td>PHP 8.4</td><td>8.4.27</td><td>基于官方安全版本</td></tr><tr><td>PHP 8.5</td><td>8.5.12</td><td>基于官方安全版本</td></tr><tr><td>PHP 7.4</td><td>7.4.34</td><td><strong>面板回补，非官方发布</strong></td></tr><tr><td>PHP 8.0</td><td>8.0.31</td><td><strong>面板回补，非官方发布</strong></td></tr><tr><td>PHP 8.1</td><td>8.1.35</td><td><strong>面板回补，非官方发布</strong></td></tr></tbody></table><p>四步完成：</p><ol><li>进入「应用商店」</li><li>点「<strong>更新远程应用</strong>」获取最新列表</li><li>在运行环境配置里把版本切到新版（<strong>如果获取不到新版本，先切换一下大版本再切回来</strong>）</li><li><strong>重启相关项目或服务</strong></li></ol><blockquote><p>⚠️ 两个面板的 7.4.34 / 8.0.31 / 8.1.35 <strong>都不是 PHP 官方发布版本</strong>，是面板基于官方最小化补丁封装的自定义标签。先切过去止血，然后<strong>尽快规划迁移</strong>。</p></blockquote><h4 id="两家的差异对比">两家的差异对比</h4><table><thead><tr><th>维度</th><th>宝塔面板</th><th>1Panel</th></tr></thead><tbody><tr><td>首发时间</td><td>2026-10-22（T+1）</td><td>2026-10-21（T+0）</td></tr><tr><td>官方分支 8.2–8.5</td><td>✅</td><td>✅</td></tr><tr><td>EOL 分支回补</td><td>✅ 8.1 / 8.0 / 7.4</td><td>✅ 8.1 / 8.0 / 7.4</td></tr><tr><td>更老分支</td><td>✅ <strong>7.0–7.3 + 5.6（AI 修复版）</strong></td><td>❌</td></tr><tr><td>面板内一键升级</td><td>✅</td><td>✅</td></tr><tr><td>配套 WAF</td><td>✅ Nginx 防火墙 9.9.0+</td><td>—</td></tr></tbody></table><p><strong>结论：如果你还在跑 PHP 7.0–7.3，甚至 5.6，宝塔是目前唯一给出成品包的。</strong></p><blockquote><p>另外提醒：<strong>PHP 8.2 将于 2026-12-31 EOL</strong>，之后不再有安全修复。</p></blockquote><h3 id="6-3-第三步：升不动时的缓解（降低，但不消除）">6.3 第三步：升不动时的缓解（降低，但不消除）</h3><p>官方反复强调：<strong>没有完整缓解。</strong> 下面这些只能降低特定攻击路径的暴露面。</p><h4 id="针对-CVE-2026-109618（OOM-相关）">针对 CVE-2026-109618（OOM 相关）</h4><figure class="highlight ini"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">; 【最重要】移除可控的内存上限失败点</span></span><br><span class="line"><span class="comment">; 必须用应用改不掉的方式设置：FPM pool 的 php_admin_value 或 Apache 配置</span></span><br><span class="line"><span class="comment">; 设置后务必检查没有哪个 pool / 目录 / 应用又把它改回有限值</span></span><br><span class="line"><span class="attr">memory_limit</span> = -<span class="number">1</span></span><br><span class="line"></span><br><span class="line"><span class="comment">; 【重要】压低请求体，掐掉内存放大器</span></span><br><span class="line"><span class="attr">post_max_size</span> = <span class="number">8</span>M</span><br><span class="line"><span class="attr">upload_max_filesize</span> = <span class="number">2</span>M</span><br></pre></td></tr></table></figure><p>补充措施：</p><ul><li>在 Web 服务器 / 代理层限制<strong>解码后</strong>的请求体大小、字段数、multipart part 数、header 数、嵌套深度</li><li>这些限制<strong>必须也覆盖没有 Content-Length 的请求</strong>（很多人漏）</li><li>用容器 / cgroup 限制做可用性边界，策略上<strong>只杀受影响的 worker</strong></li><li><strong>绝对不要</strong>用 <code>RLIMIT_AS</code> / <code>RLIMIT_DATA</code> 代替——官方明确说这两个反而会触发那个有害的分配失败</li></ul><h4 id="针对-CVE-2026-109619（陈旧全局状态相关）">针对 CVE-2026-109619（陈旧全局状态相关）</h4><figure class="highlight ini"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">; 【重要】关掉上传进度</span></span><br><span class="line"><span class="comment">; 必须写在 php.ini / FPM pool / 服务器配置里，在请求解析前生效</span></span><br><span class="line"><span class="comment">; 不能用 ini_set()，也不能用 .user.ini（来不及）</span></span><br><span class="line"><span class="attr">session.upload_progress.enabled</span> = <span class="number">0</span></span><br><span class="line"></span><br><span class="line"><span class="comment">; 【仅 PHP 8.5】关掉致命错误回溯</span></span><br><span class="line"><span class="attr">fatal_error_backtraces</span> = <span class="number">0</span></span><br></pre></td></tr></table></figure><p>补充措施：</p><ul><li><strong>改完必须重启所有 worker</strong>，否则等于没改（这条真的经常被忘）</li><li>清掉那些会在初始化前产生诊断的无效 / 废弃配置</li><li><strong>用 <code>error_reporting</code>、<code>display_errors</code> 或 <code>@</code> 屏蔽报错是无效的</strong>——报错已经产生并触发了路径</li><li>修掉攻击者可达的 fatal error 和执行超时（包括回调、上传、导入处理、清理里的失败）</li></ul><h3 id="6-4-第四步：如果你是-SOC-应急响应">6.4 第四步：如果你是 SOC / 应急响应</h3><p>这次漏洞<strong>跑在应用层之下</strong>，所以应用日志里几乎没有上下文。Wiz 给出的可观测信号：</p><table><thead><tr><th>信号</th><th>说明</th></tr></thead><tbody><tr><td><strong>异常 multipart 请求后紧跟内存上限错误</strong></td><td>最典型的组合</td></tr><tr><td><strong>反复出现 HTTP 500</strong></td><td>可能是 OOM 反复触发</td></tr><tr><td><strong>异常大或畸形的 <code>PHPSESSID</code> 响应 Cookie</strong></td><td>内存泄露路径的直接特征（URL 编码的堆内容）</td></tr><tr><td><strong>无法解释的 PHP worker 频繁重启/churn</strong></td><td>OOM 与崩溃的副作用</td></tr></tbody></table><p>Wiz Sensor 1.0.12768 及以上版本内置了响应策略，可以自动终止表现出 PHP2Shell 利用特征（exploitation）的进程。</p><hr><h2 id="七、影响范围：这不只是-企业网站-的事">七、影响范围：这不只是&quot;企业网站&quot;的事</h2><p>前面讲的都是技术机制。但我觉得最该被认真讲的，是<strong>这件事到底打到了谁</strong>。</p><p>因为很多人的第一反应是&quot;我不做网站运维，跟我没关系&quot;。</p><p><strong>恰恰相反。</strong></p><h3 id="7-1-先看硬数据">7.1 先看硬数据</h3><table><thead><tr><th>指标</th><th>数据</th><th>来源</th></tr></thead><tbody><tr><td>全球使用 PHP 的网站占比</td><td>约 <strong>70%</strong>（W3Techs 可识别服务端语言的站点中 <strong>69.3%</strong>）</td><td>Wiz / 多源</td></tr><tr><td>全球公网暴露的受影响 PHP 服务器</td><td><strong>超过 510 万台</strong></td><td>南通大学信息化中心风险通告</td></tr><tr><td>受影响的最老版本</td><td><strong>PHP 5.4</strong>（十年前）</td><td>Wiz / NVD</td></tr><tr><td>已观测到的攻击</td><td><strong>已有早期攻击尝试</strong></td><td>同上</td></tr><tr><td>已发生的极端应对</td><td><strong>部分国家临时下线政府官网避险</strong></td><td>同上</td></tr></tbody></table><p><strong>&quot;510 万台&quot;这个数字需要单独理解一下。</strong></p><p>它只是<strong>公网直接暴露</strong>的那部分。大量 PHP 服务跑在内网、跑在 NAT 后面、跑在容器编排里，这些根本不会被扫出来，但一旦有任何一个入口被打穿（比如一个老旧的接口、一个忘了关的测试环境），它们同样在射程内。</p><p>而且——<strong>它不需要你的应用有任何漏洞。</strong></p><h3 id="7-2-哪些系统在射程里">7.2 哪些系统在射程里</h3><p>Wiz 用最新官方镜像实测打通了三套 CMS：</p><ul><li><strong>WordPress</strong>（全球 43% 的网站）</li><li><strong>Drupal</strong></li><li><strong>Joomla</strong></li></ul><p>但这三套只是<strong>演示靶子</strong>。Wiz 反复强调：</p><blockquote><p>这些平台只是说明影响，<strong>漏洞在 PHP 本身</strong>。利用不依赖于应用代码的缺陷：<strong>即使是一个只写着 “Hello World” 的应用，跑在受影响版本上也可能中招。</strong></p></blockquote><p>那顺着&quot;什么跑在 PHP 上&quot;往下想，射程就非常吓人了：</p><table><thead><tr><th>领域</th><th>典型系统</th><th>为什么在这里特别致命</th></tr></thead><tbody><tr><td><strong>博客 / 内容站</strong></td><td>WordPress、Typecho、Hexo 后台、Discuz</td><td>装得多、升级懒、插件杂</td></tr><tr><td><strong>电商</strong></td><td>WooCommerce、Magento、ECShop、各类商城系统</td><td>直接持有支付与订单数据</td></tr><tr><td><strong>政务 / 教育</strong></td><td>门户站、OA、教务系统</td><td>大量老旧 PHP 7.x，且<strong>已有国家下线官网</strong></td></tr><tr><td><strong>论坛 / 社区</strong></td><td>Discuz、phpBB、Flarum、各类自建论坛</td><td>用户数据 + 常被扫</td></tr><tr><td><strong>企业官网 / 建站平台</strong></td><td>各种&quot;一键建站&quot;、模板站</td><td>一个面板管几十上百个站</td></tr><tr><td><strong>游戏服务端</strong></td><td>大量游戏后台、充值页、活动页、排行页</td><td>见下节</td></tr><tr><td><strong>接口 / 网关</strong></td><td>各类 PHP 写的 API 网关、支付回调</td><td>直接暴露公网、无 WAF</td></tr></tbody></table><p>**注意最后两行。**这才是很多人没意识到的地方。</p><h3 id="7-3-游戏服务器：一个被严重低估的暴露面">7.3 游戏服务器：一个被严重低估的暴露面</h3><p>&quot;游戏服务器&quot;听起来像是 C++ / Go 写的高性能服务，跟 PHP 没关系。</p><p><strong>但真正跑在 PHP 上的，是游戏的外围。</strong></p><p>一个国内中小型游戏 / 私服 / 页游 / 手游的典型架构长这样：</p><figure class="highlight nix"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line">游戏主逻辑   →  C<span class="operator">++</span> <span class="symbol">/</span> Go <span class="symbol">/</span> Java（跟 PHP 无关）</span><br><span class="line">     ↕</span><br><span class="line">账号中心     →  经常是 PHP</span><br><span class="line">充值 <span class="symbol">/</span> 支付回调 →  几乎都是 PHP（对接支付宝、微信、各种聚合支付）</span><br><span class="line">活动 <span class="symbol">/</span> 公告页  →  PHP 或 PHP 模板</span><br><span class="line">排行榜 <span class="symbol">/</span> 战绩  →  常是 PHP <span class="operator">+</span> Redis</span><br><span class="line">GM 后台 <span class="symbol">/</span> 运营后台 → 极常见是 PHP</span><br><span class="line">官网 <span class="symbol">/</span> 论坛 <span class="symbol">/</span> 玩家社区 → WordPress <span class="symbol">/</span> Discuz 居多</span><br><span class="line">兑换码 <span class="symbol">/</span> 礼包系统 → PHP</span><br></pre></td></tr></table></figure><p><strong>这些组件的共同点：</strong></p><ol><li><strong>直接暴露公网</strong>（支付回调必须能被支付宝/微信访问）</li><li><strong>直接摸钱</strong>（充值、订单、兑换码）</li><li><strong>直接摸账号</strong>（账号中心一破，玩家账号全泄）</li><li><strong>常常是外包或赶工产物</strong>，PHP 版本常年不升</li><li><strong>往往没有 WAF</strong>（主站有，回调域名不一定有）</li></ol><p>而 PHP2Shell 的第二个 bug（内存泄露）<strong>不需要 RCE 就能读进程内存</strong>。里面可能是什么？Wiz 说得很清楚：</p><blockquote><p>密码、认证令牌、API 密钥、证书。</p></blockquote><p>放在游戏场景里，就是：<strong>数据库密码、支付密钥、第三方 API 的 appkey、玩家 session。</strong></p><p>一次泄露，可能等于把整套充值链路和玩家库的钥匙交出去。</p><h3 id="7-4-一个必须说清楚的事：这不是-网站被黑-那么简单">7.4 一个必须说清楚的事：这不是&quot;网站被黑&quot;那么简单</h3><p>如果只是首页被挂个马，那还属于&quot;恶心但不致命&quot;。</p><p>PHP2Shell 的严重性在于，<strong>它拿到的权限是 Web 工作进程的权限</strong>，而从这个位置能做的事很多：</p><table><thead><tr><th>攻击者能做的</th><th>后果</th></tr></thead><tbody><tr><td>读进程内存</td><td>拿到数据库密码、API key、session、证书</td></tr><tr><td>写任意文件</td><td>植入 webshell、改页面、留后门</td></tr><tr><td>读数据库</td><td>拖库（用户表、订单表、玩家账号）</td></tr><tr><td>横向移动</td><td>从这台机器摸到内网其他服务</td></tr><tr><td>挖矿 / 建僵尸网络</td><td>你的服务器变成别人的资源</td></tr><tr><td>篡改内容</td><td>挂博彩、挂诈骗、挂政治内容</td></tr></tbody></table><p>腾讯云的通告里有一句总结得很到位：</p><blockquote><p>未经身份验证的远程攻击者利用该漏洞<strong>可在服务器上以 Web 工作进程账户身份执行任意代码</strong>，可能导致服务器完全沦陷、敏感数据泄露或恶意软件植入等危害。</p></blockquote><p><strong>“服务器完全沦陷”</strong>——不是夸张，是标准描述。</p><h3 id="7-5-所以，谁该紧张">7.5 所以，谁该紧张</h3><p>按优先级排一下：</p><table><thead><tr><th>优先级</th><th>谁</th><th>为什么</th></tr></thead><tbody><tr><td>🔴 <strong>最高</strong></td><td>跑 Apache + <strong>mod_php</strong> 的公网服务</td><td>官方说风险最高，已有可直接运行的利用</td></tr><tr><td>🔴 <strong>最高</strong></td><td>PHP 7.x / 8.0 / 8.1 的服务</td><td>官方不再发版，只能靠面板 / 发行版回补</td></tr><tr><td>🟠 高</td><td>支付回调、API 网关、账号中心</td><td>直接摸钱、摸账号，常无 WAF</td></tr><tr><td>🟠 高</td><td>面板管理的多站点服务器</td><td>一个面板几十个站，中一个等于全中</td></tr><tr><td>🟡 中</td><td>WordPress / Discuz / MediaWiki 站点</td><td>量大、升级慢、插件杂</td></tr><tr><td>🟡 中</td><td>游戏官网 / 活动页 / 周边商城</td><td>涉及支付，且常无人维护</td></tr><tr><td>🟢 相对低</td><td>纯静态站、无 PHP 的服务</td><td>不受影响</td></tr></tbody></table><p><strong>如果你属于前两行——现在就去查版本，别往下读了。</strong></p><hr><h2 id="八、这件事真正的意义">八、这件事真正的意义</h2><h3 id="8-1-找漏洞的成本，塌了">8.1 找漏洞的成本，塌了</h3><p>互联网底层其实建立在一堆<strong>没人付钱、也没几个人认真看</strong>的代码上。</p><p>这么多年没出大事，原因特别朴素：<strong>找漏洞太贵了。</strong></p><p>能在 PHP 内核这种地方找到可用内存漏洞的人，全世界可能就几百个。他们的时间极贵，一个洞要磨几个月。</p><p>所以很多雷能安静地埋上二十年——<strong>不是因为藏得好，是因为真的没人有空去搭理它们。</strong></p><p>Wiz 的总结很精准：</p><blockquote><p>随着 AI 降低开发和适配复杂利用所需的投入，<strong>那些曾经看起来不切实际的漏洞，变成了可行的目标</strong>。</p></blockquote><h3 id="8-2-修复能力，才是真正的瓶颈">8.2 修复能力，才是真正的瓶颈</h3><p>PHP 基金会自己在复盘里承认：人手不够。</p><p>Hacker News 上有人翻出 Debian 上负责 PHP 打包的维护者的赞助页面，月赞助<strong>连 700 美元都不到</strong>。</p><p>而全球 70% 的网站，跑在这些代码上。</p><table><thead><tr><th>环节</th><th>现状</th></tr></thead><tbody><tr><td><strong>发现</strong></td><td>被 AI 抬高了几个数量级，还在加速</td></tr><tr><td><strong>修复</strong></td><td>还是靠几个志愿者用爱发电</td></tr><tr><td><strong>部署</strong></td><td>靠全球几千万运维自己点&quot;更新&quot;</td></tr></tbody></table><p><strong>当发现速度远超修复和部署速度时，堆积的不是安全感，是风险。</strong></p><h3 id="8-3-但这次，防御者第一次跑赢了">8.3 但这次，防御者第一次跑赢了</h3><p><strong>Defender’s Window</strong> —— 这个词值得记住。</p><p>AI 8 月找到，10 月才公开。这两个月里：PHP 修好了并做了对抗性测试，云厂商备好 WAF，发行版备好回补，政府备好指引。</p><p><strong>这是第一次，“发现得早&quot;真的转化成了&quot;修得从容”。</strong></p><p>但正如 Wiz 说的——这靠的不是运气，是<strong>提前排好的协同</strong>。</p><hr><h2 id="九、今晚就要做的三件事">九、今晚就要做的三件事</h2><h3 id="①-查版本（5-分钟）">① 查版本（5 分钟）</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">php -v</span><br></pre></td></tr></table></figure><p>不在安全线上？那你就是暴露状态。面向公网的优先处理。</p><h3 id="②-先上缓解（10-分钟）">② 先上缓解（10 分钟）</h3><figure class="highlight ini"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">memory_limit</span> = -<span class="number">1</span></span><br><span class="line"><span class="attr">post_max_size</span> = <span class="number">8</span>M</span><br><span class="line"><span class="attr">upload_max_filesize</span> = <span class="number">2</span>M</span><br><span class="line"><span class="attr">session.upload_progress.enabled</span> = <span class="number">0</span></span><br><span class="line"><span class="attr">fatal_error_backtraces</span> = <span class="number">0</span>   <span class="comment">; 仅 PHP 8.5</span></span><br></pre></td></tr></table></figure><p><strong>写完记得重启 worker。</strong>（真的，很多人忘）</p><h3 id="③-重新审视你的-老旧版本债">③ 重新审视你的&quot;老旧版本债&quot;</h3><p>这次最该记住的不是这两个 CVE 编号，而是：</p><blockquote><p><strong>AI 让&quot;没人发现的旧洞&quot;，变成了一个即将到期的负债。</strong></p></blockquote><p>那些你一直拖着没升的 PHP 7.4、那些没维护的内部系统、那些&quot;反正没人看&quot;的依赖——它们的安全性假设，建立在&quot;没人有空来挖它&quot;之上。</p><p><strong>这个假设，从 2026 年开始不成立了。</strong></p><hr><h2 id="结语">结语</h2><p>说点不太像安全公告的话。</p><p>以前我们总觉得，安全是&quot;补漏洞&quot;。一个洞，一个补丁，一次重启，完事。</p><p>但 PHP2Shell 让我意识到，这次真正被改变的不是某个 CVE，而是<strong>时间尺度</strong>。</p><p>一个埋了十几年的问题，两天被翻出来。一个&quot;处于人类研究者极限边缘&quot;的利用链，被一个 Agent 顺着自己写的 <code>SKILL.md</code> 扫了出来。</p><p>Wiz 自己把这件事和 Heartbleed、Log4Shell 并列，说它可能标志着&quot;AI 时代的转折点&quot;。我觉得这个类比是准的——不是因为漏洞更严重（虽然确实很严重），而是因为它<strong>重新定义了&quot;什么才叫可利用&quot;</strong>。</p><p>当复杂度不再构成屏障，我们过去用来判断&quot;这个洞打不通所以先不管&quot;的所有直觉，都需要重写。</p><p>下次深夜响警报的时候，希望你打开的不是&quot;哪个版本又出事了&quot;的搜索框，而是一行已经跑到最新版的 <code>php -v</code>。</p><p>—— 共勉。</p><hr><h2 id="参考来源">参考来源</h2><blockquote><p>本文所有技术细节、版本号、评分与缓解措施均来自以下来源。<strong>引用的原始内容以官网公告与厂商技术分析为准</strong>，二手报道仅作背景参考。</p></blockquote><h3 id="官方公告（Primary-Sources）">官方公告（Primary Sources）</h3><ol><li><p><strong>PHP 官方安全公告（2026-10-21）</strong><br><a href="http://PHP.net">PHP.net</a> News Archive — <em>Security advisory: Critical remote code execution vulnerabilities, update now</em><br><a href="https://www.php.net/archive/2026.php#2026-10-21-5">https://www.php.net/archive/2026.php#2026-10-21-5</a></p></li><li><p><strong>PHP 8.5.12 发布说明</strong><br><a href="https://www.php.net/archive/2026.php#2026-10-21-4">https://www.php.net/archive/2026.php#2026-10-21-4</a></p></li><li><p><strong>PHP 8.4.27 发布说明</strong><br><a href="https://www.php.net/archive/2026.php#2026-10-21-3">https://www.php.net/archive/2026.php#2026-10-21-3</a></p></li><li><p><strong>PHP 8.3.36 发布说明</strong><br><a href="https://www.php.net/archive/2026.php#2026-10-21-2">https://www.php.net/archive/2026.php#2026-10-21-2</a></p></li><li><p><strong>PHP 8.2.35 发布说明</strong>（含 8.2 EOL 提示）<br><a href="https://www.php.net/archive/2026.php#2026-10-21-1">https://www.php.net/archive/2026.php#2026-10-21-1</a></p></li><li><p><strong>PHP 预告公告（2026-10-20）</strong><br><a href="http://PHP.net">PHP.net</a> News Archive — <em>Upcoming Critical PHP Security Release</em><br><a href="https://www.php.net/archive/2026.php#2026-10-20-1">https://www.php.net/archive/2026.php#2026-10-20-1</a></p></li><li><p><strong>Informational advisory: Session upload progress（2026-10-23）</strong><br>补充建议 <code>session.upload_progress.enabled=0</code>，并预告 CVE-2026-115560<br><a href="https://www.php.net/archive/2026.php#2026-10-23-1">https://www.php.net/archive/2026.php#2026-10-23-1</a></p></li><li><p><strong>GHSA-w8hw-w9fx-j79w — CVE-2026-109618</strong><br><a href="https://github.com/php/php-src/security/advisories/GHSA-w8hw-w9fx-j79w">https://github.com/php/php-src/security/advisories/GHSA-w8hw-w9fx-j79w</a></p></li><li><p><strong>GHSA-6wmf-4rv5-p3rp — CVE-2026-109619</strong><br><a href="https://github.com/php/php-src/security/advisories/GHSA-6wmf-4rv5-p3rp">https://github.com/php/php-src/security/advisories/GHSA-6wmf-4rv5-p3rp</a></p></li><li><p><strong>PHP 源码回补分支</strong></p><ul><li><a href="https://github.com/php/php-src/tree/PHP-7.4-CVE-2026-109618-109619">https://github.com/php/php-src/tree/PHP-7.4-CVE-2026-109618-109619</a></li><li><a href="https://github.com/php/php-src/tree/PHP-8.0-CVE-2026-109618-109619">https://github.com/php/php-src/tree/PHP-8.0-CVE-2026-109618-109619</a></li><li><a href="https://github.com/php/php-src/tree/PHP-8.1-CVE-2026-109618-109619">https://github.com/php/php-src/tree/PHP-8.1-CVE-2026-109618-109619</a></li></ul></li><li><p><strong>PHP 官方下载页</strong><br><a href="https://www.php.net/downloads.php">https://www.php.net/downloads.php</a></p></li></ol><h3 id="漏洞数据库（Vulnerability-Databases）">漏洞数据库（Vulnerability Databases）</h3><ol start="12"><li><p><strong>NVD — CVE-2026-109618</strong><br>CVSS v3.1 <strong>9.8</strong> CRITICAL · CWE-416 / 755 / 824 / 1325<br><a href="https://nvd.nist.gov/vuln/detail/CVE-2026-109618">https://nvd.nist.gov/vuln/detail/CVE-2026-109618</a></p></li><li><p><strong>NVD — CVE-2026-109619</strong><br>CVSS v3.1 <strong>8.1</strong> HIGH · 受影响版本自 5.4.0 起<br><a href="https://nvd.nist.gov/vuln/detail/CVE-2026-109619">https://nvd.nist.gov/vuln/detail/CVE-2026-109619</a></p></li><li><p><strong>NVD REST API（结构化数据源）</strong><br><a href="https://services.nvd.nist.gov/rest/json/cves/2.0?cveId=CVE-2026-109618">https://services.nvd.nist.gov/rest/json/cves/2.0?cveId=CVE-2026-109618</a><br><a href="https://services.nvd.nist.gov/rest/json/cves/2.0?cveId=CVE-2026-109619">https://services.nvd.nist.gov/rest/json/cves/2.0?cveId=CVE-2026-109619</a></p></li></ol><h3 id="厂商技术分析（Technical-Analysis）">厂商技术分析（Technical Analysis）</h3><ol start="15"><li><p><strong>Wiz Research — PHP2Shell: AI uncovers critical RCE vulnerabilities affecting 70% of the Internet</strong><br>四个 bug 的完整技术拆解（unserializer UAF / 内存泄露 / fatal backtrace UAF / OPcache type confusion）、利用演示、可观测信号<br><a href="https://www.wiz.io/blog/php2shell-php-rce">https://www.wiz.io/blog/php2shell-php-rce</a></p></li><li><p><strong>Calif — PHP2Shell 专题</strong><br><a href="https://calif.io/php2shell/">https://calif.io/php2shell/</a></p></li><li><p><strong>OpenAI — Coordinated disclosure of critical vulnerabilities</strong><br><a href="https://openai.com/index/coordinated-disclosure-of-critical-vulnerabilities">https://openai.com/index/coordinated-disclosure-of-critical-vulnerabilities</a></p></li><li><p><strong>The PHP Foundation — Today’s PHP security release and how we’re strengthening PHP security</strong><br><a href="https://thephp.foundation/blog/2026/10/21/todays-php-security-release-and-how-were-strengthening-php-security/">https://thephp.foundation/blog/2026/10/21/todays-php-security-release-and-how-were-strengthening-php-security/</a></p></li></ol><h3 id="生态方公告（Ecosystem-Advisories）">生态方公告（Ecosystem Advisories）</h3><ol start="19"><li><p><strong>Cloudflare — PHP vulnerabilities WAF protection</strong><br><a href="https://blog.cloudflare.com/php-vulnerabilities-waf-protection/">https://blog.cloudflare.com/php-vulnerabilities-waf-protection/</a></p></li><li><p><strong>Fastly — Fastly’s proactive protection: critical PHP RCE (CVE-2026-109618)</strong><br><a href="https://www.fastly.com/blog/fastlys-proactive-protection-critical-php-rce-cve-2026-109618">https://www.fastly.com/blog/fastlys-proactive-protection-critical-php-rce-cve-2026-109618</a></p></li><li><p><strong>Google Cloud — Responding to core PHP vulnerabilities</strong><br><a href="https://cloud.google.com/blog/products/identity-security/responding-to-core-php-vulnerabilities-cve-2026-109618-cve-2026-109619">https://cloud.google.com/blog/products/identity-security/responding-to-core-php-vulnerabilities-cve-2026-109618-cve-2026-109619</a></p></li><li><p><strong>Vercel — PHP2Shell security bulletin</strong><br><a href="https://vercel.com/kb/bulletin/php2shell-security-bulletin">https://vercel.com/kb/bulletin/php2shell-security-bulletin</a></p></li><li><p><strong>Siemens ProductCERT — SSA-566512</strong>（RUGGEDCOM APE1808 受影响）<br><a href="https://cert-portal.siemens.com/productcert/html/ssa-566512.html">https://cert-portal.siemens.com/productcert/html/ssa-566512.html</a></p></li></ol><h3 id="国内云与面板厂商（CN-Vendors-Panels）">国内云与面板厂商（CN Vendors &amp; Panels）</h3><ol start="24"><li><p><strong>腾讯云 — 【安全通告】PHP “php2shell” 远程代码执行漏洞风险通告</strong><br>含漏洞原理、影响版本区间、T-Sec 主机安全 / WAF / 云防火墙防护能力说明<br><a href="https://cloud.tencent.com/announce/detail/2525">https://cloud.tencent.com/announce/detail/2525</a></p></li><li><p><strong>宝塔面板 — PHP 严重安全漏洞修复及防护方案</strong>（2026-10-22 首发，10-23 更新）<br>§6.2.1 宝塔部分的全部事实来源：PHP 7.0–7.3 补丁逐行回移、PHP 5.6.41「宝塔 AI 修复版」、一键加固、Nginx 防火墙 9.9.0+、系统加固与防入侵<br><a href="https://docs.bt.cn/notices/php-security-protection-guide/">https://docs.bt.cn/notices/php-security-protection-guide/</a></p></li><li><p><strong>宝塔面板 — PHP 与 Node.js 紧急安全更新公告（2026-10-21）</strong><br><a href="https://docs.bt.cn/notices/php-nodejs-security-update-2026-10-21/">https://docs.bt.cn/notices/php-nodejs-security-update-2026-10-21/</a></p></li><li><p><strong>宝塔面板论坛 — 置顶公告「PHP国内独家兼补丁包上线」</strong>（2026-10-22，7 万+ 阅读）<br><a href="https://www.bt.cn/bbs/portal.php">https://www.bt.cn/bbs/portal.php</a> （「宝塔公告」版块 forum-37）</p></li><li><p><strong>宝塔面板 — 腾讯云 WordPress、WooCommerce 镜像 PHP 安全更新公告</strong><br><a href="https://docs.bt.cn/notices/tencent-cloud-wordpress-woocommerce-php-security-update/">https://docs.bt.cn/notices/tencent-cloud-wordpress-woocommerce-php-security-update/</a></p></li><li><p><strong>1Panel — PHP 运行环境安全升级说明</strong>（2026-10-21 同步封装镜像）<br>镜像命名 <code>1panel/php:&lt;版本&gt;</code>，如 <code>1panel/php:8.2.35</code></p></li></ol><h3 id="高校-机构风险通告（Institutional-Advisories）">高校 / 机构风险通告（Institutional Advisories）</h3><ol start="30"><li><strong>南通大学信息化中心 — “php2shell” 远程代码执行漏洞风险通告</strong>（2026-10-22）<br>§7.1「全球公网暴露受影响服务器超 510 万台」「已观测到早期攻击尝试」「部分国家临时下线政府官网避险」的数据来源<br><a href="https://met.ntu.edu.cn/2026/1022/c9375a300805/page.htm">https://met.ntu.edu.cn/2026/1022/c9375a300805/page.htm</a></li></ol><h3 id="邮件列表（Mailing-List）">邮件列表（Mailing List）</h3><ol start="31"><li><strong>oss-security 讨论串</strong><br><a href="https://www.openwall.com/lists/oss-security/2026/10/21/6">https://www.openwall.com/lists/oss-security/2026/10/21/6</a><br><a href="https://www.openwall.com/lists/oss-security/2026/10/21/16">https://www.openwall.com/lists/oss-security/2026/10/21/16</a></li></ol><h3 id="中文二手报道（Secondary-背景参考）">中文二手报道（Secondary / 背景参考）</h3><blockquote><p>仅用于了解中文社区的传播口径，<strong>技术细节请以上方官方来源为准</strong>。</p></blockquote><ol start="32"><li><p><strong>PHP2Shell：AI 两天挖出 9.2 分漏洞，让全球 70% 网站连夜打补丁</strong>（博客园）<br><a href="https://www.cnblogs.com/xiaobaiysf/p/23397061">https://www.cnblogs.com/xiaobaiysf/p/23397061</a></p></li><li><p><strong>PHP 两个 RCE 漏洞被提前泄露，紧急补丁明天发</strong>（开源中国）<br><a href="https://www.oschina.net/news/503132/php-cve-2026-109618-cve-2026-109619-rce">https://www.oschina.net/news/503132/php-cve-2026-109618-cve-2026-109619-rce</a></p></li><li><p><strong>PHP 披露两个严重级远程代码执行漏洞</strong>（PANews / TradingView）<br><a href="https://es.tradingview.com/news/panews:fa1e92e43e3f9:0/">https://es.tradingview.com/news/panews:fa1e92e43e3f9:0/</a></p></li><li><p><strong>PHP 存在高風險安全漏洞（CVE-2026-109618 / 109619）</strong>（國家資通安全研究院 NICS）<br><a href="https://www.nics.nat.gov.tw/core_business/information_security_information_sharing/Vulnerability_Alert_Announcements/5c4e9af1-4275-44ef-a277-c692786b5a2c/">https://www.nics.nat.gov.tw/core_business/information_security_information_sharing/Vulnerability_Alert_Announcements/5c4e9af1-4275-44ef-a277-c692786b5a2c/</a></p></li><li><p><strong>php2shell 漏洞全球暴雷：CVSS 9.2 双高危漏洞排查与修复</strong>（知乎）<br><a href="https://zhuanlan.zhihu.com/p/2096552612074086725">https://zhuanlan.zhihu.com/p/2096552612074086725</a></p></li><li><p><strong>复盘 PHP2Shell 惊魂 48 小时与 php-src 万行源码修复</strong>（afengblog）<br><a href="https://afengblog.com/blog/php2shell-48-hours-retrospective.html">https://afengblog.com/blog/php2shell-48-hours-retrospective.html</a></p></li></ol><h3 id="引用说明">引用说明</h3><ul><li>文中 <strong>CVSS 9.2</strong> 采用 PHP 官方 CVSS v4.0 口径；<strong>9.8 / 8.1</strong> 采用 NVD 的 CVSS v3.1 口径，二者并存不矛盾，详见 §1.2。</li><li>文中四个 bug 的机制描述（<code>BG(unserialize)</code>、<code>PS(id)</code>、<code>EG(last_fatal_error_backtrace)</code>、<code>CG(map_ptr_last)</code>）来自 <a href="https://www.wiz.io/blog/php2shell-php-rce">Wiz Research 技术深挖</a> 与 NVD 描述。</li><li>「PHP 5.4 起受影响」来自 Wiz 报告与 NVD <code>configurations</code> 数据。</li><li>「510 万台」「早期攻击尝试」「部分国家下线政府官网」来自南通大学信息化中心通告；此类统计口径各家不一，本文按该通告原值引用。</li><li>缓解措施逐条对应 PHP 官方安全公告的 “If you cannot update immediately” 章节。</li><li><strong>宝塔面板</strong>的 7.0–7.3 / 5.6 修复包均为<strong>宝塔自行回移或 AI 辅助修复</strong>，非 PHP 官方发布；PHP 5.6.41 官方明确标注「尚未完成真实业务验证，请先测试」，本文已如实标注。</li><li><strong>1Panel / 宝塔的 7.4.34、8.0.31、8.1.35</strong> 均为面板基于官方最小化补丁封装的自定义版本，<strong>非 PHP 官方发布</strong>。</li><li>§7.3 游戏服务器一节为<strong>基于 PHP 技术栈的架构推断与场景分析</strong>，非厂商披露的具体受害案例；文中已注明「典型架构」「典型实现」，请勿理解为已确认的被攻击事件。</li><li>全文不含任何漏洞利用代码。文中出现的命令仅为<strong>升级与缓解</strong>用途。</li></ul>]]></content>
    
    
    <summary type="html">2026 年 10 月 PHP 官方紧急修复两个 CVSS 9.2 的远程代码执行漏洞。本文从 longjmp 与 OOM、请求堆生命周期讲起，逐条拆解 4 个底层 bug、受影响版本、缓解措施与修复方案。</summary>
    
    
    
    <category term="技术学习" scheme="https://zhaogb612.github.io/categories/%E6%8A%80%E6%9C%AF%E5%AD%A6%E4%B9%A0/"/>
    
    
    <category term="PHP" scheme="https://zhaogb612.github.io/tags/PHP/"/>
    
    <category term="安全" scheme="https://zhaogb612.github.io/tags/%E5%AE%89%E5%85%A8/"/>
    
    <category term="漏洞分析" scheme="https://zhaogb612.github.io/tags/%E6%BC%8F%E6%B4%9E%E5%88%86%E6%9E%90/"/>
    
    <category term="CWE-416" scheme="https://zhaogb612.github.io/tags/CWE-416/"/>
    
  </entry>
  
  <entry>
    <title>Hexo 站点搭建与部署全流程</title>
    <link href="https://zhaogb612.github.io/posts/ea0b847d.html"/>
    <id>https://zhaogb612.github.io/posts/ea0b847d.html</id>
    <published>2026-10-17T02:30:00.000Z</published>
    <updated>2026-10-17T02:30:00.000Z</updated>
    
    <content type="html"><![CDATA[<h1 id="Hexo-站点搭建与部署全流程">Hexo 站点搭建与部署全流程</h1><p>这是一份面向零基础的教程。全程只需一台电脑和网络，按顺序照做即可，不需要事先懂编程。每一步都写明了「在哪里操作、输入什么、应该看到什么、出错怎么办」。</p><hr><h2 id="零、开始之前">零、开始之前</h2><h3 id="0-1-名词解释">0.1 名词解释</h3><p>先把下面几个词认全，后面看到就不会懵：</p><table><thead><tr><th>名词</th><th>一句话解释</th></tr></thead><tbody><tr><td><strong>Hexo</strong></td><td>一个把 Markdown 文章生成静态网页的程序，也就是本站使用的建站工具</td></tr><tr><td><strong>Node.js</strong></td><td>运行 Hexo 的环境，相当于「Hexo 的地基」</td></tr><tr><td><strong>npm</strong></td><td>Node.js 自带的包管理器，用来下载 Hexo 及其插件</td></tr><tr><td><strong>Git</strong></td><td>版本控制工具，用于下载主题、把网页上传到 GitHub</td></tr><tr><td><strong>GitHub</strong></td><td>代码托管网站，本站的网页就免费存放在它上面</td></tr><tr><td><strong>仓库（Repository）</strong></td><td>GitHub 上的一个项目文件夹，一个仓库对应一个站点</td></tr><tr><td><strong>分支（Branch）</strong></td><td>仓库内的一条独立时间线，部署时产物存放在指定分支上</td></tr><tr><td><strong>命令行 / 终端</strong></td><td>输入文字命令的黑色窗口，Windows 上叫 PowerShell 或命令提示符</td></tr><tr><td><strong>front-matter</strong></td><td>文章最上方两条 <code>---</code> 之间的配置区，用来写标题、日期、标签等</td></tr><tr><td><strong>abbrlink</strong></td><td>文章的短链接编号，由插件生成，用于构成文章网址</td></tr></tbody></table><h3 id="0-2-需要准备什么">0.2 需要准备什么</h3><ul><li>一台 Windows 或 macOS 电脑，能正常上网；</li><li>一个邮箱，用于注册 GitHub；</li><li>大约 1 小时的空闲时间，网络较差时安装依赖会更久。</li></ul><h3 id="0-3-全流程概览">0.3 全流程概览</h3><table><thead><tr><th>步骤</th><th>内容</th><th>对应章节</th></tr></thead><tbody><tr><td>1</td><td>安装 Node.js</td><td>第一章</td></tr><tr><td>2</td><td>安装 Git</td><td>第二章</td></tr><tr><td>3</td><td>注册 GitHub 并创建仓库、生成令牌</td><td>第三章</td></tr><tr><td>4</td><td>创建站点并本地预览</td><td>第四章</td></tr><tr><td>5</td><td>修改站点配置</td><td>第五章</td></tr><tr><td>6</td><td>写下第一篇文章</td><td>第六章</td></tr><tr><td>7</td><td>安装并配置主题</td><td>第七章</td></tr><tr><td>8</td><td>部署上线</td><td>第八章</td></tr><tr><td>9</td><td>配置收录</td><td>第九章</td></tr></tbody></table><hr><h2 id="一、安装-Node-js">一、安装 Node.js</h2><h3 id="1-1-下载安装包">1.1 下载安装包</h3><ol><li>打开官网 <code>https://nodejs.org/zh-cn</code>（国内访问慢可用 <code>https://nodejs.cn</code>）；</li><li>页面会有两个下载按钮，<strong>选择左边的 LTS 版本</strong>，不要选右边的 Current；</li><li>Windows 下载 <code>.msi</code> 安装包，macOS 下载 <code>.pkg</code> 安装包。</li></ol><blockquote><p>LTS 是长期支持版，稳定性优先；Current 是最新版，可能带有未修复的问题，不适合新手。</p></blockquote><h3 id="1-2-安装（以-Windows-为例）">1.2 安装（以 Windows 为例）</h3><ol><li>双击下载好的 <code>.msi</code> 文件；</li><li>一路点击 <strong>Next</strong>，其中「Destination Folder」这一步无需修改默认路径；</li><li>看到 <strong>Add to PATH</strong> 选项时保持勾选状态（默认已勾选），它决定能否在命令行中调用；</li><li>点击 <strong>Install</strong>，等待进度条走完，最后点击 <strong>Finish</strong>。</li></ol><p><strong>安装路径不要包含中文</strong>，否则后续可能出现路径解析错误。若你的 Windows 用户名是中文，安装到 <code>C:\Program Files\nodejs</code> 这类纯英文路径下即可。</p><h3 id="1-3-验证安装">1.3 验证安装</h3><p>安装完成后<strong>必须重新打开命令行窗口</strong>（安装前的窗口读不到新配置），输入：</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">node -v</span><br><span class="line">npm -v</span><br></pre></td></tr></table></figure><p>预期输出形如：</p><figure class="highlight text"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">v20.11.1</span><br><span class="line">10.2.4</span><br></pre></td></tr></table></figure><p>两行都出现版本号即安装成功。若提示「不是内部或外部命令」，说明 PATH 未生效，处理方式见第十章 10.1。</p><h3 id="1-4-切换-npm-镜像（可选但推荐）">1.4 切换 npm 镜像（可选但推荐）</h3><p>npm 默认从境外服务器下载，国内速度很慢。切换为国内镜像可以明显提速：</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">npm config <span class="built_in">set</span> registry https://registry.npmmirror.com</span><br></pre></td></tr></table></figure><p>执行后确认是否生效：</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">npm config get registry</span><br></pre></td></tr></table></figure><p>输出 <code>https://registry.npmmirror.com/</code> 即设置成功。</p><hr><h2 id="二、安装-Git">二、安装 Git</h2><h3 id="2-1-下载安装">2.1 下载安装</h3><ol><li>打开 <code>https://git-scm.com/downloads</code>；</li><li>选择你的系统版本，下载安装程序；</li><li>Windows 版双击安装，<strong>全部保持默认选项，一路点击 Next 直到 Finish 即可</strong>。</li></ol><h3 id="2-2-配置身份信息">2.2 配置身份信息</h3><p>Git 需要知道「是谁提交的」，首次使用必须配置。打开命令行，把引号内的内容换成你自己的：</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">git config --global user.name <span class="string">&quot;你的名字&quot;</span></span><br><span class="line">git config --global user.email <span class="string">&quot;你的邮箱&quot;</span></span><br></pre></td></tr></table></figure><p>这里的邮箱建议与之后注册 GitHub 用的邮箱一致。</p><h3 id="2-3-验证">2.3 验证</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">git --version</span><br><span class="line">git config --global --list</span><br></pre></td></tr></table></figure><p><code>git --version</code> 应输出版本号，<code>--list</code> 会列出刚才配置的名字与邮箱。</p><hr><h2 id="三、注册-GitHub-并创建仓库">三、注册 GitHub 并创建仓库</h2><h3 id="3-1-注册账号">3.1 注册账号</h3><ol><li>打开 <code>https://github.com</code>；</li><li>点击右上角 <strong>Sign up</strong>，依次填写邮箱、密码、用户名；</li><li>完成邮箱验证码校验；</li><li>登录后记住自己的<strong>用户名</strong>，后面创建仓库要用到。</li></ol><h3 id="3-2-创建仓库">3.2 创建仓库</h3><ol><li>登录后点击右上角的 <strong>+</strong>，选择 <strong>New repository</strong>；</li><li><strong>Repository name</strong> 必须填 <code>你的用户名.github.io</code>。例如用户名是 <code>abc</code>，就填 <code>abc.github.io</code>——这个格式决定了站点最终的访问地址，填错就无法访问；</li><li>可见性选择 <strong>Public</strong>（免费账户部署 Pages 需要公开仓库）；</li><li>下方的 Initialize 选项<strong>全部不要勾选</strong>；</li><li>点击 <strong>Create repository</strong>。</li></ol><h3 id="3-3-生成访问令牌（部署必需）">3.3 生成访问令牌（部署必需）</h3><p>从 2021 年起 GitHub 不再支持用账号密码推送代码，必须使用访问令牌（Token）。</p><ol><li>点击右上角头像 → <strong>Settings</strong>；</li><li>左侧拉到最底部 → <strong>Developer settings</strong>；</li><li>选择 <strong>Personal access tokens</strong> → <strong>Tokens (classic)</strong>；</li><li>点击 <strong>Generate new token</strong> → <strong>Generate new token (classic)</strong>；</li><li>在 <strong>Note</strong> 里填个备注，例如 <code>hexo-deploy</code>；<strong>Expiration</strong> 按需选择（选 No expiration 需自行承担泄露风险）；</li><li>勾选权限时，只需勾选 <strong>repo</strong> 这一项（它会展开若干子项，保持默认即可）；</li><li>拉到最下方点击 <strong>Generate token</strong>；</li><li>页面会显示一串以 <code>ghp_</code> 开头的字符，<strong>立刻复制保存到安全的地方</strong>——离开页面后无法再次查看。</li></ol><blockquote><p>令牌等同于密码。不要粘贴到聊天软件、不要写进会公开的仓库文件。若怀疑泄露，回到该页面点击 Delete 删除并重新生成。</p></blockquote><hr><h2 id="四、创建站点并本地预览">四、创建站点并本地预览</h2><h3 id="4-1-安装编辑器（推荐）">4.1 安装编辑器（推荐）</h3><p>推荐安装 <strong>Visual Studio Code</strong>（<code>https://code.visualstudio.com</code>），后面编辑配置和写文章都在它里面完成。安装时同样一路默认即可。安装完成后可右键文件夹选择「通过 Code 打开」。</p><h3 id="4-2-打开命令行">4.2 打开命令行</h3><p>Windows 有三种方式，任选一种：</p><ul><li>按 <code>Win + R</code>，输入 <code>cmd</code>，回车；</li><li>按 <code>Win + X</code>，选择「Windows PowerShell」；</li><li>在文件管理器的地址栏输入 <code>cmd</code> 后回车，会<strong>直接在当前文件夹打开命令行</strong>。</li></ul><p>macOS 打开「启动台」，搜索「终端」。</p><blockquote><p>命令行中有个常识：执行命令时，它操作的是<strong>当前所在的文件夹</strong>。界面上会显示当前路径（如 <code>C:\Users\abc&gt;</code>）。切换目录用 <code>cd 路径</code>；Windows 换盘符需先输入 <code>D:</code> 回车，再 <code>cd 路径</code>。</p></blockquote><h3 id="4-3-选择存放目录">4.3 选择存放目录</h3><p>建议选一个<strong>纯英文、无空格</strong>的路径，例如 <code>D:\blog</code>。先在文件资源管理器中创建好这个空文件夹，然后在命令行中进入它：</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">cd</span> /d D:\blog</span><br></pre></td></tr></table></figure><p>macOS 用 <code>cd /Users/你的名字/blog</code>。</p><h3 id="4-4-安装-Hexo-并初始化">4.4 安装 Hexo 并初始化</h3><p>按顺序执行以下命令，每条执行完再执行下一条：</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># 1. 全局安装 Hexo 命令行工具</span></span><br><span class="line">npm install -g hexo-cli</span><br><span class="line"></span><br><span class="line"><span class="comment"># 2. 验证，应输出版本号</span></span><br><span class="line">hexo -v</span><br><span class="line"></span><br><span class="line"><span class="comment"># 3. 初始化站点，blog 是站点文件夹名，可自定义</span></span><br><span class="line">hexo init blog</span><br><span class="line"></span><br><span class="line"><span class="comment"># 4. 进入站点目录</span></span><br><span class="line"><span class="built_in">cd</span> blog</span><br><span class="line"></span><br><span class="line"><span class="comment"># 5. 安装站点依赖</span></span><br><span class="line">npm install</span><br></pre></td></tr></table></figure><p>说明：</p><ul><li>第 1 步可能需要管理员权限。若提示权限不足，Windows 下改用「以管理员身份运行」的命令行；macOS 则在命令前加 <code>sudo</code>；</li><li>第 5 步会下载较多文件，耗时从几十秒到几分钟不等，期间大量滚动文字属正常现象，只要最后没有红色 <code>ERR!</code> 即为成功。</li></ul><p>执行完毕后，当前目录结构如下：</p><table><thead><tr><th>目录／文件</th><th>说明</th></tr></thead><tbody><tr><td><code>_config.yml</code></td><td>站点配置，域名、标题、永久链接等</td></tr><tr><td><code>source/_posts</code></td><td>文章源文件，可按年份或日期分子目录</td></tr><tr><td><code>source/_data</code></td><td>自定义数据文件，例如友链</td></tr><tr><td><code>themes</code></td><td>主题目录</td></tr><tr><td><code>public</code></td><td>生成产物，部署时上传的就是它</td></tr><tr><td><code>scaffolds</code></td><td>新建文章时使用的模板</td></tr><tr><td><code>package.json</code></td><td>记录已安装的插件</td></tr></tbody></table><h3 id="4-5-启动本地预览">4.5 启动本地预览</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">hexo clean &amp;&amp; hexo g &amp;&amp; hexo s</span><br></pre></td></tr></table></figure><p>这条命令由三段组成：<code>clean</code> 清理旧产物，<code>g</code> 生成网页，<code>s</code> 启动本地服务器。看到类似下面的输出即表示启动成功：</p><figure class="highlight text"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">INFO  Hexo is running at http://localhost:4000/</span><br></pre></td></tr></table></figure><p>此时浏览器访问 <code>http://localhost:4000</code>，应能看到默认主题的首页。</p><ul><li>停止服务：在命令行窗口按 <code>Ctrl + C</code>；</li><li>若提示端口 4000 被占用，处理方式见第十章 10.4；</li><li>本地预览只在你的电脑上可见，其他人访问不到。</li></ul><blockquote><p>本地服务是调试用的。每次修改文章后刷新浏览器即可看到变化；修改配置文件或主题文件则需要按 <code>Ctrl + C</code> 停止后重新执行上面的命令。</p></blockquote><hr><h2 id="五、站点基础配置">五、站点基础配置</h2><h3 id="5-1-打开配置文件">5.1 打开配置文件</h3><p>用 VS Code 打开 <code>D:\blog\blog\_config.yml</code>（即站点根目录下的 <code>_config.yml</code>）。</p><blockquote><p><strong>YAML 格式三条铁律</strong>：层级用<strong>空格</strong>缩进，不要用 Tab；冒号后必须有一个空格；同一层级的项左对齐。缩进错一个空格都会导致配置失效。</p></blockquote><h3 id="5-2-必改字段">5.2 必改字段</h3><figure class="highlight yaml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">title:</span> <span class="string">站点名称</span></span><br><span class="line"><span class="attr">subtitle:</span> <span class="string">站点副标题</span></span><br><span class="line"><span class="attr">description:</span> <span class="string">站点描述，用于搜索结果摘要</span></span><br><span class="line"><span class="attr">keywords:</span> <span class="string">关键词，逗号分隔</span></span><br><span class="line"><span class="attr">author:</span> <span class="string">作者名</span></span><br><span class="line"><span class="attr">language:</span> <span class="string">zh-CN</span></span><br><span class="line"><span class="attr">timezone:</span> <span class="string">Asia/Shanghai</span></span><br><span class="line"></span><br><span class="line"><span class="attr">url:</span> <span class="string">https://用户名.github.io</span></span><br><span class="line"><span class="attr">root:</span> <span class="string">/</span></span><br><span class="line"><span class="attr">permalink:</span> <span class="string">posts/:abbrlink.html</span></span><br></pre></td></tr></table></figure><table><thead><tr><th>字段</th><th>填写要求</th></tr></thead><tbody><tr><td><code>title</code></td><td>显示在浏览器标签页与侧边栏的站点名</td></tr><tr><td><code>subtitle</code></td><td>副标题，部分主题会显示在标题下方</td></tr><tr><td><code>description</code></td><td>会写入页面 meta 描述，建议控制在 30 字以内</td></tr><tr><td><code>keywords</code></td><td>搜索关键词，用英文逗号分隔</td></tr><tr><td><code>author</code></td><td>作者名，会显示在作者卡片上</td></tr><tr><td><code>url</code></td><td><strong>必须</strong>填 <code>https://你的用户名.github.io</code>，结尾不要带斜杠</td></tr><tr><td><code>root</code></td><td>部署在根路径时填 <code>/</code>，填错会导致样式全部丢失</td></tr><tr><td><code>permalink</code></td><td>建议填 <code>posts/:abbrlink.html</code>，避免中文标题出现在网址中</td></tr></tbody></table><p><code>url</code> 与 <code>root</code> 决定全站所有绝对地址的拼接结果，配置错误会导致 sitemap、canonical、og:url 同时指向 localhost，排查方法见<a href="/posts/b4d81e6a.html">相关记录</a>。</p><h3 id="5-3-安装短链接插件">5.3 安装短链接插件</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">npm install hexo-abbrlink --save</span><br></pre></td></tr></table></figure><p>然后在 <code>_config.yml</code> 末尾追加：</p><figure class="highlight yaml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">abbrlink:</span></span><br><span class="line">  <span class="attr">alg:</span> <span class="string">crc32</span></span><br><span class="line">  <span class="attr">rep:</span> <span class="string">hex</span></span><br></pre></td></tr></table></figure><blockquote><p><strong>这一条务必记住，本站曾因它丢掉过整篇文章。</strong> 当文章的 front-matter 中没有 <code>abbrlink</code> 字段时，该插件会自动生成一个，并<strong>回写源文件</strong>；而这次回写只保留 front-matter 部分，<code>---</code> 以下的正文会被整段清空。</p><p>规避方法有三条：新建文章时手动填写 <code>abbrlink</code>；文件保存为 <strong>UTF-8 无 BOM</strong>、换行使用 <strong>LF</strong>；站点搭好后立刻用 Git 提交一次，万一误删还能恢复。检查换行符的方式见第六章 6.3。</p></blockquote><hr><h2 id="六、写下第一篇文章">六、写下第一篇文章</h2><h3 id="6-1-新建文章">6.1 新建文章</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">hexo new <span class="string">&quot;我的第一篇文章&quot;</span></span><br></pre></td></tr></table></figure><p>执行后会在 <code>source/_posts/</code> 下生成 <code>我的第一篇文章.md</code>。若要放进子目录分类存放，用 <code>--path</code> 指定相对路径：</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">hexo new <span class="string">&quot;我的第一篇文章&quot;</span> --path 2026/10/我的第一篇文章.md</span><br></pre></td></tr></table></figure><p>生成的文件内容如下：</p><figure class="highlight markdown"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">---</span><br><span class="line">title: 我的第一篇文章</span><br><span class="line">date: 2026-10-17 10:30:00</span><br><span class="line"><span class="section">tags:</span></span><br><span class="line"><span class="section">---</span></span><br></pre></td></tr></table></figure><h3 id="6-2-补全-front-matter">6.2 补全 front-matter</h3><p>常用字段说明：</p><table><thead><tr><th>字段</th><th>作用</th><th>示例</th></tr></thead><tbody><tr><td><code>title</code></td><td>文章标题</td><td><code>我的第一篇文章</code></td></tr><tr><td><code>date</code></td><td>发布日期</td><td><code>2026-10-17 10:30:00</code></td></tr><tr><td><code>tags</code></td><td>标签，可在下方以 <code>- 标签名</code> 逐行列出</td><td><code>- Hexo</code></td></tr><tr><td><code>categories</code></td><td>分类，只能属于一个</td><td><code>技术学习</code></td></tr><tr><td><code>cover</code></td><td>封面图地址</td><td><code>'https://.../图片.png'</code></td></tr><tr><td><code>abbrlink</code></td><td>短链接编号，<strong>必须手动填写</strong></td><td><code>'hexo-start-2026'</code></td></tr></tbody></table><p><code>abbrlink</code> 可以填任意不重复的英文或数字组合，例如 <code>hexo-start-2026</code>。手动填写后插件就不会再回写源文件，也就不会清空正文。</p><h3 id="6-3-检查文件换行符">6.3 检查文件换行符</h3><p>用 VS Code 打开文章文件，看窗口<strong>右下角状态栏</strong>：</p><ul><li>显示 <code>CRLF</code> 时，点击它，在弹出的列表中选择 <code>LF</code>；</li><li>显示 <code>UTF-8</code> 表示编码正确；若显示 <code>UTF-8 with BOM</code>，同样点击后改为 <code>UTF-8</code>。</li></ul><p>改完按 <code>Ctrl + S</code> 保存。</p><h3 id="6-4-预览效果">6.4 预览效果</h3><p>回到正在运行的本地服务，浏览器刷新 <code>http://localhost:4000</code> 即可看到新文章。<code>source/</code> 下的文件支持热加载，<strong>不需要</strong>重启服务。</p><p>正文用 Markdown 编写，常用语法：</p><table><thead><tr><th>写法</th><th>效果</th></tr></thead><tbody><tr><td><code># 标题</code> / <code>## 小标题</code></td><td>一级／二级标题</td></tr><tr><td><code>**加粗**</code></td><td><strong>加粗</strong></td></tr><tr><td><code>- 内容</code></td><td>无序列表</td></tr><tr><td><code>&gt; 内容</code></td><td>引用块</td></tr><tr><td><code>`代码`</code></td><td>行内代码</td></tr><tr><td>三个反引号包裹</td><td>代码块</td></tr><tr><td><code>***</code></td><td>分隔线</td></tr></tbody></table><hr><h2 id="七、安装与配置主题">七、安装与配置主题</h2><p>默认主题比较简陋，这里以 Butterfly 为例换一个。</p><h3 id="7-1-下载主题">7.1 下载主题</h3><p>在站点根目录（<code>D:\blog\blog</code>）执行：</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git <span class="built_in">clone</span> https://github.com/jerryc127/hexo-theme-butterfly themes/butterfly</span><br></pre></td></tr></table></figure><p>若 <code>git clone</code> 速度很慢或失败，也可以直接访问该页面，点击 <strong>Code → Download ZIP</strong>，下载后解压，把得到的文件夹重命名为 <code>butterfly</code>，放入 <code>themes</code> 目录中。</p><h3 id="7-2-复制主题配置">7.2 复制主题配置</h3><p>主题自带的 <code>themes/butterfly/_config.yml</code> <strong>不要直接改</strong>。正确做法是把它复制到站点根目录，并重命名为 <code>_config.butterfly.yml</code>：</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">copy themes\butterfly\_config.yml _config.butterfly.yml</span><br></pre></td></tr></table></figure><p>macOS 用 <code>cp themes/butterfly/_config.yml _config.butterfly.yml</code>。</p><p>Hexo 会优先读取站点根目录的这一份。这样做的好处是：将来升级主题时，直接替换 <code>themes/butterfly</code> 整个文件夹，你的配置不会被覆盖。</p><h3 id="7-3-安装主题依赖">7.3 安装主题依赖</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">npm install</span><br></pre></td></tr></table></figure><p>Butterfly 依赖若干插件（如 <code>hexo-renderer-pug</code>、<code>hexo-renderer-stylus</code>），<code>npm install</code> 会依据主题目录的 <code>package.json</code> 自动补齐。</p><h3 id="7-4-配置生效规则">7.4 配置生效规则</h3><table><thead><tr><th>修改的文件</th><th>是否需要重启 <code>hexo server</code></th></tr></thead><tbody><tr><td><code>source/</code> 下的文章与页面</td><td>否，刷新即可生效</td></tr><tr><td><code>_config.yml</code>、<code>_config.butterfly.yml</code></td><td>是</td></tr><tr><td><code>themes/</code> 下的模板与样式</td><td>是</td></tr></tbody></table><p><code>hexo server</code> 启动时会把配置文件与主题目录读入内存，运行期间修改这些文件不会被重新加载。这是本地调试时「改了却没效果」最常见的原因。</p><h3 id="7-5-常见小问题">7.5 常见小问题</h3><table><thead><tr><th>现象</th><th>原因</th></tr></thead><tbody><tr><td>菜单栏是空的</td><td><code>_config.butterfly.yml</code> 中 <code>menu</code> 的条目被注释，去掉行首的 <code>#</code> 即可</td></tr><tr><td>图标不显示</td><td>图标名需拼写正确，字体图标库未加载时刷新即可</td></tr><tr><td>页面是白板</td><td><code>_config.yml</code> 的 <code>theme</code> 未与主题文件夹名一致，应填 <code>butterfly</code></td></tr><tr><td>改了配置无变化</td><td>配置与主题文件不热加载，需重启本地服务</td></tr></tbody></table><hr><h2 id="八、部署到-GitHub-Pages">八、部署到 GitHub Pages</h2><h3 id="8-1-安装部署插件">8.1 安装部署插件</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">npm install hexo-deployer-git --save</span><br></pre></td></tr></table></figure><h3 id="8-2-配置-deploy">8.2 配置 deploy</h3><p>在 <code>_config.yml</code> 末尾追加。把 <code>用户名</code> 与 <code>令牌</code> 替换成第三章准备的内容：</p><figure class="highlight yaml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">deploy:</span></span><br><span class="line">  <span class="attr">type:</span> <span class="string">git</span></span><br><span class="line">  <span class="attr">repo:</span> <span class="string">https://用户名:令牌@github.com/用户名/用户名.github.io.git</span></span><br><span class="line">  <span class="attr">branch:</span> <span class="string">main</span></span><br></pre></td></tr></table></figure><p>若你的仓库默认分支是 <code>master</code>，把 <code>branch</code> 改为 <code>master</code>。</p><blockquote><p>令牌写在配置文件里是最省事的做法，但请<strong>不要</strong>把这个文件提交到公开仓库，否则令牌会泄露。</p></blockquote><h3 id="8-3-执行部署">8.3 执行部署</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">hexo clean &amp;&amp; hexo g &amp;&amp; hexo d</span><br></pre></td></tr></table></figure><p><code>clean</code> 会删除 <code>public/</code> 与 <code>db.json</code>。这一步不能省略：上一次构建的产物中可能残留旧域名链接，不清除会一并部署到线上。</p><p>出现下面这行即为部署成功：</p><figure class="highlight text"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">INFO  Deploy done: git</span><br></pre></td></tr></table></figure><h3 id="8-4-首次部署后的检查">8.4 首次部署后的检查</h3><ol><li>浏览器访问 <code>https://你的用户名.github.io</code>；</li><li>若返回 404，进入仓库页面点击 <strong>Settings → Pages</strong>，确认 <strong>Source</strong> 选择的是 <strong>Deploy from a branch</strong>，<strong>Branch</strong> 选择 <code>main</code> 且目录为 <code>/ (root)</code>，保存后等待几分钟；</li><li>首次部署后 CDN 可能有约 10 分钟的缓存，无痕窗口可避开本地缓存干扰。</li></ol><h3 id="8-5-以后如何更新">8.5 以后如何更新</h3><p>站点更新只需重复一条命令：</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">hexo clean &amp;&amp; hexo g &amp;&amp; hexo d</span><br></pre></td></tr></table></figure><p>源文件建议保存在本地，或用另一个私有仓库管理，避免与产物混在一起。</p><hr><h2 id="九、上线后的必要配置">九、上线后的必要配置</h2><p>站点能够访问只是第一步，以下配置直接影响被搜索引擎收录的效果：</p><table><thead><tr><th>项目</th><th>作用</th><th>配置位置</th></tr></thead><tbody><tr><td><code>robots.txt</code></td><td>告知爬虫抓取范围，并声明 sitemap 地址</td><td><code>source/robots.txt</code></td></tr><tr><td>sitemap</td><td>提供给搜索引擎的页面清单</td><td><code>hexo-generator-sitemap</code> 插件</td></tr><tr><td>站长验证</td><td>在站长平台证明站点归属</td><td><code>_config.butterfly.yml</code> 的 <code>site_verification</code></td></tr></tbody></table><p>具体排查步骤与验证流程参见<a href="/posts/b4d81e6a.html">Hexo 博客 SEO 配置与收录排查教程</a>。</p><hr><h2 id="十、常见报错与排查">十、常见报错与排查</h2><h3 id="10-1-提示「不是内部或外部命令」">10.1 提示「不是内部或外部命令」</h3><p>现象：输入 <code>node -v</code> 或 <code>hexo -v</code> 后提示命令不存在。</p><p>原因：安装时未勾选加入 PATH，或安装后没有重新打开命令行窗口。</p><p>处理：先关闭所有命令行窗口再重开；仍不行则卸载后重装，安装时确保勾选 <strong>Add to PATH</strong>。</p><h3 id="10-2-npm-安装缓慢或报证书错误">10.2 npm 安装缓慢或报证书错误</h3><p>处理：切换国内镜像；若开了代理软件，先暂时关闭再安装。</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">npm config <span class="built_in">set</span> registry https://registry.npmmirror.com</span><br></pre></td></tr></table></figure><h3 id="10-3-提示权限不足（macOS-常见）">10.3 提示权限不足（macOS 常见）</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">sudo</span> npm install -g hexo-cli</span><br></pre></td></tr></table></figure><p>输入系统密码（输入时屏幕不显示字符，属正常现象）。</p><h3 id="10-4-端口-4000-被占用">10.4 端口 4000 被占用</h3><p>最省事的做法是换一个端口启动：</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">hexo s -p 5000</span><br></pre></td></tr></table></figure><p>访问地址相应变为 <code>http://localhost:5000</code>。</p><p>若一定要释放 4000 端口，Windows 下先查占用进程：</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">netstat -ano | findstr :4000</span><br></pre></td></tr></table></figure><p>记下最后一列的 PID，再结束它：</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">taskkill /PID 进程号 /F</span><br></pre></td></tr></table></figure><h3 id="10-5-提示-fatal-not-a-git-repository">10.5 提示 fatal: not a git repository</h3><p>原因：命令执行时所在的目录不对，不在站点目录或指定的仓库目录内。</p><p>处理：先 <code>cd</code> 到正确的目录再执行。可用 <code>dir</code>（Windows）或 <code>ls</code>（macOS）确认当前目录内容。</p><h3 id="10-6-部署时提示认证失败">10.6 部署时提示认证失败</h3><p>现象：<code>remote: Support for password authentication was removed</code>。</p><p>原因：GitHub 已停用账号密码推送，必须使用访问令牌。</p><p>处理：回到第三章 3.3 重新生成令牌，并把 <code>deploy</code> 配置中的 <code>repo</code> 改为带令牌的写法。</p><h3 id="10-7-部署成功但线上仍是旧内容">10.7 部署成功但线上仍是旧内容</h3><p>原因：本地未执行 <code>hexo clean</code>，或 CDN 缓存未过期。</p><p>处理：用 <code>hexo clean &amp;&amp; hexo g &amp;&amp; hexo d</code> 重新部署；用无痕窗口验证，或等待约 10 分钟。</p><h3 id="10-8-线上样式丢失、图片不显示">10.8 线上样式丢失、图片不显示</h3><p>原因：多为 <code>root</code> 配置错误导致资源路径拼接失败。</p><p>处理：确认 <code>_config.yml</code> 中 <code>root</code> 为 <code>/</code>，<code>url</code> 为线上地址；检查页面源代码中 css 与 js 引用地址，若含 <code>localhost</code> 说明部署前未重新生成。</p><h3 id="10-9-文章正文消失，只剩几行配置">10.9 文章正文消失，只剩几行配置</h3><p>原因：<code>hexo-abbrlink</code> 在文章未填写 <code>abbrlink</code> 时回写源文件，且回写只保留 front-matter。</p><p>处理：补全 <code>abbrlink</code> 字段，并把文件保存为 UTF-8 无 BOM、LF 换行。若之前用 Git 提交过，可用 <code>git checkout 文件名</code> 恢复；未提交则无法找回，这也是建议搭好站点后立刻提交一次的原因。</p><hr><h2 id="十一、完整检查清单">十一、完整检查清单</h2><table><thead><tr><th>步骤</th><th>操作</th><th>通过标准</th></tr></thead><tbody><tr><td>1</td><td><code>node -v</code>、<code>npm -v</code></td><td>输出版本号</td></tr><tr><td>2</td><td><code>git --version</code></td><td>输出版本号</td></tr><tr><td>3</td><td><code>hexo init blog</code> 后 <code>npm install</code></td><td>无红色 <code>ERR!</code></td></tr><tr><td>4</td><td><code>hexo clean &amp;&amp; hexo g &amp;&amp; hexo s</code></td><td>本地 4000 端口可访问</td></tr><tr><td>5</td><td>打开 <code>_config.yml</code> 改 <code>url</code>、<code>root</code>、<code>permalink</code></td><td>保存无报错</td></tr><tr><td>6</td><td><code>hexo new</code> 新建文章并填 <code>abbrlink</code></td><td>文件换行显示 LF</td></tr><tr><td>7</td><td>复制主题配置为 <code>_config.butterfly.yml</code></td><td>站点模板正常渲染</td></tr><tr><td>8</td><td>配置 <code>deploy</code> 并执行 <code>hexo d</code></td><td>出现 <code>Deploy done: git</code></td></tr><tr><td>9</td><td>访问线上域名</td><td>返回站点首页而非 404</td></tr><tr><td>10</td><td>配置 robots.txt 与 sitemap</td><td>线上可直接打开这两个文件</td></tr></tbody></table><hr><h2 id="十二、小结">十二、小结</h2><ol><li>搭建顺序固定为：Node.js → Git → GitHub 仓库 → 建站 → 配置 → 发文 → 主题 → 部署；</li><li><code>url</code> 与 <code>root</code> 决定全站绝对地址，部署前必须确认；</li><li>主题配置应放在站点根目录的 <code>_config.butterfly.yml</code>，避免升级时被覆盖；</li><li>部署命令为 <code>hexo clean &amp;&amp; hexo g &amp;&amp; hexo d</code>，其中 <code>clean</code> 不可省略；</li><li>新建文章务必手动填写 <code>abbrlink</code>，并保持 UTF-8 无 BOM、LF 换行；</li><li>配置与主题文件不热加载，改动后需要重启本地服务。</li></ol><hr><h2 id="参考来源">参考来源</h2><ul><li><a href="https://hexo.io/zh-cn/docs/">Hexo 官方文档</a></li><li><a href="https://hexo.io/zh-cn/docs/github-pages">Hexo 部署 · GitHub Pages</a></li><li><a href="https://nodejs.org/zh-cn">Node.js 中文官网</a></li><li><a href="https://git-scm.com/downloads">Git for Windows</a></li><li><a href="https://docs.github.com/zh/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens">GitHub 文档 · 创建个人访问令牌</a></li><li><a href="https://github.com/hexojs/hexo-deployer-git">hexo-deployer-git（GitHub）</a></li><li><a href="https://github.com/rozbo/hexo-abbrlink">hexo-abbrlink（GitHub）</a></li><li><a href="https://butterfly.js.org/">Butterfly 主题文档</a></li><li><a href="https://docs.github.com/zh/pages">GitHub Pages 文档</a></li></ul>]]></content>
    
    
      
      
    <summary type="html">&lt;h1 id=&quot;Hexo-站点搭建与部署全流程&quot;&gt;Hexo 站点搭建与部署全流程&lt;/h1&gt;
&lt;p&gt;这是一份面向零基础的教程。全程只需一台电脑和网络，按顺序照做即可，不需要事先懂编程。每一步都写明了「在哪里操作、输入什么、应该看到什么、出错怎么办」。&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id</summary>
      
    
    
    
    <category term="技术学习" scheme="https://zhaogb612.github.io/categories/%E6%8A%80%E6%9C%AF%E5%AD%A6%E4%B9%A0/"/>
    
    
    <category term="技术学习" scheme="https://zhaogb612.github.io/tags/%E6%8A%80%E6%9C%AF%E5%AD%A6%E4%B9%A0/"/>
    
    <category term="Hexo" scheme="https://zhaogb612.github.io/tags/Hexo/"/>
    
    <category term="站点部署" scheme="https://zhaogb612.github.io/tags/%E7%AB%99%E7%82%B9%E9%83%A8%E7%BD%B2/"/>
    
  </entry>
  
  <entry>
    <title>家庭网络排查与优化指南</title>
    <link href="https://zhaogb612.github.io/posts/b2f078f9.html"/>
    <id>https://zhaogb612.github.io/posts/b2f078f9.html</id>
    <published>2026-10-17T02:00:00.000Z</published>
    <updated>2026-10-17T02:00:00.000Z</updated>
    
    <content type="html"><![CDATA[<h1 id="家庭网络排查与优化指南">家庭网络排查与优化指南</h1><p>家庭网络出现问题时，「重启路由器」往往能解决一部分，却无法解释剩下的部分。本文按「先定位链路、再量化数据、最后逐项调整」的顺序，整理一套可复用的排查与优化方法。</p><hr><h2 id="一、先厘清链路">一、先厘清链路</h2><p>家用网络的物理链路通常是固定的，排查的第一步是明确数据从哪来、经过谁：</p><table><thead><tr><th>环节</th><th>设备</th><th>常见问题</th></tr></thead><tbody><tr><td>入户</td><td>光猫</td><td>拨号失败、端口限速、旧光猫仅百兆</td></tr><tr><td>分发</td><td>路由器</td><td>性能不足、设置错误、发热降频</td></tr><tr><td>扩展</td><td>交换机 / Mesh 节点</td><td>环路、回程带宽不足</td></tr><tr><td>终端</td><td>电脑 / 手机 / 电视</td><td>网卡老旧、驱动异常、省电策略断流</td></tr></tbody></table><p>排查的基本思路是<strong>逐段替换</strong>：把电脑用网线直连光猫测速，再直连路由器测速，最后换到 Wi-Fi 测速。三次结果对比即可判断瓶颈落在哪一段：</p><table><thead><tr><th>对比结果</th><th>结论</th></tr></thead><tbody><tr><td>直连光猫也不达标</td><td>问题在运营商或光猫</td></tr><tr><td>直连光猫正常、连路由器偏低</td><td>问题在路由器</td></tr><tr><td>有线正常、Wi-Fi 偏低</td><td>问题在无线覆盖或信道</td></tr></tbody></table><hr><h2 id="二、量化数据：先测再调">二、量化数据：先测再调</h2><p>优化的前提是有可对比的数据。仅凭「感觉卡」无法判断改动是否有效。</p><table><thead><tr><th>工具</th><th>适用场景</th><th>关注指标</th></tr></thead><tbody><tr><td>Speedtest by Ookla</td><td>公网带宽测速</td><td>下行 / 上行、延迟</td></tr><tr><td>运营商测速页</td><td>排查是否达标</td><td>与签约带宽对比</td></tr><tr><td>iperf3</td><td>局域网内测速</td><td>内网吞吐、排除公网干扰</td></tr><tr><td><code>ping</code> ／ <code>tracert</code></td><td>定位延迟与丢包</td><td>平均延迟、丢包率</td></tr></tbody></table><p>系统自带的命令足以完成基础排查：</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># 连续发包，观察是否稳定</span></span><br><span class="line">ping -n 50 网关地址</span><br><span class="line"></span><br><span class="line"><span class="comment"># 查看每一跳的延迟，定位卡在哪一段</span></span><br><span class="line">tracert 目标地址</span><br></pre></td></tr></table></figure><p>判断标准：延迟本身不重要，<strong>抖动与丢包</strong>才影响体验。游戏卡顿往往源于丢包，而非带宽不足。</p><hr><h2 id="三、Wi-Fi-优化">三、Wi-Fi 优化</h2><h3 id="3-1-2-4G-与-5G-的选择">3.1 2.4G 与 5G 的选择</h3><table><thead><tr><th>频段</th><th>优点</th><th>缺点</th><th>适用场景</th></tr></thead><tbody><tr><td>2.4G</td><td>穿墙强、覆盖广</td><td>干扰多、速率低</td><td>距离远、隔墙多的设备</td></tr><tr><td>5G</td><td>速率高、干扰少</td><td>穿墙弱</td><td>同房间、电视与电脑</td></tr></tbody></table><p>现在的路由器普遍支持双频合一，由设备自行选择。若家中有设备频繁在两者间切换导致断流，可将其拆分为两个独立 SSID，手动指定连接。</p><h3 id="3-2-信道选择">3.2 信道选择</h3><p>2.4G 频段只有 1 至 13 信道，且互不重叠的仅有 <strong>1、6、11</strong> 三个。周边路由器密集时，应固定到干扰最小的一个，而非交给自动选择。</p><p>5G 频段的信道更多，使用 Wi-Fi 分析类应用可以直观看到各信道的占用情况，选择空闲信道即可。</p><h3 id="3-3-频宽设置">3.3 频宽设置</h3><table><thead><tr><th>频段</th><th>建议频宽</th><th>说明</th></tr></thead><tbody><tr><td>2.4G</td><td>20MHz</td><td>40MHz 在拥挤环境下反而更慢</td></tr><tr><td>5G</td><td>40 或 80MHz</td><td>环境干扰大时可降到 40MHz 换取稳定</td></tr></tbody></table><h3 id="3-4-位置与天线">3.4 位置与天线</h3><ul><li>路由器尽量放在房屋<strong>居中、开阔、离地</strong>的位置；</li><li>远离金属柜体、微波炉、冰箱等干扰源；</li><li>外置天线的路由器，天线保持垂直可兼顾水平覆盖，全向发射。</li></ul><hr><h2 id="四、路由器基础设置">四、路由器基础设置</h2><p>登录管理后台（常见地址为 <code>192.168.1.1</code> 或 <code>192.168.0.1</code>，可在设备背面标签或默认网关中查到），逐项确认以下设置：</p><table><thead><tr><th>设置项</th><th>建议</th><th>原因</th></tr></thead><tbody><tr><td>管理员密码</td><td>必须修改</td><td>默认密码是设备被劫持的主要入口</td></tr><tr><td>固件版本</td><td>保持最新</td><td>修复已知漏洞与稳定性问题</td></tr><tr><td>DHCP 地址池</td><td>足够大且不与静态 IP 冲突</td><td>避免出现「设备过多分不到地址」</td></tr><tr><td>DNS</td><td>可改为公共 DNS</td><td>部分运营商 DNS 解析慢或存在劫持</td></tr><tr><td>IPv6</td><td>光猫支持则可开启</td><td>部分网络与流媒体依赖 IPv6</td></tr><tr><td>远程管理</td><td>关闭</td><td>降低被外网扫描的风险</td></tr></tbody></table><p>公共 DNS 的常见选项：</p><figure class="highlight text"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">阿里 DNS     223.5.5.5 / 223.6.6.6</span><br><span class="line">腾讯 DNS     119.29.29.29</span><br></pre></td></tr></table></figure><p>需要注意，更换 DNS 只影响域名解析速度，不会提升下载带宽。</p><hr><h2 id="五、常见故障排查">五、常见故障排查</h2><h3 id="5-1-全屋网速偏低">5.1 全屋网速偏低</h3><p>按第一节的替换法定位。若判断为路由器侧问题，优先检查：是否运行在百兆口（检查网线与端口协商速率）、是否被 QoS 限速、是否因散热不良而降频。</p><h3 id="5-2-个别设备无法连接">5.2 个别设备无法连接</h3><p>现象：其他设备正常，某一台始终连不上。处理顺序：先忽略该设备重新连接，再检查是否启用了 MAC 地址过滤，最后确认设备是否停留在 2.4G 而该频段被关闭。</p><h3 id="5-3-频繁掉线">5.3 频繁掉线</h3><p>常见成因有三类：无线信道被邻居路由器的信道冲突干扰；双频合一导致设备漫游切换失败；路由器负载过高或过热。对应处理为固定信道、拆分 SSID、改善散热。</p><h3 id="5-4-已连接但无法上网">5.4 已连接但无法上网</h3><p>依次检查：光猫指示灯是否正常（LOS 红灯表示光路故障，需报修）；路由器是否成功拨号；终端能否获取到 IP 地址——若拿到的是 <code>169.254.x.x</code>，说明 DHCP 未响应，通常重启路由器即可恢复。</p><h3 id="5-5-游戏与视频卡顿">5.5 游戏与视频卡顿</h3><p>优先关注丢包与延迟抖动，而不是带宽。可在后台开启 QoS，将游戏设备设为高优先级；若使用的是 Wi-Fi，尽量改用网线连接。</p><hr><h2 id="六、进阶优化">六、进阶优化</h2><table><thead><tr><th>措施</th><th>效果</th><th>前提</th></tr></thead><tbody><tr><td>Mesh 组网</td><td>解决大户型覆盖问题</td><td>支持 Mesh 的同品牌设备</td></tr><tr><td>有线回程</td><td>节点间走网线，速率不衰减</td><td>已预埋网线</td></tr><tr><td>QoS 限速</td><td>保障关键设备体验</td><td>路由器支持</td></tr><tr><td>访客网络</td><td>隔离外来设备</td><td>路由器支持</td></tr><tr><td>静态 IP 绑定</td><td>打印服务器、NAS 地址固定</td><td>记录设备 MAC 地址</td></tr></tbody></table><p>其中<strong>有线回程</strong>的收益最明显：Mesh 节点的无线回程会占用一半带宽用于自身通信，走网线后可完全避免这部分损耗。</p><hr><h2 id="七、安全建议">七、安全建议</h2><ol><li>管理员密码与 Wi-Fi 密码均不使用默认值，Wi-Fi 加密选择 WPA2 或 WPA3；</li><li>关闭 WPS 一键连接功能，该功能存在被暴力破解的风险；</li><li>关闭 UPnP，避免内网服务被自动映射到公网；</li><li>为访客开启独立的访客网络，与主网络隔离；</li><li>定期查看已连接设备列表，发现未知设备及时处理。</li></ol><hr><h2 id="八、上手检查清单">八、上手检查清单</h2><table><thead><tr><th>步骤</th><th>操作</th><th>通过标准</th></tr></thead><tbody><tr><td>1</td><td>有线直连光猫测速</td><td>接近签约带宽</td></tr><tr><td>2</td><td>有线直连路由器测速</td><td>与上一步接近</td></tr><tr><td>3</td><td>Wi-Fi 测速</td><td>5G 下无明显下降</td></tr><tr><td>4</td><td><code>ping</code> 网关 50 次</td><td>无丢包，抖动小</td></tr><tr><td>5</td><td>检查 2.4G 信道</td><td>固定为 1／6／11 中干扰最小者</td></tr><tr><td>6</td><td>确认密码与固件</td><td>已修改、已更新</td></tr></tbody></table><hr><h2 id="九、小结">九、小结</h2><ol><li>排查遵循逐段替换的思路，先确定瓶颈在哪一段，再针对性调整；</li><li>判断网络质量应以丢包与抖动为主要指标，而非仅看带宽；</li><li>Wi-Fi 优化的收益大多来自信道固定、频宽设置与设备位置；</li><li>有线回程是 Mesh 组网中收益最高的单项措施；</li><li>默认密码、WPS、UPnP 是最应优先关闭的三项风险设置。</li></ol><hr><h2 id="参考来源">参考来源</h2><ul><li><a href="https://www.wi-fi.org/">Wi-Fi 联盟 · 频段与信道说明</a></li><li><a href="https://www.speedtest.net/">Speedtest by Ookla</a></li><li><a href="https://iperf.fr/">iperf3 官方文档</a></li><li><a href="https://learn.microsoft.com/zh-cn/windows-server/administration/windows-commands/ping">Microsoft 文档 · ping / tracert 命令</a></li><li><a href="https://www.alidns.com/">阿里公共 DNS</a></li></ul>]]></content>
    
    
      
      
    <summary type="html">&lt;h1 id=&quot;家庭网络排查与优化指南&quot;&gt;家庭网络排查与优化指南&lt;/h1&gt;
&lt;p&gt;家庭网络出现问题时，「重启路由器」往往能解决一部分，却无法解释剩下的部分。本文按「先定位链路、再量化数据、最后逐项调整」的顺序，整理一套可复用的排查与优化方法。&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id=&quot;一</summary>
      
    
    
    
    <category term="技术指南" scheme="https://zhaogb612.github.io/categories/%E6%8A%80%E6%9C%AF%E6%8C%87%E5%8D%97/"/>
    
    
    <category term="网络" scheme="https://zhaogb612.github.io/tags/%E7%BD%91%E7%BB%9C/"/>
    
    <category term="路由器" scheme="https://zhaogb612.github.io/tags/%E8%B7%AF%E7%94%B1%E5%99%A8/"/>
    
    <category term="实用教程" scheme="https://zhaogb612.github.io/tags/%E5%AE%9E%E7%94%A8%E6%95%99%E7%A8%8B/"/>
    
  </entry>
  
  <entry>
    <title>Hexo 博客 SEO 配置与收录排查教程</title>
    <link href="https://zhaogb612.github.io/posts/b4d81e6a.html"/>
    <id>https://zhaogb612.github.io/posts/b4d81e6a.html</id>
    <published>2026-10-07T04:00:00.000Z</published>
    <updated>2026-10-07T04:00:00.000Z</updated>
    
    <content type="html"><![CDATA[<h1 id="Hexo-博客-SEO-配置与收录排查教程">Hexo 博客 SEO 配置与收录排查教程</h1><p>本文说明 Hexo 站点无法被搜索引擎收录的常见成因，并给出可复现的排查与修复步骤。文中配置以 Butterfly 主题为例，其他主题的原理相同。</p><hr><h2 id="一、适用范围">一、适用范围</h2><table><thead><tr><th>项目</th><th>说明</th></tr></thead><tbody><tr><td>生成器</td><td>Hexo 6.x</td></tr><tr><td>部署方式</td><td>GitHub Pages（<code>用户名.github.io</code>）</td></tr><tr><td>主题</td><td>Butterfly 4.x（用于说明站长验证的配置位置）</td></tr></tbody></table><p>若站点已绑定自有域名并完成备案，收录表现与本文描述不同，相关差异见第十一节。</p><hr><h2 id="二、问题现象">二、问题现象</h2><p>站点可正常访问，文章页面也能打开，但在搜索引擎中检索站点名称或文章标题时无法找到结果。</p><p>这类现象通常与内容质量无关，而是站点的基础配置存在缺陷，导致爬虫无法识别页面的规范地址。</p><hr><h2 id="三、排查步骤：三项自检">三、排查步骤：三项自检</h2><p>修改任何配置之前，应先确认爬虫实际抓取到的内容。以下三项检查不需要额外工具：</p><table><thead><tr><th>检查项</th><th>操作</th><th>预期结果</th></tr></thead><tbody><tr><td><code>你的域名/robots.txt</code></td><td>浏览器直接打开</td><td>返回内容，且 <code>Sitemap:</code> 指向真实域名</td></tr><tr><td><code>你的域名/sitemap.xml</code></td><td>浏览器直接打开</td><td>每一条链接均为线上域名</td></tr><tr><td>页面规范地址</td><td>打开任一文章，查看页面源代码，检索 <code>canonical</code> 与 <code>og:url</code></td><td>均指向线上域名</td></tr></tbody></table><p>三项中任意一项不符合预期，后续优化都不会生效，因为爬虫无法定位到正确的页面。</p><hr><h2 id="四、配置修正：url-与-root">四、配置修正：url 与 root</h2><h3 id="4-1-错误表现">4.1 错误表现</h3><p>打开 <code>sitemap.xml</code>，所有条目均指向本地地址：</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">&lt;loc&gt;http://localhost:4000/posts/e9f2a7c4.html&lt;/loc&gt;</span><br></pre></td></tr></table></figure><h3 id="4-2-成因">4.2 成因</h3><p><code>url</code> 与 <code>root</code> 定义在 <code>_config.yml</code> 中，是站点的根地址配置。Hexo 不保存绝对路径，所有绝对地址均在生成阶段由这两项拼接得到，包括 sitemap、canonical、og:url、RSS 以及文章永久链接。</p><p>本地调试时将 <code>url</code> 设为 <code>http://localhost:4000</code>，若该配置随产物一同部署，上述所有地址都会指向本地主机。</p><h3 id="4-3-连锁影响：canonical-与-og-url">4.3 连锁影响：canonical 与 og:url</h3><p>爬虫在页面 <code>&lt;head&gt;</code> 中读取到的规范地址为：</p><figure class="highlight html"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="tag">&lt;<span class="name">link</span> <span class="attr">rel</span>=<span class="string">&quot;canonical&quot;</span> <span class="attr">href</span>=<span class="string">&quot;http://localhost:4000/posts/e9f2a7c4.html&quot;</span>&gt;</span></span><br></pre></td></tr></table></figure><p><code>canonical</code> 用于声明页面的规范地址。该值指向 localhost 时，爬虫会判定 localhost 上的页面为正本，线上页面仅为其副本。结果是页面虽被抓取，但规范地址不可访问，因而不会出现在检索结果中。</p><p>同理，<code>og:url</code> 错误会导致内容分享至社交平台时，链接指向本地地址。</p><h3 id="4-4-正确配置">4.4 正确配置</h3><figure class="highlight yaml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">url:</span> <span class="string">https://你的用户名.github.io</span></span><br><span class="line"><span class="attr">root:</span> <span class="string">/</span></span><br><span class="line"><span class="attr">permalink:</span> <span class="string">posts/:abbrlink.html</span></span><br></pre></td></tr></table></figure><p>说明：</p><ul><li><code>url</code> 填写线上实际访问地址，结尾不带斜杠；</li><li><code>root</code> 在部署于根路径时为 <code>/</code>；</li><li><code>permalink</code> 建议使用 <code>abbrlink</code>，避免中文标题出现在 URL 中。中文会被编码为 <code>%E4%B8%AD%E6%96%87</code> 形式，既影响可读性，也可能在分享过程中被截断。</li></ul><p>修改后必须重新生成站点，原因见第九节。</p><hr><h2 id="五、robots-txt-配置">五、robots.txt 配置</h2><h3 id="5-1-现象">5.1 现象</h3><p>访问 <code>你的域名/robots.txt</code> 返回 404。</p><h3 id="5-2-成因">5.2 成因</h3><p>GitHub Pages 仅使用仓库中的构建产物。本地新增文件而未执行部署时，线上不存在该文件。</p><h3 id="5-3-配置方法">5.3 配置方法</h3><p>在 <code>source/</code> 目录下创建 <code>robots.txt</code>，生成时会原样复制到站点根目录：</p><figure class="highlight nix"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br></pre></td><td class="code"><pre><span class="line"><span class="params">User-agent:</span> <span class="operator">*</span></span><br><span class="line"><span class="params">Allow:</span> <span class="symbol">/</span></span><br><span class="line"></span><br><span class="line"><span class="comment"># 静态资源无需抓取，可节省抓取配额</span></span><br><span class="line"><span class="params">Disallow:</span> <span class="operator">/</span>js<span class="symbol">/</span></span><br><span class="line"><span class="params">Disallow:</span> <span class="operator">/</span>css<span class="symbol">/</span></span><br><span class="line"><span class="params">Disallow:</span> <span class="operator">/</span>live2d<span class="symbol">/</span></span><br><span class="line"><span class="params">Disallow:</span> <span class="symbol">/search.xml</span></span><br><span class="line"></span><br><span class="line"><span class="params">Sitemap:</span> https:<span class="operator">//</span>你的用户名.github.io<span class="symbol">/sitemap.xml</span></span><br><span class="line"><span class="params">Sitemap:</span> https:<span class="operator">//</span>你的用户名.github.io<span class="symbol">/baidusitemap.xml</span></span><br><span class="line"><span class="params">Sitemap:</span> https:<span class="operator">//</span>你的用户名.github.io<span class="operator">/</span>atom.xml</span><br></pre></td></tr></table></figure><p>注意事项：</p><ul><li><code>Disallow</code> 仅用于屏蔽静态资源目录，不应使用 <code>Disallow: /</code>，该写法会禁止全站抓取；</li><li><code>Sitemap:</code> 后的域名必须与线上域名一致，地址错误时爬虫会抓取到无效页面，影响比不配置更差。</li></ul><hr><h2 id="六、sitemap-的生成与校验">六、sitemap 的生成与校验</h2><p><code>sitemap.xml</code> 由插件生成，先确认插件已安装：</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">npm <span class="built_in">ls</span> hexo-generator-sitemap hexo-generator-baidu-sitemap</span><br></pre></td></tr></table></figure><p>安装后执行 <code>hexo generate</code>，打开 <code>public/sitemap.xml</code> 确认所有条目均为线上地址。校验应在部署前针对本地产物完成，可减少线上排查成本。</p><hr><h2 id="七、站长平台验证">七、站长平台验证</h2><h3 id="7-1-配置位置">7.1 配置位置</h3><p>在 <code>_config.butterfly.yml</code> 中填写各平台提供的验证码，由主题生成对应的 <code>&lt;meta&gt;</code> 标签：</p><figure class="highlight yaml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">site_verification:</span></span><br><span class="line">  <span class="attr">google:</span> <span class="string">你的验证码</span></span><br><span class="line">  <span class="attr">bing:</span> <span class="string">你的验证码</span></span><br><span class="line">  <span class="attr">baidu:</span> <span class="string">你的验证码</span></span><br></pre></td></tr></table></figure><h3 id="7-2-验证方式的选择">7.2 验证方式的选择</h3><p><code>用户名.github.io</code> 属于二级域名，其 CNAME 记录由 GitHub 管理，因此无法使用 CNAME 文件验证方式。应改用 HTML 元标签验证，或在支持该方式的平台使用 XML 文件验证。</p><hr><h2 id="八、验证失败的常见原因：CDN-缓存">八、验证失败的常见原因：CDN 缓存</h2><p>现象：验证码核对无误，站长平台仍提示「验证密钥错误」。</p><p>原因：GitHub Pages 前置了 CDN，缓存时间为 <code>max-age=600</code>，即 10 分钟。源站更新后，爬虫在缓存有效期内仍会读取旧页面，而旧页面中不含验证标签。</p><p>处理步骤：</p><ol><li>使用无痕窗口访问线上页面，查看页面源代码，确认 <code>&lt;meta name=&quot;...verification&quot;...&gt;</code> 是否已存在；</li><li>确认存在后等待约 10 分钟，重新执行验证；</li><li>或改用 XML 文件验证，该方式不依赖页面缓存。</li></ol><p>由此可得一条通用结论：<strong>部署完成不等于线上生效，中间存在缓存延迟。</strong></p><hr><h2 id="九、本地与线上不一致：服务的热加载规则">九、本地与线上不一致：服务的热加载规则</h2><h3 id="9-1-现象">9.1 现象</h3><p>修改配置后本地预览正常，线上无变化；或页面内容已更新，但配套脚本未更新。</p><h3 id="9-2-成因">9.2 成因</h3><p><code>hexo server</code> 在启动时将配置文件与主题目录读取至内存，运行期间修改这些文件不会被重新加载。</p><h3 id="9-3-处理规则">9.3 处理规则</h3><table><thead><tr><th>修改内容</th><th>本地预览</th><th>是否需要重启 <code>hexo server</code></th></tr></thead><tbody><tr><td><code>source/</code> 下的文章与页面</td><td>刷新即可生效</td><td>否</td></tr><tr><td><code>_config.yml</code>、<code>_config.butterfly.yml</code></td><td>不生效</td><td>是</td></tr><tr><td><code>themes/</code> 下的模板与样式</td><td>不生效</td><td>是</td></tr></tbody></table><hr><h2 id="十、操作流程与校验清单">十、操作流程与校验清单</h2><h3 id="10-1-完整流程">10.1 完整流程</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># 1. 修改 _config.yml（url / root / permalink）</span></span><br><span class="line"><span class="comment"># 2. 在 source/ 下创建 robots.txt</span></span><br><span class="line"><span class="comment"># 3. 配置 _config.butterfly.yml 的 site_verification</span></span><br><span class="line"><span class="comment"># 4. 清理并重新生成</span></span><br><span class="line">hexo clean &amp;&amp; hexo g</span><br><span class="line"><span class="comment"># 5. 按 10.2 校验本地产物</span></span><br><span class="line"><span class="comment"># 6. 部署</span></span><br><span class="line">hexo d</span><br></pre></td></tr></table></figure><p><code>hexo clean</code> 用于删除 <code>public/</code> 与 <code>db.json</code>，避免上一次构建的产物（含旧域名链接）被一并部署。</p><h3 id="10-2-部署前校验清单">10.2 部署前校验清单</h3><table><thead><tr><th>校验项</th><th>校验方式</th><th>通过标准</th></tr></thead><tbody><tr><td><code>public/sitemap.xml</code></td><td>直接打开</td><td>全部为线上地址</td></tr><tr><td><code>public/robots.txt</code></td><td>直接打开</td><td>含正确的 <code>Sitemap:</code> 地址</td></tr><tr><td>页面规范地址</td><td>打开任一文章 HTML，检索 <code>canonical</code></td><td>指向线上地址</td></tr><tr><td>站长验证标签</td><td>打开 <code>public/index.html</code>，检索 <code>verification</code></td><td>存在对应 <code>&lt;meta&gt;</code></td></tr></tbody></table><h3 id="10-3-部署后校验清单">10.3 部署后校验清单</h3><table><thead><tr><th>校验项</th><th>校验方式</th><th>通过标准</th></tr></thead><tbody><tr><td><code>域名/robots.txt</code></td><td>浏览器访问</td><td>返回内容而非 404</td></tr><tr><td><code>域名/sitemap.xml</code></td><td>浏览器访问</td><td>全部为线上地址</td></tr><tr><td>站长平台</td><td>提交 sitemap</td><td>平台接受并开始抓取</td></tr></tbody></table><hr><h2 id="十一、补充说明：github-io-的收录局限">十一、补充说明：<a href="http://github.io">github.io</a> 的收录局限</h2><p><code>用户名.github.io</code> 属于二级域名，且不在国内备案。百度等中文搜索引擎对此类站点的抓取与收录量明显低于自有域名。</p><p>该问题无法通过配置调整解决。若站点主要面向中文搜索引擎，需要绑定自有域名并完成备案。</p><hr><h2 id="十二、小结">十二、小结</h2><ol><li>站点的绝对地址由 <code>_config.yml</code> 中的 <code>url</code> 与 <code>root</code> 决定，配置错误会使 sitemap、canonical、og:url 同时失准；</li><li>本地新增的文件必须部署后才会出现在线上；</li><li>GitHub Pages 的前置 CDN 存在约 10 分钟的缓存延迟；</li><li><code>hexo server</code> 对配置与主题文件不做热加载，修改后需要重启。</li></ol><p>以上四项均非技术难题，而是排查时容易忽略的检查点。</p><hr><h2 id="参考来源">参考来源</h2><ul><li><a href="https://hexo.io/zh-cn/docs/configuration">Hexo 文档 · 配置（url / root / permalink）</a></li><li><a href="https://github.com/hexojs/hexo-generator-sitemap">hexo-generator-sitemap（GitHub）</a></li><li><a href="https://developers.google.com/search/docs/crawling-indexing/consolidate-duplicate-urls">Google 搜索中心 · 规范化网址（canonical）</a></li><li><a href="https://developers.google.com/search/docs/crawling-indexing/robots/intro">Google 搜索中心 · robots.txt 简介</a></li><li><a href="https://support.google.com/webmasters/answer/9008080">Google Search Console 帮助 · 验证网站所有权</a></li><li><a href="https://www.bing.com/webmasters">Bing Webmaster Tools</a></li><li><a href="https://docs.github.com/zh/pages">GitHub Pages 文档</a></li></ul>]]></content>
    
    
      
      
    <summary type="html">&lt;h1 id=&quot;Hexo-博客-SEO-配置与收录排查教程&quot;&gt;Hexo 博客 SEO 配置与收录排查教程&lt;/h1&gt;
&lt;p&gt;本文说明 Hexo 站点无法被搜索引擎收录的常见成因，并给出可复现的排查与修复步骤。文中配置以 Butterfly 主题为例，其他主题的原理相同。&lt;/p&gt;
&lt;</summary>
      
    
    
    
    <category term="技术学习" scheme="https://zhaogb612.github.io/categories/%E6%8A%80%E6%9C%AF%E5%AD%A6%E4%B9%A0/"/>
    
    
    <category term="技术学习" scheme="https://zhaogb612.github.io/tags/%E6%8A%80%E6%9C%AF%E5%AD%A6%E4%B9%A0/"/>
    
    <category term="Hexo" scheme="https://zhaogb612.github.io/tags/Hexo/"/>
    
    <category term="SEO" scheme="https://zhaogb612.github.io/tags/SEO/"/>
    
  </entry>
  
  <entry>
    <title>杀毒软件运行原理与病毒拦截</title>
    <link href="https://zhaogb612.github.io/posts/e9f2a7c4.html"/>
    <id>https://zhaogb612.github.io/posts/e9f2a7c4.html</id>
    <published>2026-10-06T13:00:00.000Z</published>
    <updated>2026-10-06T15:58:00.000Z</updated>
    
    <content type="html"><![CDATA[<h1 id="杀毒软件运行原理与病毒拦截">杀毒软件运行原理与病毒拦截</h1><p>双击一个来路不明的 exe 之前，心里总要先默念一句「应该没事吧」……然后杀毒软件默默把这份心虚接了过去 (～￣▽￣)～</p><p>它到底在后台忙什么？又凭什么认出病毒？这篇用尽量短的篇幅，讲清从<strong>运行机制</strong>到<strong>病毒拦截</strong>的全过程。</p><hr><h2 id="一、杀毒软件是怎么运行的">一、杀毒软件是怎么运行的</h2><h3 id="1-1-常驻内存">1.1 常驻内存</h3><p>杀毒软件通常以<strong>系统服务</strong>身份开机自启，并加载一个<strong>文件系统过滤驱动</strong>（Windows 上多为 <code>minifilter</code>），把守在系统与磁盘之间——文件的读写、创建、执行，都得先过它这一关。</p><h3 id="1-2-三种工作模式">1.2 三种工作模式</h3><table><thead><tr><th>模式</th><th>触发时机</th><th>作用</th></tr></thead><tbody><tr><td><strong>实时监控</strong></td><td>文件被创建 / 写入 / 执行时</td><td>即时拦截，第一道防线</td></tr><tr><td><strong>定时扫描</strong></td><td>按计划（如每周）</td><td>全盘清查漏网之鱼</td></tr><tr><td><strong>手动扫描</strong></td><td>用户主动点击</td><td>定向查杀指定目录</td></tr></tbody></table><h3 id="1-3-引擎的组成">1.3 引擎的组成</h3><p>一套完整的杀毒引擎，往往是下面几种机制的叠加：</p><ul><li><strong>特征库</strong>：已知病毒的「指纹」，命中即报毒；</li><li><strong>启发式引擎</strong>：判断文件「像不像」病毒；</li><li><strong>行为监控（HIPS）</strong>：等程序真正动手作恶时再拦；</li><li><strong>云查杀</strong>：本地拿不准的，上传哈希问云端。</li></ul><hr><h2 id="二、凭什么认出病毒">二、凭什么认出病毒</h2><h3 id="2-1-特征码匹配">2.1 特征码匹配</h3><p>最经典也最快的方式：引擎在文件中搜索与特征库一致的<strong>字节序列</strong>，命中就判定为病毒。优点是快、准；缺点是只会「认脸」，病毒改一个字节就可能骗过去。</p><h3 id="2-2-启发式分析">2.2 启发式分析</h3><p>特征库认不出时，引擎转而分析文件的<strong>结构特征</strong>：是否要写启动项、是否自解压、是否调用了可疑 API。像不像，三分样——可疑就先盯上。</p><h3 id="2-3-行为监控与沙箱">2.3 行为监控与沙箱</h3><ul><li><strong>行为监控</strong>：不看长相，只看动作。大批加密文件、注入其他进程、偷偷开机自启，一律算高危；</li><li><strong>沙箱</strong>：把可疑程序丢进隔离环境跑一遍，看它究竟想干什么，再决定是否放行。</li></ul><hr><h2 id="三、遇到病毒，它是怎么拦的">三、遇到病毒，它是怎么拦的</h2><p>拦截本质上是一条<strong>流水线</strong>，病毒每走一步都可能被截停：</p><table><thead><tr><th>环节</th><th>拦截点</th><th>处理方式</th></tr></thead><tbody><tr><td>落盘</td><td>文件被写入磁盘</td><td>直接删除 / 隔离</td></tr><tr><td>执行</td><td>进程被创建</td><td>阻止运行并弹窗</td></tr><tr><td>驻留</td><td>写启动项 / 计划任务 / 服务</td><td>拒绝写入并回滚</td></tr><tr><td>联网</td><td>连接远程控制服务器</td><td>阻断连接</td></tr><tr><td>破坏</td><td>加密文件 / 篡改系统设置</td><td>挂起并强制结束进程</td></tr></tbody></table><p>常见的三种处置结果：</p><ul><li><strong>隔离</strong>：把文件加密挪进专用目录，无害化保存；</li><li><strong>清除</strong>：在染毒文件中剥离恶意代码，保留可用部分；</li><li><strong>删除</strong>：最干脆，也最省事。</li></ul><blockquote><p>小剧场——病毒：(๑•̀ㅂ•́)و✧ 我进来了！杀软：(´；ω；`) 不，你没有。</p></blockquote><hr><h2 id="四、弹窗广告、捆绑软件与流氓软件">四、弹窗广告、捆绑软件与流氓软件</h2><p>严格说，这些算不上「病毒」，却常年盘踞在灰色地带。更麻烦的是——<strong>它们常常是病毒进入系统的跳板</strong>。</p><table><thead><tr><th>类型</th><th>典型表现</th><th>为什么难缠</th></tr></thead><tbody><tr><td><strong>弹窗广告</strong></td><td>桌面、锁屏、浏览器反复弹推广，甚至驱动级弹窗</td><td>常由带正规签名的「推广组件」下发，杀软难直接定性</td></tr><tr><td><strong>捆绑安装</strong></td><td>装 A 时默认勾选 B、C、D，静默安装并开机自启</td><td>用户在「下一步」里一路放行，等于主动授权</td></tr><tr><td><strong>流氓行为</strong></td><td>改主页、劫持搜索、锁浏览器、拒绝卸载</td><td>组件互相守护，卸掉一个，另一个把它装回来</td></tr><tr><td><strong>浏览器劫持</strong></td><td>主页 / 搜索引擎被改、跳中间页、加推广参数</td><td>藏在计划任务与服务里，删了还会重建</td></tr></tbody></table><p>杀软把这类程序归为 <strong>PUP（潜在不受欢迎程序）</strong>。「讨厌」和「有害」之间没有硬标准，误杀风险高，因此不少杀软只提示、不处理；也有像火绒这样，把「拦弹窗、拦流氓」当作看家本领的。</p><p>它们的危害远不止烦人：占资源、拖慢开机、泄露浏览习惯，还经常顺手塞给你一个木马——<strong>你以为装的是输入法，其实装的是入口</strong> (；´д｀)</p><hr><h2 id="五、病毒进了系统，到底在干什么">五、病毒进了系统，到底在干什么</h2><p>弄清楚「行为」，才能理解杀软为什么死盯着那些动作。常见的恶意行为大致这么几类：</p><table><thead><tr><th>行为类型</th><th>目的</th><th>典型迹象</th></tr></thead><tbody><tr><td><strong>持久化</strong></td><td>开机复活，删了还在</td><td>写入启动项、计划任务、服务、驱动</td></tr><tr><td><strong>信息窃取</strong></td><td>偷账号、密码、Cookie、聊天记录</td><td>读取浏览器数据库、记录键盘、监听剪贴板</td></tr><tr><td><strong>远程控制（RAT）</strong></td><td>给攻击者留一扇随时能进的后门</td><td>异常外联，可被远程投屏、传文件、执行命令</td></tr><tr><td><strong>勒索加密</strong></td><td>批量加密文件后索要赎金</td><td>大量文件后缀被改、弹出勒索说明</td></tr><tr><td><strong>挖矿</strong></td><td>用你的电费和硬件替别人赚钱</td><td>CPU / GPU 长期满载、风扇狂转、异常卡顿</td></tr><tr><td><strong>下载器 / 投放器</strong></td><td>先落一个「干净的小程序」，再拉真正的毒</td><td>程序很小，运行后才联网取 payload</td></tr><tr><td><strong>横向传播</strong></td><td>从一台机器扩散到整个内网</td><td>内网扫描、弱口令爆破、感染 U 盘与共享目录</td></tr><tr><td><strong>对抗分析</strong></td><td>让杀软和沙箱「看不见」</td><td>检测虚拟机 / 调试器，发现被围观就休眠</td></tr></tbody></table><p>留意最后一条：<strong>现代病毒的核心竞争力，早已不是「破坏力」，而是「不被发现」</strong>。这就引出了下一个问题。</p><hr><h2 id="六、针对性「免杀」：为什么有些病毒专挑杀软下手">六、针对性「免杀」：为什么有些病毒专挑杀软下手</h2><p>很多人有个误解：「我这台装了某款杀软，扫过没毒，那就没事。」——未必。</p><p><strong>不同杀软的引擎、特征库、行为规则各不相同</strong>，攻击者手里往往同时装着好几款杀软，把样本逐个丢进去测，一直改到「全都不报」为止。这种针对特定杀软做的定向优化，就是<strong>免杀（Evasion）</strong>。</p><p>常见的免杀手法：</p><ul><li><strong>特征码定位与改写</strong>：定位文件里被杀软标记的那段字节，替换成等价指令、打乱顺序——「脸」一变，「认脸」就失效；</li><li><strong>加壳 / 混淆 / 加密</strong>：把真实代码藏起来，运行时才解密执行，静态扫描只看得到一团乱码；</li><li><strong>白利用</strong>：借带正规数字签名的程序去加载恶意代码，披着合法外衣过关；</li><li><strong>驱动对抗</strong>：加载自己的内核驱动，反过来结束杀软进程、摘掉监控、关闭回调；</li><li><strong>环境探测</strong>：检测沙箱、虚拟机、调试器，一旦发现「被围观」就装死，等你放松警惕再发作；</li><li><strong>云查杀对抗</strong>：断网运行、随机化文件哈希与域名、延时触发，让云端来不及收录；</li><li><strong>专杀对抗</strong>：实时盯着杀软进程，一旦被盯上就自我清除或变异重生。</li></ul><p><strong>银狐木马</strong>是国内很有代表性的一类：它以伪造安装包、钓鱼链接、捆绑下载为入口，专门针对国产杀软做免杀与对抗，常被用于盗号、诈骗和打内网。它的存在恰恰说明一件事——<strong>「某款杀软扫不出来」，不等于这个文件就干净</strong>。</p><p>所以，别把「扫不出毒」当成安全证明，那只是「暂时没被认出来」。免杀与反免杀本就是一场长期的猫鼠游戏，指望任何一款杀软做到 100%，都不现实。</p><p>除了免杀，拦不住还有别的原因：<strong>零日漏洞</strong>（利用未公开漏洞，行为还没进黑名单）、<strong>用户自己关掉防护</strong>（为省性能把门敞开）。这些叠加起来，再强的杀软也有力竭的时候。</p><blockquote><p>额外提醒：网上打着「银狐专杀」「勒索解密工具」名号的东西，不少本身就是二次投毒——<strong>认准官方渠道，别从网盘、群文件里下所谓的专杀</strong>。</p></blockquote><hr><h2 id="七、当「官网」也会骗你：仿冒下载站与捆绑投毒">七、当「官网」也会骗你：仿冒下载站与捆绑投毒</h2><p>前面讲的免杀与对抗，落到国内最常见的入口，就是<strong>仿冒官网</strong>。近两年针对国内用户的规模化攻击，几乎都走这条路：搜一个软件名，点进一个长得像官网的页面，下载一个「看起来正常」的安装包——毒就这么进来了。</p><h3 id="7-1-一条完整的攻击链">7.1 一条完整的攻击链</h3><p>国家互联网应急中心（CNCERT）在 2026 年的多份风险提示中，把这条链路概括为：<strong>网络钓鱼 → 木马下载 → 进程注入 → 远控控制</strong>。拆开大致四步：</p><ol><li><strong>批量搭站</strong>：用 AI 快速生成高仿真页面，仿冒 WPS、Chrome、钉钉、飞书、向日葵等「高频刚需」软件。CNCERT 对 2026 年 2 月至 5 月注册的 439 个钓鱼域名分析发现，仅 WPS 与 Chrome 就占了 77.4%。</li><li><strong>抢搜索排名</strong>：通过黑帽 SEO 与关键词竞价，把假站顶到搜索结果首页。有的页面还会检查 <code>referer</code> 请求头——只对来自搜索引擎的访问显示正常内容，直接输入域名则跳转别处，专门躲避逆向分析。</li><li><strong>多层跳转投递</strong>：下载链接经多次跳转，最终落到境外云存储或对象存储桶；同名压缩包<strong>按次打包、哈希各不相同</strong>，让特征库永远慢半拍。</li><li><strong>安装即投毒</strong>：这是最要命的一点——安装包会<strong>真的把正版软件装上</strong>，让你「用完没事」，同时在后台悄悄执行恶意行为。</li></ol><h3 id="7-2-它到底是怎么「藏」的">7.2 它到底是怎么「藏」的</h3><p>以被仿冒最多的 Chrome 安装包为例，公开的样本分析披露了层层递进的手法：</p><ul><li><strong>白加黑（DLL 侧加载）</strong>：用带签名的正规程序去加载恶意 DLL——签名是真的，逻辑是坏的；</li><li><strong>进程注入</strong>：把 shellcode 注入 <code>ctfmon.exe</code>、<code>sihost.exe</code>、<code>svchost.exe</code> 等系统关键进程，<strong>连外联 C2 的流量都挂在系统进程名下</strong>，行为监控很难仅凭进程名定性；</li><li><strong>反杀软与持久化</strong>：写入 Windows Defender 的排除项、篡改 <code>hosts</code> 阻断安全软件站点、注册计划任务，甚至用带漏洞的合法驱动（BYOVD）结束或致盲 360、火绒、腾讯电脑管家等进程；</li><li><strong>环境感知</strong>：检测到沙箱、虚拟机、调试环境就静默退出，让动态分析也抓不到把柄。</li></ul><h3 id="7-3-专业性评判：它为什么这么难防">7.3 专业性评判：它为什么这么难防</h3><p>结合公开报告，能清楚看到这类攻击的「工业化」特征：</p><ul><li><strong>成本极低、变种极快</strong>：CNCERT 与安天联合发布的报告显示，「游蛇」（银狐）团伙用搜索引擎推广伪造 Chrome 下载站，<strong>每日上线的境内受控主机（按 IP 计）一度超过 1.7 万</strong>；</li><li><strong>用数据做运营</strong>：钓鱼页面挂第三方流量统计，按不同 ID 区分仿冒主题，用来核算投入产出比、优化投放——这已不是散兵游勇，而是<strong>有 KPI 的黑产</strong>；</li><li><strong>目标在升级</strong>：CNCERT 与天融信 2026 年 9 月的报告指出，「甲蚁（G01）」团伙已从大众软件转向 FinalShell、Xshell、SecureCRT 等<strong>开发运维工具</strong>——因为这类用户手里握着更高价值的主机权限；</li><li><strong>主流威胁占比</strong>：据新华网援引瑞星《2025 年中国网络安全报告》，木马以 <strong>73.35%</strong> 的占比成为第一大威胁，而银狐仿冒最多的正是 WPS、搜狗输入法这类「装机必备」。</li></ul><p>一句话总结：<strong>「域名像官网」和「安装界面像正版」都不构成安全证明</strong>。真正的信任锚点只有一个——<strong>数字签名</strong>。</p><h3 id="7-4-防这条链，记住四件事">7.4 防这条链，记住四件事</h3><ol><li><strong>别从搜索广告位下载</strong>：把官网加进收藏，认准域名，警惕形似字、多横杠、错拼的地址；</li><li><strong>装前查签名</strong>：右键安装包 →「属性」→「数字签名」，核对签发者是否与官网一致；签名异常或没有签名，就别装；</li><li><strong>下载只走官方渠道</strong>：软件官网、应用商店、学校 / 单位的正版平台，群文件与网盘里的「内部版」一律不碰；</li><li><strong>拿不准就送检</strong>：可疑文件先上传国家计算机病毒协同分析平台（<a href="http://virus.cverc.org.cn">virus.cverc.org.cn</a>）或 VirusTotal 做多引擎比对，别拿真机去试。</li></ol><blockquote><p>顺带一提：这类页面里最像「官方」的那些，往往连备案信息、域名年限都经不起细看——花十秒核对一下，能躲掉九成的坑。</p></blockquote><hr><h2 id="八、怎么判断自己是不是中招了">八、怎么判断自己是不是中招了</h2><p>杀软没报警，不等于万事大吉。学会自己「望闻问切」，比什么都靠谱。</p><h3 id="8-1-这些异常信号值得警惕">8.1 这些异常信号值得警惕</h3><ul><li><strong>资源异常</strong>：没开什么程序，CPU / 风扇却长期满载、机器发烫卡顿——多半在挖矿；</li><li><strong>网络异常</strong>：后台持续外联、上传流量莫名很大、DNS 被悄悄改掉；</li><li><strong>浏览器异常</strong>：主页 / 搜索引擎被换、广告乱弹、搜索结果跳中间页；</li><li><strong>账号异常</strong>：出现异地登录，好友收到你发出的奇怪链接或消息；</li><li><strong>文件异常</strong>：冒出陌生文件、文档被改后缀打不开、出现勒索说明；</li><li><strong>杀软异常</strong>：防护无故变灰、被强制退出或卸载，任务管理器打不开，组策略 / 注册表被锁；</li><li><strong>陌生常驻</strong>：进程列表、启动项、计划任务、服务里出现从没见过的条目。</li></ul><h3 id="8-2-银狐木马爱留下的痕迹">8.2 银狐木马爱留下的痕迹</h3><p>银狐这类远控木马，几处表现比较典型：</p><ul><li><strong>入口伪装</strong>：常伪装成「XX 助手 / XX 优化 / 税务财务 / 企业通知」等安装包，或仿冒办公软件官网，经钓鱼链接、群文件、网盘传播；</li><li><strong>偷装远控</strong>：落地后常悄悄装上 TeamViewer、向日葵、AnyDesk 这类远程控制软件；</li><li><strong>对抗杀软</strong>：主动结束国产杀软进程、关掉防护，或让自己「扫不出来」；</li><li><strong>白加黑</strong>：用带签名的正规程序加载恶意模块，进程名伪装成系统程序；</li><li><strong>重点目标</strong>：企业财务、HR、管理岗是高发人群。</li></ul><h3 id="8-3-一张自查清单">8.3 一张自查清单</h3><ol><li><strong>看进程</strong>：任务管理器里找陌生进程，重点盯异常占用 CPU / 网络的；</li><li><strong>查自启</strong>：启动项、任务计划程序、服务里排查陌生条目；</li><li><strong>看网络</strong>：用资源监视器或 <code>netstat -ano</code> 找异常外联；</li><li><strong>查软件</strong>：已安装列表里有没有莫名的远控 / 代理类程序；</li><li><strong>交叉验证</strong>：用 Process Explorer、Autoruns、火绒剑等工具深挖，可疑文件丢 VirusTotal 做多引擎比对；</li><li><strong>拿不准</strong>：断网 → 进安全模式 → 全盘查杀；</li><li><strong>中得太深</strong>：若存在驱动对抗、杀软反复被干掉，格式化重装才是最干净的选择（先备份重要数据）。</li></ol><blockquote><p>提醒：VirusTotal 会把样本共享给厂商，涉及隐私或公司机密的文件别随便上传；而「杀软扫不出来」从来不等于「没中招」，要结合行为一起判断。</p></blockquote><h3 id="8-4-万一已经中招">8.4 万一已经中招</h3><ul><li>第一时间<strong>断网</strong>，切断攻击者的远控通道；</li><li>改掉重要账号密码（邮箱、网银、社交），并开启两步验证；</li><li>通知常联系人，谨防骗子冒用你的身份行骗；</li><li>别急着在原系统上登录网银或输入密码，先清干净再说。</li></ul><hr><h2 id="九、主流杀毒软件横向对比">九、主流杀毒软件横向对比</h2><p>原理讲完，落到选择上。下面这份对比只看「实际用起来」的几个维度，不含任何充值排名：</p><table><thead><tr><th>软件</th><th>阵营</th><th>优势</th><th>短板</th><th>适合谁</th></tr></thead><tbody><tr><td><strong>Microsoft Defender</strong></td><td>系统自带（免费）</td><td>与 Windows 深度集成、零广告、免安装，基础查杀够用</td><td>对国产流氓软件、捆绑弹窗的拦截偏弱，缺少本地化主动防御</td><td>不折腾、只求基础防护</td></tr><tr><td><strong>火绒安全</strong></td><td>国产（个人免费）</td><td>轻量安静、无广告无捆绑、拦弹窗与流氓软件强，HIPS 规则可自定义</td><td>病毒库与云查杀规模不如国际大厂，对新式勒索、高级威胁略弱</td><td>讨厌弹窗、追求清爽的国内用户</td></tr><tr><td><strong>卡巴斯基</strong></td><td>国际老牌（付费为主）</td><td>检测率高、行为拦截强、杀勒索经验丰富，第三方评测常年第一梯队</td><td>占用偏大，对国内特色流氓软件偶有水土不服，付费，另有地缘合规争议</td><td>看重检测率、愿为它付费</td></tr><tr><td><strong>Bitdefender</strong></td><td>国际（付费）</td><td>机器学习引擎强、防护全面、占用控制不错，评测常年高分</td><td>界面偏英文，付费，本地化一般</td><td>看重国际评测成绩</td></tr><tr><td><strong>ESET NOD32</strong></td><td>国际（付费）</td><td>极轻量、扫描快、误报低，对老机器友好</td><td>HIPS 配置门槛高，付费</td><td>老机器 / 追求低占用</td></tr><tr><td><strong>360 安全卫士</strong></td><td>国产（免费）</td><td>功能全（查杀 + 清理 + 加速），对国内木马响应快、云查杀强</td><td>广告弹窗多、爱捆绑安装、全家桶、隐私争议</td><td>能忍受广告、想要一站式工具</td></tr><tr><td><strong>腾讯电脑管家</strong></td><td>国产（免费）</td><td>免费、界面友好，与腾讯生态联动</td><td>推广较多、功能繁杂，纯查杀能力一般</td><td>腾讯生态重度用户</td></tr></tbody></table><p>几点选型建议：</p><ul><li><strong>只想「有就行」</strong>：Defender 加良好习惯，对大多数人是及格线；</li><li><strong>要清爽又要国产适配</strong>：火绒是性价比之选，安静得像不存在；</li><li><strong>要极致查杀</strong>：卡巴斯基 / Bitdefender / ESET，按占用与预算挑一个；</li><li><strong>别为「功能全」而装全家桶</strong>：工具越杂，系统越慢，隐私越少。</li></ul><blockquote><p>提醒：AV-TEST、AV-Comparatives 这类第三方评测成绩会随版本频繁变动，看最新实测即可，别迷信任何一次排名，也别信「付费刷榜」的宣传。</p></blockquote><hr><h2 id="十、使用杀毒软件时要注意什么">十、使用杀毒软件时要注意什么</h2><p>选好了杀软，还得会用。下面分三个阶段说。</p><h3 id="10-1-安装与更换">10.1 安装与更换</h3><ul><li><strong>只装一款</strong>：两款杀软抢同一层底层驱动，轻则卡顿蓝屏，重则互相查杀、防护全废；</li><li><strong>换杀软要换干净</strong>：先彻底卸载旧的（含残留驱动），重启后再装新的，别「叠罗汉」；</li><li><strong>只从官方渠道下载</strong>：破解版、绿色版、网盘「优化版」一概不碰，假杀软本身就是病毒；</li><li><strong>留意冲突</strong>：游戏反作弊、虚拟机 / 安卓模拟器、Hyper-V / WSL 等可能与实时防护打架，报错时对症加白名单，而不是直接关防护。</li></ul><h3 id="10-2-日常使用">10.2 日常使用</h3><ul><li><strong>别随手退出</strong>：为了「让某个程序跑起来」而关掉实时防护，等于把门敞开；</li><li><strong>保持更新</strong>：引擎和特征库都要最新，长期离线等于拿旧地图找新路；</li><li><strong>重点盯防下载目录、U 盘、邮件附件</strong>：病毒最爱的落地点；</li><li><strong>定期全盘扫描</strong>：实时监控会漏，隔段时间做一次彻底清查。</li></ul><h3 id="10-3-报毒之后">10.3 报毒之后</h3><ul><li><strong>先看来源</strong>：看清报毒的文件路径与进程来源，判断是真毒还是误报；</li><li><strong>优先隔离，别急着删</strong>：隔离可恢复，删错了就找不回，确认无误后再清除；</li><li><strong>加白名单要谨慎</strong>：放行一次往往就是永久放行，别为省事整盘信任；</li><li><strong>善用日志</strong>：处理不了就查隔离区与拦截日志、向厂商上报，别自己硬删注册表瞎折腾。</li></ul><hr><h2 id="十一、给用户的几条告诫">十一、给用户的几条告诫</h2><ol><li><strong>别「裸奔」</strong>——现代木马、勒索、挖矿不挑人，不上奇怪网站不代表不会中招；</li><li><strong>来路不明的一律不跑</strong>——尤其是破解补丁、外挂、各类「激活工具」，以及群文件里的安装包；</li><li><strong>别乱点「允许 / 信任」</strong>——报毒时先看清它在拦什么，白名单一放行，拦截就形同虚设；</li><li><strong>警惕假弹窗诈骗</strong>——网页突然弹「你的电脑已中毒，请拨打电话 / 下载专杀」，一律关掉，那是钓鱼；</li><li><strong>别长期关闭实时防护</strong>——为省一点性能关掉监控，代价可能是整台电脑；</li><li><strong>免费的也不免费</strong>——无广告的杀软要么靠付费，要么拿你的数据 / 广告位交换，选之前想清楚；</li><li><strong>保持更新</strong>——特征库与系统补丁都要打，漏洞不补，再好的杀软也白搭；</li><li><strong>备份才是底线</strong>——杀软做不到 100%，勒索加密前不一定拦得住，定期备份比任何查杀都保命 (๑•̀ㅂ•́)و✧</li></ol><hr><h2 id="十二、总结">十二、总结</h2><p>杀毒软件的逻辑并不神秘：<strong>特征库认老朋友，启发式猜新面孔，行为监控盯手脚，云查杀兜底</strong>。病毒想进来，就得逐一闯过落盘、执行、驻留、联网这几道关。</p><p>可对手也在进化：会免杀、会对抗、会伪造官网、会捆绑投毒，会挑软柿子捏，中间还夹着满地走的流氓软件与弹窗广告。杀软能做的，是把风险压到更低，而不是清零。</p><p>所以，除了装一款靠谱的杀软，你还需要一点判断力：会核对域名与签名，会看异常信号，会自查痕迹，会正确处理报毒。它拦得住大多数「笨贼」，却拦不住你亲手把门打开——最好的安全措施，永远是那个不随便双击的你 (๑•̀ㅂ•́)و✧</p><hr><h2 id="参考来源">参考来源</h2><ul><li><a href="https://www.cert.org.cn/publish/main/10/2026/20260522113326926111046/20260522113326926111046_.html">关于黑产团伙批量搭建高仿真钓鱼网站大规模传播银狐木马的风险提示（CNCERT，2026-05-22）</a></li><li><a href="https://www.cert.org.cn/publish/main/upload/File/Colubrid%20Black%20Market%20New.pdf">关于「游蛇」黑产攻击活动的风险提示（CNCERT 与安天）</a></li><li><a href="https://www.secrss.com/articles/94370">关于「银狐」木马「甲蚁（G01）」团伙攻击态势深入分析报告（CNCERT 与天融信，2026-09-29）</a></li><li><a href="https://news.cctv.com/2026/05/21/ARTIy7dnY6zSuPreHPSHiqLZ260521.shtml">关于针对我国用户的「银狐」系列木马病毒攻击活动的预警报告（国家计算机病毒应急处理中心 / 央视网，2026-05-21）</a></li><li><a href="https://news.cctv.cn/2025/04/25/ARTImRQthoBuCLhaQxRyYKZL250425.shtml">远程控制、窃密、挖矿！我国境内捕获「银狐」木马病毒变种（央视网，2025-04-25）</a></li><li><a href="http://www.xinhuanet.com/politics/20260328/af11a700d9f5487494be498623140346/c.html">那些悄悄「上位」的链接（国家安全部 / 新华网，2026-03-28）</a></li><li><a href="https://www.news.cn/tech/20260206/a2f7a6ad626e44eeabea737bdf24c73d/c.html">瑞星发布报告：网络安全呈现智能化、隐蔽化和全局化新特征（新华网，2026-02-06）</a></li><li><a href="https://m.gmw.cn/2026-06/16/content_1304498009.htm">新型「银狐」木马病毒犯罪气焰嚣张，多地警方重拳出击（光明网，2026-06-16）</a></li></ul>]]></content>
    
    
      
      
    <summary type="html">&lt;h1 id=&quot;杀毒软件运行原理与病毒拦截&quot;&gt;杀毒软件运行原理与病毒拦截&lt;/h1&gt;
&lt;p&gt;双击一个来路不明的 exe 之前，心里总要先默念一句「应该没事吧」……然后杀毒软件默默把这份心虚接了过去 (～￣▽￣)～&lt;/p&gt;
&lt;p&gt;它到底在后台忙什么？又凭什么认出病毒？这篇用尽量短的篇</summary>
      
    
    
    
    <category term="技术学习" scheme="https://zhaogb612.github.io/categories/%E6%8A%80%E6%9C%AF%E5%AD%A6%E4%B9%A0/"/>
    
    
    <category term="杀毒软件" scheme="https://zhaogb612.github.io/tags/%E6%9D%80%E6%AF%92%E8%BD%AF%E4%BB%B6/"/>
    
    <category term="安全防护" scheme="https://zhaogb612.github.io/tags/%E5%AE%89%E5%85%A8%E9%98%B2%E6%8A%A4/"/>
    
  </entry>
  
  <entry>
    <title>终末地画廊下载器</title>
    <link href="https://zhaogb612.github.io/posts/a8b1c2d3.html"/>
    <id>https://zhaogb612.github.io/posts/a8b1c2d3.html</id>
    <published>2026-08-15T14:00:00.000Z</published>
    <updated>2026-08-15T14:00:00.000Z</updated>
    
    <content type="html"><![CDATA[<h1 id="终末地画廊下载器">终末地画廊下载器</h1><p>逛终末地画廊的时候想批量扒图，但一张张右键保存实在太累了 (´；ω；`)</p><p>于是就有了这款<strong>终末地画廊下载器</strong>——基于 PySide6 打造，蓝白配色、方形简洁风格，专为站内图片资源批量爬取而生。</p><blockquote><p><strong>下载地址</strong>：<a href="https://pan.huang1111.cn/s/y5MLGU6">点我下载</a> 提取密码：<code>2026</code>（打包好的单文件，双击即用。）</p></blockquote><hr><h2 id="一、核心功能">一、核心功能</h2><table><thead><tr><th>功能</th><th>说明</th></tr></thead><tbody><tr><td><strong>URL 爬取</strong></td><td>输入目标页面地址，自动解析页面中所有图片资源</td></tr><tr><td><strong>图片预览</strong></td><td>点击列表项即可在右侧实时预览大图</td></tr><tr><td><strong>批量下载</strong></td><td>多线程并发下载，支持全选/反选/清空</td></tr><tr><td><strong>MacOS 风格标题栏</strong></td><td>红黄圆形关闭/最小化按钮，右侧布局</td></tr><tr><td><strong>自定义下载目录</strong></td><td>默认系统下载目录，可自由指定</td></tr><tr><td><strong>操作日志</strong></td><td>底部单行日志，实时显示当前操作状态</td></tr></tbody></table><hr><h2 id="二、使用教程">二、使用教程</h2><h3 id="2-1-爬取图片">2.1 爬取图片</h3><p>启动后默认填入目标网址，点击「<strong>爬取</strong>」按钮即可解析页面中所有图片。右侧列表会展示每张图片的缩略图和文件名。</p><h3 id="2-2-预览与筛选">2.2 预览与筛选</h3><p>点击列表中的图片可在右侧预览区域查看大图。使用「<strong>全选</strong>」「<strong>清空</strong>」「<strong>反选</strong>」按钮快速筛选需要下载的图片。</p><h3 id="2-3-下载">2.3 下载</h3><p>点击「<strong>下载</strong>」按钮，程序会自动创建 <code>ZmdPicture</code> 文件夹，将选中的图片批量保存到本地。下载过程中可随时点击「<strong>停止</strong>」中断。</p><hr><h2 id="三、技术特点">三、技术特点</h2><table><thead><tr><th>方面</th><th>说明</th></tr></thead><tbody><tr><td><strong>框架</strong></td><td>PySide6，LGPL 许可</td></tr><tr><td><strong>打包</strong></td><td>PyInstaller 单文件，无 CMD 弹窗</td></tr><tr><td><strong>多线程</strong></td><td>下载在独立 QThread 执行，界面不卡顿不闪退</td></tr><tr><td><strong>配色</strong></td><td>蓝白配色，方形直角按钮，统一简洁</td></tr><tr><td><strong>标题栏</strong></td><td>自定义无边框窗口，仿 macOS 红黄圆点按钮</td></tr></tbody></table><hr><h2 id="四、总结">四、总结</h2><p>小巧轻量、即开即用，适合需要批量保存站内图片资源的场景。如果对功能有建议或者遇到 bug，欢迎在评论区留言反馈 (๑•́ ▽ •̀๑)</p>]]></content>
    
    
      
      
    <summary type="html">&lt;h1 id=&quot;终末地画廊下载器&quot;&gt;终末地画廊下载器&lt;/h1&gt;
&lt;p&gt;逛终末地画廊的时候想批量扒图，但一张张右键保存实在太累了 (´；ω；`)&lt;/p&gt;
&lt;p&gt;于是就有了这款&lt;strong&gt;终末地画廊下载器&lt;/strong&gt;——基于 PySide6 打造，蓝白配色、方形简洁风格，专</summary>
      
    
    
    
    <category term="技术实践" scheme="https://zhaogb612.github.io/categories/%E6%8A%80%E6%9C%AF%E5%AE%9E%E8%B7%B5/"/>
    
    
    <category term="技术实践" scheme="https://zhaogb612.github.io/tags/%E6%8A%80%E6%9C%AF%E5%AE%9E%E8%B7%B5/"/>
    
    <category term="Python" scheme="https://zhaogb612.github.io/tags/Python/"/>
    
  </entry>
  
  <entry>
    <title>沙尘音乐</title>
    <link href="https://zhaogb612.github.io/posts/5d3a7c91.html"/>
    <id>https://zhaogb612.github.io/posts/5d3a7c91.html</id>
    <published>2026-07-31T16:10:00.000Z</published>
    <updated>2026-07-31T16:50:00.000Z</updated>
    
    <content type="html"><![CDATA[<h1 id="沙尘音乐">沙尘音乐</h1><p>大家好～今天来介绍一下本博客自制的网页音乐播放器 —— <strong>沙尘音乐</strong> (ゝω·)ノ</p><p>纯前端开发，零依赖，打开浏览器就能听歌，无需安装。</p><hr><h2 id="一、核心特性">一、核心特性</h2><table><thead><tr><th>特性</th><th>说明</th></tr></thead><tbody><tr><td><strong>网易云音源</strong></td><td>海量曲库，多源自动轮换</td></tr><tr><td><strong>VIP 完整解析</strong></td><td>支持整首播放，告别 45 秒试听</td></tr><tr><td><strong>音频可视化</strong></td><td>柱状 / 波形 / 圆点三种频谱样式</td></tr><tr><td><strong>歌词展示</strong></td><td>卡拉 OK / 高亮放大等效果，支持翻译</td></tr><tr><td><strong>主题定制</strong></td><td>多套配色、封面、背景自由搭配</td></tr><tr><td><strong>快捷键</strong></td><td>全部按键可自定义</td></tr><tr><td><strong>部署灵活</strong></td><td>本地代理与静态直连双模式</td></tr></tbody></table><hr><h2 id="二、功能亮点">二、功能亮点</h2><ul><li><strong>搜索解析</strong>：优先走 VIP 完整解析接口（320kbps），主源挂了自动切换备用源</li><li><strong>可视化</strong>：WebAudio 频谱分析，灵敏度可调（0.5x~2.5x），波形是对称山丘形，动感十足</li><li><strong>歌词</strong>：卡拉 OK 逐字上色、高亮放大、仅高亮、无效果，字体/字号/对齐随意调</li><li><strong>外观</strong>：樱桃红/天空蓝/清新绿/葡萄紫/暖橙/自定义主题色，黑胶唱片/圆形/方形封面，默认/玻璃/毛玻璃/渐变/动态背景</li><li><strong>快捷键</strong>：默认 <code>空格</code> 播放暂停、<code>←/→</code> 切歌、<code>Ctrl+←/→</code> 快进快退、<code>↑/↓</code> 音量、<code>j</code> 静音、<code>k</code> 白天黑夜、<code>`</code> 沉浸模式、<code>Tab</code> 播放列表、<code>Ctrl+Alt+空格</code> 设置，全部可在设置面板录制修改</li><li><strong>播放列表</strong>：localStorage 持久化，支持列表循环/单曲循环/随机/顺序播放</li></ul><hr><h2 id="三、技术架构">三、技术架构</h2><p>原生 HTML + CSS + JS，HTML5 Audio + WebAudio 分析音频，搜索解析走网易云官方与祈杰 Meting-API，本地可用 Node 代理（server.js），静态部署自动切换直连模式。</p><hr><h2 id="四、在线体验">四、在线体验</h2><p>前往博客<strong>音乐盒页面</strong>即可使用：<a href="https://zhaogb612.github.io/life/music/">https://zhaogb612.github.io/life/music/</a></p><hr><h2 id="五、总结">五、总结</h2><p>功能齐全、颜值在线、部署零成本，想给自己的博客加个在线播放器的可以参考这个项目 (๑•̀ㅂ•́)و✧</p><blockquote><p>小贴士：数据仅供个人学习参考，请支持正版音乐哦～</p></blockquote>]]></content>
    
    
      
      
    <summary type="html">&lt;h1 id=&quot;沙尘音乐&quot;&gt;沙尘音乐&lt;/h1&gt;
&lt;p&gt;大家好～今天来介绍一下本博客自制的网页音乐播放器 —— &lt;strong&gt;沙尘音乐&lt;/strong&gt; (ゝω·)ノ&lt;/p&gt;
&lt;p&gt;纯前端开发，零依赖，打开浏览器就能听歌，无需安装。&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id=&quot;一、核心特性</summary>
      
    
    
    
    <category term="技术实践" scheme="https://zhaogb612.github.io/categories/%E6%8A%80%E6%9C%AF%E5%AE%9E%E8%B7%B5/"/>
    
    
    <category term="技术学习" scheme="https://zhaogb612.github.io/tags/%E6%8A%80%E6%9C%AF%E5%AD%A6%E4%B9%A0/"/>
    
    <category term="HTML" scheme="https://zhaogb612.github.io/tags/HTML/"/>
    
  </entry>
  
  <entry>
    <title>文件批量重命名工具 —— 一键搞定杂乱文件名</title>
    <link href="https://zhaogb612.github.io/posts/p9q0r1s2.html"/>
    <id>https://zhaogb612.github.io/posts/p9q0r1s2.html</id>
    <published>2026-07-27T14:00:00.000Z</published>
    <updated>2026-07-27T14:00:00.000Z</updated>
    
    <content type="html"><![CDATA[<h1 id="文件批量重命名工具-——-一键搞定杂乱文件名">文件批量重命名工具 —— 一键搞定杂乱文件名</h1><p>整理文件最头疼的莫过于面对一堆命名毫无规律的文件——各种下载的图片、素材、文档，手动一个一个 F2 改名简直让人崩溃 (╯°□°)╯</p><p>于是就有了这款自制的<strong>文件批量重命名工具</strong>，基于 PySide6 打造，蓝白配色、方形简洁风格，目标是让你用最少的操作完成大批量文件改名。</p><blockquote><p><strong>下载地址</strong>：<a href="https://pan.huang1111.cn/s/k2YBguB">点我下载 FileRenamer.exe</a> 提取密码：<code>2026</code>（打包好的单文件，双击即用。）</p></blockquote><hr><h2 id="一、核心功能">一、核心功能</h2><p>这款工具的核心思路是：<strong>选文件夹 → 设规则 → 预览 → 一键执行</strong>，全程可视化操作，不慌不忙 ( ﾟ▽ﾟ)/</p><h3 id="功能一览">功能一览</h3><table><thead><tr><th>功能</th><th>说明</th></tr></thead><tbody><tr><td><strong>批量重命名</strong></td><td>统一修改文件名，支持添加前缀、后缀、序列号</td></tr><tr><td><strong>后缀修改</strong></td><td>可单独修改文件扩展名，格式转换前一步到位</td></tr><tr><td><strong>递进式编号</strong></td><td>自定义起始数字和补零位数，如 <code>图片_001.png</code></td></tr><tr><td><strong>实时预览</strong></td><td>执行前先预览结果，确认无误再操作</td></tr><tr><td><strong>文件名筛选</strong></td><td>按指定后缀筛选文件，支持自定义多个后缀</td></tr><tr><td><strong>覆盖/跳过</strong></td><td>源目录与输出目录相同时，可切换覆盖或跳过同名文件</td></tr><tr><td><strong>暂停/继续</strong></td><td>大批量操作时可随时暂停和恢复</td></tr><tr><td><strong>配置存取</strong></td><td>保存命名规则为 JSON 配置，下次一键加载</td></tr><tr><td><strong>操作日志</strong></td><td>完整的成功/失败日志，附带统计总结</td></tr></tbody></table><hr><h2 id="二、使用教程">二、使用教程</h2><h3 id="2-1-选择文件">2.1 选择文件</h3><p>点击「文件选择」区域的 <strong>浏览</strong> 按钮，选择要处理的文件夹。工具会自动加载该目录下所有文件，并在右下角后缀下拉框中列出检测到的文件类型。</p><p>你可以直接处理全部文件，也可以：</p><ul><li>从下拉框中选择某个后缀</li><li>在「自定义」输入框中输入后缀（多个用逗号分隔）</li><li>点击「筛选」按钮，只处理符合条件的文件</li></ul><h3 id="2-2-设置规则">2.2 设置规则</h3><p>工具提供四条可选的命名规则，每条规则都有独立的「<strong>关 / 开</strong>」开关：</p><table><thead><tr><th>规则</th><th>用法示例</th></tr></thead><tbody><tr><td><strong>重命名文件名</strong></td><td>统一改为 <code>封面图</code></td></tr><tr><td><strong>修改文件后缀</strong></td><td>把 <code>.jpg</code> 改成 <code>.png</code></td></tr><tr><td><strong>添加前缀</strong></td><td>原文件名前加 <code>2026-07-</code></td></tr><tr><td><strong>递进式后缀</strong></td><td>文件名后加 <code>_001</code>、<code>_002</code> …</td></tr></tbody></table><blockquote><p>规则可以自由组合。比如打开「重命名文件名」+「递进式后缀」，就能一键生成 <code>封面图_001.jpg</code> ~ <code>封面图_099.jpg</code> 这样的序列名。</p></blockquote><h3 id="2-3-预览与执行">2.3 预览与执行</h3><p>点击 <strong>预览</strong> 按钮，表格最右边的「预览结果」列会显示每个文件重命名后的样子。确认无误后，选择输出文件夹（或直接使用同一目录），点击 <strong>重命名</strong> 即可。</p><p>如果输出目录和源目录相同，右侧会自动亮起「<strong>覆盖 / 跳过</strong>」按钮：</p><ul><li><strong>覆盖</strong>（默认）：直接覆盖同名文件</li><li><strong>跳过</strong>：保留原文件不做处理</li></ul><p>执行过程中可以随时 <strong>暂停</strong>、<strong>继续</strong>，底部日志区域会实时输出每条操作的状态。</p><hr><h2 id="三、技术特点">三、技术特点</h2><table><thead><tr><th>方面</th><th>说明</th></tr></thead><tbody><tr><td><strong>框架</strong></td><td>PySide6（Qt for Python），相比 PyQt5 更轻量、LGPL 许可</td></tr><tr><td><strong>打包</strong></td><td>PyInstaller 单文件打包，无 CMD 弹窗，开箱即用</td></tr><tr><td><strong>多线程</strong></td><td>重命名操作在独立线程执行，界面不卡顿</td></tr><tr><td><strong>递归扫描</strong></td><td>支持子文件夹内所有文件的批量处理</td></tr><tr><td><strong>配色</strong></td><td>蓝白配色方案，深蓝色标题栏 + 白色卡片，视觉清爽</td></tr></tbody></table><p>整个界面采用方形直角设计，所有控件统一风格——按钮、输入框、表格、文本日志全部无圆角，强迫症友好 (<em>´▽`</em>)</p><hr><h2 id="四、下载与使用">四、下载与使用</h2><p>目前提供 Windows 平台的单文件可执行版本：</p><p><a href="https://pan.huang1111.cn/s/k2YBguB">下载 FileRenamer.exe</a>　提取密码：<code>2026</code></p><p>如果对功能有建议或者遇到 bug，欢迎在评论区留言反馈 (๑•́ ▽ •̀๑)</p>]]></content>
    
    
      
      
    <summary type="html">&lt;h1 id=&quot;文件批量重命名工具-——-一键搞定杂乱文件名&quot;&gt;文件批量重命名工具 —— 一键搞定杂乱文件名&lt;/h1&gt;
&lt;p&gt;整理文件最头疼的莫过于面对一堆命名毫无规律的文件——各种下载的图片、素材、文档，手动一个一个 F2 改名简直让人崩溃 (╯°□°)╯&lt;/p&gt;
&lt;p&gt;于是就</summary>
      
    
    
    
    <category term="软件推荐" scheme="https://zhaogb612.github.io/categories/%E8%BD%AF%E4%BB%B6%E6%8E%A8%E8%8D%90/"/>
    
    
    <category term="技术实践" scheme="https://zhaogb612.github.io/tags/%E6%8A%80%E6%9C%AF%E5%AE%9E%E8%B7%B5/"/>
    
    <category term="Python" scheme="https://zhaogb612.github.io/tags/Python/"/>
    
  </entry>
  
  <entry>
    <title>Sakura Nav 导航页 —— 你的动漫风格上网入口</title>
    <link href="https://zhaogb612.github.io/posts/l5m6n7o8.html"/>
    <id>https://zhaogb612.github.io/posts/l5m6n7o8.html</id>
    <published>2026-07-14T15:00:00.000Z</published>
    <updated>2026-07-14T15:00:00.000Z</updated>
    
    <content type="html"><![CDATA[<h1 id="Sakura-Nav-导航页-——-你的动漫风格上网入口">Sakura Nav 导航页 —— 你的动漫风格上网入口</h1><p>今天来聊聊本站自带的动漫风格导航页，也就是点开顶部菜单栏「<strong>网址导航</strong>」后看到的那个小天地。</p><blockquote><p><strong>直接访问</strong>：<a href="/box/nav/">点我打开导航页</a></p></blockquote><hr><h2 id="一、导航页是什么？">一、导航页是什么？</h2><p>这是一款自制的动漫主题导航页面，把日常常用的网站整理在一起，打开浏览器一键直达，再也不用在收藏夹里翻半天啦 (๑•̀ㅂ•́)و✧</p><p>内置的功能还挺丰富的：</p><table><thead><tr><th>功能</th><th>说明</th></tr></thead><tbody><tr><td><strong>樱花飘落</strong></td><td>可开关的桌面樱花特效，配合速度/数量调节</td></tr><tr><td><strong>主题切换</strong></td><td>浅色/深色模式自由切换，跟随系统也行</td></tr><tr><td><strong>背景模糊</strong></td><td>卡片和背景的毛玻璃模糊度可调</td></tr><tr><td><strong>背景音乐</strong></td><td>内置 BGM 播放器，支持进度拖拽和音量调节</td></tr><tr><td><strong>迷你日历</strong></td><td>右下角显示实时时间日期</td></tr><tr><td><strong>搜索栏</strong></td><td>一键搜索 Bing，找不到网站直接搜</td></tr><tr><td><strong>添加网站</strong></td><td>自己往导航页里加常用站点</td></tr><tr><td><strong>拖拽排序</strong></td><td>长按拖拽调整网站卡片顺序</td></tr><tr><td><strong>右键删除</strong></td><td>右键长按 4s 删除自己添加的网站</td></tr><tr><td><strong>返回顶部</strong></td><td>滚动后一键回到顶部</td></tr></tbody></table><hr><h2 id="二、页面截图">二、页面截图</h2><p>整个页面以「樱花」为主题，采用了毛玻璃（Glassmorphism）设计风格：</p><ul><li>标题用的是 <strong>Sacramento</strong> 英文字体 + <strong>马善政</strong> 中文字体</li><li>卡片半透明毛玻璃质感，配合渐变发光图标</li><li>深色模式自动切换背景图片</li><li>樱花飘落的粒子效果，可自由开关和调速</li></ul><hr><h2 id="三、功能使用指南">三、功能使用指南</h2><h3 id="3-1-左侧设置面板">3.1 左侧设置面板</h3><p>点击页面左上角的 ⚙️ 齿轮图标，可以打开侧边栏设置：</p><p><strong>主题切换</strong>：一键切换浅色/深色模式</p><p><strong>背景模糊</strong>：</p><ul><li>卡片模糊：调整导航卡片和面板的毛玻璃强度（0~20px）</li><li>背景模糊：调整背景图片的模糊程度（0~20px）</li><li>可一键重置为默认值</li></ul><p><strong>樱花飘落</strong>：</p><ul><li>开关樱花特效，懒人一键开启</li><li>飘落速度调节：0%~100%，从乌龟漫步到狂风暴雨</li><li>飘落数量调节：10~200 朵，自定义满天飞花</li></ul><p><strong>背景音乐</strong>：</p><ul><li>自动循环播放内置 BGM</li><li>支持播放/暂停、进度拖拽、音量调节</li><li>右下角有迷你播放器，最小化后不占地方</li></ul><h3 id="3-2-自定义网站">3.2 自定义网站</h3><p>点击导航网格最后的「<strong>添加网站</strong>」按钮，可以添加自定义网站：</p><ol><li>填写网站名称和 URL</li><li>选择一个喜欢的图标</li><li>选择分类</li><li>点击「添加」</li></ol><p>添加的网站会保存在浏览器的本地存储中，下次打开还在。</p><h3 id="3-3-管理网站">3.3 管理网站</h3><ul><li><strong>排序</strong>：鼠标拖拽网站卡片即可调整顺序，自动保存</li><li><strong>删除</strong>：在要删除的卡片上<strong>右键长按 4 秒</strong>，弹出确认后删除（仅限自定义添加的网站）</li></ul><blockquote><p>预置的固定网站（哔哩哔哩、网易云等）不可删除，确保常用网站一直都在 (｡･ω･｡)</p></blockquote><h3 id="3-4-迷你日历">3.4 迷你日历</h3><p>右下角的播放器上方有一个迷你日历组件，显示：</p><ul><li>当前时间（时:分）</li><li>星期 + 月日</li><li>年份</li></ul><p>点击播放器区域可以展开/收起日历，点击日历的「–」可以最小化，「×」可以关闭。</p><hr><h2 id="四、技术栈">四、技术栈</h2><table><thead><tr><th>技术</th><th>用途</th></tr></thead><tbody><tr><td><strong>HTML5</strong></td><td>页面结构</td></tr><tr><td><strong>CSS3</strong></td><td>样式 + 毛玻璃 + 动画 + 响应式</td></tr><tr><td><strong>JavaScript</strong></td><td>交互逻辑 + 本地存储 + 音频控制</td></tr><tr><td><strong>Font Awesome</strong></td><td>图标库</td></tr><tr><td><strong>Google Fonts</strong></td><td>艺术字体（Sacramento + 马善政）</td></tr></tbody></table><p>纯前端实现，所有用户自定义数据（添加的网站、主题偏好、模糊设置等）都存储在浏览器的 <code>localStorage</code> 中，无需后端数据库。</p><hr><h2 id="五、也可以自己做一个">五、也可以自己做一个</h2><p>如果你也想拥有一个属于自己的导航页，可以参考本站的 HTML 入门指南，从零开始写一个：</p><p><a href="/2026/07/14/HTML%E5%85%A5%E9%97%A8%E6%92%B0%E5%86%99%E6%8C%87%E5%8D%97/">HTML 入门撰写指南</a></p><p>或者直接查看本导航页的源码，在 <code>source/box/nav/</code> 目录下，按需修改即可 (◕‿◕✿)</p><figure class="highlight html"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">&lt;!-- 导航页源码结构 --&gt;</span></span><br><span class="line">box/nav/</span><br><span class="line">├── index.html        # 主页面</span><br><span class="line">├── style.css         # 样式文件</span><br><span class="line">├── script.js         # 交互脚本</span><br><span class="line">└── assets/</span><br><span class="line">    ├── images/       # 头像和背景图片</span><br><span class="line">    └── music/        # BGM 音频文件</span><br></pre></td></tr></table></figure><hr><h2 id="六、总结">六、总结</h2><p>这个导航页从设计到实现都围绕「樱花 × 动漫 × 毛玻璃」的风格，既好看又实用。如果你有想要添加的网站建议，或者发现什么 bug，欢迎在评论区留言 ( ﾟ∀ﾟ) ﾉ♡</p><p>那么，快去逛一逛导航页吧～ <a href="/box/nav/">点我直达</a></p>]]></content>
    
    
      
      
    <summary type="html">&lt;h1 id=&quot;Sakura-Nav-导航页-——-你的动漫风格上网入口&quot;&gt;Sakura Nav 导航页 —— 你的动漫风格上网入口&lt;/h1&gt;
&lt;p&gt;今天来聊聊本站自带的动漫风格导航页，也就是点开顶部菜单栏「&lt;strong&gt;网址导航&lt;/strong&gt;」后看到的那个小天地。&lt;/p&gt;</summary>
      
    
    
    
    <category term="技术学习" scheme="https://zhaogb612.github.io/categories/%E6%8A%80%E6%9C%AF%E5%AD%A6%E4%B9%A0/"/>
    
    
    <category term="HTML" scheme="https://zhaogb612.github.io/tags/HTML/"/>
    
    <category term="技术实践" scheme="https://zhaogb612.github.io/tags/%E6%8A%80%E6%9C%AF%E5%AE%9E%E8%B7%B5/"/>
    
  </entry>
  
  <entry>
    <title>HTML 入门撰写指南 —— 从零开始打造你的第一个网页</title>
    <link href="https://zhaogb612.github.io/posts/h1i2j3k4.html"/>
    <id>https://zhaogb612.github.io/posts/h1i2j3k4.html</id>
    <published>2026-07-14T14:00:00.000Z</published>
    <updated>2026-07-14T14:00:00.000Z</updated>
    
    <content type="html"><![CDATA[<h1 id="HTML-入门撰写指南-——-从零开始打造你的第一个网页">HTML 入门撰写指南 —— 从零开始打造你的第一个网页</h1><p>想学网页制作又不知道从哪下手？别慌，这篇文章带你从零开始，写一个属于你自己的网页，就这么简单 (๑•̀ㅂ•́)و✧</p><blockquote><p><strong>免责声明</strong>：本文仅提供入门教学参考，具体实践中如遇到任何问题，均与本站无关。请根据自身实际情况谨慎操作 (｡･ω･｡)</p></blockquote><hr><h2 id="一、HTML-到底是什么">一、HTML 到底是什么</h2><p>HTML 全称 <strong>HyperText Markup Language</strong>（超文本标记语言），说人话就是——<strong>网页的骨架</strong>。就像盖房子需要钢筋水泥，网页就是由 HTML 搭建起来的。</p><ul><li>不是编程语言，是<strong>标记语言</strong>（用标签「标记」内容）</li><li>浏览器会读取 HTML 文件，然后渲染成你看到的网页</li><li>最新版本是 <strong>HTML5</strong>，目前所有浏览器都支持</li></ul><p>你只需要一个 <strong>记事本</strong>（Notepad / VS Code / 记事本++ 都行）就能开始写 HTML 了 (◕‿◕✿)</p><hr><h2 id="二、HTML-的基本结构">二、HTML 的基本结构</h2><p>一个标准的 HTML 文件长这样：</p><figure class="highlight html"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">&lt;!DOCTYPE <span class="keyword">html</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;<span class="name">html</span> <span class="attr">lang</span>=<span class="string">&quot;zh-CN&quot;</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;<span class="name">head</span>&gt;</span></span><br><span class="line">  <span class="tag">&lt;<span class="name">meta</span> <span class="attr">charset</span>=<span class="string">&quot;UTF-8&quot;</span>&gt;</span></span><br><span class="line">  <span class="tag">&lt;<span class="name">title</span>&gt;</span>我的第一个网页<span class="tag">&lt;/<span class="name">title</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;/<span class="name">head</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;<span class="name">body</span>&gt;</span></span><br><span class="line">  <span class="tag">&lt;<span class="name">h1</span>&gt;</span>你好，世界！<span class="tag">&lt;/<span class="name">h1</span>&gt;</span></span><br><span class="line">  <span class="tag">&lt;<span class="name">p</span>&gt;</span>这是我的第一个网页 (★ω★)<span class="tag">&lt;/<span class="name">p</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;/<span class="name">body</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;/<span class="name">html</span>&gt;</span></span><br></pre></td></tr></table></figure><p>把这段代码复制到记事本，保存为 <code>index.html</code>，双击打开——恭喜你，第一个网页诞生啦</p><h3 id="2-1-各部分说明">2.1 各部分说明</h3><table><thead><tr><th>标签</th><th>作用</th><th>说明</th></tr></thead><tbody><tr><td><code>&lt;!DOCTYPE html&gt;</code></td><td>声明文档类型</td><td>告诉浏览器这是 HTML5</td></tr><tr><td><code>&lt;html&gt;</code></td><td>根标签</td><td>整个网页的根，<code>lang</code> 属性设置语言</td></tr><tr><td><code>&lt;head&gt;</code></td><td>头部</td><td>存放元信息，用户看不见的内容</td></tr><tr><td><code>&lt;meta charset=&quot;UTF-8&quot;&gt;</code></td><td>字符编码</td><td>不写的话中文会乱码 (´；ω；`)</td></tr><tr><td><code>&lt;title&gt;</code></td><td>网页标题</td><td>显示在浏览器标签栏上的文字</td></tr><tr><td><code>&lt;body&gt;</code></td><td>主体</td><td>用户能看到的所有内容都放这里</td></tr></tbody></table><blockquote><p>记住：<code>&lt;head&gt;</code> 是后台，<code>&lt;body&gt;</code> 是前台 ─=≡Σ((( つ•̀ω•́)つ</p></blockquote><hr><h2 id="三、常用标签大盘点">三、常用标签大盘点</h2><h3 id="3-1-文本标签">3.1 文本标签</h3><figure class="highlight html"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line"><span class="tag">&lt;<span class="name">h1</span>&gt;</span>一级标题<span class="tag">&lt;/<span class="name">h1</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;<span class="name">h2</span>&gt;</span>二级标题<span class="tag">&lt;/<span class="name">h2</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;<span class="name">h3</span>&gt;</span>三级标题<span class="tag">&lt;/<span class="name">h3</span>&gt;</span></span><br><span class="line"><span class="comment">&lt;!-- h4 / h5 / h6 依次变小 --&gt;</span></span><br><span class="line"><span class="tag">&lt;<span class="name">p</span>&gt;</span>这是一个段落，用来放普通文字。<span class="tag">&lt;/<span class="name">p</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;<span class="name">b</span>&gt;</span>加粗<span class="tag">&lt;/<span class="name">b</span>&gt;</span> 和 <span class="tag">&lt;<span class="name">strong</span>&gt;</span>也是加粗（语义更强）<span class="tag">&lt;/<span class="name">strong</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;<span class="name">i</span>&gt;</span>斜体<span class="tag">&lt;/<span class="name">i</span>&gt;</span> 和 <span class="tag">&lt;<span class="name">em</span>&gt;</span>也是斜体（语义强调）<span class="tag">&lt;/<span class="name">em</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;<span class="name">br</span>&gt;</span>           <span class="comment">&lt;!-- 换行 --&gt;</span></span><br><span class="line"><span class="tag">&lt;<span class="name">hr</span>&gt;</span>           <span class="comment">&lt;!-- 分割线 --&gt;</span></span><br></pre></td></tr></table></figure><blockquote><p><code>&lt;h1&gt;</code> 是一篇文章里最重要的标题，一页只用一次比较好 (｀・ω・´)</p></blockquote><h3 id="3-2-链接与图片">3.2 链接与图片</h3><figure class="highlight html"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">&lt;!-- 超链接 --&gt;</span></span><br><span class="line"><span class="tag">&lt;<span class="name">a</span> <span class="attr">href</span>=<span class="string">&quot;https://example.com&quot;</span> <span class="attr">target</span>=<span class="string">&quot;_blank&quot;</span>&gt;</span>点我打开新页面<span class="tag">&lt;/<span class="name">a</span>&gt;</span></span><br><span class="line"></span><br><span class="line"><span class="comment">&lt;!-- 图片 --&gt;</span></span><br><span class="line"><span class="tag">&lt;<span class="name">img</span> <span class="attr">src</span>=<span class="string">&quot;图片地址.jpg&quot;</span> <span class="attr">alt</span>=<span class="string">&quot;图片加载失败时显示的文字&quot;</span> <span class="attr">width</span>=<span class="string">&quot;400&quot;</span>&gt;</span></span><br></pre></td></tr></table></figure><table><thead><tr><th>属性</th><th>说明</th></tr></thead><tbody><tr><td><code>href</code></td><td>链接目标地址</td></tr><tr><td><code>target=&quot;_blank&quot;</code></td><td>在新标签页打开</td></tr><tr><td><code>src</code></td><td>图片文件路径或 URL</td></tr><tr><td><code>alt</code></td><td>图片挂了时的替代文字（SEO 也靠它）</td></tr></tbody></table><h3 id="3-3-列表">3.3 列表</h3><figure class="highlight html"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">&lt;!-- 无序列表（圆点） --&gt;</span></span><br><span class="line"><span class="tag">&lt;<span class="name">ul</span>&gt;</span></span><br><span class="line">  <span class="tag">&lt;<span class="name">li</span>&gt;</span>苹果<span class="tag">&lt;/<span class="name">li</span>&gt;</span></span><br><span class="line">  <span class="tag">&lt;<span class="name">li</span>&gt;</span>香蕉<span class="tag">&lt;/<span class="name">li</span>&gt;</span></span><br><span class="line">  <span class="tag">&lt;<span class="name">li</span>&gt;</span>橘子<span class="tag">&lt;/<span class="name">li</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;/<span class="name">ul</span>&gt;</span></span><br><span class="line"></span><br><span class="line"><span class="comment">&lt;!-- 有序列表（数字） --&gt;</span></span><br><span class="line"><span class="tag">&lt;<span class="name">ol</span>&gt;</span></span><br><span class="line">  <span class="tag">&lt;<span class="name">li</span>&gt;</span>第一步打开冰箱<span class="tag">&lt;/<span class="name">li</span>&gt;</span></span><br><span class="line">  <span class="tag">&lt;<span class="name">li</span>&gt;</span>第二步把大象塞进去<span class="tag">&lt;/<span class="name">li</span>&gt;</span></span><br><span class="line">  <span class="tag">&lt;<span class="name">li</span>&gt;</span>第三步关上冰箱门<span class="tag">&lt;/<span class="name">li</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;/<span class="name">ol</span>&gt;</span></span><br></pre></td></tr></table></figure><h3 id="3-4-表格">3.4 表格</h3><figure class="highlight html"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br></pre></td><td class="code"><pre><span class="line"><span class="tag">&lt;<span class="name">table</span>&gt;</span></span><br><span class="line">  <span class="tag">&lt;<span class="name">tr</span>&gt;</span></span><br><span class="line">    <span class="tag">&lt;<span class="name">th</span>&gt;</span>姓名<span class="tag">&lt;/<span class="name">th</span>&gt;</span></span><br><span class="line">    <span class="tag">&lt;<span class="name">th</span>&gt;</span>年龄<span class="tag">&lt;/<span class="name">th</span>&gt;</span></span><br><span class="line">    <span class="tag">&lt;<span class="name">th</span>&gt;</span>技能<span class="tag">&lt;/<span class="name">th</span>&gt;</span></span><br><span class="line">  <span class="tag">&lt;/<span class="name">tr</span>&gt;</span></span><br><span class="line">  <span class="tag">&lt;<span class="name">tr</span>&gt;</span></span><br><span class="line">    <span class="tag">&lt;<span class="name">td</span>&gt;</span>小明<span class="tag">&lt;/<span class="name">td</span>&gt;</span></span><br><span class="line">    <span class="tag">&lt;<span class="name">td</span>&gt;</span>18<span class="tag">&lt;/<span class="name">td</span>&gt;</span></span><br><span class="line">    <span class="tag">&lt;<span class="name">td</span>&gt;</span>HTML (★ω★)<span class="tag">&lt;/<span class="name">td</span>&gt;</span></span><br><span class="line">  <span class="tag">&lt;/<span class="name">tr</span>&gt;</span></span><br><span class="line">  <span class="tag">&lt;<span class="name">tr</span>&gt;</span></span><br><span class="line">    <span class="tag">&lt;<span class="name">td</span>&gt;</span>小红<span class="tag">&lt;/<span class="name">td</span>&gt;</span></span><br><span class="line">    <span class="tag">&lt;<span class="name">td</span>&gt;</span>17<span class="tag">&lt;/<span class="name">td</span>&gt;</span></span><br><span class="line">    <span class="tag">&lt;<span class="name">td</span>&gt;</span>CSS (´▽\`ʃ♡ƪ)<span class="tag">&lt;/<span class="name">td</span>&gt;</span></span><br><span class="line">  <span class="tag">&lt;/<span class="name">tr</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;/<span class="name">table</span>&gt;</span></span><br></pre></td></tr></table></figure><table><thead><tr><th>标签</th><th>含义</th></tr></thead><tbody><tr><td><code>&lt;table&gt;</code></td><td>表格</td></tr><tr><td><code>&lt;tr&gt;</code></td><td>行（table row）</td></tr><tr><td><code>&lt;th&gt;</code></td><td>表头（table header）</td></tr><tr><td><code>&lt;td&gt;</code></td><td>单元格（table data）</td></tr></tbody></table><h3 id="3-5-常用语义标签（HTML5）">3.5 常用语义标签（HTML5）</h3><figure class="highlight html"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line"><span class="tag">&lt;<span class="name">header</span>&gt;</span>页眉 / 头部<span class="tag">&lt;/<span class="name">header</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;<span class="name">nav</span>&gt;</span>导航栏<span class="tag">&lt;/<span class="name">nav</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;<span class="name">main</span>&gt;</span>主要内容<span class="tag">&lt;/<span class="name">main</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;<span class="name">section</span>&gt;</span>区块 / 章节<span class="tag">&lt;/<span class="name">section</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;<span class="name">article</span>&gt;</span>独立文章<span class="tag">&lt;/<span class="name">article</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;<span class="name">aside</span>&gt;</span>侧边栏<span class="tag">&lt;/<span class="name">aside</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;<span class="name">footer</span>&gt;</span>页脚<span class="tag">&lt;/<span class="name">footer</span>&gt;</span></span><br></pre></td></tr></table></figure><p>用语义标签代替无脑 <code>&lt;div&gt;</code>，代码可读性直接起飞 (๑˃̵ᴗ˂̵)و</p><hr><h2 id="四、动手实践-——-写一个完整页面">四、动手实践 —— 写一个完整页面</h2><p>光看不动手等于没学！来，跟着写一个个人简介页面：</p><figure class="highlight html"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">&lt;!DOCTYPE <span class="keyword">html</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;<span class="name">html</span> <span class="attr">lang</span>=<span class="string">&quot;zh-CN&quot;</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;<span class="name">head</span>&gt;</span></span><br><span class="line">  <span class="tag">&lt;<span class="name">meta</span> <span class="attr">charset</span>=<span class="string">&quot;UTF-8&quot;</span>&gt;</span></span><br><span class="line">  <span class="tag">&lt;<span class="name">meta</span> <span class="attr">name</span>=<span class="string">&quot;viewport&quot;</span> <span class="attr">content</span>=<span class="string">&quot;width=device-width, initial-scale=1.0&quot;</span>&gt;</span></span><br><span class="line">  <span class="tag">&lt;<span class="name">title</span>&gt;</span>我的个人主页<span class="tag">&lt;/<span class="name">title</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;/<span class="name">head</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;<span class="name">body</span>&gt;</span></span><br><span class="line">  <span class="tag">&lt;<span class="name">header</span>&gt;</span></span><br><span class="line">    <span class="tag">&lt;<span class="name">h1</span>&gt;</span>✨ 米娜桑欢迎来到我的小站 ✨<span class="tag">&lt;/<span class="name">h1</span>&gt;</span></span><br><span class="line">    <span class="tag">&lt;<span class="name">nav</span>&gt;</span></span><br><span class="line">      <span class="tag">&lt;<span class="name">a</span> <span class="attr">href</span>=<span class="string">&quot;#about&quot;</span>&gt;</span>关于我<span class="tag">&lt;/<span class="name">a</span>&gt;</span> |</span><br><span class="line">      <span class="tag">&lt;<span class="name">a</span> <span class="attr">href</span>=<span class="string">&quot;#skills&quot;</span>&gt;</span>技能<span class="tag">&lt;/<span class="name">a</span>&gt;</span> |</span><br><span class="line">      <span class="tag">&lt;<span class="name">a</span> <span class="attr">href</span>=<span class="string">&quot;#contact&quot;</span>&gt;</span>联系我<span class="tag">&lt;/<span class="name">a</span>&gt;</span></span><br><span class="line">    <span class="tag">&lt;/<span class="name">nav</span>&gt;</span></span><br><span class="line">  <span class="tag">&lt;/<span class="name">header</span>&gt;</span></span><br><span class="line"></span><br><span class="line">  <span class="tag">&lt;<span class="name">hr</span>&gt;</span></span><br><span class="line"></span><br><span class="line">  <span class="tag">&lt;<span class="name">main</span>&gt;</span></span><br><span class="line">    <span class="comment">&lt;!-- 关于我 --&gt;</span></span><br><span class="line">    <span class="tag">&lt;<span class="name">section</span> <span class="attr">id</span>=<span class="string">&quot;about&quot;</span>&gt;</span></span><br><span class="line">      <span class="tag">&lt;<span class="name">h2</span>&gt;</span>关于我 (´▽\`ʃ♡ƪ)<span class="tag">&lt;/<span class="name">h2</span>&gt;</span></span><br><span class="line">      <span class="tag">&lt;<span class="name">img</span> <span class="attr">src</span>=<span class="string">&quot;https://via.placeholder.com/150&quot;</span> <span class="attr">alt</span>=<span class="string">&quot;头像&quot;</span>&gt;</span></span><br><span class="line">      <span class="tag">&lt;<span class="name">p</span>&gt;</span>大家好！我是小明，一个热爱二次元的前端萌新～<span class="tag">&lt;/<span class="name">p</span>&gt;</span></span><br><span class="line">      <span class="tag">&lt;<span class="name">p</span>&gt;</span>梦想是写出漂亮的网页，然后躺在家里数钱 (￣▽￣\*)ゞ<span class="tag">&lt;/<span class="name">p</span>&gt;</span></span><br><span class="line">    <span class="tag">&lt;/<span class="name">section</span>&gt;</span></span><br><span class="line"></span><br><span class="line">    <span class="comment">&lt;!-- 技能 --&gt;</span></span><br><span class="line">    <span class="tag">&lt;<span class="name">section</span> <span class="attr">id</span>=<span class="string">&quot;skills&quot;</span>&gt;</span></span><br><span class="line">      <span class="tag">&lt;<span class="name">h2</span>&gt;</span>我的技能<span class="tag">&lt;/<span class="name">h2</span>&gt;</span></span><br><span class="line">      <span class="tag">&lt;<span class="name">ul</span>&gt;</span></span><br><span class="line">        <span class="tag">&lt;<span class="name">li</span>&gt;</span><span class="tag">&lt;<span class="name">b</span>&gt;</span>HTML<span class="tag">&lt;/<span class="name">b</span>&gt;</span> —— 勉强会写 (◕‿◕✿)<span class="tag">&lt;/<span class="name">li</span>&gt;</span></span><br><span class="line">        <span class="tag">&lt;<span class="name">li</span>&gt;</span><span class="tag">&lt;<span class="name">b</span>&gt;</span>CSS<span class="tag">&lt;/<span class="name">b</span>&gt;</span> —— 正在修炼中<span class="tag">&lt;/<span class="name">li</span>&gt;</span></span><br><span class="line">        <span class="tag">&lt;<span class="name">li</span>&gt;</span><span class="tag">&lt;<span class="name">b</span>&gt;</span>JavaScript<span class="tag">&lt;/<span class="name">b</span>&gt;</span> —— 还在背单词阶段 (´；ω；\`)<span class="tag">&lt;/<span class="name">li</span>&gt;</span></span><br><span class="line">      <span class="tag">&lt;/<span class="name">ul</span>&gt;</span></span><br><span class="line">    <span class="tag">&lt;/<span class="name">section</span>&gt;</span></span><br><span class="line"></span><br><span class="line">    <span class="comment">&lt;!-- 联系我 --&gt;</span></span><br><span class="line">    <span class="tag">&lt;<span class="name">section</span> <span class="attr">id</span>=<span class="string">&quot;contact&quot;</span>&gt;</span></span><br><span class="line">      <span class="tag">&lt;<span class="name">h2</span>&gt;</span>联系我 📬<span class="tag">&lt;/<span class="name">h2</span>&gt;</span></span><br><span class="line">      <span class="tag">&lt;<span class="name">table</span>&gt;</span></span><br><span class="line">        <span class="tag">&lt;<span class="name">tr</span>&gt;</span></span><br><span class="line">          <span class="tag">&lt;<span class="name">th</span>&gt;</span>方式<span class="tag">&lt;/<span class="name">th</span>&gt;</span></span><br><span class="line">          <span class="tag">&lt;<span class="name">th</span>&gt;</span>地址<span class="tag">&lt;/<span class="name">th</span>&gt;</span></span><br><span class="line">        <span class="tag">&lt;/<span class="name">tr</span>&gt;</span></span><br><span class="line">        <span class="tag">&lt;<span class="name">tr</span>&gt;</span></span><br><span class="line">          <span class="tag">&lt;<span class="name">td</span>&gt;</span>邮箱<span class="tag">&lt;/<span class="name">td</span>&gt;</span></span><br><span class="line">          <span class="tag">&lt;<span class="name">td</span>&gt;</span>xiaoming@example.com<span class="tag">&lt;/<span class="name">td</span>&gt;</span></span><br><span class="line">        <span class="tag">&lt;/<span class="name">tr</span>&gt;</span></span><br><span class="line">        <span class="tag">&lt;<span class="name">tr</span>&gt;</span></span><br><span class="line">          <span class="tag">&lt;<span class="name">td</span>&gt;</span>GitHub<span class="tag">&lt;/<span class="name">td</span>&gt;</span></span><br><span class="line">          <span class="tag">&lt;<span class="name">td</span>&gt;</span></span><br><span class="line">            <span class="tag">&lt;<span class="name">a</span> <span class="attr">href</span>=<span class="string">&quot;https://github.com&quot;</span> <span class="attr">target</span>=<span class="string">&quot;_blank&quot;</span>&gt;</span></span><br><span class="line">              github.com/xiaoming</span><br><span class="line">            <span class="tag">&lt;/<span class="name">a</span>&gt;</span></span><br><span class="line">          <span class="tag">&lt;/<span class="name">td</span>&gt;</span></span><br><span class="line">        <span class="tag">&lt;/<span class="name">tr</span>&gt;</span></span><br><span class="line">      <span class="tag">&lt;/<span class="name">table</span>&gt;</span></span><br><span class="line">    <span class="tag">&lt;/<span class="name">section</span>&gt;</span></span><br><span class="line">  <span class="tag">&lt;/<span class="name">main</span>&gt;</span></span><br><span class="line"></span><br><span class="line">  <span class="tag">&lt;<span class="name">hr</span>&gt;</span></span><br><span class="line"></span><br><span class="line">  <span class="tag">&lt;<span class="name">footer</span>&gt;</span></span><br><span class="line">    <span class="tag">&lt;<span class="name">p</span>&gt;</span>© 2026 小明的小站 · 用 ❤️ 和 HTML 写成 (ゝω·)ノ<span class="tag">&lt;/<span class="name">p</span>&gt;</span></span><br><span class="line">  <span class="tag">&lt;/<span class="name">footer</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;/<span class="name">body</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;/<span class="name">html</span>&gt;</span></span><br></pre></td></tr></table></figure><p>把这段代码保存为 <code>index.html</code>，双击打开看看效果吧 (๑¯◡¯๑)</p><hr><h2 id="五、常用标签速查表">五、常用标签速查表</h2><table><thead><tr><th>标签</th><th>作用</th><th style="text-align:center">自闭合</th></tr></thead><tbody><tr><td><code>&lt;h1&gt;</code> ~ <code>&lt;h6&gt;</code></td><td>标题</td><td style="text-align:center">❌</td></tr><tr><td><code>&lt;p&gt;</code></td><td>段落</td><td style="text-align:center">❌</td></tr><tr><td><code>&lt;a&gt;</code></td><td>超链接</td><td style="text-align:center">❌</td></tr><tr><td><code>&lt;img&gt;</code></td><td>图片</td><td style="text-align:center">✅</td></tr><tr><td><code>&lt;br&gt;</code></td><td>换行</td><td style="text-align:center">✅</td></tr><tr><td><code>&lt;hr&gt;</code></td><td>分割线</td><td style="text-align:center">✅</td></tr><tr><td><code>&lt;ul&gt;</code> / <code>&lt;ol&gt;</code></td><td>无序 / 有序列表</td><td style="text-align:center">❌</td></tr><tr><td><code>&lt;li&gt;</code></td><td>列表项</td><td style="text-align:center">❌</td></tr><tr><td><code>&lt;table&gt;</code></td><td>表格</td><td style="text-align:center">❌</td></tr><tr><td><code>&lt;div&gt;</code></td><td>块级容器（无特殊含义）</td><td style="text-align:center">❌</td></tr><tr><td><code>&lt;span&gt;</code></td><td>行内容器（无特殊含义）</td><td style="text-align:center">❌</td></tr><tr><td><code>&lt;input&gt;</code></td><td>输入框</td><td style="text-align:center">✅</td></tr><tr><td><code>&lt;button&gt;</code></td><td>按钮</td><td style="text-align:center">❌</td></tr><tr><td><code>&lt;!-- 注释 --&gt;</code></td><td>注释，浏览器不显示</td><td style="text-align:center">—</td></tr></tbody></table><blockquote><p>自闭合标签无需结束标签（不用写 <code>&lt;/xxx&gt;</code>）ヽ(✿ﾟ▽ﾟ)ノ</p></blockquote><hr><h2 id="六、新手常见坑">六、新手常见坑</h2><h3 id="6-1-标签没闭合">6.1 标签没闭合</h3><figure class="highlight html"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">&lt;!-- ❌ 错误的 --&gt;</span></span><br><span class="line"><span class="tag">&lt;<span class="name">p</span>&gt;</span>文字没有结束标签</span><br><span class="line"></span><br><span class="line"><span class="comment">&lt;!-- ✅ 正确的 --&gt;</span></span><br><span class="line"><span class="tag">&lt;<span class="name">p</span>&gt;</span>文字有结束标签<span class="tag">&lt;/<span class="name">p</span>&gt;</span></span><br></pre></td></tr></table></figure><h3 id="6-2-标签嵌套顺序乱">6.2 标签嵌套顺序乱</h3><figure class="highlight html"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">&lt;!-- ❌ 错误的 --&gt;</span></span><br><span class="line"><span class="tag">&lt;<span class="name">b</span>&gt;</span><span class="tag">&lt;<span class="name">i</span>&gt;</span>文字<span class="tag">&lt;/<span class="name">b</span>&gt;</span><span class="tag">&lt;/<span class="name">i</span>&gt;</span></span><br><span class="line"></span><br><span class="line"><span class="comment">&lt;!-- ✅ 正确的（先开的后关） --&gt;</span></span><br><span class="line"><span class="tag">&lt;<span class="name">b</span>&gt;</span><span class="tag">&lt;<span class="name">i</span>&gt;</span>文字<span class="tag">&lt;/<span class="name">i</span>&gt;</span><span class="tag">&lt;/<span class="name">b</span>&gt;</span></span><br></pre></td></tr></table></figure><h3 id="6-3-属性值忘加引号">6.3 属性值忘加引号</h3><figure class="highlight html"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">&lt;!-- ❌ 错误的 --&gt;</span></span><br><span class="line"><span class="tag">&lt;<span class="name">a</span> <span class="attr">href</span>=<span class="string">https://example.com</span>&gt;</span>链接<span class="tag">&lt;/<span class="name">a</span>&gt;</span></span><br><span class="line"></span><br><span class="line"><span class="comment">&lt;!-- ✅ 正确的 --&gt;</span></span><br><span class="line"><span class="tag">&lt;<span class="name">a</span> <span class="attr">href</span>=<span class="string">&quot;https://example.com&quot;</span>&gt;</span>链接<span class="tag">&lt;/<span class="name">a</span>&gt;</span></span><br></pre></td></tr></table></figure><h3 id="6-4-编码没设导致中文乱码">6.4 编码没设导致中文乱码</h3><figure class="highlight html"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">&lt;!-- 务必在 &lt;head&gt; 里加上这行 (；´Д｀) --&gt;</span></span><br><span class="line"><span class="tag">&lt;<span class="name">meta</span> <span class="attr">charset</span>=<span class="string">&quot;UTF-8&quot;</span>&gt;</span></span><br></pre></td></tr></table></figure><hr><h2 id="七、接下来学什么">七、接下来学什么</h2><p>HTML 只是第一步，学会之后可以继续解锁：</p><table><thead><tr><th>技能</th><th>作用</th><th style="text-align:center">难度</th></tr></thead><tbody><tr><td><strong>CSS</strong></td><td>给网页化妆，变漂亮</td><td style="text-align:center">⭐⭐</td></tr><tr><td><strong>JavaScript</strong></td><td>让网页动起来，有交互</td><td style="text-align:center">⭐⭐⭐</td></tr><tr><td><strong>Flexbox / Grid</strong></td><td>布局神器</td><td style="text-align:center">⭐⭐</td></tr><tr><td><strong>响应式设计</strong></td><td>手机电脑都能看</td><td style="text-align:center">⭐⭐⭐</td></tr><tr><td><strong>GitHub Pages</strong></td><td>免费部署你的网页到互联网</td><td style="text-align:center">⭐</td></tr></tbody></table><p>推荐学习路线：HTML → CSS → JavaScript → 一个框架（React / Vue），这条路走完基本就是前端入门啦 (๑•̀ω•́)ノ</p><hr><h2 id="八、总结">八、总结</h2><ul><li>HTML 是网页的<strong>骨架</strong>，用<strong>标签</strong>标记内容</li><li>基本结构：<code>&lt;!DOCTYPE html&gt;</code> → <code>&lt;html&gt;</code> → <code>&lt;head&gt;</code> + <code>&lt;body&gt;</code></li><li>常用标签：标题 <code>&lt;h1&gt;</code>~<code>&lt;h6&gt;</code>、段落 <code>&lt;p&gt;</code>、链接 <code>&lt;a&gt;</code>、图片 <code>&lt;img&gt;</code>、列表 <code>&lt;ul&gt;/&lt;ol&gt;</code>、表格 <code>&lt;table&gt;</code></li><li>标签要<strong>闭合</strong>、<strong>正确嵌套</strong>、属性值加<strong>引号</strong></li><li><strong>动手写</strong>比看一百遍都管用 (ゝω·)ノ</li></ul><p>那么，快去打开编辑器写一个属于你的网页吧</p>]]></content>
    
    
      
      
    <summary type="html">&lt;h1 id=&quot;HTML-入门撰写指南-——-从零开始打造你的第一个网页&quot;&gt;HTML 入门撰写指南 —— 从零开始打造你的第一个网页&lt;/h1&gt;
&lt;p&gt;想学网页制作又不知道从哪下手？别慌，这篇文章带你从零开始，写一个属于你自己的网页，就这么简单 (๑•̀ㅂ•́)و✧&lt;/p&gt;
&lt;bl</summary>
      
    
    
    
    <category term="技术学习" scheme="https://zhaogb612.github.io/categories/%E6%8A%80%E6%9C%AF%E5%AD%A6%E4%B9%A0/"/>
    
    
    <category term="技术学习" scheme="https://zhaogb612.github.io/tags/%E6%8A%80%E6%9C%AF%E5%AD%A6%E4%B9%A0/"/>
    
    <category term="HTML" scheme="https://zhaogb612.github.io/tags/HTML/"/>
    
  </entry>
  
  <entry>
    <title>浏览器优化指南 —— Edge / Chrome 调教 + 自定义视频标签页 + 多标签管理</title>
    <link href="https://zhaogb612.github.io/posts/e5f6g7h8.html"/>
    <id>https://zhaogb612.github.io/posts/e5f6g7h8.html</id>
    <published>2026-07-14T08:00:00.000Z</published>
    <updated>2026-07-14T08:00:00.000Z</updated>
    
    <content type="html"><![CDATA[<h1 id="浏览器优化指南-——-Edge-Chrome-调教-自定义视频标签页-多标签管理">浏览器优化指南 —— Edge / Chrome 调教 + 自定义视频标签页 + 多标签管理</h1><p>好久不见～今天来一篇浏览器终极调教指南，让你的 Edge 和 Chrome 快如闪电，顺便把新标签页变成动态视频壁纸，再也不用面对那永远关不完的标签页啦 (ゝω·)ノ</p><blockquote><p><strong>免责声明</strong>：本文仅提供操作参考，具体实践中如遇到任何问题，均与本站无关。请根据自身实际情况谨慎操作 (｡･ω･｡)</p></blockquote><blockquote><p><strong>关于扩展链接的说明</strong>：由于 Chrome 应用商店在国内无法正常访问，本文所有扩展均只提供 <strong>Edge 加载项商店</strong> 的安装链接。两个浏览器的扩展是通用的（Chromium 内核），在 Edge 商店安装后 Chrome 也能同步使用，或者直接在扩展官网 / GitHub 下载 crx 文件拖入浏览器安装即可 ( •̀ ω •́ )✧</p></blockquote><hr><h2 id="一、Edge-Chrome-性能优化">一、Edge / Chrome 性能优化</h2><p>浏览器越用越卡？别急着换电脑，调教一下就好啦 (๑•̀ㅂ•́)و✧</p><h3 id="1-1-睡眠标签页">1.1 睡眠标签页</h3><p><strong>Edge</strong>：<code>设置</code> → <code>系统和性能</code></p><table><thead><tr><th>设置项</th><th>推荐值</th><th>说明</th></tr></thead><tbody><tr><td>效率模式</td><td>开启</td><td>自动平衡性能与功耗</td></tr><tr><td>睡眠标签页</td><td>开启</td><td>闲置标签自动休眠</td></tr><tr><td>睡眠等待时间</td><td>5 分钟</td><td>激进一点更省内存</td></tr><tr><td>淡出睡眠标签页</td><td>开启</td><td>一眼分清谁在睡觉</td></tr></tbody></table><p><strong>Chrome</strong>：<code>设置</code> → <code>性能</code></p><table><thead><tr><th>设置项</th><th>推荐值</th></tr></thead><tbody><tr><td>内存节省程序</td><td>开启</td></tr><tr><td>节能模式</td><td>开启</td></tr></tbody></table><h3 id="1-2-关掉后台上吊的应用">1.2 关掉后台上吊的应用</h3><p>标签关了进程还在偷偷吃资源，必须斩草除根 (╯°□°)╯︵ ┻━┻</p><ul><li><strong>Edge</strong>：<code>设置</code> → <code>系统和性能</code> → 关掉「关闭后继续运行后台扩展」</li><li><strong>Chrome</strong>：<code>设置</code> → <code>系统</code> → 关掉「关闭后继续运行后台应用」</li><li>关掉「预加载网页」和「预测服务」两个吃流量的摆设</li></ul><h3 id="1-3-扩展大扫除">1.3 扩展大扫除</h3><p>每装一个扩展，浏览器就多背一座山 (´；ω；`) 定期去 <code>edge://extensions/</code> 或 <code>chrome://extensions/</code> 删掉那些「装完再也没用过」的废柴扩展。</p><h3 id="1-4-Flags-实验性调优">1.4 Flags 实验性调优</h3><p>地址栏输入 <code>edge://flags/</code> 或 <code>chrome://flags/</code>，开启以下选项：</p><table><thead><tr><th>Flag</th><th>推荐值</th><th>效果</th></tr></thead><tbody><tr><td>Parallel downloading</td><td>Enabled</td><td>多线程下载，嗖嗖的</td></tr><tr><td>Override software rendering list</td><td>Enabled</td><td>强制 GPU 加速，老显卡救星</td></tr><tr><td>Smooth Scrolling</td><td>Enabled</td><td>丝滑滚动 (´▽`ʃ♡ƪ)</td></tr><tr><td>GPU rasterization</td><td>Enabled</td><td>GPU 渲染，速度翻倍</td></tr></tbody></table><blockquote><p>Flags 是实验功能，翻车了请还原 Default (￣▽￣*)ゞ</p></blockquote><h3 id="1-5-定期清缓存">1.5 定期清缓存</h3><p><code>Ctrl + Shift + Del</code> → 时间不限 → 清缓存 → 每 1~2 个月来一次，浏览器重回青春</p><hr><h2 id="二、自定义视频标签页">二、自定义视频标签页</h2><p>每次开新标签都是白板？太无聊了吧！搞个视频背景，打开浏览器就是享受 (ﾉ◕ヮ◕)ﾉ*:･ﾟ✧</p><h3 id="2-1-方案对比">2.1 方案对比</h3><table><thead><tr><th>方案</th><th style="text-align:center">视频背景</th><th style="text-align:center">自定义视频</th><th style="text-align:center">收费</th><th>适合</th></tr></thead><tbody><tr><td><strong>Bonjourr</strong></td><td style="text-align:center">✅</td><td style="text-align:center">本地/URL</td><td style="text-align:center">免费</td><td>极简美学党</td></tr><tr><td><strong>Tabliss</strong></td><td style="text-align:center">✅</td><td style="text-align:center">URL</td><td style="text-align:center">免费</td><td>组件化玩家</td></tr><tr><td><strong>Momentum</strong></td><td style="text-align:center">付费</td><td style="text-align:center">❌</td><td style="text-align:center">免费+付费</td><td>专注工作流</td></tr><tr><td><strong>Infinity</strong></td><td style="text-align:center">✅</td><td style="text-align:center">URL</td><td style="text-align:center">免费</td><td>功能拉满党</td></tr><tr><td><strong>自制 HTML</strong></td><td style="text-align:center">✅</td><td style="text-align:center">完全自由</td><td style="text-align:center">免费</td><td>动手大佬</td></tr></tbody></table><h3 id="2-2-Bonjourr">2.2 Bonjourr</h3><p>界面干净到想哭，MIT 协议开源，视频背景支持本地文件 (★ω★)</p><p><strong>安装</strong>：<a href="https://microsoftedge.microsoft.com/addons/detail/bonjourr-%C2%B7-minimalist-new/dehmmlejmefjphdeoagelkpaoolicmid">Edge 商店</a><br><strong>亮点</strong>：动态视频背景 · 极简无广告 · 时钟+天气 · 快捷书签 · 自动跟随系统深色模式</p><p><strong>设置视频背景</strong>：设置 → 背景 → 视频 → 粘贴 URL 或上传本地文件 → 调亮度模糊度 → 完成 (๑˃̵ᴗ˂̵)و</p><blockquote><p>免费视频素材推荐 <a href="https://www.pexels.com/zh-cn/search/videos/landscape/">Pexels</a> / <a href="https://coverr.co/">Coverr</a></p></blockquote><h3 id="2-3-Tabliss-——-组件化定制">2.3 Tabliss —— 组件化定制</h3><p>像搭积木一样自由组合小组件，支持视频背景直链 URL。</p><p><strong>安装</strong>：<a href="https://microsoftedge.microsoft.com/addons/detail/tabliss-a-beautiful-new/lklaendlmlfkaabeleddanafeinnenih">Edge 商店</a></p><p>设置 → Background → Video → 填入直链 → 调参 → 搞定 ₍₍ (ง ˙ω˙)ว ⁾⁾</p><h3 id="2-4-究极自定义-——-手写-HTML">2.4 究极自定义 —— 手写 HTML</h3><p>扩展不够玩？自己写一个！配合 <a href="https://microsoftedge.microsoft.com/addons/detail/custom-new-tab-page-%E8%87%AA%E5%AE%9A%E4%B9%89%E6%96%B0/ljabenhdllbfiglklhlmoecabdkmkjkp">Custom New Tab Page</a> 或 <a href="https://microsoftedge.microsoft.com/addons/detail/new-tab-redirect/dggcmncjbhkegejpinbolgbnjkggdogf">New Tab Redirect</a> 使用：</p><figure class="highlight html"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">&lt;!DOCTYPE <span class="keyword">html</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;<span class="name">html</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;<span class="name">head</span>&gt;</span></span><br><span class="line">  <span class="tag">&lt;<span class="name">style</span>&gt;</span><span class="language-css"></span></span><br><span class="line"><span class="language-css">    * &#123; <span class="attribute">margin</span>: <span class="number">0</span>; <span class="attribute">padding</span>: <span class="number">0</span>; <span class="attribute">box-sizing</span>: border-box; &#125;</span></span><br><span class="line"><span class="language-css">    <span class="selector-tag">body</span> &#123; <span class="attribute">overflow</span>: hidden; &#125;</span></span><br><span class="line"><span class="language-css">    <span class="selector-tag">video</span> &#123;</span></span><br><span class="line"><span class="language-css">      <span class="attribute">position</span>: fixed; <span class="attribute">top</span>: <span class="number">0</span>; <span class="attribute">left</span>: <span class="number">0</span>;</span></span><br><span class="line"><span class="language-css">      <span class="attribute">width</span>: <span class="number">100vw</span>; <span class="attribute">height</span>: <span class="number">100vh</span>;</span></span><br><span class="line"><span class="language-css">      <span class="attribute">object-fit</span>: cover; <span class="attribute">z-index</span>: -<span class="number">1</span>;</span></span><br><span class="line"><span class="language-css">    &#125;</span></span><br><span class="line"><span class="language-css">    <span class="selector-class">.overlay</span> &#123;</span></span><br><span class="line"><span class="language-css">      <span class="attribute">position</span>: fixed; <span class="attribute">top</span>: <span class="number">0</span>; <span class="attribute">left</span>: <span class="number">0</span>;</span></span><br><span class="line"><span class="language-css">      <span class="attribute">width</span>: <span class="number">100vw</span>; <span class="attribute">height</span>: <span class="number">100vh</span>;</span></span><br><span class="line"><span class="language-css">      <span class="attribute">display</span>: flex; <span class="attribute">flex-direction</span>: column;</span></span><br><span class="line"><span class="language-css">      <span class="attribute">align-items</span>: center; <span class="attribute">justify-content</span>: center;</span></span><br><span class="line"><span class="language-css">      <span class="attribute">background</span>: <span class="built_in">rgba</span>(<span class="number">0</span>,<span class="number">0</span>,<span class="number">0</span>,<span class="number">0.3</span>); <span class="attribute">color</span>: <span class="number">#fff</span>;</span></span><br><span class="line"><span class="language-css">    &#125;</span></span><br><span class="line"><span class="language-css">    <span class="selector-class">.time</span> &#123; <span class="attribute">font-size</span>: <span class="number">80px</span>; <span class="attribute">font-weight</span>: <span class="number">300</span>; &#125;</span></span><br><span class="line"><span class="language-css">    <span class="selector-class">.date</span> &#123; <span class="attribute">font-size</span>: <span class="number">24px</span>; <span class="attribute">margin-top</span>: <span class="number">10px</span>; <span class="attribute">opacity</span>: <span class="number">0.8</span>; &#125;</span></span><br><span class="line"><span class="language-css">    <span class="selector-class">.search</span> &#123;</span></span><br><span class="line"><span class="language-css">      <span class="attribute">margin-top</span>: <span class="number">40px</span>; <span class="attribute">width</span>: <span class="number">500px</span>;</span></span><br><span class="line"><span class="language-css">      <span class="attribute">padding</span>: <span class="number">14px</span> <span class="number">24px</span>;</span></span><br><span class="line"><span class="language-css">      <span class="attribute">border</span>: <span class="number">2px</span> solid <span class="built_in">rgba</span>(<span class="number">255</span>,<span class="number">255</span>,<span class="number">255</span>,<span class="number">0.3</span>);</span></span><br><span class="line"><span class="language-css">      <span class="attribute">border-radius</span>: <span class="number">30px</span>;</span></span><br><span class="line"><span class="language-css">      <span class="attribute">background</span>: <span class="built_in">rgba</span>(<span class="number">255</span>,<span class="number">255</span>,<span class="number">255</span>,<span class="number">0.15</span>);</span></span><br><span class="line"><span class="language-css">      <span class="attribute">backdrop-filter</span>: <span class="built_in">blur</span>(<span class="number">10px</span>);</span></span><br><span class="line"><span class="language-css">      <span class="attribute">color</span>: <span class="number">#fff</span>; <span class="attribute">font-size</span>: <span class="number">16px</span>; <span class="attribute">outline</span>: none;</span></span><br><span class="line"><span class="language-css">    &#125;</span></span><br><span class="line"><span class="language-css">    <span class="selector-class">.search</span><span class="selector-pseudo">::placeholder</span> &#123; <span class="attribute">color</span>: <span class="built_in">rgba</span>(<span class="number">255</span>,<span class="number">255</span>,<span class="number">255</span>,<span class="number">0.6</span>); &#125;</span></span><br><span class="line"><span class="language-css">  </span><span class="tag">&lt;/<span class="name">style</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;/<span class="name">head</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;<span class="name">body</span>&gt;</span></span><br><span class="line">  <span class="tag">&lt;<span class="name">video</span> <span class="attr">autoplay</span> <span class="attr">loop</span> <span class="attr">muted</span> <span class="attr">playsinline</span>&gt;</span></span><br><span class="line">    <span class="tag">&lt;<span class="name">source</span> <span class="attr">src</span>=<span class="string">&quot;你的视频地址.mp4&quot;</span> <span class="attr">type</span>=<span class="string">&quot;video/mp4&quot;</span>&gt;</span></span><br><span class="line">  <span class="tag">&lt;/<span class="name">video</span>&gt;</span></span><br><span class="line">  <span class="tag">&lt;<span class="name">div</span> <span class="attr">class</span>=<span class="string">&quot;overlay&quot;</span>&gt;</span></span><br><span class="line">    <span class="tag">&lt;<span class="name">div</span> <span class="attr">class</span>=<span class="string">&quot;time&quot;</span> <span class="attr">id</span>=<span class="string">&quot;time&quot;</span>&gt;</span><span class="tag">&lt;/<span class="name">div</span>&gt;</span></span><br><span class="line">    <span class="tag">&lt;<span class="name">div</span> <span class="attr">class</span>=<span class="string">&quot;date&quot;</span> <span class="attr">id</span>=<span class="string">&quot;date&quot;</span>&gt;</span><span class="tag">&lt;/<span class="name">div</span>&gt;</span></span><br><span class="line">    <span class="tag">&lt;<span class="name">input</span> <span class="attr">class</span>=<span class="string">&quot;search&quot;</span> <span class="attr">type</span>=<span class="string">&quot;text&quot;</span> <span class="attr">placeholder</span>=<span class="string">&quot;搜索你想要的...&quot;</span> <span class="attr">id</span>=<span class="string">&quot;search&quot;</span>&gt;</span></span><br><span class="line">  <span class="tag">&lt;/<span class="name">div</span>&gt;</span></span><br><span class="line">  <span class="tag">&lt;<span class="name">script</span>&gt;</span><span class="language-javascript"></span></span><br><span class="line"><span class="language-javascript">    <span class="keyword">function</span> <span class="title function_">updateTime</span>(<span class="params"></span>) &#123;</span></span><br><span class="line"><span class="language-javascript">      <span class="keyword">const</span> now = <span class="keyword">new</span> <span class="title class_">Date</span>();</span></span><br><span class="line"><span class="language-javascript">      <span class="variable language_">document</span>.<span class="title function_">getElementById</span>(<span class="string">&#x27;time&#x27;</span>).<span class="property">textContent</span> =</span></span><br><span class="line"><span class="language-javascript">        now.<span class="title function_">toLocaleTimeString</span>(<span class="string">&#x27;zh-CN&#x27;</span>, &#123; <span class="attr">hour12</span>: <span class="literal">false</span> &#125;);</span></span><br><span class="line"><span class="language-javascript">      <span class="variable language_">document</span>.<span class="title function_">getElementById</span>(<span class="string">&#x27;date&#x27;</span>).<span class="property">textContent</span> =</span></span><br><span class="line"><span class="language-javascript">        now.<span class="title function_">toLocaleDateString</span>(<span class="string">&#x27;zh-CN&#x27;</span>, &#123;</span></span><br><span class="line"><span class="language-javascript">          <span class="attr">year</span>: <span class="string">&#x27;numeric&#x27;</span>, <span class="attr">month</span>: <span class="string">&#x27;long&#x27;</span>, <span class="attr">day</span>: <span class="string">&#x27;numeric&#x27;</span>, <span class="attr">weekday</span>: <span class="string">&#x27;long&#x27;</span></span></span><br><span class="line"><span class="language-javascript">        &#125;);</span></span><br><span class="line"><span class="language-javascript">    &#125;</span></span><br><span class="line"><span class="language-javascript">    <span class="built_in">setInterval</span>(updateTime, <span class="number">1000</span>);</span></span><br><span class="line"><span class="language-javascript">    <span class="title function_">updateTime</span>();</span></span><br><span class="line"><span class="language-javascript">    <span class="variable language_">document</span>.<span class="title function_">getElementById</span>(<span class="string">&#x27;search&#x27;</span>).<span class="title function_">addEventListener</span>(<span class="string">&#x27;keydown&#x27;</span>, <span class="function"><span class="params">e</span> =&gt;</span> &#123;</span></span><br><span class="line"><span class="language-javascript">      <span class="keyword">if</span> (e.<span class="property">key</span> === <span class="string">&#x27;Enter&#x27;</span>) &#123;</span></span><br><span class="line"><span class="language-javascript">        <span class="variable language_">window</span>.<span class="property">location</span>.<span class="property">href</span> = <span class="string">&#x27;https://www.google.com/search?q=&#x27;</span> +</span></span><br><span class="line"><span class="language-javascript">          <span class="built_in">encodeURIComponent</span>(e.<span class="property">target</span>.<span class="property">value</span>);</span></span><br><span class="line"><span class="language-javascript">      &#125;</span></span><br><span class="line"><span class="language-javascript">    &#125;);</span></span><br><span class="line"><span class="language-javascript">  </span><span class="tag">&lt;/<span class="name">script</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;/<span class="name">body</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;/<span class="name">html</span>&gt;</span></span><br></pre></td></tr></table></figure><p>保存为 HTML，扩展里设成新标签页地址即可～视频换自己喜欢的就好 (◕‿◕✿)</p><hr><h2 id="三、多标签页管理">三、多标签页管理</h2><p>标签页多到标题栏挤成一条线？来，管好它们 ∠( ᐛ 」∠)＿</p><h3 id="3-1-方案对比">3.1 方案对比</h3><table><thead><tr><th>工具</th><th>类型</th><th>核心功能</th><th>收费</th></tr></thead><tbody><tr><td><strong>OneTab</strong></td><td>扩展</td><td>一键收纳所有标签</td><td>免费</td></tr><tr><td><strong>Toby</strong></td><td>扩展</td><td>可视化标签集合</td><td>免费+付费</td></tr><tr><td><strong>Workona</strong></td><td>扩展</td><td>工作区管理</td><td>免费+付费</td></tr><tr><td><strong>Edge 工作区</strong></td><td>内置</td><td>原生工作区</td><td>免费</td></tr><tr><td><strong>Chrome 标签组</strong></td><td>内置</td><td>分组+颜色标记</td><td>免费</td></tr><tr><td><strong>Session Buddy</strong></td><td>扩展</td><td>会话管理+崩溃恢复</td><td>免费</td></tr></tbody></table><h3 id="3-2-OneTab-——-一键拯救内存">3.2 OneTab —— 一键拯救内存</h3><p>标签炸了？点一下，全部收纳成清爽列表，内存直降 95% (☉д⊙)</p><p><strong>安装</strong>：<a href="https://microsoftedge.microsoft.com/addons/detail/onetab/hoimpamkkoehapgenciaoajfkfkpgfop">Edge 商店</a></p><ul><li>一键全部收纳</li><li>列表可分组、锁定、导出</li><li>单标签恢复或全部恢复</li></ul><blockquote><p>专治「舍不得关但又不看」的囤积症 ( ・◇・)？</p></blockquote><h3 id="3-3-原生标签组-——-零扩展方案">3.3 原生标签组 —— 零扩展方案</h3><p><strong>Edge</strong>：右键标签 → 添加到新组 → 命名 + 选色 → 可折叠，支持保存后恢复<br><strong>Chrome</strong>：右键标签 → 向新组添加 → 同理</p><p>按场景配色：🔴 紧急 · 🟢 参考 · 🔵 工具，一眼定位 ( • ̀ω•́ )✧</p><h3 id="3-4-Session-Buddy-——-崩溃保护神">3.4 Session Buddy —— 崩溃保护神</h3><p>浏览器崩溃标签全丢的绝望你懂吗？Session Buddy 自动保存快照，崩了一键恢复 (´；ω；`)ﾌﾞﾜｯ</p><p><strong>安装</strong>：<a href="https://microsoftedge.microsoft.com/addons/detail/session-share/ipbjgjlijbncebpoghpdblidcniaclfn">Edge 商店</a></p><ul><li>自动保存会话快照</li><li>崩溃一键恢复</li><li>手动保存多个会话随时切换</li><li>支持搜索、导出</li></ul><h3 id="3-5-最佳实践速查">3.5 最佳实践速查</h3><table><thead><tr><th>场景</th><th>推荐</th></tr></thead><tbody><tr><td>标签太多想清空</td><td>OneTab</td></tr><tr><td>日常分类</td><td>原生标签组</td></tr><tr><td>项目切换</td><td>Edge 工作区 / Workona</td></tr><tr><td>防崩溃</td><td>Session Buddy</td></tr><tr><td>长期待阅</td><td>OneTab 列表 + 固定标签</td></tr></tbody></table><hr><h2 id="四、我的配置方案">四、我的配置方案</h2><table><thead><tr><th>项目</th><th>选择</th><th>理由</th></tr></thead><tbody><tr><td>浏览器</td><td>Edge</td><td>Chromium 内核 + Windows 原生优化 + 垂直标签页</td></tr><tr><td>新标签页</td><td>Bonjourr</td><td>极简 + 视频背景，打开就是壁纸 (◡‿◡)</td></tr><tr><td>标签收纳</td><td>OneTab</td><td>一键解放内存</td></tr><tr><td>日常管理</td><td>原生标签组</td><td>不装多余扩展，自带的就够用</td></tr><tr><td>会话保存</td><td>Session Buddy</td><td>不怕崩</td></tr><tr><td>主题</td><td>深色模式</td><td>护眼 + OLED 省电</td></tr></tbody></table><hr><h2 id="五、总结">五、总结</h2><p>记住三条就够了：</p><ol><li><strong>少即是多</strong>：扩展能少装就少装，原生功能很能打</li><li><strong>定期大扫除</strong>：每月清一次缓存和无用扩展</li><li><strong>视频标签页</strong>：每天打开浏览器第一眼就心情好，效率自然高 (๑¯◡¯๑)</li></ol><p>有好用的技巧或扩展欢迎评论区分享～那么，掰掰 ( ﾟ∀ﾟ) ﾉ♡</p>]]></content>
    
    
      
      
    <summary type="html">&lt;h1 id=&quot;浏览器优化指南-——-Edge-Chrome-调教-自定义视频标签页-多标签管理&quot;&gt;浏览器优化指南 —— Edge / Chrome 调教 + 自定义视频标签页 + 多标签管理&lt;/h1&gt;
&lt;p&gt;好久不见～今天来一篇浏览器终极调教指南，让你的 Edge 和 Chro</summary>
      
    
    
    
    <category term="性能优化" scheme="https://zhaogb612.github.io/categories/%E6%80%A7%E8%83%BD%E4%BC%98%E5%8C%96/"/>
    
    
    <category term="性能提升" scheme="https://zhaogb612.github.io/tags/%E6%80%A7%E8%83%BD%E6%8F%90%E5%8D%87/"/>
    
    <category term="浏览器" scheme="https://zhaogb612.github.io/tags/%E6%B5%8F%E8%A7%88%E5%99%A8/"/>
    
  </entry>
  
  <entry>
    <title>Hexo 网站配置 Live2D 看板娘 教程</title>
    <link href="https://zhaogb612.github.io/posts/a1b2c3d5.html"/>
    <id>https://zhaogb612.github.io/posts/a1b2c3d5.html</id>
    <published>2026-07-11T15:00:00.000Z</published>
    <updated>2026-07-11T15:10:00.000Z</updated>
    
    <content type="html"><![CDATA[<h1 id="Hexo-网站配置-Live2D-看板娘-教程">Hexo 网站配置 Live2D 看板娘 教程</h1><p>大家好～今天教大家如何给 Hexo 博客添加一个可爱的 Live2D 看板娘 (´▽`ʃ♡ƪ)</p><blockquote><p><strong>免责声明</strong>：本文仅提供操作选项与配置参考，具体实践中如遇到任何错误或问题，均与本站无关。教学方法来源于站主个人经验总结及互联网公开内容，请根据自身实际情况谨慎操作。</p></blockquote><hr><h2 id="一、什么是-Live2D-看板娘">一、什么是 Live2D 看板娘</h2><p><strong>Live2D</strong> 是一种 2D 动画技术，通过分层贴图和网格变形实现流畅的动画效果。将 Live2D 模型作为<strong>看板娘</strong>放在网页上，可以实现：</p><ul><li>模型随鼠标移动自然转头、眨眼</li><li>点击模型有互动反馈（表情变化、动作播放）</li><li>自定义工具栏：截图、切换模型、切换表情等</li><li>自定义提示语，根据页面内容弹出不同台词</li></ul><p>本项目基于 <a href="https://github.com/letere-gzj/live2d-widget-v3">live2d-widget-v3</a> 二次开发，支持 <strong>moc3 格式</strong>的 Live2D 模型（Cubism 3.0 及以上版本），搭配 Cubism 5 SDK，效果流畅。</p><hr><h2 id="二、项目介绍">二、项目介绍</h2><h3 id="2-1-仓库地址">2.1 仓库地址</h3><ul><li><strong>原作者仓库</strong>：<a href="https://github.com/letere-gzj/live2d-widget-v3">letere-gzj/live2d-widget-v3</a></li><li><strong>参考教程</strong>：<a href="https://blog.dogxi.me/diy-website-live2d/">dogxi 博客 — 在你的网站中加入 live2d 自定义看板娘</a></li></ul><h3 id="2-2-项目结构">2.2 项目结构</h3><figure class="highlight nix"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line">live2d-widget-v3<span class="symbol">/</span></span><br><span class="line">├── waifu.css              <span class="comment"># 看板娘样式文件</span></span><br><span class="line">├── waifu-tips.js          <span class="comment"># 提示语逻辑文件</span></span><br><span class="line">├── waifu-tips.json        <span class="comment"># 提示语内容配置</span></span><br><span class="line">├── live2d-sdk.js          <span class="comment"># Live2D Cubism SDK（核心引擎）</span></span><br><span class="line">├── Core<span class="symbol">/</span></span><br><span class="line">│   └── live2dcubismcore.js    <span class="comment"># Cubism Core 渲染核心</span></span><br><span class="line">└── Resources<span class="symbol">/</span></span><br><span class="line">    ├── model_list.json    <span class="comment"># 模型加载列表配置</span></span><br><span class="line">    └── model<span class="symbol">/</span>             <span class="comment"># 模型文件夹，每个模型一个子目录</span></span><br></pre></td></tr></table></figure><blockquote><p><strong>注意</strong>：本项目只支持 <strong>moc3 模型</strong>（Cubism 3.0+），不支持旧的 moc 格式。如果你需要兼容两类模型，可参考 <a href="https://github.com/oh-my-live2d/oh-my-live2d">oh-my-live2d</a> 项目。</p></blockquote><hr><h2 id="三、快速部署-—-直接-CDN-引用">三、快速部署 — 直接 CDN 引用</h2><h3 id="3-1-引入脚本">3.1 引入脚本</h3><p>在 Hexo 主题的布局文件中注入以下脚本（Butterfly 主题可在 <code>_config.butterfly.yml</code> 的 <code>inject.bottom</code> 中添加）：</p><figure class="highlight html"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br></pre></td><td class="code"><pre><span class="line"><span class="tag">&lt;<span class="name">script</span>&gt;</span><span class="language-javascript"></span></span><br><span class="line"><span class="language-javascript">  <span class="keyword">const</span> cdnPath = <span class="string">&#x27;https://cdn.jsdelivr.net/gh/你的用户名/你的仓库@main/&#x27;</span></span></span><br><span class="line"><span class="language-javascript">  <span class="keyword">const</span> config = &#123;</span></span><br><span class="line"><span class="language-javascript">    <span class="attr">path</span>: &#123;</span></span><br><span class="line"><span class="language-javascript">      <span class="attr">homePath</span>: <span class="string">&#x27;/&#x27;</span>,</span></span><br><span class="line"><span class="language-javascript">      <span class="attr">modelPath</span>: cdnPath + <span class="string">&#x27;/Resources/&#x27;</span>,</span></span><br><span class="line"><span class="language-javascript">      <span class="attr">cssPath</span>: cdnPath + <span class="string">&#x27;/waifu.css&#x27;</span>,</span></span><br><span class="line"><span class="language-javascript">      <span class="attr">tipsJsonPath</span>: cdnPath + <span class="string">&#x27;/waifu-tips.json&#x27;</span>,</span></span><br><span class="line"><span class="language-javascript">      <span class="attr">tipsJsPath</span>: cdnPath + <span class="string">&#x27;/waifu-tips.js&#x27;</span>,</span></span><br><span class="line"><span class="language-javascript">      <span class="attr">live2dCorePath</span>: cdnPath + <span class="string">&#x27;/Core/live2dcubismcore.js&#x27;</span>,</span></span><br><span class="line"><span class="language-javascript">      <span class="attr">live2dSdkPath</span>: cdnPath + <span class="string">&#x27;/live2d-sdk.js&#x27;</span>,</span></span><br><span class="line"><span class="language-javascript">    &#125;,</span></span><br><span class="line"><span class="language-javascript">    <span class="attr">tools</span>: [<span class="string">&#x27;hitokoto&#x27;</span>, <span class="string">&#x27;asteroids&#x27;</span>, <span class="string">&#x27;express&#x27;</span>, <span class="string">&#x27;switch-model&#x27;</span>, <span class="string">&#x27;switch-texture&#x27;</span>, <span class="string">&#x27;photo&#x27;</span>, <span class="string">&#x27;info&#x27;</span>, <span class="string">&#x27;quit&#x27;</span>],</span></span><br><span class="line"><span class="language-javascript">    <span class="attr">drag</span>: &#123; <span class="attr">enable</span>: <span class="literal">true</span>, <span class="attr">direction</span>: [<span class="string">&#x27;x&#x27;</span>, <span class="string">&#x27;y&#x27;</span>] &#125;,</span></span><br><span class="line"><span class="language-javascript">    <span class="attr">switchType</span>: <span class="string">&#x27;order&#x27;</span>,</span></span><br><span class="line"><span class="language-javascript">  &#125;</span></span><br><span class="line"><span class="language-javascript"></span></span><br><span class="line"><span class="language-javascript">  <span class="keyword">if</span> (screen.<span class="property">width</span> &gt;= <span class="number">768</span>) &#123;</span></span><br><span class="line"><span class="language-javascript">    <span class="title class_">Promise</span>.<span class="title function_">all</span>([</span></span><br><span class="line"><span class="language-javascript">      <span class="title function_">loadExternalResource</span>(config.<span class="property">path</span>.<span class="property">cssPath</span>, <span class="string">&#x27;css&#x27;</span>),</span></span><br><span class="line"><span class="language-javascript">      <span class="title function_">loadExternalResource</span>(config.<span class="property">path</span>.<span class="property">live2dCorePath</span>, <span class="string">&#x27;js&#x27;</span>),</span></span><br><span class="line"><span class="language-javascript">      <span class="title function_">loadExternalResource</span>(config.<span class="property">path</span>.<span class="property">live2dSdkPath</span>, <span class="string">&#x27;js&#x27;</span>),</span></span><br><span class="line"><span class="language-javascript">      <span class="title function_">loadExternalResource</span>(config.<span class="property">path</span>.<span class="property">tipsJsPath</span>, <span class="string">&#x27;js&#x27;</span>),</span></span><br><span class="line"><span class="language-javascript">    ]).<span class="title function_">then</span>(<span class="function">() =&gt;</span> &#123;</span></span><br><span class="line"><span class="language-javascript">      <span class="title function_">initWidget</span>(&#123;</span></span><br><span class="line"><span class="language-javascript">        <span class="attr">waifuPath</span>: config.<span class="property">path</span>.<span class="property">tipsJsonPath</span>,</span></span><br><span class="line"><span class="language-javascript">        <span class="attr">cdnPath</span>: config.<span class="property">path</span>.<span class="property">modelPath</span>,</span></span><br><span class="line"><span class="language-javascript">        <span class="attr">tools</span>: config.<span class="property">tools</span>,</span></span><br><span class="line"><span class="language-javascript">        <span class="attr">dragEnable</span>: config.<span class="property">drag</span>.<span class="property">enable</span>,</span></span><br><span class="line"><span class="language-javascript">        <span class="attr">dragDirection</span>: config.<span class="property">drag</span>.<span class="property">direction</span>,</span></span><br><span class="line"><span class="language-javascript">        <span class="attr">switchType</span>: config.<span class="property">switchType</span>,</span></span><br><span class="line"><span class="language-javascript">      &#125;)</span></span><br><span class="line"><span class="language-javascript">    &#125;)</span></span><br><span class="line"><span class="language-javascript">  &#125;</span></span><br><span class="line"><span class="language-javascript"></span></span><br><span class="line"><span class="language-javascript">  <span class="keyword">function</span> <span class="title function_">loadExternalResource</span>(<span class="params">url, type</span>) &#123;</span></span><br><span class="line"><span class="language-javascript">    <span class="keyword">return</span> <span class="keyword">new</span> <span class="title class_">Promise</span>(<span class="function">(<span class="params">resolve, reject</span>) =&gt;</span> &#123;</span></span><br><span class="line"><span class="language-javascript">      <span class="keyword">let</span> tag</span></span><br><span class="line"><span class="language-javascript">      <span class="keyword">if</span> (type === <span class="string">&#x27;css&#x27;</span>) &#123; tag = <span class="variable language_">document</span>.<span class="title function_">createElement</span>(<span class="string">&#x27;link&#x27;</span>); tag.<span class="property">rel</span> = <span class="string">&#x27;stylesheet&#x27;</span>; tag.<span class="property">href</span> = url &#125;</span></span><br><span class="line"><span class="language-javascript">      <span class="keyword">else</span> <span class="keyword">if</span> (type === <span class="string">&#x27;js&#x27;</span>) &#123; tag = <span class="variable language_">document</span>.<span class="title function_">createElement</span>(<span class="string">&#x27;script&#x27;</span>); tag.<span class="property">src</span> = url &#125;</span></span><br><span class="line"><span class="language-javascript">      <span class="keyword">if</span> (tag) &#123;</span></span><br><span class="line"><span class="language-javascript">        tag.<span class="property">onload</span> = <span class="function">() =&gt;</span> <span class="title function_">resolve</span>(url)</span></span><br><span class="line"><span class="language-javascript">        tag.<span class="property">onerror</span> = <span class="function">() =&gt;</span> <span class="title function_">reject</span>(url)</span></span><br><span class="line"><span class="language-javascript">        <span class="variable language_">document</span>.<span class="property">head</span>.<span class="title function_">appendChild</span>(tag)</span></span><br><span class="line"><span class="language-javascript">      &#125;</span></span><br><span class="line"><span class="language-javascript">    &#125;)</span></span><br><span class="line"><span class="language-javascript">  &#125;</span></span><br><span class="line"><span class="language-javascript"></span><span class="tag">&lt;/<span class="name">script</span>&gt;</span></span><br></pre></td></tr></table></figure><h3 id="3-2-参数说明">3.2 参数说明</h3><table><thead><tr><th>参数</th><th>说明</th></tr></thead><tbody><tr><td><code>path.homePath</code></td><td>网站主页路径，有子路径则填写子路径，否则填 <code>/</code></td></tr><tr><td><code>path.modelPath</code></td><td>模型文件路径，可用 CDN 地址</td></tr><tr><td><code>path.cssPath</code></td><td>看板娘样式文件路径</td></tr><tr><td><code>path.tipsJsonPath</code></td><td>提示语 JSON 文件路径</td></tr><tr><td><code>tools</code></td><td>工具栏按钮（见下方说明）</td></tr><tr><td><code>drag.enable</code></td><td>是否开启拖拽</td></tr><tr><td><code>switchType</code></td><td>模型切换方式：<code>order</code> 顺序 / <code>random</code> 随机</td></tr></tbody></table><h3 id="3-3-工具栏按钮说明">3.3 工具栏按钮说明</h3><table><thead><tr><th>按钮</th><th>功能</th></tr></thead><tbody><tr><td><code>hitokoto</code></td><td>一言（随机句子）</td></tr><tr><td><code>asteroids</code></td><td>网页飞机小游戏</td></tr><tr><td><code>express</code></td><td>切换模型表情</td></tr><tr><td><code>switch-model</code></td><td>切换模型分组</td></tr><tr><td><code>switch-texture</code></td><td>切换分组下的模型</td></tr><tr><td><code>photo</code></td><td>截图下载</td></tr><tr><td><code>info</code></td><td>作者信息</td></tr><tr><td><code>quit</code></td><td>隐藏看板娘</td></tr></tbody></table><h3 id="3-4-Butterfly-主题注入配置示例">3.4 Butterfly 主题注入配置示例</h3><p>在 <code>_config.butterfly.yml</code> 的 <code>inject.bottom</code> 中添加：</p><figure class="highlight yaml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">inject:</span></span><br><span class="line">  <span class="attr">bottom:</span></span><br><span class="line">    <span class="bullet">-</span> <span class="string">&lt;script</span> <span class="string">src=&quot;/live2d/waifu.css&quot;&gt;&lt;/script&gt;</span> <span class="comment"># 如果使用本地部署</span></span><br><span class="line">    <span class="bullet">-</span> <span class="string">&lt;script&gt;</span></span><br><span class="line">        <span class="string">const</span> <span class="string">cdnPath</span> <span class="string">=</span> <span class="string">&#x27;/live2d/&#x27;</span>  <span class="comment"># 本地路径，以 / 结尾</span></span><br><span class="line">        <span class="string">//</span> <span class="string">...</span> <span class="string">上述完整脚本</span> <span class="string">...</span></span><br><span class="line">    <span class="string">&lt;/script&gt;</span></span><br></pre></td></tr></table></figure><blockquote><p>注意：路径以 <code>/</code> 结尾是必须的，否则资源加载会 404。</p></blockquote><hr><h2 id="四、自定义模型">四、自定义模型</h2><h3 id="4-1-模型目录结构">4.1 模型目录结构</h3><p>每个模型应放在 <code>Resources/model/</code> 下的独立文件夹中，目录结构如下：</p><figure class="highlight jboss-cli"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br></pre></td><td class="code"><pre><span class="line">Resources/model/你的模型名/</span><br><span class="line">├── config.json              <span class="comment"># 模型大小和位置配置</span></span><br><span class="line">├── 你的模型名<span class="string">.model3.json</span>   <span class="comment"># 模型主配置文件</span></span><br><span class="line">├── 你的模型名<span class="string">.moc3</span>          <span class="comment"># 模型数据文件</span></span><br><span class="line">├── 你的模型名<span class="string">.physics3.json</span> <span class="comment"># 物理效果配置</span></span><br><span class="line">├── 你的模型名<span class="string">.cdi3.json</span>     <span class="comment"># 显示信息配置</span></span><br><span class="line">├── 你的模型名<span class="string">.vtube.json</span>    <span class="comment"># VTS 配置</span></span><br><span class="line">├── 你的模型名<span class="string">.8192/</span>         <span class="comment"># 纹理贴图文件夹</span></span><br><span class="line">│   └── texture_00.png       <span class="comment"># 贴图文件</span></span><br><span class="line">├── expressions/             <span class="comment"># 表情文件夹</span></span><br><span class="line">│   └── xxx.exp3.json        <span class="comment"># 表情文件</span></span><br><span class="line">└── motions/                 <span class="comment"># 动作文件夹（可选）</span></span><br><span class="line">    └── xxx.motion3.json     <span class="comment"># 动作文件</span></span><br></pre></td></tr></table></figure><h3 id="4-2-调整模型大小和位置">4.2 调整模型大小和位置</h3><p>在模型文件夹下创建 <code>config.json</code>：</p><figure class="highlight json"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line"><span class="punctuation">&#123;</span></span><br><span class="line">  <span class="attr">&quot;scale&quot;</span><span class="punctuation">:</span> <span class="number">1.0</span><span class="punctuation">,</span></span><br><span class="line">  <span class="attr">&quot;translate&quot;</span><span class="punctuation">:</span> <span class="punctuation">&#123;</span></span><br><span class="line">    <span class="attr">&quot;x&quot;</span><span class="punctuation">:</span> <span class="number">0.0</span><span class="punctuation">,</span></span><br><span class="line">    <span class="attr">&quot;y&quot;</span><span class="punctuation">:</span> <span class="number">0.0</span></span><br><span class="line">  <span class="punctuation">&#125;</span></span><br><span class="line"><span class="punctuation">&#125;</span></span><br></pre></td></tr></table></figure><ul><li><code>scale</code>：模型大小（值越大模型越大）</li><li><code>translate.x</code>：水平偏移（正数向右）</li><li><code>translate.y</code>：垂直偏移（正数向上）</li></ul><h3 id="4-3-配置模型表情">4.3 配置模型表情</h3><p>编辑 <code>xxx.model3.json</code>，在 <code>FileReferences</code> 中添加 <code>Expressions</code> 字段：</p><figure class="highlight json"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br></pre></td><td class="code"><pre><span class="line"><span class="punctuation">&#123;</span></span><br><span class="line">  <span class="attr">&quot;Version&quot;</span><span class="punctuation">:</span> <span class="number">3</span><span class="punctuation">,</span></span><br><span class="line">  <span class="attr">&quot;FileReferences&quot;</span><span class="punctuation">:</span> <span class="punctuation">&#123;</span></span><br><span class="line">    <span class="attr">&quot;Moc&quot;</span><span class="punctuation">:</span> <span class="string">&quot;模型名.moc3&quot;</span><span class="punctuation">,</span></span><br><span class="line">    <span class="attr">&quot;Textures&quot;</span><span class="punctuation">:</span> <span class="punctuation">[</span><span class="string">&quot;模型名.8192/texture_00.png&quot;</span><span class="punctuation">]</span><span class="punctuation">,</span></span><br><span class="line">    <span class="attr">&quot;Physics&quot;</span><span class="punctuation">:</span> <span class="string">&quot;模型名.physics3.json&quot;</span><span class="punctuation">,</span></span><br><span class="line">    <span class="attr">&quot;DisplayInfo&quot;</span><span class="punctuation">:</span> <span class="string">&quot;模型名.cdi3.json&quot;</span><span class="punctuation">,</span></span><br><span class="line">    <span class="attr">&quot;Expressions&quot;</span><span class="punctuation">:</span> <span class="punctuation">[</span></span><br><span class="line">      <span class="punctuation">&#123;</span> <span class="attr">&quot;Name&quot;</span><span class="punctuation">:</span> <span class="string">&quot;表情名称&quot;</span><span class="punctuation">,</span> <span class="attr">&quot;File&quot;</span><span class="punctuation">:</span> <span class="string">&quot;expressions/表情文件.exp3.json&quot;</span> <span class="punctuation">&#125;</span></span><br><span class="line">    <span class="punctuation">]</span></span><br><span class="line">  <span class="punctuation">&#125;</span></span><br><span class="line"><span class="punctuation">&#125;</span></span><br></pre></td></tr></table></figure><h3 id="4-4-配置模型动作">4.4 配置模型动作</h3><p>动作分为两种：</p><ul><li><strong>Idle（闲置动作）</strong>：模型空闲时随机播放</li><li><strong>TapBody（点击动作）</strong>：点击模型时随机播放</li></ul><figure class="highlight json"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br></pre></td><td class="code"><pre><span class="line"><span class="punctuation">&#123;</span></span><br><span class="line">  <span class="attr">&quot;FileReferences&quot;</span><span class="punctuation">:</span> <span class="punctuation">&#123;</span></span><br><span class="line">    <span class="attr">&quot;Motions&quot;</span><span class="punctuation">:</span> <span class="punctuation">&#123;</span></span><br><span class="line">      <span class="attr">&quot;Idle&quot;</span><span class="punctuation">:</span> <span class="punctuation">[</span></span><br><span class="line">        <span class="punctuation">&#123;</span> <span class="attr">&quot;File&quot;</span><span class="punctuation">:</span> <span class="string">&quot;motions/动作文件.motion3.json&quot;</span> <span class="punctuation">&#125;</span></span><br><span class="line">      <span class="punctuation">]</span><span class="punctuation">,</span></span><br><span class="line">      <span class="attr">&quot;TapBody&quot;</span><span class="punctuation">:</span> <span class="punctuation">[</span></span><br><span class="line">        <span class="punctuation">&#123;</span> <span class="attr">&quot;File&quot;</span><span class="punctuation">:</span> <span class="string">&quot;motions/动作文件.motion3.json&quot;</span><span class="punctuation">,</span> <span class="attr">&quot;Sound&quot;</span><span class="punctuation">:</span> <span class="string">&quot;motions/音效文件.mp3&quot;</span> <span class="punctuation">&#125;</span></span><br><span class="line">      <span class="punctuation">]</span></span><br><span class="line">    <span class="punctuation">&#125;</span></span><br><span class="line">  <span class="punctuation">&#125;</span></span><br><span class="line"><span class="punctuation">&#125;</span></span><br></pre></td></tr></table></figure><p>其中 <code>Sound</code> 为可选字段，配置后点击模型会播放音效。</p><h3 id="4-5-配置模型加载列表">4.5 配置模型加载列表</h3><p>编辑 <code>Resources/model_list.json</code>，按格式填入你的模型：</p><figure class="highlight json"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line"><span class="punctuation">&#123;</span></span><br><span class="line">  <span class="attr">&quot;models&quot;</span><span class="punctuation">:</span> <span class="punctuation">[</span></span><br><span class="line">    <span class="punctuation">[</span><span class="string">&quot;模型1文件夹名&quot;</span><span class="punctuation">,</span> <span class="string">&quot;模型2文件夹名&quot;</span><span class="punctuation">]</span><span class="punctuation">,</span></span><br><span class="line">    <span class="punctuation">[</span><span class="string">&quot;模型3文件夹名&quot;</span><span class="punctuation">]</span></span><br><span class="line">  <span class="punctuation">]</span><span class="punctuation">,</span></span><br><span class="line">  <span class="attr">&quot;messages&quot;</span><span class="punctuation">:</span> <span class="punctuation">[</span></span><br><span class="line">    <span class="punctuation">[</span><span class="string">&quot;模型1入场语&quot;</span><span class="punctuation">,</span> <span class="string">&quot;模型2入场语&quot;</span><span class="punctuation">]</span><span class="punctuation">,</span></span><br><span class="line">    <span class="punctuation">[</span><span class="string">&quot;模型3入场语&quot;</span><span class="punctuation">]</span></span><br><span class="line">  <span class="punctuation">]</span></span><br><span class="line"><span class="punctuation">&#125;</span></span><br></pre></td></tr></table></figure><p><strong>说明：</strong></p><ul><li>外层数组的每个元素是一个<strong>分组</strong>，分组内可以有一个或多个模型</li><li>工具栏的「切换模型」按钮按<strong>分组</strong>切换</li><li>分组内的模型通过「切换纹理」按钮切换</li><li><code>messages</code> 与 <code>models</code> 结构一一对应</li></ul><p><strong>示例（你的博客当前配置）：</strong></p><figure class="highlight json"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"><span class="punctuation">&#123;</span></span><br><span class="line">  <span class="attr">&quot;models&quot;</span><span class="punctuation">:</span> <span class="punctuation">[</span><span class="punctuation">[</span><span class="string">&quot;ariu&quot;</span><span class="punctuation">,</span> <span class="string">&quot;atri&quot;</span><span class="punctuation">,</span> <span class="string">&quot;yumi&quot;</span><span class="punctuation">,</span> <span class="string">&quot;mali&quot;</span><span class="punctuation">]</span><span class="punctuation">]</span><span class="punctuation">,</span></span><br><span class="line">  <span class="attr">&quot;messages&quot;</span><span class="punctuation">:</span> <span class="punctuation">[</span><span class="punctuation">[</span><span class="string">&quot;你好，我是ariu&quot;</span><span class="punctuation">,</span> <span class="string">&quot;你好，我是玛丽偶像&quot;</span><span class="punctuation">]</span><span class="punctuation">]</span></span><br><span class="line"><span class="punctuation">&#125;</span></span><br></pre></td></tr></table></figure><p>这里 4 个模型在同一个分组中，通过「切换纹理」按钮轮换。</p><hr><h2 id="五、部署到-GitHub-jsDelivr-CDN">五、部署到 GitHub + jsDelivr CDN</h2><h3 id="5-1-上传到-GitHub">5.1 上传到 GitHub</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># 在 GitHub 创建新仓库（如 live2d-widget-v3）</span></span><br><span class="line"><span class="comment"># 然后本地推送到仓库</span></span><br><span class="line">git init</span><br><span class="line">git add .</span><br><span class="line">git commit -m <span class="string">&quot;初始化 Live2D 项目&quot;</span></span><br><span class="line">git branch -M main</span><br><span class="line">git remote add origin git@github.com:你的用户名/live2d-widget-v3.git</span><br><span class="line">git push -u origin main</span><br></pre></td></tr></table></figure><h3 id="5-2-使用-jsDelivr-CDN">5.2 使用 jsDelivr CDN</h3><p>jsDelivr 是一个免费的全球加速 CDN，可以代理 GitHub 仓库的文件：</p><figure class="highlight awk"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">https:<span class="regexp">//</span>cdn.jsdelivr.net<span class="regexp">/gh/</span>你的用户名<span class="regexp">/你的仓库名@分支名/</span></span><br></pre></td></tr></table></figure><p>例如：</p><figure class="highlight awk"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">https:<span class="regexp">//</span>cdn.jsdelivr.net<span class="regexp">/gh/</span>dogxii<span class="regexp">/live2d-widget-v3@main/</span></span><br></pre></td></tr></table></figure><p>将脚本中的 <code>cdnPath</code> 改为：</p><figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">const</span> cdnPath = <span class="string">&#x27;https://cdn.jsdelivr.net/gh/你的用户名/live2d-widget-v3@main/&#x27;</span></span><br></pre></td></tr></table></figure><h3 id="5-3-刷新-CDN-缓存">5.3 刷新 CDN 缓存</h3><p>jsDelivr 有 24 小时的缓存机制。当你更新仓库文件后，访问以下链接可以手动刷新缓存：</p><figure class="highlight awk"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">https:<span class="regexp">//</span>purge.jsdelivr.net<span class="regexp">/gh/</span>你的用户名<span class="regexp">/你的仓库名@分支名/</span></span><br></pre></td></tr></table></figure><p>例如：</p><figure class="highlight awk"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">https:<span class="regexp">//</span>purge.jsdelivr.net<span class="regexp">/gh/</span>dogxii<span class="regexp">/live2d-widget-v3@main/</span></span><br></pre></td></tr></table></figure><h3 id="5-4-本地部署（替代方案）">5.4 本地部署（替代方案）</h3><p>如果你的服务器带宽充足，或者不想依赖外部 CDN，也可以将文件放在博客的 <code>source</code> 目录下直接引用：</p><figure class="highlight awk"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">将 live2d 文件夹放入 blog<span class="regexp">/source/</span> 目录</span><br><span class="line">cdnPath 改为 <span class="regexp">/live2d/</span></span><br></pre></td></tr></table></figure><p>这样 <code>hexo g</code> 生成时会将文件直接复制到 <code>public</code> 目录。</p><hr><h2 id="六、自定义样式和提示语">六、自定义样式和提示语</h2><h3 id="6-1-修改看板娘位置">6.1 修改看板娘位置</h3><p>编辑 <code>waifu.css</code>，通过修改 <code>right</code> 和 <code>bottom</code> 属性调整位置：</p><figure class="highlight css"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"><span class="selector-id">#waifu</span> &#123;</span><br><span class="line">  <span class="attribute">right</span>: <span class="number">30px</span>;   <span class="comment">/* 距右侧距离 */</span></span><br><span class="line">  <span class="attribute">bottom</span>: <span class="number">0</span>;     <span class="comment">/* 距底部距离 */</span></span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure><p>如果想放到左侧，把 <code>right</code> 改为 <code>left</code> 即可。</p><h3 id="6-2-自定义提示语">6.2 自定义提示语</h3><p>编辑 <code>waifu-tips.json</code>，可以配置看板娘在不同页面的提示语：</p><figure class="highlight json"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br></pre></td><td class="code"><pre><span class="line"><span class="punctuation">&#123;</span></span><br><span class="line">  <span class="attr">&quot;mouseover&quot;</span><span class="punctuation">:</span> <span class="punctuation">[</span></span><br><span class="line">    <span class="punctuation">&#123;</span></span><br><span class="line">      <span class="attr">&quot;selector&quot;</span><span class="punctuation">:</span> <span class="string">&quot;a[href^=&#x27;/&#x27;]&quot;</span><span class="punctuation">,</span></span><br><span class="line">      <span class="attr">&quot;text&quot;</span><span class="punctuation">:</span> <span class="punctuation">[</span><span class="string">&quot;你点我干嘛！&quot;</span><span class="punctuation">]</span></span><br><span class="line">    <span class="punctuation">&#125;</span></span><br><span class="line">  <span class="punctuation">]</span><span class="punctuation">,</span></span><br><span class="line">  <span class="attr">&quot;click&quot;</span><span class="punctuation">:</span> <span class="punctuation">[</span></span><br><span class="line">    <span class="punctuation">&#123;</span></span><br><span class="line">      <span class="attr">&quot;selector&quot;</span><span class="punctuation">:</span> <span class="string">&quot;#waifu&quot;</span><span class="punctuation">,</span></span><br><span class="line">      <span class="attr">&quot;text&quot;</span><span class="punctuation">:</span> <span class="punctuation">[</span><span class="string">&quot;别戳我！&quot;</span><span class="punctuation">]</span></span><br><span class="line">    <span class="punctuation">&#125;</span></span><br><span class="line">  <span class="punctuation">]</span></span><br><span class="line"><span class="punctuation">&#125;</span></span><br></pre></td></tr></table></figure><p>提示语支持两种触发方式：</p><table><thead><tr><th>类型</th><th>触发条件</th></tr></thead><tbody><tr><td><code>mouseover</code></td><td>鼠标悬停在指定元素上</td></tr><tr><td><code>click</code></td><td>点击指定元素</td></tr><tr><td><code>seasons</code></td><td>特定日期（生日、节日等）</td></tr><tr><td><code>message</code></td><td>定时弹出消息</td></tr></tbody></table><h3 id="6-3-自定义工具栏">6.3 自定义工具栏</h3><p>在脚本中修改 <code>tools</code> 数组即可增减工具栏按钮：</p><figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">tools</span>: [<span class="string">&#x27;hitokoto&#x27;</span>, <span class="string">&#x27;switch-model&#x27;</span>, <span class="string">&#x27;express&#x27;</span>, <span class="string">&#x27;photo&#x27;</span>, <span class="string">&#x27;quit&#x27;</span>]</span><br></pre></td></tr></table></figure><p>这样就只保留了一言、切换模型、切换表情、截图和退出 5 个按钮。</p><hr><h2 id="七、模型获取">七、模型获取</h2><p>以下是可用的 Live2D 模型资源（均需为 moc3 格式）：</p><blockquote><p><strong>版权声明</strong>：以下资源均收集于互联网，仅供学习参考。请尊重创作者版权，禁止用于商业用途。</p></blockquote><table><thead><tr><th>渠道</th><th>说明</th></tr></thead><tbody><tr><td><a href="https://www.bilibili.com/video/BV15z4y1F7db/">Bilibili 视频</a></td><td>UP 主分享的免费模型（草莓兔兔等）</td></tr><tr><td><a href="https://www.live2d.com/download/sample-data/">Live2D 官方示例</a></td><td>Live2D 官方的免费示例模型</td></tr><tr><td><a href="https://booth.pm/">Booth.pm</a></td><td>日本同人模型市场（部分免费）</td></tr><tr><td><a href="https://pan.huang1111.cn/s/2vARlhN">网盘分享 — huang1111</a></td><td>沙尘612提供</td></tr><tr><td><a href="https://1817487102.share.123pan.cn/123pan/AYjjVv-dMId3">网盘分享 — 123云盘</a></td><td>沙尘612提供</td></tr></tbody></table><hr><h2 id="八、常见问题">八、常见问题</h2><h3 id="Q1：看板娘显示空白，只看到工具栏">Q1：看板娘显示空白，只看到工具栏</h3><p>可能原因：</p><ol><li><strong>模型路径错误</strong>：检查 <code>modelPath</code> 是否正确，确认模型文件夹名与 <code>model_list.json</code> 一致</li><li><strong>CORS 问题</strong>：使用本地文件（<code>file://</code>）打开页面时，浏览器会拦截跨域加载。解决方案：<ul><li>启动本地服务器（<code>python -m http.server 8000</code>）后通过 <code>localhost</code> 访问</li><li>或部署到服务器/CDN 后访问</li></ul></li><li><strong>模型文件损坏</strong>：确认 <code>.moc3</code> 文件完整，<code>model3.json</code> 中的文件路径引用正确</li></ol><h3 id="Q2：模型加载速度慢">Q2：模型加载速度慢</h3><ul><li>使用 CDN（jsDelivr、Cloudflare 等）加速静态资源</li><li>确认每个模型文件夹大小，过大的纹理贴图会拖慢加载</li><li>可以考虑将纹理转为 WebP 格式减小体积</li></ul><h3 id="Q3：看板娘被页面内容遮挡">Q3：看板娘被页面内容遮挡</h3><p>修改 <code>waifu.css</code> 中的 <code>z-index</code>：</p><figure class="highlight css"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="selector-id">#waifu</span> &#123;</span><br><span class="line">  <span class="attribute">z-index</span>: <span class="number">9999</span>;  <span class="comment">/* 足够大即可显示在最上层 */</span></span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure><h3 id="Q4：模型不出来，控制台报-404">Q4：模型不出来，控制台报 404</h3><ul><li>检查 <code>model_list.json</code> 中的文件夹名是否与实际文件夹名一致（区分大小写）</li><li>检查模型 <code>model3.json</code> 中引用的文件路径是否正确</li><li>检查 <code>cdnPath</code> 结尾是否有 <code>/</code></li></ul><h3 id="Q5：手机端不显示看板娘">Q5：手机端不显示看板娘</h3><p>脚本中默认限制了 <code>screen.width &gt;= 768</code> 才加载。如果你想在手机上也显示，可以移除这个判断或将 <code>768</code> 改小：</p><figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">// 移除 if 判断，直接执行</span></span><br><span class="line"><span class="title class_">Promise</span>.<span class="title function_">all</span>([...]).<span class="title function_">then</span>(<span class="function">() =&gt;</span> &#123; ... &#125;)</span><br></pre></td></tr></table></figure><hr><h2 id="九、总结">九、总结</h2><table><thead><tr><th>步骤</th><th>操作</th></tr></thead><tbody><tr><td>1</td><td>Fork 或下载 <a href="https://github.com/letere-gzj/live2d-widget-v3">live2d-widget-v3</a> 项目</td></tr><tr><td>2</td><td>将模型放入 <code>Resources/model/</code> 并配置 <code>model_list.json</code></td></tr><tr><td>3</td><td>上传到 GitHub，使用 jsDelivr CDN</td></tr><tr><td>4</td><td>在博客主题中注入脚本，设置 <code>cdnPath</code></td></tr><tr><td>5</td><td>按需修改 <code>waifu.css</code> 样式和 <code>waifu-tips.json</code> 提示语</td></tr></tbody></table><p>有了看板娘，你的博客瞬间就有了灵魂～快去试试吧 (´▽`ʃ♡ƪ)</p><hr><blockquote><p>小贴士：初次加载因为 CDN 缓存可能需要等待几分钟，耐心即可。你也可以使用 <code>purge.jsdelivr.net</code> 提前刷新缓存。</p></blockquote><h3 id="相关链接">相关链接</h3><table><thead><tr><th>资源</th><th>地址</th></tr></thead><tbody><tr><td>原作者项目</td><td><a href="https://github.com/letere-gzj/live2d-widget-v3">letere-gzj/live2d-widget-v3</a></td></tr><tr><td>参考教程</td><td><a href="https://blog.dogxi.me/diy-website-live2d/">dogxi 博客 — 在你的网站中加入 live2d 自定义看板娘</a></td></tr><tr><td>参考文章</td><td><a href="https://letere-gzj.github.io/hugo-stack/p/hugo/live2d-moc3/">letere-gzj — Hugo 博客引入 moc3 类型的 live2d 模型</a></td></tr><tr><td>jsDelivr CDN</td><td><a href="https://www.jsdelivr.com/">jsdelivr.com</a></td></tr><tr><td>兼容型项目</td><td><a href="https://github.com/oh-my-live2d/oh-my-live2d">oh-my-live2d</a></td></tr><tr><td>兼容型项目</td><td><a href="https://github.com/Konata09/Live2dOnWeb">Live2dOnWeb</a></td></tr></tbody></table>]]></content>
    
    
      
      
    <summary type="html">&lt;h1 id=&quot;Hexo-网站配置-Live2D-看板娘-教程&quot;&gt;Hexo 网站配置 Live2D 看板娘 教程&lt;/h1&gt;
&lt;p&gt;大家好～今天教大家如何给 Hexo 博客添加一个可爱的 Live2D 看板娘 (´▽`ʃ♡ƪ)&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong</summary>
      
    
    
    
    <category term="技术学习" scheme="https://zhaogb612.github.io/categories/%E6%8A%80%E6%9C%AF%E5%AD%A6%E4%B9%A0/"/>
    
    
    <category term="技术学习" scheme="https://zhaogb612.github.io/tags/%E6%8A%80%E6%9C%AF%E5%AD%A6%E4%B9%A0/"/>
    
    <category term="Hexo" scheme="https://zhaogb612.github.io/tags/Hexo/"/>
    
    <category term="Live2D" scheme="https://zhaogb612.github.io/tags/Live2D/"/>
    
  </entry>
  
  <entry>
    <title>Hexo 网站公告栏 — Butterfly 主题公告配置教程</title>
    <link href="https://zhaogb612.github.io/posts/e7c3d4f5.html"/>
    <id>https://zhaogb612.github.io/posts/e7c3d4f5.html</id>
    <published>2026-07-11T14:00:00.000Z</published>
    <updated>2026-07-11T14:30:00.000Z</updated>
    
    <content type="html"><![CDATA[<h1 id="Hexo-网站公告栏-—-Butterfly-主题公告配置教程">Hexo 网站公告栏 — Butterfly 主题公告配置教程</h1><p>大家好～今天教大家如何给 Butterfly 主题的 Hexo 博客配置一个漂亮的公告栏 (´▽`ʃ♡ƪ)</p><blockquote><p><strong>免责声明</strong>：本文仅提供操作选项与配置参考，具体实践中如遇到任何错误或问题，均与本站无关。教学方法来源于站主个人经验总结及互联网公开内容，请根据自身实际情况谨慎操作。</p></blockquote><hr><h2 id="一、前言">一、前言</h2><p>Butterfly 主题自带了公告栏功能（<code>card_announcement</code>），默认情况下它只能显示一段静态文本。但我们可以通过 <strong>inject 注入</strong> 功能，让它支持文字轮播、自定义样式，变成一个动态的信息展示区域。</p><p>最终效果：</p><ul><li>每次只显示一条公告，每 4 秒自动轮换</li><li>淡入上移动画，过渡自然</li><li>支持白天/黑夜模式自动适配</li><li>文字靠左显示，简洁美观</li></ul><hr><h2 id="二、开启公告栏">二、开启公告栏</h2><p>在 Butterfly 主题配置文件 <code>_config.butterfly.yml</code> 中找到 <code>card_announcement</code> 并开启：</p><figure class="highlight yaml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">card_announcement:</span></span><br><span class="line">  <span class="attr">enable:</span> <span class="literal">true</span></span><br><span class="line">  <span class="attr">content:</span> <span class="string">&#x27;&lt;center&gt;&lt;span id=&quot;anno-rotate&quot;&gt;&lt;/span&gt;&lt;/center&gt;&#x27;</span></span><br></pre></td></tr></table></figure><p>将 <code>enable</code> 设为 <code>true</code> 即可启用公告栏。<code>content</code> 中我们放一个 <code>&lt;span&gt;</code> 容器，后续通过 JavaScript 动态修改它的内容来实现轮播。</p><blockquote><p><strong>注意</strong>：<code>content</code> 中只能使用纯 HTML 标签，不支持 Markdown。</p></blockquote><hr><h2 id="三、编写轮播-JavaScript">三、编写轮播 JavaScript</h2><p>在 <code>_config.butterfly.yml</code> 的 <code>inject.bottom</code> 中注入轮播脚本。</p><p><code>inject</code> 是 Butterfly 主题提供的资源注入功能，<code>bottom</code> 表示在页面底部注入（这里放 JS 脚本）：</p><figure class="highlight yaml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">inject:</span></span><br><span class="line">  <span class="attr">bottom:</span></span><br><span class="line">    <span class="bullet">-</span> <span class="string">&lt;script&gt;</span></span><br><span class="line">      <span class="string">var</span> <span class="string">annoList</span> <span class="string">=</span> [</span><br><span class="line">        <span class="string">&#x27;▎ 第一条公告内容&#x27;</span>,</span><br><span class="line">        <span class="string">&#x27;▎ 第二条公告内容&#x27;</span>,</span><br><span class="line">        <span class="string">&#x27;▎ 第三条公告内容&#x27;</span></span><br><span class="line">      ]<span class="string">;</span></span><br><span class="line">      <span class="string">var</span> <span class="string">idx</span> <span class="string">=</span> <span class="number">0</span><span class="string">;</span></span><br><span class="line">      <span class="string">var</span> <span class="string">el</span> <span class="string">=</span> <span class="string">document.getElementById(&#x27;anno-rotate&#x27;);</span></span><br><span class="line">      <span class="string">function</span> <span class="string">showAnno()</span> &#123;</span><br><span class="line">        <span class="string">el.innerHTML</span> <span class="string">=</span> <span class="string">annoList</span>[<span class="string">idx</span>]<span class="string">;</span></span><br><span class="line">        <span class="string">idx</span> <span class="string">=</span> <span class="string">(idx</span> <span class="string">+</span> <span class="number">1</span><span class="string">)</span> <span class="string">%</span> <span class="string">annoList.length;</span></span><br><span class="line">      &#125;</span><br><span class="line">      <span class="string">showAnno();</span></span><br><span class="line">      <span class="string">setInterval(showAnno,</span> <span class="number">4000</span><span class="string">);</span></span><br><span class="line">    <span class="string">&lt;/script&gt;</span></span><br></pre></td></tr></table></figure><h3 id="代码说明">代码说明</h3><table><thead><tr><th>代码片段</th><th>说明</th></tr></thead><tbody><tr><td><code>annoList</code></td><td>公告内容数组，按需增删条目</td></tr><tr><td><code>idx = (idx + 1) % annoList.length</code></td><td>循环索引，到达末尾后回到 0</td></tr><tr><td><code>showAnno()</code></td><td>首次手动调用显示第一条</td></tr><tr><td><code>setInterval(showAnno, 4000)</code></td><td>每 4000 毫秒（4 秒）轮换到下一条</td></tr></tbody></table><p>你可以修改 <code>setInterval</code> 的间隔时间，例如改为 <code>3000</code> 就是 3 秒轮换一次。</p><h3 id="公告内容示例">公告内容示例</h3><figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">var</span> annoList = [</span><br><span class="line">  <span class="string">&#x27;▎ 资源均来源于互联网，仅供学习参考&#x27;</span>,</span><br><span class="line">  <span class="string">&#x27;▎ 本站应用及软件不付费，收费来自第三方网盘&#x27;</span>,</span><br><span class="line">  <span class="string">&#x27;▎ 技术文章来自个人实践与网络总结&#x27;</span>,</span><br><span class="line">  <span class="string">&#x27;▎ 内容仅供参考，不构成使用建议&#x27;</span>,</span><br><span class="line">  <span class="string">&#x27;▎ 侵权联系删除，转载注明出处&#x27;</span>,</span><br><span class="line">  <span class="string">&#x27;▎ 本站暂不开放评论区&#x27;</span>,</span><br><span class="line">  <span class="string">&#x27;▎ 已关闭友链申请，请通过邮件联系&#x27;</span>,</span><br><span class="line">];</span><br></pre></td></tr></table></figure><p>每条开头加 <code>▎</code> 符号用作分隔标记，视觉上更清晰。你也可以换成其他符号，比如 <code>◆</code>、<code>📌</code>、<code>👉</code> 等。</p><hr><h2 id="四、美化样式">四、美化样式</h2><p>在 <code>inject.head</code> 中注入 CSS 样式，控制公告栏的外观：</p><figure class="highlight yaml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">inject:</span></span><br><span class="line">  <span class="attr">head:</span></span><br><span class="line">    <span class="bullet">-</span> <span class="string">&lt;style&gt;</span></span><br><span class="line">      <span class="comment">#anno-rotate &#123;</span></span><br><span class="line">        <span class="attr">font-weight:</span> <span class="number">600</span><span class="string">;</span></span><br><span class="line">        <span class="attr">color:</span> <span class="string">var(--font-color);</span></span><br><span class="line">        <span class="attr">min-height:</span> <span class="number">2.</span><span class="string">5em;</span></span><br><span class="line">        <span class="attr">display:</span> <span class="string">flex;</span></span><br><span class="line">        <span class="attr">align-items:</span> <span class="string">center;</span></span><br><span class="line">        <span class="attr">justify-content:</span> <span class="string">flex-start;</span></span><br><span class="line">        <span class="attr">font-size:</span> <span class="string">13px;</span></span><br><span class="line">        <span class="attr">line-height:</span> <span class="number">1.5</span><span class="string">;</span></span><br><span class="line">        <span class="attr">padding:</span> <span class="string">4px</span> <span class="string">8px;</span></span><br><span class="line">        <span class="attr">animation:</span> <span class="string">fadeAnno</span> <span class="string">.8s</span> <span class="string">ease;</span></span><br><span class="line">      <span class="string">&#125;</span></span><br><span class="line">      <span class="string">@keyframes</span> <span class="string">fadeAnno</span> &#123;</span><br><span class="line">        <span class="number">0</span><span class="string">%</span>   &#123; <span class="attr">opacity:</span> <span class="number">0</span><span class="string">;</span> <span class="attr">transform:</span> <span class="string">translateY(6px);</span> &#125;</span><br><span class="line">        <span class="number">100</span><span class="string">%</span> &#123; <span class="attr">opacity:</span> <span class="number">1</span><span class="string">;</span> <span class="attr">transform:</span> <span class="string">translateY(0);</span> &#125;</span><br><span class="line">      &#125;</span><br><span class="line">    <span class="string">&lt;/style&gt;</span></span><br></pre></td></tr></table></figure><h3 id="动画效果说明">动画效果说明</h3><p><code>fadeAnno</code> 动画在每次切换公告时执行：</p><ul><li>透明度从 0 淡入到 1</li><li>位置从下方 6px 上移到原位</li></ul><p>你也可以自定动画：</p><figure class="highlight css"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">/* 从左滑入 */</span></span><br><span class="line"><span class="keyword">@keyframes</span> slideAnno &#123;</span><br><span class="line">  <span class="number">0%</span>   &#123; <span class="attribute">opacity</span>: <span class="number">0</span>; <span class="attribute">transform</span>: <span class="built_in">translateX</span>(-<span class="number">10px</span>); &#125;</span><br><span class="line">  <span class="number">100%</span> &#123; <span class="attribute">opacity</span>: <span class="number">1</span>; <span class="attribute">transform</span>: <span class="built_in">translateX</span>(<span class="number">0</span>); &#125;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="comment">/* 放大淡入 */</span></span><br><span class="line"><span class="keyword">@keyframes</span> scaleAnno &#123;</span><br><span class="line">  <span class="number">0%</span>   &#123; <span class="attribute">opacity</span>: <span class="number">0</span>; <span class="attribute">transform</span>: <span class="built_in">scale</span>(<span class="number">0.9</span>); &#125;</span><br><span class="line">  <span class="number">100%</span> &#123; <span class="attribute">opacity</span>: <span class="number">1</span>; <span class="attribute">transform</span>: <span class="built_in">scale</span>(<span class="number">1</span>); &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure><h3 id="颜色适配说明">颜色适配说明</h3><p>使用 <code>var(--font-color)</code> 这类 CSS 变量，可以自动适配 Butterfly 的白天/黑夜模式：</p><table><thead><tr><th>CSS 变量</th><th>白天模式</th><th>黑夜模式</th></tr></thead><tbody><tr><td><code>var(--font-color)</code></td><td>黑色文字</td><td>白色文字</td></tr><tr><td><code>var(--card-bg)</code></td><td>白色背景</td><td>深灰背景</td></tr><tr><td><code>var(--border-color)</code></td><td>浅灰边框</td><td>深灰边框</td></tr></tbody></table><hr><h2 id="五、完整配置示例">五、完整配置示例</h2><figure class="highlight yaml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># Butterfly 主题配置 — _config.butterfly.yml</span></span><br><span class="line"></span><br><span class="line"><span class="attr">card_announcement:</span></span><br><span class="line">  <span class="attr">enable:</span> <span class="literal">true</span></span><br><span class="line">  <span class="attr">content:</span> <span class="string">&#x27;&lt;center&gt;&lt;span id=&quot;anno-rotate&quot;&gt;&lt;/span&gt;&lt;/center&gt;&#x27;</span></span><br><span class="line"></span><br><span class="line"><span class="attr">inject:</span></span><br><span class="line">  <span class="attr">head:</span></span><br><span class="line">    <span class="bullet">-</span> <span class="string">&lt;style&gt;</span></span><br><span class="line">      <span class="comment">#anno-rotate &#123;</span></span><br><span class="line">        <span class="attr">font-weight:</span> <span class="number">600</span><span class="string">;</span></span><br><span class="line">        <span class="attr">color:</span> <span class="string">var(--font-color);</span></span><br><span class="line">        <span class="attr">min-height:</span> <span class="number">2.</span><span class="string">5em;</span></span><br><span class="line">        <span class="attr">display:</span> <span class="string">flex;</span></span><br><span class="line">        <span class="attr">align-items:</span> <span class="string">center;</span></span><br><span class="line">        <span class="attr">justify-content:</span> <span class="string">flex-start;</span></span><br><span class="line">        <span class="attr">font-size:</span> <span class="string">13px;</span></span><br><span class="line">        <span class="attr">line-height:</span> <span class="number">1.5</span><span class="string">;</span></span><br><span class="line">        <span class="attr">padding:</span> <span class="string">4px</span> <span class="string">8px;</span></span><br><span class="line">        <span class="attr">animation:</span> <span class="string">fadeAnno</span> <span class="string">.8s</span> <span class="string">ease;</span></span><br><span class="line">      <span class="string">&#125;</span></span><br><span class="line">      <span class="string">@keyframes</span> <span class="string">fadeAnno</span> &#123;</span><br><span class="line">        <span class="number">0</span><span class="string">%</span>   &#123; <span class="attr">opacity:</span> <span class="number">0</span><span class="string">;</span> <span class="attr">transform:</span> <span class="string">translateY(6px);</span> &#125;</span><br><span class="line">        <span class="number">100</span><span class="string">%</span> &#123; <span class="attr">opacity:</span> <span class="number">1</span><span class="string">;</span> <span class="attr">transform:</span> <span class="string">translateY(0);</span> &#125;</span><br><span class="line">      &#125;</span><br><span class="line">    <span class="string">&lt;/style&gt;</span></span><br><span class="line"></span><br><span class="line">  <span class="attr">bottom:</span></span><br><span class="line">    <span class="bullet">-</span> <span class="string">&lt;script&gt;</span></span><br><span class="line">      <span class="string">var</span> <span class="string">annoList</span> <span class="string">=</span> [</span><br><span class="line">        <span class="string">&#x27;▎ 资源均来源于互联网，仅供学习参考&#x27;</span>,</span><br><span class="line">        <span class="string">&#x27;▎ 本站应用及软件不付费，收费来自第三方网盘&#x27;</span>,</span><br><span class="line">        <span class="string">&#x27;▎ 技术文章来自个人实践与网络总结&#x27;</span>,</span><br><span class="line">        <span class="string">&#x27;▎ 内容仅供参考，不构成使用建议&#x27;</span>,</span><br><span class="line">        <span class="string">&#x27;▎ 侵权联系删除，转载注明出处&#x27;</span>,</span><br><span class="line">        <span class="string">&#x27;▎ 本站暂不开放评论区&#x27;</span>,</span><br><span class="line">        <span class="string">&#x27;▎ 已关闭友链申请，请通过邮件联系&#x27;</span>,</span><br><span class="line">      ]<span class="string">;</span></span><br><span class="line">      <span class="string">var</span> <span class="string">idx</span> <span class="string">=</span> <span class="number">0</span><span class="string">;</span></span><br><span class="line">      <span class="string">var</span> <span class="string">el</span> <span class="string">=</span> <span class="string">document.getElementById(&#x27;anno-rotate&#x27;);</span></span><br><span class="line">      <span class="string">function</span> <span class="string">showAnno()</span> &#123;</span><br><span class="line">        <span class="string">el.innerHTML</span> <span class="string">=</span> <span class="string">annoList</span>[<span class="string">idx</span>]<span class="string">;</span></span><br><span class="line">        <span class="string">idx</span> <span class="string">=</span> <span class="string">(idx</span> <span class="string">+</span> <span class="number">1</span><span class="string">)</span> <span class="string">%</span> <span class="string">annoList.length;</span></span><br><span class="line">      &#125;</span><br><span class="line">      <span class="string">showAnno();</span></span><br><span class="line">      <span class="string">setInterval(showAnno,</span> <span class="number">4000</span><span class="string">);</span></span><br><span class="line">    <span class="string">&lt;/script&gt;</span></span><br></pre></td></tr></table></figure><hr><h2 id="六、进阶技巧">六、进阶技巧</h2><h3 id="6-1-点击切换">6.1 点击切换</h3><p>如果你想让用户点击公告时手动切换，可以加上点击事件：</p><figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">el.<span class="title function_">addEventListener</span>(<span class="string">&#x27;click&#x27;</span>, <span class="keyword">function</span>(<span class="params"></span>) &#123;</span><br><span class="line">  <span class="title function_">showAnno</span>();</span><br><span class="line">&#125;);</span><br></pre></td></tr></table></figure><h3 id="6-2-添加图标">6.2 添加图标</h3><p>在公告内容中插入 emoji 图标，让显示更生动：</p><figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">var</span> annoList = [</span><br><span class="line">  <span class="string">&#x27;📢 本站声明：资源仅供学习参考&#x27;</span>,</span><br><span class="line">  <span class="string">&#x27;🔒 评论区暂未开放&#x27;</span>,</span><br><span class="line">  <span class="string">&#x27;📧 联系请发送邮件&#x27;</span>,</span><br><span class="line">];</span><br></pre></td></tr></table></figure><h3 id="6-3-多行公告">6.3 多行公告</h3><p>如果某条公告内容较长，可以包含 HTML 标签：</p><figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">var</span> annoList = [</span><br><span class="line">  <span class="string">&#x27;📢 欢迎来到本站！&#x27;</span>,</span><br><span class="line">  <span class="string">&#x27;📌 公告标题&lt;br&gt;&lt;small&gt;这是副标题内容&lt;/small&gt;&#x27;</span>,</span><br><span class="line">];</span><br></pre></td></tr></table></figure><h3 id="6-4-随机显示">6.4 随机显示</h3><p>如果不希望按顺序轮播，可以改为随机抽取：</p><figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">function</span> <span class="title function_">showAnno</span>(<span class="params"></span>) &#123;</span><br><span class="line">  idx = <span class="title class_">Math</span>.<span class="title function_">floor</span>(<span class="title class_">Math</span>.<span class="title function_">random</span>() * annoList.<span class="property">length</span>);</span><br><span class="line">  el.<span class="property">innerHTML</span> = annoList[idx];</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure><hr><h2 id="七、常见问题">七、常见问题</h2><h3 id="Q1：公告栏没有显示">Q1：公告栏没有显示</h3><p>检查以下配置：</p><ol><li><code>card_announcement.enable</code> 是否为 <code>true</code></li><li><code>content</code> 中是否包含 <code>id=&quot;anno-rotate&quot;</code> 的 <code>&lt;span&gt;</code></li><li><code>inject.bottom</code> 中的 JS 脚本是否放在页面加载后执行（默认已满足）</li><li>运行 <code>hexo g</code> 重新生成博客</li></ol><h3 id="Q2：YAML-解析报错">Q2：YAML 解析报错</h3><p>如果出现类似 <code>can not read a block mapping entry</code> 的错误，说明 <code>inject</code> 的缩进或格式有问题。建议将长段样式放在 <code>head</code> 区域的 <code>&lt;style&gt;</code> 中，而不是直接写在 <code>content</code> 字段里。</p><h3 id="Q3：公告文字在黑夜模式下看不清">Q3：公告文字在黑夜模式下看不清</h3><p>确保 CSS 中使用 <code>var(--font-color)</code> 而非固定颜色值：</p><figure class="highlight css"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">/* 推荐：自适应模式 */</span></span><br><span class="line"><span class="attribute">color</span>: <span class="built_in">var</span>(--font-color);</span><br><span class="line"></span><br><span class="line"><span class="comment">/* 不推荐：固定颜色在黑夜模式下可能看不清 */</span></span><br><span class="line"><span class="attribute">color</span>: <span class="number">#000</span>;</span><br></pre></td></tr></table></figure><h3 id="Q4：切换时页面布局抖动">Q4：切换时页面布局抖动</h3><p>给 <code>#anno-rotate</code> 设置一个 <code>min-height</code>，确保所有公告内容的高度不超过最小值：</p><figure class="highlight css"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="attribute">min-height</span>: <span class="number">2.5em</span>;</span><br></pre></td></tr></table></figure><hr><h2 id="八、总结">八、总结</h2><p>通过 <code>inject</code> 注入 + 少量 JavaScript，就可以让 Butterfly 主题的公告栏变成一个动态、美观的信息展示区。核心三步：</p><table><thead><tr><th>步骤</th><th>位置</th><th>操作</th></tr></thead><tbody><tr><td>1</td><td><code>card_announcement.content</code></td><td>放一个 <code>&lt;span&gt;</code> 容器</td></tr><tr><td>2</td><td><code>inject.head</code></td><td>写 CSS 美化样式</td></tr><tr><td>3</td><td><code>inject.bottom</code></td><td>写 JS 实现轮播逻辑</td></tr></tbody></table><p>整个配置不需要修改任何主题源文件，完全通过 Butterfly 提供的 inject 接口完成，升级主题时无需担心配置丢失。</p><p>你也快去试试给自己的博客加上公告栏吧 (´▽`ʃ♡ƪ)</p><hr><blockquote><p>小贴士：修改配置后记得执行 <code>hexo clean &amp;&amp; hexo g</code> 重新生成博客，刷新页面即可看到效果～</p></blockquote>]]></content>
    
    
      
      
    <summary type="html">&lt;h1 id=&quot;Hexo-网站公告栏-—-Butterfly-主题公告配置教程&quot;&gt;Hexo 网站公告栏 — Butterfly 主题公告配置教程&lt;/h1&gt;
&lt;p&gt;大家好～今天教大家如何给 Butterfly 主题的 Hexo 博客配置一个漂亮的公告栏 (´▽`ʃ♡ƪ)&lt;/p&gt;
&lt;</summary>
      
    
    
    
    <category term="技术学习" scheme="https://zhaogb612.github.io/categories/%E6%8A%80%E6%9C%AF%E5%AD%A6%E4%B9%A0/"/>
    
    
    <category term="技术学习" scheme="https://zhaogb612.github.io/tags/%E6%8A%80%E6%9C%AF%E5%AD%A6%E4%B9%A0/"/>
    
    <category term="Hexo" scheme="https://zhaogb612.github.io/tags/Hexo/"/>
    
    <category term="Butterfly" scheme="https://zhaogb612.github.io/tags/Butterfly/"/>
    
  </entry>
  
  <entry>
    <title>Hexo 追番插件 — Bangumis &amp; Bilibili-Bangumi</title>
    <link href="https://zhaogb612.github.io/posts/f5a8b2c3.html"/>
    <id>https://zhaogb612.github.io/posts/f5a8b2c3.html</id>
    <published>2026-07-11T12:00:00.000Z</published>
    <updated>2026-07-11T12:10:00.000Z</updated>
    
    <content type="html"><![CDATA[<h1 id="Hexo-追番插件-—-Bangumis-Bilibili-Bangumi">Hexo 追番插件 — Bangumis &amp; Bilibili-Bangumi</h1><p>大家好～今天给大家推荐两款 Hexo 博客的追番页面插件，让你在博客上展示自己的追番列表 (ゝω·)ノ</p><blockquote><p><strong>免责声明</strong>：本文仅提供操作选项与配置参考，具体实践中如遇到任何错误或问题，均与本站无关。教学方法来源于站主个人经验总结及互联网公开内容，请根据自身实际情况谨慎操作。</p></blockquote><hr><h2 id="一、为什么需要追番插件">一、为什么需要追番插件</h2><p>作为一名动漫爱好者，追番是日常。如果你有自己的 Hexo 博客，把追番列表集成到博客中不仅能展示你的动漫品味，还能：</p><ul><li>自动同步追番进度，无需手动更新</li><li>精美的卡片式展示封面、评分和简介</li><li>访客可以快速了解你正在看的番剧</li><li>结合 Bangumi / Bilibili 数据源，信息自动更新</li></ul><hr><h2 id="二、插件一：hexo-bangumis">二、插件一：hexo-bangumis</h2><h3 id="2-1-简介">2.1 简介</h3><p><a href="https://github.com/mmdjiji/hexo-bangumis">hexo-bangumis</a> 是一款为 Hexo 博客添加 <a href="https://bangumi.tv/">Bangumi</a> 追番页面的插件，由 <a href="https://github.com/mmdjiji">mmdjiji</a> 开发。</p><p>它使用 <a href="http://bgm.tv">bgm.tv</a> 的官方 API 来爬取追番数据，并在博客中生成精美的追番列表页面。</p><p><strong>特色功能：</strong></p><table><thead><tr><th>特性</th><th>说明</th></tr></thead><tbody><tr><td><strong><a href="http://bgm.tv">bgm.tv</a> 官方 API</strong></td><td>使用 Bangumi 官方数据源，番剧更多，可用性更高</td></tr><tr><td><strong>数据缓存</strong></td><td>支持缓存番剧数据，防止上游服务故障导致连锁效应</td></tr><tr><td><strong>封面图本地化</strong></td><td>支持下载番剧封面到本地，纯离线场景下也能正常部署</td></tr><tr><td><strong>自定义番剧列表</strong></td><td>极端条件下可手动编辑文件自定义番剧，添加 <a href="http://bgm.tv">bgm.tv</a> 上没有的番剧</td></tr><tr><td><strong>离线部署</strong></td><td>只要爬取过番剧数据，就算 <a href="http://bgm.tv">bgm.tv</a> 上删除了该番剧也能继续使用</td></tr><tr><td><strong>GitHub Actions 自动更新</strong></td><td>支持配置定时任务自动更新追番数据</td></tr></tbody></table><h3 id="2-2-安装">2.2 安装</h3><p>在 Hexo 博客根目录下执行：</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">npm install hexo-bangumis --save</span><br></pre></td></tr></table></figure><h3 id="2-3-配置">2.3 配置</h3><p>在站点的配置文件 <code>_config.yml</code> 中添加以下配置：</p><figure class="highlight yaml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">bangumis:</span></span><br><span class="line">  <span class="attr">enable:</span> <span class="literal">true</span>           <span class="comment"># 是否启用</span></span><br><span class="line">  <span class="attr">path:</span> <span class="string">bangumis/index.html</span>  <span class="comment"># 生成追番页面的路径</span></span><br><span class="line">  <span class="attr">show:</span> <span class="number">1</span>                <span class="comment"># 0=想看, 1=在看, 2=看完</span></span><br><span class="line">  <span class="attr">title:</span> <span class="string">&#x27;追番列表&#x27;</span>       <span class="comment"># 标题</span></span><br><span class="line">  <span class="attr">quote:</span> <span class="string">&#x27;生命不息，追番不止&#x27;</span> <span class="comment"># 格言</span></span><br><span class="line">  <span class="attr">color_meta:</span> <span class="string">&quot;#555&quot;</span>     <span class="comment"># 追番项元数据的颜色</span></span><br><span class="line">  <span class="attr">color_summary:</span> <span class="string">&quot;#555&quot;</span>  <span class="comment"># 追番项简介的颜色</span></span><br><span class="line">  <span class="attr">bgmtv_uid:</span> <span class="string">你的uid</span>     <span class="comment"># bgm.tv 的用户 ID</span></span><br><span class="line">  <span class="attr">download_image:</span> <span class="literal">true</span>   <span class="comment"># 是否下载图片到本地</span></span><br><span class="line">  <span class="attr">image_level:</span> <span class="string">c</span>         <span class="comment"># 图片高清等级 (l, c, m, s, g)</span></span><br><span class="line">  <span class="attr">lazyload:</span> <span class="literal">true</span>         <span class="comment"># 是否开启懒加载</span></span><br><span class="line">  <span class="attr">margin:</span> <span class="string">20px</span>           <span class="comment"># 封面图的偏移量微调</span></span><br></pre></td></tr></table></figure><h3 id="2-4-获取-bgm-tv-的-UID">2.4 获取 <a href="http://bgm.tv">bgm.tv</a> 的 UID</h3><p>登录 <a href="https://bgm.tv/">bgm.tv</a> 后打开浏览器控制台（快捷键 <code>Ctrl</code> + <code>Shift</code> + <code>J</code>），输入 <code>CHOBITS_UID</code> 后按回车，得到的数字就是你的 UID。</p><h3 id="2-5-使用命令">2.5 使用命令</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># 更新追番数据</span></span><br><span class="line">hexo bangumis -u</span><br><span class="line"></span><br><span class="line"><span class="comment"># 删除追番数据</span></span><br><span class="line">hexo bangumis -d</span><br></pre></td></tr></table></figure><h3 id="2-6-配置-Bangumi-API-反代">2.6 配置 Bangumi API 反代</h3><p>由于某些原因，Bangumi（<a href="http://bgm.tv">bgm.tv</a>）在国内可能无法直接访问。如果你遇到 <code>hexo bangumis -u</code> 无法获取数据的情况，可以通过配置反代来解决。</p><p>可以参考 <a href="https://github.com/Yuri-NagaSaki/bangumi-proxy">Yuri-NagaSaki/bangumi-proxy</a> 项目，有 Nginx 和 Cloudflare Worker 两种方案：</p><p><strong>方案一：Nginx 反代</strong></p><figure class="highlight nginx"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"><span class="attribute">proxy_pass</span> https://api.bgm.tv;</span><br><span class="line"><span class="attribute">proxy_set_header</span> Host api.bgm.tv;</span><br><span class="line"><span class="attribute">proxy_ssl_server_name</span> <span class="literal">on</span>;</span><br><span class="line"><span class="attribute">proxy_ssl_name</span> api.bgm.tv;</span><br></pre></td></tr></table></figure><p>图片反代将 <code>lain.bgm.tv</code> 替换为自己的域名：</p><figure class="highlight nginx"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"><span class="attribute">proxy_pass</span> https://lain.bgm.tv;</span><br><span class="line"><span class="attribute">proxy_set_header</span> Host lain.bgm.tv;</span><br><span class="line"><span class="attribute">proxy_ssl_server_name</span> <span class="literal">on</span>;</span><br><span class="line"><span class="attribute">proxy_ssl_name</span> lain.bgm.tv;</span><br></pre></td></tr></table></figure><p><strong>方案二：Cloudflare Worker</strong></p><p>使用仓库中的 <code>worker.js</code>，修改开头的两个域名：</p><figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">const</span> <span class="variable constant_">API_HOST</span> = <span class="string">&quot;你的API域名&quot;</span></span><br><span class="line"><span class="keyword">const</span> <span class="variable constant_">IMG_HOST</span> = <span class="string">&quot;你的图片域名&quot;</span></span><br></pre></td></tr></table></figure><p><strong>已有公开反代地址（可直接使用）：</strong></p><table><thead><tr><th>用途</th><th>地址</th></tr></thead><tbody><tr><td>API 反代</td><td><code>https://bgmapi.anibt.net</code></td></tr><tr><td>图片反代</td><td><code>https://bgmimg.anibt.net</code></td></tr></tbody></table><blockquote><p>注意：hexo-bangumis 会在 npm 包中直接请求 <a href="http://bgm.tv">bgm.tv</a> API，如果你需要使用反代，可能需要修改插件源码中的 API 地址指向反代地址。</p></blockquote><hr><h2 id="三、插件二：hexo-bilibili-bangumi">三、插件二：hexo-bilibili-bangumi</h2><h3 id="3-1-简介">3.1 简介</h3><p><a href="https://github.com/HCLonely/hexo-bilibili-bangumi">hexo-bilibili-bangumi</a> 是一款功能更全面的 Hexo 追番/追剧/游戏页面插件，由 <a href="https://github.com/HCLonely">HCLonely</a> 开发。它支持多个数据源，不仅可以展示追番列表，还能展示追剧和游戏列表。</p><p><strong>特色功能：</strong></p><table><thead><tr><th>特性</th><th>说明</th></tr></thead><tbody><tr><td><strong>多数据源支持</strong></td><td>支持 Bilibili、Bangumi、AniList、Simkl 四种数据源</td></tr><tr><td><strong>追番 + 追剧 + 游戏</strong></td><td>三合一页面，功能最全面</td></tr><tr><td><strong>图片懒加载</strong></td><td>支持图片懒加载，提升页面性能</td></tr><tr><td><strong>WebP 格式</strong></td><td>支持 WebP 格式图片，大幅减小体积</td></tr><tr><td><strong>进度条展示</strong></td><td>支持展示追番进度</td></tr><tr><td><strong>响应式设计</strong></td><td>适配移动端和桌面端</td></tr><tr><td><strong>图片镜像缓存</strong></td><td>支持配置封面镜像缓存解决防盗链</td></tr><tr><td><strong>手动添加数据</strong></td><td>支持手动添加番剧数据</td></tr></tbody></table><h3 id="3-2-安装">3.2 安装</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">npm install hexo-bilibili-bangumi --save</span><br></pre></td></tr></table></figure><h3 id="3-3-配置">3.3 配置</h3><p>在站点的配置文件 <code>_config.yml</code> 中添加以下配置：</p><figure class="highlight yaml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">bangumi:</span> <span class="comment"># 追番设置</span></span><br><span class="line">  <span class="attr">enable:</span> <span class="literal">true</span>           <span class="comment"># 是否启用</span></span><br><span class="line">  <span class="attr">source:</span> <span class="string">bili</span>           <span class="comment"># 数据源: bili / bgmv0 / bangumi / bgm / anilist / simkl</span></span><br><span class="line">  <span class="attr">path:</span> <span class="string">bangumis/index.html</span>  <span class="comment"># 页面路径</span></span><br><span class="line">  <span class="attr">vmid:</span> <span class="string">你的UID</span>          <span class="comment"># Bilibili UID 或 Bangumi 用户名/ID</span></span><br><span class="line">  <span class="attr">title:</span> <span class="string">&#x27;追番列表&#x27;</span>       <span class="comment"># 页面标题</span></span><br><span class="line">  <span class="attr">quote:</span> <span class="string">&#x27;生命不息，追番不止！&#x27;</span> <span class="comment"># 页面引言</span></span><br><span class="line">  <span class="attr">theme:</span> <span class="string">auto</span>            <span class="comment"># 页面主题: light=亮色, dark=暗色, auto=跟随系统</span></span><br><span class="line">  <span class="attr">show:</span> <span class="number">1</span>                <span class="comment"># 初始显示页面: 0=想看, 1=在看, 2=看过</span></span><br><span class="line">  <span class="attr">lazyload:</span> <span class="literal">true</span>         <span class="comment"># 是否启用图片懒加载</span></span><br><span class="line">  <span class="attr">webp:</span> <span class="literal">true</span>             <span class="comment"># 是否使用 webp 格式图片</span></span><br><span class="line">  <span class="attr">progress:</span> <span class="literal">true</span>         <span class="comment"># 是否显示进度条</span></span><br><span class="line">  <span class="attr">extraOrder:</span>            <span class="comment"># 手动添加的番剧是否优先显示</span></span><br><span class="line">  <span class="attr">order:</span> <span class="string">latest</span>          <span class="comment"># 排序: latest / score / -score</span></span><br><span class="line">  <span class="attr">coverMirror:</span>           <span class="comment"># 封面镜像缓存（解决图片加载失败403）</span></span><br><span class="line"></span><br><span class="line"><span class="attr">cinema:</span> <span class="comment"># 追剧设置</span></span><br><span class="line">  <span class="attr">enable:</span> <span class="literal">true</span></span><br><span class="line">  <span class="attr">source:</span> <span class="string">bili</span></span><br><span class="line">  <span class="attr">path:</span> <span class="string">cinemas/index.html</span></span><br><span class="line">  <span class="attr">vmid:</span> <span class="string">你的UID</span></span><br><span class="line">  <span class="attr">title:</span> <span class="string">&#x27;追剧列表&#x27;</span></span><br><span class="line">  <span class="attr">quote:</span> <span class="string">&#x27;生命不息，追剧不止！&#x27;</span></span><br><span class="line">  <span class="attr">show:</span> <span class="number">1</span></span><br><span class="line">  <span class="attr">lazyload:</span> <span class="literal">true</span></span><br><span class="line">  <span class="attr">webp:</span> <span class="literal">true</span></span><br><span class="line"></span><br><span class="line"><span class="attr">game:</span> <span class="comment"># 游戏设置，仅支持 source: bgmv0</span></span><br><span class="line">  <span class="attr">enable:</span> <span class="literal">true</span></span><br><span class="line">  <span class="attr">source:</span> <span class="string">bgmv0</span></span><br><span class="line">  <span class="attr">path:</span> <span class="string">games/index.html</span></span><br><span class="line">  <span class="attr">vmid:</span> <span class="string">你的UID</span></span><br><span class="line">  <span class="attr">title:</span> <span class="string">&#x27;游戏列表&#x27;</span></span><br><span class="line">  <span class="attr">quote:</span> <span class="string">&#x27;游戏世界，无限可能！&#x27;</span></span><br><span class="line">  <span class="attr">show:</span> <span class="number">1</span></span><br><span class="line">  <span class="attr">lazyload:</span> <span class="literal">true</span></span><br><span class="line">  <span class="attr">webp:</span> <span class="literal">true</span></span><br></pre></td></tr></table></figure><h3 id="3-4-数据源说明">3.4 数据源说明</h3><table><thead><tr><th>数据源</th><th>source 值</th><th>说明</th><th>vmid 获取方式</th></tr></thead><tbody><tr><td>Bilibili</td><td><code>bili</code></td><td>B站追番数据</td><td>个人空间 URL 后的数字 UID</td></tr><tr><td>Bangumi API</td><td><code>bgmv0</code></td><td>建议的 Bgm API 源</td><td><a href="http://bgm.tv">bgm.tv</a> 用户名</td></tr><tr><td>Bangumi</td><td><code>bangumi</code></td><td><a href="http://bangumi.tv">bangumi.tv</a> 源</td><td><a href="http://bgm.tv">bgm.tv</a> 用户 ID</td></tr><tr><td><a href="http://bgm.tv">bgm.tv</a></td><td><code>bgm</code></td><td><a href="http://bgm.tv">bgm.tv</a> 源</td><td><a href="http://bgm.tv">bgm.tv</a> 用户 ID</td></tr><tr><td>AniList</td><td><code>anilist</code></td><td>国际番剧平台</td><td>AniList 用户名</td></tr><tr><td>Simkl</td><td><code>simkl</code></td><td>国际番剧平台</td><td>Simkl 用户 ID</td></tr></tbody></table><h3 id="3-5-使用命令">3.5 使用命令</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># 更新追番数据</span></span><br><span class="line">hexo bangumi -u</span><br><span class="line"><span class="comment"># 指定 Bilibili SESSDATA 获取追番进度</span></span><br><span class="line">hexo bangumi -u <span class="string">&#x27;你的SESSDATA&#x27;</span></span><br><span class="line"></span><br><span class="line"><span class="comment"># 更新追剧数据</span></span><br><span class="line">hexo cinema -u</span><br><span class="line"></span><br><span class="line"><span class="comment"># 更新游戏数据</span></span><br><span class="line">hexo game -u</span><br><span class="line"></span><br><span class="line"><span class="comment"># 删除追番数据</span></span><br><span class="line">hexo bangumi -d</span><br></pre></td></tr></table></figure><h3 id="3-6-图片加载失败解决">3.6 图片加载失败解决</h3><p>如果番剧封面出现 403 加载失败或加载缓慢，可以配置封面镜像服务：</p><figure class="highlight yaml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">bangumi:</span></span><br><span class="line">  <span class="attr">coverMirror:</span> <span class="string">&#x27;https://image.baidu.com/search/down?url=&#x27;</span></span><br></pre></td></tr></table></figure><p>推荐镜像地址：</p><table><thead><tr><th>镜像服务</th><th>地址</th></tr></thead><tbody><tr><td>百度镜像</td><td><code>https://image.baidu.com/search/down?url=</code></td></tr><tr><td>Weserv</td><td><code>https://images.weserv.nl/?url=</code></td></tr><tr><td>雪花镜像</td><td><code>https://pic1.xuehuaimg.com/proxy/</code></td></tr><tr><td>Naver 镜像</td><td><code>https://search.pstatic.net/common?src=</code></td></tr></tbody></table><hr><h2 id="四、添加到菜单导航">四、添加到菜单导航</h2><p>无论使用哪款插件，生成页面后都需要在 Butterfly 主题配置中添加菜单导航：</p><figure class="highlight yaml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">menu:</span></span><br><span class="line">  <span class="string">追番列表:</span> <span class="string">/bangumis/</span> <span class="string">||</span> <span class="string">fa-solid</span> <span class="string">fa-tv</span></span><br><span class="line">  <span class="string">追剧列表:</span> <span class="string">/cinemas/</span> <span class="string">||</span> <span class="string">fa-solid</span> <span class="string">fa-film</span></span><br><span class="line">  <span class="string">游戏列表:</span> <span class="string">/games/</span> <span class="string">||</span> <span class="string">fa-solid</span> <span class="string">fa-gamepad</span></span><br></pre></td></tr></table></figure><hr><h2 id="五、两款插件对比">五、两款插件对比</h2><table><thead><tr><th>对比项</th><th>hexo-bangumis</th><th>hexo-bilibili-bangumi</th></tr></thead><tbody><tr><td><strong>作者</strong></td><td>mmdjiji</td><td>HCLonely</td></tr><tr><td><strong>数据源</strong></td><td>仅 <a href="http://bgm.tv">bgm.tv</a></td><td>Bilibili / Bangumi / AniList / Simkl</td></tr><tr><td><strong>多数据源</strong></td><td>❌ 仅 <a href="http://bgm.tv">bgm.tv</a></td><td>✅ 支持 6 种数据源</td></tr><tr><td><strong>追剧支持</strong></td><td>❌ 仅追番</td><td>✅ 追番 + 追剧 + 游戏</td></tr><tr><td><strong>封面本地化</strong></td><td>✅ 支持下载到本地</td><td>❌</td></tr><tr><td><strong>离线部署</strong></td><td>✅ 可纯离线部署</td><td>❌ 需要网络</td></tr><tr><td><strong>WebP 支持</strong></td><td>❌</td><td>✅ 支持</td></tr><tr><td><strong>进度条展示</strong></td><td>❌</td><td>✅ 支持</td></tr><tr><td><strong>封面镜像缓存</strong></td><td>❌</td><td>✅ 支持配置</td></tr><tr><td><strong>npm 包名</strong></td><td><code>hexo-bangumis</code></td><td><code>hexo-bilibili-bangumi</code></td></tr><tr><td><strong>GitHub Stars</strong></td><td>⭐ 36</td><td>⭐ 更多</td></tr></tbody></table><hr><h2 id="六、选择建议">六、选择建议</h2><table><thead><tr><th>需求场景</th><th>推荐选择</th></tr></thead><tbody><tr><td><strong>使用 Bangumi 管理番剧</strong></td><td>hexo-bangumis</td></tr><tr><td><strong>使用 Bilibili 追番</strong></td><td>hexo-bilibili-bangumi（bili 源）</td></tr><tr><td><strong>需要离线部署</strong></td><td>hexo-bangumis</td></tr><tr><td><strong>需要追剧 + 游戏页面</strong></td><td>hexo-bilibili-bangumi</td></tr><tr><td><strong>追求功能全面</strong></td><td>hexo-bilibili-bangumi</td></tr><tr><td><strong>追求数据稳定可缓存</strong></td><td>hexo-bangumis</td></tr></tbody></table><hr><h2 id="七、配置-GitHub-Actions-自动更新">七、配置 GitHub Actions 自动更新</h2><h3 id="7-1-适用于-hexo-bangumis">7.1 适用于 hexo-bangumis</h3><figure class="highlight yaml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">name:</span> <span class="string">Auto</span> <span class="string">Update</span> <span class="string">Bangumi</span></span><br><span class="line"></span><br><span class="line"><span class="attr">on:</span></span><br><span class="line">  <span class="attr">workflow_dispatch:</span></span><br><span class="line">  <span class="attr">schedule:</span></span><br><span class="line">    <span class="bullet">-</span> <span class="attr">cron:</span> <span class="string">&#x27;0 0 * * *&#x27;</span></span><br><span class="line"></span><br><span class="line"><span class="attr">jobs:</span></span><br><span class="line">  <span class="attr">update:</span></span><br><span class="line">    <span class="attr">runs-on:</span> <span class="string">ubuntu-latest</span></span><br><span class="line">    <span class="attr">steps:</span></span><br><span class="line">      <span class="bullet">-</span> <span class="attr">uses:</span> <span class="string">actions/checkout@v4</span></span><br><span class="line">      <span class="bullet">-</span> <span class="attr">uses:</span> <span class="string">actions/setup-node@v4</span></span><br><span class="line">        <span class="attr">with:</span></span><br><span class="line">          <span class="attr">node-version:</span> <span class="string">&#x27;20&#x27;</span></span><br><span class="line">      <span class="bullet">-</span> <span class="attr">run:</span> <span class="string">npm</span> <span class="string">install</span></span><br><span class="line">      <span class="bullet">-</span> <span class="attr">run:</span> <span class="string">npx</span> <span class="string">hexo</span> <span class="string">bangumis</span> <span class="string">-u</span> <span class="string">||</span> <span class="literal">true</span></span><br><span class="line">      <span class="bullet">-</span> <span class="attr">run:</span> <span class="string">|</span></span><br><span class="line"><span class="string">          git config user.email &quot;github-actions[bot]@users.noreply.github.com&quot;</span></span><br><span class="line"><span class="string">          git config user.name &quot;github-actions[bot]&quot;</span></span><br><span class="line"><span class="string">          git add .</span></span><br><span class="line"><span class="string">          git commit -m &quot;Update bangumi data&quot; || true</span></span><br><span class="line"><span class="string"></span>      <span class="bullet">-</span> <span class="attr">uses:</span> <span class="string">ad-m/github-push-action@master</span></span><br><span class="line">        <span class="attr">with:</span></span><br><span class="line">          <span class="attr">github_token:</span> <span class="string">$&#123;&#123;</span> <span class="string">secrets.GITHUB_TOKEN</span> <span class="string">&#125;&#125;</span></span><br></pre></td></tr></table></figure><h3 id="7-2-适用于-hexo-bilibili-bangumi">7.2 适用于 hexo-bilibili-bangumi</h3><figure class="highlight yaml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">name:</span> <span class="string">Auto</span> <span class="string">Update</span> <span class="string">Bangumi</span> <span class="string">&amp;</span> <span class="string">Cinema</span></span><br><span class="line"></span><br><span class="line"><span class="attr">on:</span></span><br><span class="line">  <span class="attr">workflow_dispatch:</span></span><br><span class="line">  <span class="attr">schedule:</span></span><br><span class="line">    <span class="bullet">-</span> <span class="attr">cron:</span> <span class="string">&#x27;0 0 * * *&#x27;</span></span><br><span class="line"></span><br><span class="line"><span class="attr">jobs:</span></span><br><span class="line">  <span class="attr">update:</span></span><br><span class="line">    <span class="attr">runs-on:</span> <span class="string">ubuntu-latest</span></span><br><span class="line">    <span class="attr">steps:</span></span><br><span class="line">      <span class="bullet">-</span> <span class="attr">uses:</span> <span class="string">actions/checkout@v4</span></span><br><span class="line">      <span class="bullet">-</span> <span class="attr">uses:</span> <span class="string">actions/setup-node@v4</span></span><br><span class="line">        <span class="attr">with:</span></span><br><span class="line">          <span class="attr">node-version:</span> <span class="string">&#x27;20&#x27;</span></span><br><span class="line">      <span class="bullet">-</span> <span class="attr">run:</span> <span class="string">npm</span> <span class="string">install</span></span><br><span class="line">      <span class="bullet">-</span> <span class="attr">run:</span> <span class="string">npx</span> <span class="string">hexo</span> <span class="string">bangumi</span> <span class="string">-u</span> <span class="string">||</span> <span class="literal">true</span></span><br><span class="line">      <span class="bullet">-</span> <span class="attr">run:</span> <span class="string">npx</span> <span class="string">hexo</span> <span class="string">cinema</span> <span class="string">-u</span> <span class="string">||</span> <span class="literal">true</span></span><br><span class="line">      <span class="bullet">-</span> <span class="attr">run:</span> <span class="string">npx</span> <span class="string">hexo</span> <span class="string">game</span> <span class="string">-u</span> <span class="string">||</span> <span class="literal">true</span></span><br><span class="line">      <span class="bullet">-</span> <span class="attr">run:</span> <span class="string">|</span></span><br><span class="line"><span class="string">          git config user.email &quot;github-actions[bot]@users.noreply.github.com&quot;</span></span><br><span class="line"><span class="string">          git config user.name &quot;github-actions[bot]&quot;</span></span><br><span class="line"><span class="string">          git add .</span></span><br><span class="line"><span class="string">          git commit -m &quot;Update bangumi &amp; cinema data&quot; || true</span></span><br><span class="line"><span class="string"></span>      <span class="bullet">-</span> <span class="attr">uses:</span> <span class="string">ad-m/github-push-action@master</span></span><br><span class="line">        <span class="attr">with:</span></span><br><span class="line">          <span class="attr">github_token:</span> <span class="string">$&#123;&#123;</span> <span class="string">secrets.GITHUB_TOKEN</span> <span class="string">&#125;&#125;</span></span><br></pre></td></tr></table></figure><hr><h2 id="八、相关链接">八、相关链接</h2><table><thead><tr><th>资源</th><th>地址</th></tr></thead><tbody><tr><td>hexo-bangumis 仓库</td><td><a href="https://github.com/mmdjiji/hexo-bangumis">mmdjiji/hexo-bangumis</a></td></tr><tr><td>hexo-bilibili-bangumi 仓库</td><td><a href="https://github.com/HCLonely/hexo-bilibili-bangumi">HCLonely/hexo-bilibili-bangumi</a></td></tr><tr><td>Bangumi 官网</td><td><a href="https://bgm.tv/">bgm.tv</a></td></tr><tr><td>Bangumi 反代项目</td><td><a href="https://github.com/Yuri-NagaSaki/bangumi-proxy">Yuri-NagaSaki/bangumi-proxy</a></td></tr><tr><td>反代配置教程</td><td><a href="https://catcat.blog/2026/05/bangumi-reverse-proxy">猫猫博客 — 自建 Bangumi API 和图片反代</a></td></tr><tr><td>公开 API 反代</td><td><code>https://bgmapi.anibt.net</code></td></tr><tr><td>公开图片反代</td><td><code>https://bgmimg.anibt.net</code></td></tr></tbody></table><hr><blockquote><p>小贴士：更新追番数据后别忘了重新生成部署博客，页面才会显示最新数据哦 (´・ω・`)</p></blockquote>]]></content>
    
    
      
      
    <summary type="html">&lt;h1 id=&quot;Hexo-追番插件-—-Bangumis-Bilibili-Bangumi&quot;&gt;Hexo 追番插件 — Bangumis &amp;amp; Bilibili-Bangumi&lt;/h1&gt;
&lt;p&gt;大家好～今天给大家推荐两款 Hexo 博客的追番页面插件，让你在博客上展示自己的追</summary>
      
    
    
    
    <category term="技术学习" scheme="https://zhaogb612.github.io/categories/%E6%8A%80%E6%9C%AF%E5%AD%A6%E4%B9%A0/"/>
    
    
    <category term="技术学习" scheme="https://zhaogb612.github.io/tags/%E6%8A%80%E6%9C%AF%E5%AD%A6%E4%B9%A0/"/>
    
    <category term="Hexo" scheme="https://zhaogb612.github.io/tags/Hexo/"/>
    
  </entry>
  
  <entry>
    <title>图吧工具箱推荐</title>
    <link href="https://zhaogb612.github.io/posts/9k0l1m2n.html"/>
    <id>https://zhaogb612.github.io/posts/9k0l1m2n.html</id>
    <published>2026-06-27T05:00:00.000Z</published>
    <updated>2026-06-27T05:30:00.000Z</updated>
    
    <content type="html"><![CDATA[<h1 id="图吧工具箱推荐">图吧工具箱推荐</h1><p>大家好～今天给大家推荐一款装机佬必备的硬件工具合集 —— 图吧工具箱 (ゝω·)ノ</p><hr><h2 id="一、为什么推荐图吧工具箱">一、为什么推荐图吧工具箱</h2><p>折腾电脑的人都知道，修电脑测硬件最烦的不是问题本身，而是满世界找工具——CPU 检测要下这个、硬盘检测要下那个、内存测试还得再找一个……装完一堆软件桌面都炸了。</p><p>图吧工具箱把 PC 硬件检测 / 测试 / 维护需要用到的工具全部打包到一起，<strong>一个工具箱搞定所有</strong>，清爽省心 ╰(°▽°)╯</p><table><thead><tr><th>特性</th><th>说明</th></tr></thead><tbody><tr><td><strong>完全免费</strong></td><td>无付费、无广告、无弹窗</td></tr><tr><td><strong>工具齐全</strong></td><td>集成 50+ 硬件检测工具，覆盖所有主流硬件</td></tr><tr><td><strong>绿色便携</strong></td><td>解压即用，无需安装，不写注册表</td></tr><tr><td><strong>持续更新</strong></td><td>紧跟硬件更新，定期收录新版工具</td></tr><tr><td><strong>纯净封装</strong></td><td>整合打包无捆绑，拒绝全家桶</td></tr><tr><td><strong>界面清爽</strong></td><td>分类清晰，工具按硬件类型归类</td></tr></tbody></table><hr><h2 id="二、核心工具一览">二、核心工具一览</h2><h3 id="2-1-CPU-工具">2.1 CPU 工具</h3><table><thead><tr><th>工具</th><th>功能</th></tr></thead><tbody><tr><td>CPU-Z</td><td>查看 CPU、主板、内存详细信息</td></tr><tr><td>Core Temp</td><td>实时监控 CPU 各核心温度</td></tr><tr><td>Cinebench</td><td>CPU 性能跑分测试</td></tr><tr><td>AIDA64</td><td>烤机测试 + 系统信息全面检测</td></tr><tr><td>IntelBurnTest</td><td>CPU 稳定性压力测试</td></tr></tbody></table><h3 id="2-2-显卡工具">2.2 显卡工具</h3><table><thead><tr><th>工具</th><th>功能</th></tr></thead><tbody><tr><td>GPU-Z</td><td>查看显卡详细参数与传感器数据</td></tr><tr><td>FurMark</td><td>GPU 甜甜圈烤机测试</td></tr><tr><td>3DMark</td><td>3D 性能跑分测试</td></tr><tr><td>OCCT</td><td>电源 + GPU 综合压力测试</td></tr></tbody></table><h3 id="2-3-内存工具">2.3 内存工具</h3><table><thead><tr><th>工具</th><th>功能</th></tr></thead><tbody><tr><td>MemTest64</td><td>内存稳定性测试</td></tr><tr><td>MemTestPro</td><td>专业级内存错误检测</td></tr><tr><td>Thaiphoon Burner</td><td>查看内存颗粒信息</td></tr></tbody></table><h3 id="2-4-硬盘工具">2.4 硬盘工具</h3><table><thead><tr><th>工具</th><th>功能</th></tr></thead><tbody><tr><td>CrystalDiskInfo</td><td>硬盘健康状态检测</td></tr><tr><td>CrystalDiskMark</td><td>硬盘读写速度测试</td></tr><tr><td>AS SSD Benchmark</td><td>SSD 性能基准测试</td></tr><tr><td>HD Tune Pro</td><td>硬盘坏道扫描 + 性能测试</td></tr><tr><td>DiskGenius</td><td>分区管理 + 数据恢复</td></tr></tbody></table><h3 id="2-5-屏幕与外设">2.5 屏幕与外设</h3><table><thead><tr><th>工具</th><th>功能</th></tr></thead><tbody><tr><td>DisplayX</td><td>屏幕坏点 / 漏光检测</td></tr><tr><td>MonitorTest</td><td>显示器色彩与响应测试</td></tr><tr><td>KeyboardTest</td><td>键盘按键测试</td></tr><tr><td>MouseTest</td><td>鼠标点击与滚轮测试</td></tr></tbody></table><h3 id="2-6-系统工具">2.6 系统工具</h3><table><thead><tr><th>工具</th><th>功能</th></tr></thead><tbody><tr><td>Dism++</td><td>系统优化与垃圾清理</td></tr><tr><td>Geek Uninstaller</td><td>强力卸载软件</td></tr><tr><td>HDTune</td><td>硬盘健康检测</td></tr><tr><td>AIDA64 系统信息</td><td>硬件信息全面检测报告</td></tr></tbody></table><hr><h2 id="三、使用场景">三、使用场景</h2><table><thead><tr><th>场景</th><th>推荐工具</th></tr></thead><tbody><tr><td><strong>新机验货</strong></td><td>CPU-Z + GPU-Z + CrystalDiskInfo + DisplayX</td></tr><tr><td><strong>电脑卡顿排查</strong></td><td>AIDA64 烤机 + MemTest64 + CrystalDiskMark</td></tr><tr><td><strong>二手硬件检测</strong></td><td>HD Tune Pro + FurMark + MonitorTest</td></tr><tr><td><strong>游戏掉帧诊断</strong></td><td>GPU-Z 监控 + OCCT 压力测试</td></tr><tr><td><strong>系统维护</strong></td><td>Dism++ 清理 + Geek Uninstaller 卸载</td></tr><tr><td><strong>装机稳定性测试</strong></td><td>Cinebench + MemTest64 + FurMark + AIDA64 四件套</td></tr></tbody></table><hr><h2 id="四、同类工具箱对比">四、同类工具箱对比</h2><table><thead><tr><th>对比维度</th><th>图吧工具箱</th><th>OCCT</th><th>HWiNFO</th><th>AIDA64</th></tr></thead><tbody><tr><td>价格</td><td>完全免费</td><td>免费 / Pro</td><td>免费 / Pro（$29）</td><td>付费（$39.95）</td></tr><tr><td>工具数量</td><td>多</td><td>单一</td><td>信息查看</td><td>综合检测</td></tr><tr><td>便携性</td><td>绿色版</td><td>安装版</td><td>两者皆可</td><td>安装版</td></tr><tr><td>中文界面</td><td>全面支持</td><td>英文</td><td>英文</td><td>中文</td></tr><tr><td>更新频率</td><td>每月更新</td><td>定期</td><td>定期</td><td>定期</td></tr><tr><td>附加功能</td><td>系统维护工具集</td><td>纯压力测试</td><td>传感器监控</td><td>烤机 + 系统信息</td></tr></tbody></table><hr><h2 id="五、缺点与不足">五、缺点与不足</h2><p>当然，图吧工具箱也不是完美的 (´・ω・`)</p><table><thead><tr><th>问题</th><th>说明</th></tr></thead><tbody><tr><td><strong>工具版本略旧</strong></td><td>部分内置工具并非最新版，需手动更新</td></tr><tr><td><strong>UI 较朴素</strong></td><td>界面设计偏实用向，颜值一般</td></tr><tr><td><strong>误报风险</strong></td><td>部分杀软会误报破解工具包中的文件</td></tr><tr><td><strong>无 Mac 版</strong></td><td>Windows 专属，macOS 用户无法使用</td></tr><tr><td><strong>工具堆砌感</strong></td><td>对新手来说工具太多，反而不知从何下手</td></tr><tr><td><strong>部分工具冗余</strong></td><td>同类功能存在多个工具选择，稍有重复</td></tr></tbody></table><hr><p>总的来说，对于 DIY 玩家、装机和维修从业者来说，图吧工具箱绝对是装机必备的百宝箱 (๑•̀ㅂ•́)و✧</p><p><strong>下载方式</strong>：官网 <a href="https://www.tbtool.cn/">www.tbtool.cn</a> 即可找到最新版本～</p>]]></content>
    
    
      
      
    <summary type="html">&lt;h1 id=&quot;图吧工具箱推荐&quot;&gt;图吧工具箱推荐&lt;/h1&gt;
&lt;p&gt;大家好～今天给大家推荐一款装机佬必备的硬件工具合集 —— 图吧工具箱 (ゝω·)ノ&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id=&quot;一、为什么推荐图吧工具箱&quot;&gt;一、为什么推荐图吧工具箱&lt;/h2&gt;
&lt;p&gt;折腾电脑的人都知道，修电脑</summary>
      
    
    
    
    <category term="软件推荐" scheme="https://zhaogb612.github.io/categories/%E8%BD%AF%E4%BB%B6%E6%8E%A8%E8%8D%90/"/>
    
    
    <category term="软件推荐" scheme="https://zhaogb612.github.io/tags/%E8%BD%AF%E4%BB%B6%E6%8E%A8%E8%8D%90/"/>
    
    <category term="系统优化" scheme="https://zhaogb612.github.io/tags/%E7%B3%BB%E7%BB%9F%E4%BC%98%E5%8C%96/"/>
    
  </entry>
  
  <entry>
    <title>HiBit Uninstaller 强力卸载工具推荐</title>
    <link href="https://zhaogb612.github.io/posts/5g6h7i8j.html"/>
    <id>https://zhaogb612.github.io/posts/5g6h7i8j.html</id>
    <published>2026-06-20T12:00:00.000Z</published>
    <updated>2026-06-20T12:30:00.000Z</updated>
    
    <content type="html"><![CDATA[<h1 id="HiBit-Uninstaller-强力卸载工具推荐">HiBit Uninstaller 强力卸载工具推荐</h1><p>大家好～今天给大家推荐一款完全免费的 Windows 卸载神器 —— HiBit Uninstaller (ゝω·)ノ</p><hr><h2 id="一、为什么推荐-HiBit-Uninstaller">一、为什么推荐 HiBit Uninstaller</h2><p>Windows 自带的「添加或删除程序」功能非常鸡肋——卸载完了往往留下一堆注册表垃圾和残留文件夹，日积月累拖慢系统。而 HiBit Uninstaller 就是来解决这个痛点的。</p><table><thead><tr><th>特性</th><th>说明</th></tr></thead><tbody><tr><td><strong>完全免费</strong></td><td>无付费墙、无广告弹窗、无功能限制</td></tr><tr><td><strong>绿色便携</strong></td><td>支持安装版和免安装便携版，解压即用</td></tr><tr><td><strong>体积小巧</strong></td><td>安装包约 5.7 MB，解压后仅约 15 MB</td></tr><tr><td><strong>深度清理</strong></td><td>卸载后自动扫描残留文件和注册表项</td></tr><tr><td><strong>强制卸载</strong></td><td>对付顽固 / 损坏 / 流氓程序的终极手段</td></tr><tr><td><strong>批量卸载</strong></td><td>一次选中多个程序，依次卸载并清理</td></tr></tbody></table><hr><h2 id="二、核心功能">二、核心功能</h2><h3 id="2-1-彻底卸载-残留扫描">2.1 彻底卸载 + 残留扫描</h3><p>普通卸载只是调用程序自带的卸载器，完事就撒手不管了。HiBit 在卸载完成后会自动启动<strong>残留扫描</strong>，把藏在 AppData、ProgramData、注册表里的垃圾碎片全揪出来，一键清理。</p><h3 id="2-2-强制卸载">2.2 强制卸载</h3><p>遇到卸载程序损坏、卸载按钮灰色、或者干脆就是流氓软件赖着不走的情况，强制卸载能直接扫描程序关联的所有文件和注册表项，彻底抹除。这个功能可以说是 HiBit 的灵魂 (๑•̀ㅂ•́)و✧</p><h3 id="2-3-批量卸载">2.3 批量卸载</h3><table><thead><tr><th>对比维度</th><th>Windows 自带</th><th>HiBit Uninstaller</th></tr></thead><tbody><tr><td>批量操作</td><td>不支持</td><td>选中多个程序依次卸载 + 清理</td></tr><tr><td>残留清理</td><td>不处理</td><td>每个程序卸载后自动扫描</td></tr><tr><td>强制移除</td><td>无此功能</td><td>绕过损坏的卸载器直接清除</td></tr><tr><td>UWP 应用</td><td>仅部分支持</td><td>全面支持卸载</td></tr></tbody></table><h3 id="2-4-附加工具">2.4 附加工具</h3><p>除了卸载，HiBit 还内置了 10+ 个实用小工具：</p><ul><li><strong>启动项管理</strong> — 禁用开机自启的程序</li><li><strong>注册表清理</strong> — 扫除孤立注册表项</li><li><strong>文件粉碎机</strong> — 彻底删除敏感文件</li><li><strong>浏览器扩展管理</strong> — 清理 Chrome / Edge / Firefox 插件</li><li><strong>空文件夹清理</strong> — 扫除空的遗留目录</li><li><strong>系统还原点管理</strong> — 操作前创建还原点</li></ul><hr><h2 id="三、使用方法">三、使用方法</h2><h3 id="3-1-标准卸载">3.1 标准卸载</h3><ol><li>打开 HiBit Uninstaller，软件列表自动加载</li><li>右键目标程序 → 选择「卸载」</li><li>程序自带卸载器运行完成后，HiBit 自动弹出残留扫描</li><li>勾选要清理的项目 → 点击删除</li></ol><h3 id="3-2-强制卸载">3.2 强制卸载</h3><ol><li>点击工具栏「强制卸载」</li><li>输入或拖入程序的文件夹路径 / 可执行文件</li><li>HiBit 扫描所有关联项并彻底清除</li></ol><h3 id="3-3-批量卸载">3.3 批量卸载</h3><ol><li>按住 Ctrl 多选要卸载的程序</li><li>点击「卸载所选」</li><li>HiBit 依次处理每个程序并自动清理残留</li></ol><hr><h2 id="四、与同类工具对比">四、与同类工具对比</h2><table><thead><tr><th>对比维度</th><th>HiBit Uninstaller</th><th>Geek Uninstaller</th><th>Revo Uninstaller</th></tr></thead><tbody><tr><td>价格</td><td>完全免费</td><td>免费版功能受限</td><td>付费（约 $25）</td></tr><tr><td>强制卸载</td><td>支持</td><td>支持</td><td>支持</td></tr><tr><td>残留扫描</td><td>深度扫描</td><td>轻度扫描</td><td>深度扫描</td></tr><tr><td>批量卸载</td><td>支持</td><td>不支持</td><td>仅 Pro 版</td></tr><tr><td>附加工具</td><td>10+ 个</td><td>无</td><td>Pro 版部分支持</td></tr><tr><td>便携版</td><td>支持</td><td>支持</td><td>不支持</td></tr><tr><td>中文界面</td><td>支持</td><td>支持</td><td>支持</td></tr></tbody></table><hr><h2 id="五、缺点与不足">五、缺点与不足</h2><table><thead><tr><th>问题</th><th>说明</th></tr></thead><tbody><tr><td><strong>界面风格偏老旧</strong></td><td>传统 Windows 风格，颜值党可能不太满意</td></tr><tr><td><strong>大程序扫描慢</strong></td><td>残留扫描时偶尔响应缓慢</td></tr><tr><td><strong>仅支持 Windows</strong></td><td>无 macOS / Linux 版</td></tr><tr><td><strong>更新频率一般</strong></td><td>不像商业软件那样高频迭代</td></tr></tbody></table><hr><h2 id="六、下载方式">六、下载方式</h2><table><thead><tr><th>版本</th><th>获取方式</th></tr></thead><tbody><tr><td>官网</td><td><a href="https://hibit-uninstaller.com/zh/">hibit-uninstaller.com</a></td></tr><tr><td>便携版</td><td>官网下载 ZIP，解压即用，无需安装</td></tr><tr><td>安装版</td><td>官网下载 EXE 安装器</td></tr></tbody></table><blockquote><p><strong>小提示</strong>：首次运行建议在「设置」中切换为简体中文界面 (´・ω·`)</p></blockquote><hr><h2 id="七、总结">七、总结</h2><p>HiBit Uninstaller 是一款小而美的卸载工具，完全免费、无广告、不捆绑，核心功能却能和付费的 Revo 掰手腕。如果你觉得 Windows 自带卸载太鸡肋，又不想为卸载工具花钱，HiBit 绝对是最佳选择 (๑•̀ㅂ•́)و✧</p><p><strong>官网地址</strong>：<a href="https://hibit-uninstaller.com/">https://hibit-uninstaller.com/</a></p>]]></content>
    
    
      
      
    <summary type="html">&lt;h1 id=&quot;HiBit-Uninstaller-强力卸载工具推荐&quot;&gt;HiBit Uninstaller 强力卸载工具推荐&lt;/h1&gt;
&lt;p&gt;大家好～今天给大家推荐一款完全免费的 Windows 卸载神器 —— HiBit Uninstaller (ゝω·)ノ&lt;/p&gt;
&lt;hr&gt;
</summary>
      
    
    
    
    <category term="软件推荐" scheme="https://zhaogb612.github.io/categories/%E8%BD%AF%E4%BB%B6%E6%8E%A8%E8%8D%90/"/>
    
    
    <category term="软件推荐" scheme="https://zhaogb612.github.io/tags/%E8%BD%AF%E4%BB%B6%E6%8E%A8%E8%8D%90/"/>
    
  </entry>
  
</feed>
