<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
    <channel>
        <title>fatekey's Blog</title>
        <link>https://blog.fatekey.icu/</link>
        <description>这是一个不想做菜狗的菜狗的博客</description>
        <lastBuildDate>Thu, 19 Feb 2026 01:24:19 GMT</lastBuildDate>
        <docs>https://validator.w3.org/feed/docs/rss2.html</docs>
        <generator>https://github.com/jpmonette/feed</generator>
        <language>zh-CN</language>
        <copyright>All rights reserved 2026, fatekey</copyright>
        <item>
            <title><![CDATA[clash-verge 本地提权漏洞复现]]></title>
            <link>https://blog.fatekey.icu/article/clash-verge-rce</link>
            <guid>https://blog.fatekey.icu/article/clash-verge-rce</guid>
            <pubDate>Mon, 28 Apr 2025 00:00:00 GMT</pubDate>
            <content:encoded><![CDATA[<div id="notion-article" class="mx-auto overflow-hidden "><main class="notion light-mode notion-page notion-block-1e3a8162226d807b9c5ff2c5b99a1c4d"><div class="notion-viewport"></div><div class="notion-collection-page-properties"></div><div class="notion-callout notion-gray_background_co notion-block-1e3a8162226d80328d47c6df5fb9917c"><div class="notion-page-icon-inline notion-page-icon-span"><span class="notion-page-icon" role="img" aria-label="😀">😀</span></div><div class="notion-callout-text">看到网上爆出 clash-verge 存在提权漏洞，简单复现下。
<a target="_blank" rel="noopener noreferrer" class="notion-link" href="https://github.com/clash-verge-rev/clash-verge-rev/issues/3428">https://github.com/clash-verge-rev/clash-verge-rev/issues/3428</a></div></div><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-1e3a8162226d808e8e70cc3d973a135e" data-id="1e3a8162226d808e8e70cc3d973a135e"><span><div id="1e3a8162226d808e8e70cc3d973a135e" class="notion-header-anchor"></div><a class="notion-hash-link" href="#1e3a8162226d808e8e70cc3d973a135e" title="0x00 定位漏洞"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">0x00 定位漏洞</span></span></h2><div class="notion-text notion-block-1e3a8162226d809486c2c1801aede563">已知是提权到system的漏洞，那直接看 service 相关代码就好。</div><div class="notion-text notion-block-1e3a8162226d80fc8457c71ab8bebf96">在 <code class="notion-inline-code">clash-verge-rev/src-tauri/src/core/service.rs</code> 可以看到33211端口有 http 服务</div><div class="notion-text notion-block-1e3a8162226d8069926acef1bb917576">存在 4 个 api 接口并且没有任何鉴权机制。</div><div class="notion-text notion-block-1e3a8162226d801d94d9f373ded69f66"><code class="notion-inline-code">/start_clash</code> 启动Clash核心，接受POST请求，需要在请求体中提供JSON格式的配置信息，包含以下参数：</div><div class="notion-text notion-block-1e3a8162226d807e94d9f4e6f076f851"><code class="notion-inline-code">core_type</code>: 核心类型（如&quot;verge-mihomo&quot;）
<code class="notion-inline-code">bin_path</code>: 二进制文件路径
<code class="notion-inline-code">config_dir</code>: 配置目录路径
<code class="notion-inline-code">config_file</code>: 配置文件路径
<code class="notion-inline-code">log_file</code>: 日志文件路径</div><div class="notion-text notion-block-1e3a8162226d801b8579c6f87d0f8076">一看就很有问题，文件路径是自己指定的，用powershell请求下试试</div><div class="notion-text notion-block-1e3a8162226d80f39d8ff8a3813bda3b">看下任务管理器，system权限的notepad进程已经启动了。</div><div class="notion-text notion-block-1e3a8162226d808d945bc7970dc706f9">启动参数如下：</div><div class="notion-text notion-block-1e3a8162226d808ea593d881e6a25142">利用cmd的一些特性，可以构造如下参数执行任意命令。</div><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-1e3a8162226d80acb038e39eda8ccdee" data-id="1e3a8162226d80acb038e39eda8ccdee"><span><div id="1e3a8162226d80acb038e39eda8ccdee" class="notion-header-anchor"></div><a class="notion-hash-link" href="#1e3a8162226d80acb038e39eda8ccdee" title="0x01 进一步分析"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">0x01 进一步分析</span></span></h2><div class="notion-text notion-block-1e3a8162226d8029b69ec7e071d44650">和之前 clash 的漏洞一样，尝试使用浏览器js访问，不过不同于 clash 的api，服务的 api 受到 CORS的限制，不允许读取响应以及不允许设置Content-Type为application/json。这就导致 start_clash 这个api 不可能通过浏览器 js 利用。</div><div class="notion-callout notion-gray_background_co notion-block-1e3a8162226d80b7b0e7dede5da76d9a"><div class="notion-page-icon-inline notion-page-icon-span"><span class="notion-page-icon" role="img" aria-label="💡">💡</span></div><div class="notion-callout-text"><div class="notion-text notion-block-1e3a8162226d805e9d33c5094fec592e">为啥说基本不可能利用呢，因为有些条件苛刻的方法有可能绕过CORS。
比如使用 flash，但是现在哪还有支持 flash 的浏览器，也许可以做个假的基于 flash 的登录页面来钓攻击者的鱼？</div></div></div><div class="notion-text notion-block-1e3a8162226d8087bf03ea5d4a99e23c">看起来这个漏洞对普通用户基本没啥危害，普通用户电脑上也没啥需要提权的低权限用户。</div></main></div>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Windows 11 LTSC 刷机记录]]></title>
            <link>https://blog.fatekey.icu/article/win11ltsc</link>
            <guid>https://blog.fatekey.icu/article/win11ltsc</guid>
            <pubDate>Sat, 08 Mar 2025 00:00:00 GMT</pubDate>
            <content:encoded><![CDATA[<div id="notion-article" class="mx-auto overflow-hidden "><main class="notion light-mode notion-page notion-block-1afa8162226d80f3824dc8fcb135a136"><div class="notion-viewport"></div><div class="notion-collection-page-properties"></div><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-1afa8162226d80b991c2cbbc9f3b1c97" data-id="1afa8162226d80b991c2cbbc9f3b1c97"><span><div id="1afa8162226d80b991c2cbbc9f3b1c97" class="notion-header-anchor"></div><a class="notion-hash-link" href="#1afa8162226d80b991c2cbbc9f3b1c97" title="0x00 起因"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">0x00 起因</span></span></h2><div class="notion-text notion-block-1afa8162226d80adaa2dd393a0f83d9b">一般我很少折腾系统，买来的火影7840HS笔记本系统用了一年了没怎么管过，但最近自动升级到 win11 2024.2 之后，出现了各种奇怪的bug。</div><ul class="notion-list notion-list-disc notion-block-1afa8162226d80179574c41ebd4266ce"><li>浏览器经常有一块页面卡住不动</li></ul><ul class="notion-list notion-list-disc notion-block-1afa8162226d8084af47f2c985910883"><li>虚拟机离开一会后图像就会卡住</li></ul><ul class="notion-list notion-list-disc notion-block-1afa8162226d808eaee3e0ecafbbc76f"><li>电脑锁屏后过段时间再解锁wifi会不可用</li></ul><ul class="notion-list notion-list-disc notion-block-1afa8162226d80f5a918e801dbb1a049"><li>间歇性极短时间花屏</li></ul><div class="notion-text notion-block-1afa8162226d800da6a7df517a9836c6">更新了各种驱动也无济于事，于是决定重新安装下系统，听说 <b>IoT </b>版本比较稳定，于是尝试切换到 <b>Windows 11 IoT Enterprise LTSC</b>。</div><div class="notion-text notion-block-1afa8162226d80118bc7ede89502f207">因为从事安全工作，个人一直习惯虚拟机开发，虚拟机调试，实体机只用来开办公软件和浏览器，所以对实体机环境依赖比较少，能够稳定运行即可。如果是要在实体机开发、游戏的话，需要考虑下 IoT 版本是否阉割掉了必要的依赖。</div><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-1afa8162226d808ab2bed250a4b73ad4" data-id="1afa8162226d808ab2bed250a4b73ad4"><span><div id="1afa8162226d808ab2bed250a4b73ad4" class="notion-header-anchor"></div><a class="notion-hash-link" href="#1afa8162226d808ab2bed250a4b73ad4" title="0x01 制作启动 U 盘"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">0x01 <b>制作启动 U 盘</b></span></span></h2><div class="notion-text notion-block-1afa8162226d805391f7ccdef3efe773">镜像下载地址：<span class="notion-link-mention"><a href="https://massgrave.dev/windows_ltsc_links" target="_blank" rel="noopener noreferrer" class="notion-link-mention-link"><img class="notion-link-mention-icon" src="https://massgrave.dev/img/favicon.ico"/><span class="notion-link-mention-title">Windows LTSC Download | MAS</span></a><div class="notion-link-mention-preview"><article class="notion-link-mention-card"><img class="notion-link-mention-preview-thumbnail" src="https://massgrave.dev/img/card.png" alt="Windows LTSC Download | MAS" referrerPolicy="same-origin"/><div class="notion-link-mention-preview-content"><p class="notion-link-mention-preview-title">Windows LTSC Download | MAS</p><p class="notion-link-mention-preview-description">All download links lead to genuine files only.</p><div class="notion-link-mention-preview-footer"><img class="notion-link-mention-preview-icon" src="https://massgrave.dev/img/favicon.ico" referrerPolicy="same-origin"/><span class="notion-link-mention-preview-provider"></span></div></div></article></div></span></div><div class="notion-text notion-block-1afa8162226d80a094feef2b53d1fcea">镜像用 rufus 写入 U 盘，全都默认配置就好。</div><div class="notion-text notion-block-1afa8162226d804ab445cdd042566b18"><a target="_blank" rel="noopener noreferrer" class="notion-link" href="https://rufus.ie/zh/">https://rufus.ie/zh/</a></div><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-1afa8162226d80598428cfc46f904b6f" data-id="1afa8162226d80598428cfc46f904b6f"><span><div id="1afa8162226d80598428cfc46f904b6f" class="notion-header-anchor"></div><a class="notion-hash-link" href="#1afa8162226d80598428cfc46f904b6f" title="0x02 进入 BIOS 修改启动顺序"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">0x02 进入 BIOS 修改启动顺序</span></span></h2><div class="notion-text notion-block-1afa8162226d808b9939e0148e4b35ce">火影的笔记本是开机时按 F2 进入，不同主机可能会有不同。</div><div class="notion-text notion-block-1afa8162226d8048be61c3fb796e7899">将 USB 设为首选启动项。</div><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-1afa8162226d808ea552ee80f9cf7e9b" data-id="1afa8162226d808ea552ee80f9cf7e9b"><span><div id="1afa8162226d808ea552ee80f9cf7e9b" class="notion-header-anchor"></div><a class="notion-hash-link" href="#1afa8162226d808ea552ee80f9cf7e9b" title="0x03 安装"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">0x03 安装</span></span></h2><div class="notion-text notion-block-1afa8162226d80ff8d74c2f97b3163b0">全程英文操作，与普通系统安装操作逻辑是一样的，选择Windows 11 IoT Enterprise LTSC版本。</div><div class="notion-text notion-block-1afa8162226d80c49f1aced60f76cda6">安装完无法联网，安装从笔记本官网下载的驱动。</div><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-1b0a8162226d8046bba0ee2ac8baec08" data-id="1b0a8162226d8046bba0ee2ac8baec08"><span><div id="1b0a8162226d8046bba0ee2ac8baec08" class="notion-header-anchor"></div><a class="notion-hash-link" href="#1b0a8162226d8046bba0ee2ac8baec08" title="0x04 配置中文"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">0x04 配置中文</span></span></h2><div class="notion-text notion-block-1b0a8162226d80eb928df640c6a7e078">IoT Enterprise LTSC 版本不自带中文，需要额外配置。</div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-1afa8162226d809880d4d308b721e17d"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/attachment%3Aeb5f03ad-ef2f-40ec-9e87-08ea86c9f8d5%3Aimage.png?table=block&amp;id=1afa8162-226d-8098-80d4-d308b721e17d&amp;t=1afa8162-226d-8098-80d4-d308b721e17d" alt="notion image" loading="lazy" decoding="async"/></div></figure><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-1afa8162226d80d4aa37caf5dbe73cc1"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/attachment%3A21d06419-306c-425e-a7d9-b3921458f3c6%3Aimage.png?table=block&amp;id=1afa8162-226d-80d4-aa37-caf5dbe73cc1&amp;t=1afa8162-226d-80d4-aa37-caf5dbe73cc1" alt="notion image" loading="lazy" decoding="async"/></div></figure><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-1afa8162226d8098bee1e119c8365d04"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/attachment%3A18a1026d-f19f-4cfc-861d-f14aa849f235%3Aimage.png?table=block&amp;id=1afa8162-226d-8098-bee1-e119c8365d04&amp;t=1afa8162-226d-8098-bee1-e119c8365d04" alt="notion image" loading="lazy" decoding="async"/></div></figure><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-1afa8162226d80f287efc830d47e437f"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/attachment%3A90cd01b9-dfde-4776-b795-321573c75260%3Aimage.png?table=block&amp;id=1afa8162-226d-80f2-87ef-c830d47e437f&amp;t=1afa8162-226d-80f2-87ef-c830d47e437f" alt="notion image" loading="lazy" decoding="async"/></div></figure><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-1afa8162226d8089b64dea292d4009aa"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/attachment%3A5ee6c5dd-2e60-4f28-a2b4-9f552558b85f%3Aimage.png?table=block&amp;id=1afa8162-226d-8089-b64d-ea292d4009aa&amp;t=1afa8162-226d-8089-b64d-ea292d4009aa" alt="notion image" loading="lazy" decoding="async"/></div></figure><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-1b0a8162226d805a90f8fe57b7f568a4" data-id="1b0a8162226d805a90f8fe57b7f568a4"><span><div id="1b0a8162226d805a90f8fe57b7f568a4" class="notion-header-anchor"></div><a class="notion-hash-link" href="#1b0a8162226d805a90f8fe57b7f568a4" title="0x05 安装必要软件"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">0x05 安装必要软件</span></span></h2><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-1b0a8162226d80db8b01ca7da4e09b17" data-id="1b0a8162226d80db8b01ca7da4e09b17"><span><div id="1b0a8162226d80db8b01ca7da4e09b17" class="notion-header-anchor"></div><a class="notion-hash-link" href="#1b0a8162226d80db8b01ca7da4e09b17" title="scoop"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">scoop</span></span></h3><div class="notion-text notion-block-1b0a8162226d8021b33df18e101e2e3c">ltsc不带微软商店，而且微软商店除了特定软件外不如scoop好用，scoop是非常方便的包管理工具，有了它就能快速安装各种软件了。</div><div class="notion-text notion-block-1b0a8162226d80cb804fc37ed07c5f26">如果官方没有想安装的软件，可以添加第三方仓库（这种自动整合多个仓库的项目，总感觉有投毒的风险）。</div><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-1b0a8162226d800f8ffbf9a6b6e8e9c6" data-id="1b0a8162226d800f8ffbf9a6b6e8e9c6"><span><div id="1b0a8162226d800f8ffbf9a6b6e8e9c6" class="notion-header-anchor"></div><a class="notion-hash-link" href="#1b0a8162226d800f8ffbf9a6b6e8e9c6" title="vmware"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">vmware</span></span></h3><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-1b0a8162226d80a5a10cc36968c02504" data-id="1b0a8162226d80a5a10cc36968c02504"><span><div id="1b0a8162226d80a5a10cc36968c02504" class="notion-header-anchor"></div><a class="notion-hash-link" href="#1b0a8162226d80a5a10cc36968c02504" title="chrome"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">chrome</span></span></h3><div class="notion-text notion-block-1b0a8162226d805ba116e7465af2295c">顺便把 edge 卸载了</div><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-1b0a8162226d80e3a44eeb73aef7eb04" data-id="1b0a8162226d80e3a44eeb73aef7eb04"><span><div id="1b0a8162226d80e3a44eeb73aef7eb04" class="notion-header-anchor"></div><a class="notion-hash-link" href="#1b0a8162226d80e3a44eeb73aef7eb04" title="office"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">office</span></span></h3><div class="notion-text notion-block-1b0a8162226d8009ae50f7e69990f5e1">scoop 第三方仓库可以一键安装office，不过我更喜欢 <b>office-tool-plus 。</b>可以装各种版本的office，更新通道选择 <b>Office 2024 企业长期版</b>，产品选择<b>Office LTSC 专业增强版 2024 - 批量许可证</b></div><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-1b0a8162226d8078af5ee54850e4aeee" data-id="1b0a8162226d8078af5ee54850e4aeee"><span><div id="1b0a8162226d8078af5ee54850e4aeee" class="notion-header-anchor"></div><a class="notion-hash-link" href="#1b0a8162226d8078af5ee54850e4aeee" title="vscode"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">vscode</span></span></h3><div class="notion-blank notion-block-1b0a8162226d800590fccf998ad36a71"> </div><h4 class="notion-h notion-h3 notion-h-indent-2 notion-block-1b0a8162226d804fa990dcfd4cf45571" data-id="1b0a8162226d804fa990dcfd4cf45571"><span><div id="1b0a8162226d804fa990dcfd4cf45571" class="notion-header-anchor"></div><a class="notion-hash-link" href="#1b0a8162226d804fa990dcfd4cf45571" title="其他"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">其他</span></span></h4><h4 class="notion-h notion-h3 notion-h-indent-2 notion-block-273a8162226d806a90cbd83ec880c157" data-id="273a8162226d806a90cbd83ec880c157"><span><div id="273a8162226d806a90cbd83ec880c157" class="notion-header-anchor"></div><a class="notion-hash-link" href="#273a8162226d806a90cbd83ec880c157" title="开发软件"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">开发软件</span></span></h4><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-1b0a8162226d804ebc70e666fcac5e85" data-id="1b0a8162226d804ebc70e666fcac5e85"><span><div id="1b0a8162226d804ebc70e666fcac5e85" class="notion-header-anchor"></div><a class="notion-hash-link" href="#1b0a8162226d804ebc70e666fcac5e85" title="0x06 激活"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">0x06 激活</span></span></h2><div class="notion-text notion-block-1b0a8162226d80faaeffc241449af030">使用 0 和 1 分别激活windows和office</div><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-1b0a8162226d80fb9a58c4d9c2125b42" data-id="1b0a8162226d80fb9a58c4d9c2125b42"><span><div id="1b0a8162226d80fb9a58c4d9c2125b42" class="notion-header-anchor"></div><a class="notion-hash-link" href="#1b0a8162226d80fb9a58c4d9c2125b42" title="0x07 优化"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">0x07 优化</span></span></h2><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-1b0a8162226d80cb8e7cc5b8e452504c" data-id="1b0a8162226d80cb8e7cc5b8e452504c"><span><div id="1b0a8162226d80cb8e7cc5b8e452504c" class="notion-header-anchor"></div><a class="notion-hash-link" href="#1b0a8162226d80cb8e7cc5b8e452504c" title="光标变色"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">光标变色</span></span></h3><div class="notion-text notion-block-1b0a8162226d80d09cb1c2a6f86d59cd">光标颜色变来变去的很容易找不到。</div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-1b0a8162226d80b3b605e8144329bd09"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/attachment%3Aac2b9f5b-0420-4336-9533-a8b6978b9415%3Aimage.png?table=block&amp;id=1b0a8162-226d-80b3-b605-e8144329bd09&amp;t=1b0a8162-226d-80b3-b605-e8144329bd09" alt="notion image" loading="lazy" decoding="async"/></div></figure><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-1b0a8162226d8089aabfe19de4be5140"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/attachment%3A15781870-edfd-45c3-addf-0325bf3dd077%3Aimage.png?table=block&amp;id=1b0a8162-226d-8089-aabf-e19de4be5140&amp;t=1b0a8162-226d-8089-aabf-e19de4be5140" alt="notion image" loading="lazy" decoding="async"/></div></figure><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-1b0a8162226d80f3a959d9322c8169bd" data-id="1b0a8162226d80f3a959d9322c8169bd"><span><div id="1b0a8162226d80f3a959d9322c8169bd" class="notion-header-anchor"></div><a class="notion-hash-link" href="#1b0a8162226d80f3a959d9322c8169bd" title="右键菜单"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">右键菜单</span></span></h3><div class="notion-text notion-block-1b0a8162226d809e9656c407f0fc8b99">新右键菜单纯属逆天，很多时候都要点更多选项，很影响效率，使用以下命令还原经典右键菜单。</div><blockquote class="notion-quote notion-block-1b2a8162226d80b3b88eceee0dc1f562"><div>也可以用 optimizer 修改</div></blockquote><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-1b1a8162226d802fabbad28d2bb43bbe" data-id="1b1a8162226d802fabbad28d2bb43bbe"><span><div id="1b1a8162226d802fabbad28d2bb43bbe" class="notion-header-anchor"></div><a class="notion-hash-link" href="#1b1a8162226d802fabbad28d2bb43bbe" title="彻底关闭虚拟化"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">彻底关闭虚拟化</span></span></h3><div class="notion-text notion-block-1b1a8162226d80d58972e096839e20ea">关闭windows虚拟化后能提高虚拟机的性能。</div><div class="notion-file notion-block-1b1a8162226d80558838e5c72f2f50c1"><a target="_blank" rel="noopener noreferrer" class="notion-file-link" href="https://file.notion.so/f/f/9b088554-7e2b-4e15-a3ac-f935a8faacef/e1eb1f4c-fbf8-4f44-a4a8-b1bc51ad04c7/tool.bat?table=block&amp;id=1b1a8162-226d-8055-8838-e5c72f2f50c1&amp;spaceId=9b088554-7e2b-4e15-a3ac-f935a8faacef&amp;expirationTimestamp=1771488000000&amp;signature=DrR2aXQL5wS0qq8ObImdfwmz9JVsoTYHFI79lnh5XIg"><svg class="notion-file-icon" viewBox="0 0 30 30"><path d="M22,8v12c0,3.866-3.134,7-7,7s-7-3.134-7-7V8c0-2.762,2.238-5,5-5s5,2.238,5,5v12c0,1.657-1.343,3-3,3s-3-1.343-3-3V8h-2v12c0,2.762,2.238,5,5,5s5-2.238,5-5V8c0-3.866-3.134-7-7-7S6,4.134,6,8v12c0,4.971,4.029,9,9,9s9-4.029,9-9V8H22z"></path></svg><div class="notion-file-info"><div class="notion-file-title">tool.bat</div><div class="notion-file-size">1.1KB</div></div></a></div><blockquote class="notion-quote notion-block-1b2a8162226d806bb472c68641b7bf64"><div>也可以用 optimizer 关闭</div></blockquote><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-1b0a8162226d80e9bbddf9fd11b21ce6" data-id="1b0a8162226d80e9bbddf9fd11b21ce6"><span><div id="1b0a8162226d80e9bbddf9fd11b21ce6" class="notion-header-anchor"></div><a class="notion-hash-link" href="#1b0a8162226d80e9bbddf9fd11b21ce6" title="0x08 IOT 版本发现的bug"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">0x08 IOT 版本发现的bug</span></span></h2><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-1b0a8162226d8046a3cfc08d58ede496" data-id="1b0a8162226d8046a3cfc08d58ede496"><span><div id="1b0a8162226d8046a3cfc08d58ede496" class="notion-header-anchor"></div><a class="notion-hash-link" href="#1b0a8162226d8046a3cfc08d58ede496" title="中文支持不完美"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">中文支持不完美</span></span></h3><ul class="notion-list notion-list-disc notion-block-1b0a8162226d8064bdfeefe5218e31fe"><li>区域和语言都是中国的情况下，部分软件（如微信）依然选择英文为默认语言，可能是因为 iot 版本默认只有英文导致的？</li></ul><ul class="notion-list notion-list-disc notion-block-1b0a8162226d80a4876dc8022500f3a5"><li>更新后变成一半中文一半英文（严重影响使用）</li></ul><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-1b0a8162226d80f882f6c611d8d48b8b" data-id="1b0a8162226d80f882f6c611d8d48b8b"><span><div id="1b0a8162226d80f882f6c611d8d48b8b" class="notion-header-anchor"></div><a class="notion-hash-link" href="#1b0a8162226d80f882f6c611d8d48b8b" title="0x09 切换到 LTSC"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">0x09 切换到 LTSC</span></span></h2><div class="notion-text notion-block-1b0a8162226d80adb768e95d95fdea83">既然bug都是中文相关的，所以选择切换到有中文支持的 LTSC 版本，安装步骤与 IOT 版本相同。</div><div class="notion-text notion-block-1c2a8162226d80dfbbd8e8870f1dacc7">切换到 LTSC 版本后没有再遇到中文的问题。</div><div class="notion-blank notion-block-1c2a8162226d809c9152fc1bea392cef"> </div></main></div>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AMSI研究(1) - 基础]]></title>
            <link>https://blog.fatekey.icu/article/AMSI1</link>
            <guid>https://blog.fatekey.icu/article/AMSI1</guid>
            <pubDate>Tue, 11 Jun 2024 00:00:00 GMT</pubDate>
            <content:encoded><![CDATA[<div id="notion-article" class="mx-auto overflow-hidden "><main class="notion light-mode notion-page notion-block-9d41b1a8f47d467381e17ad62e8dfa0f"><div class="notion-viewport"></div><div class="notion-collection-page-properties"></div><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-3051e0eb02c54e7abadc80bde0743c93" data-id="3051e0eb02c54e7abadc80bde0743c93"><span><div id="3051e0eb02c54e7abadc80bde0743c93" class="notion-header-anchor"></div><a class="notion-hash-link" href="#3051e0eb02c54e7abadc80bde0743c93" title="0x00 什么是AMSI"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">0x00 什么是AMSI</span></span></h2><div class="notion-text notion-block-81541c956ac24072ad095aee43c7e8bc">AMSI 全称 <b>Antimalware Scan Interface</b>，反恶意软件扫描接口，是微软为了对抗无文件攻击而开发的安全组件。历史上，杀毒引擎和 EDR 产品在对抗基于文件的恶意软件方面较为有效，但内存中的恶意代码一直是一个具有挑战性的盲点。在没有 AMSI 之前，安全 厂商要想检测在内存中执行的代码，需要将检测代码注入到待检测的程序中，这显然并不容易实现，并且随着系统更新需要不断对实现方式进行维护。</div><div class="notion-text notion-block-cd907486c30140c3bfe4b6d316ca8e44">微软认识到需要改进内存中的检测能力，同时提供一个稳定的接口供自己和第三方供应商使用。由此产生的就是反恶意软件扫描接口（AMSI）。AMSI 实质上是一个管道，把 powershell 或者其他程序执行的代码传送给防病毒程序进行检测，微软设计的初衷是希望各种程序都可以接入 AMSI ，现在一般情况下只有微软开发的程序接入了 AMSI。</div><div class="notion-text notion-block-b5295e1ece3d41f1abd4e7853e810e33">本体是 <code class="notion-inline-code">c:\\windows\\system32\\amsi.dll</code> 它提供了通用的标准接口（COM接口、Win32 API），API是为接入 AMSI 的程序提供的，COM 接口是为防病毒厂商提供的。</div><div class="notion-text notion-block-0960127a38eb4412816d8eb723f1f7eb">可以使用以下命令获取接入了 AMSI 的 exe 及 dll 文件。</div><div class="notion-text notion-block-f31abccb4a19403799be94df9aa8b2b8">接入了 AMSI 接口的程序如下：</div><ul class="notion-list notion-list-disc notion-block-befb950ba9d64dd8b7c648a64b13f0db"><li>PowerShell（&gt;2.0）：由 <code class="notion-inline-code">System.Management.Automation.dll</code> 实现</li></ul><ul class="notion-list notion-list-disc notion-block-d433673d821645bebc4e54a1031bb8f0"><li>VBScript：由 <code class="notion-inline-code">vbscript.dll</code> 实现</li></ul><ul class="notion-list notion-list-disc notion-block-e8b5ed2a91324b61b377640d52d67565"><li>JScript：由 <code class="notion-inline-code">jscript.dll</code>、<code class="notion-inline-code">jscript9.dll</code> 和 <code class="notion-inline-code">jscriptlegacy.dll</code> 实现</li></ul><ul class="notion-list notion-list-disc notion-block-207ff79b71cf4bf19f7dc09ef325afc0"><li>Office 文档中的 VBA 宏：由 <code class="notion-inline-code">VBE7.dll</code> 实现</li></ul><ul class="notion-list notion-list-disc notion-block-25fd11ad987943549f62d00a95619957"><li>Excel 4.0 宏：由 <code class="notion-inline-code">excel.exe</code> 和 <code class="notion-inline-code">excelcnv.exe</code> 实现</li></ul><ul class="notion-list notion-list-disc notion-block-4920b5a9481c4f9ea0d0f40e545ea4e0"><li>Exchange Server 2016：由 <code class="notion-inline-code">Microsoft.Exchange.HttpRequestFiltering.dll</code> 实现</li></ul><ul class="notion-list notion-list-disc notion-block-df295855580d4357a87e59d7eb15e0d7"><li>WMI：由 <code class="notion-inline-code">fastprox.dll</code> 实现</li></ul><ul class="notion-list notion-list-disc notion-block-e67141f8da66443b8b441881d9d2fef2"><li>.NET 内存中的程序集加载：在 .NET 4.8+ 中由 <code class="notion-inline-code">clr.dll</code> 和 <code class="notion-inline-code">coreclr.dll</code> 实现</li></ul><ul class="notion-list notion-list-disc notion-block-572652b9af454545a857bacedeec47ba"><li>卷影复制操作：由 <code class="notion-inline-code">VSSVC.exe</code> 和 <code class="notion-inline-code">swprv.dll</code> 实现</li></ul><ul class="notion-list notion-list-disc notion-block-c6c755a3ccd54c51bf726d44761c30eb"><li>用户账户控制（UAC）提升：由 <code class="notion-inline-code">consent.exe</code> 实现</li></ul><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-6f69d3c4c70d41aeb6adbf66401071bb" data-id="6f69d3c4c70d41aeb6adbf66401071bb"><span><div id="6f69d3c4c70d41aeb6adbf66401071bb" class="notion-header-anchor"></div><a class="notion-hash-link" href="#6f69d3c4c70d41aeb6adbf66401071bb" title="0x01 AMSI 的实现"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">0x01 AMSI 的实现</span></span></h2><div class="notion-text notion-block-73fd389bda824523bdb963bf4d5488aa">当应用程序尝试提交要由 AMSI 提供程序扫描的内容时，应用程序将 <code class="notion-inline-code">amsi.dll</code> 加载并调用其 <code class="notion-inline-code"><b><a target="_blank" rel="noopener noreferrer" class="notion-link" href="https://docs.microsoft.com/en-us/windows/win32/api/amsi/nf-amsi-amsiinitialize">AmsiInitialize</a></b></code> 和 <code class="notion-inline-code">AmsiOpenSession</code> 函数以建立 AMSI 会话。然后通过 <code class="notion-inline-code">AmsiScanString</code> 或  <code class="notion-inline-code">AmsiScanBuffer</code> 函数提交要扫描的内容。<div class="notion-text-children"><div class="notion-text notion-block-3e6d45197e14412a9f439bfbad86f65c">amsi api 列表：<a target="_blank" rel="noopener noreferrer" class="notion-link" href="https://learn.microsoft.com/en-us/windows/win32/amsi/antimalware-scan-interface-functions">https://learn.microsoft.com/en-us/windows/win32/amsi/antimalware-scan-interface-functions</a></div><blockquote class="notion-quote notion-block-5ef5ce31991141949f420590a03c1b85"><div>在 <a target="_blank" rel="noopener noreferrer" class="notion-link" href="https://www.cyberark.com/resources/threat-research-blog/amsi-bypass-patching-technique">AmsiScanString 绕过方法</a>公开后， <code class="notion-inline-code">AmsiScanBuffer</code>取代了 <code class="notion-inline-code">AmsiScanString</code>。（顺带一提，<code class="notion-inline-code">AmsiScanBuffer</code>也能被绕过，但微软不再认为 AMSI 绕过是一种漏洞，修复的并不积极。）</div></blockquote></div></div><ul class="notion-list notion-list-disc notion-block-73fa7021840a4e3e85c08590f30ac770"><li>第一个参数是应用程序的名称，第二个参数是指向名为 <code class="notion-inline-code">amsiContext</code>的上下文句柄的指针。这个名为 <code class="notion-inline-code">amsiContext</code>的上下文句柄在每个后续 AMSI 相关函数中都会使用。</li></ul><ul class="notion-list notion-list-disc notion-block-655407ed6aab48ec91bc12a89fa0e162"><li>对 <code class="notion-inline-code">AmsiInitialize</code>的调用发生在我们能够调用任何 PowerShell 命令之前，这意味着我们无法以任何方式影响这个过程。</li><ul class="notion-list notion-list-disc notion-block-655407ed6aab48ec91bc12a89fa0e162"><blockquote class="notion-quote notion-block-cfdec2c243c1402faf635339bc68a831"><div><code class="notion-inline-code">AmsiInitialize</code>的第一次调用无法被干扰，但可以反射调用 <code class="notion-inline-code">AmsiUninitialize</code> ，这会导致powershell 重新进行 <code class="notion-inline-code">AmsiInitialize</code> ，这次调用是可以提前干扰的。</div></blockquote></ul></ul><div class="notion-text notion-block-03e1e8f123d84911ac8a63a9cc2f9d8d">一旦 <code class="notion-inline-code">AmsiInitialize </code>完成并创建上下文结构，AMSI 就可以解析发出的命令。当我们执行 PowerShell 命令时，会调用 <code class="notion-inline-code">AmsiOpenSession </code>API。</div><ul class="notion-list notion-list-disc notion-block-300b171b8e9d4e5992031b472b4553ec"><li>其作用是使用已经初始化的<code class="notion-inline-code">amsiContext</code>上下文句柄来创建一个新的会话句柄。<code class="notion-inline-code">amsiContext</code>保存了 AMSI 的全局状态，而每个会话句柄则代表了一个独立的扫描会话。</li></ul><div class="notion-text notion-block-ae76f0f2b76b418ab2a59a41d6623e43">随后调用 AmsiScanBuffer 对内容进行扫描。</div><ul class="notion-list notion-list-disc notion-block-a7c9d1bc31ee4fe4bf72093e6292b7b2"><li>第一个参数是 AMSI 上下文句柄，后面是指向包含要扫描的内容的缓冲区的指针，以及缓冲区的长度。以下参数是输入标识符 (contentName)、会话句柄 (amsiSession)，最后是指向扫描结果存储缓冲区的指针。</li></ul><ul class="notion-list notion-list-disc notion-block-faa48eb5edec439aace920720f02bacf"><li>根据<a target="_blank" rel="noopener noreferrer" class="notion-link" href="https://learn.microsoft.com/en-gb/windows/win32/api/amsi/ne-amsi-amsi_result">微软文档</a>的说法，返回结果越大威胁越大大于等于32768被视为恶意软件。软件对于不同的返回结果可以自行实现如何处理，对于 powershell，判断为恶意时会对命令进行阻断。</li></ul><div class="notion-text notion-block-3495414177374f9f905eb4d4c608950c">供应商的 AMSI 提供程序 DLL 接收AmsiScanBuffer提交的内容并进行分析。供应商可以使用其关联的 COM GUID 值在 <code class="notion-inline-code">HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\AMSI\Providers</code> 注册表项中注册多个 AMSI 提供程序。</div><ul class="notion-list notion-list-disc notion-block-988233d3c71e41bb852c41f776cab6ae"><li>对于多个 AMSI 提供程序，有一个认为恶意，那 AMSI 就会认为恶意，并且不再送给接下来的提供程序扫描。</li></ul><div class="notion-text notion-block-ab670992e9b4470fa40d8f9f5365ed13">在 Windows 10 上注册AMSI 提供程序的方法 （具体实现见第二章  ）：</div><ul class="notion-list notion-list-disc notion-block-39178b842c334bd68694729e882515c7"><li>在键中 <code class="notion-inline-code">HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\AMSI\Providers</code> ，有一个子键，其名称为 <code class="notion-inline-code">{2781761E-28E0-4109-99FE-B9D127C57AFE}</code></li></ul><ul class="notion-list notion-list-disc notion-block-34a6afb6f5174c32a3c17b3858ecc9fb"><li>若要确定与该 GUID 值关联的相应 AMSI 提供程序 DLL，可以查看如下键   <code class="notion-inline-code">HKEY_CLASSES_ROOT\CLSID\{2781761E-28E0-4109-99FE-B9D127C57AFE}\InprocServer32 - (default)</code> .该注册表值的内容为 <code class="notion-inline-code">%ProgramData%\Microsoft\Windows Defender\Platform\4.18.2110.6-0\MpOav.dll</code> 。因此，MpOav.dll 是特定供应商（在本例中为 Microsoft）的 AMSI 提供程序 DLL，负责接收和处理应用程序传递给它的内容。</li></ul><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-9ec8d53db6c846bb8ae87e035bca112f" data-id="9ec8d53db6c846bb8ae87e035bca112f"><span><div id="9ec8d53db6c846bb8ae87e035bca112f" class="notion-header-anchor"></div><a class="notion-hash-link" href="#9ec8d53db6c846bb8ae87e035bca112f" title="0x02 分析 Powershell AMSI 扫描的实现"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">0x02 分析 Powershell AMSI 扫描的实现</span></span></h2><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-035b452b83f74d5580bdd4abd4e6b294" data-id="035b452b83f74d5580bdd4abd4e6b294"><span><div id="035b452b83f74d5580bdd4abd4e6b294" class="notion-header-anchor"></div><a class="notion-hash-link" href="#035b452b83f74d5580bdd4abd4e6b294" title="2.1 源码分析"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">2.1 源码分析</span></span></h3><div class="notion-text notion-block-f1d8dfcd4b77431ca2ae6d9691c628ae">powershell是开源的，可以对源码直接进行分析，要分析的代码主要在 <code class="notion-inline-code">PowerShell/src/System.Management.Automation/security/SecuritySupport.cs</code> 和<code class="notion-inline-code">PowerShell/src/System.Management.Automation/engine/runtime/CompiledScriptBlock.cs</code> 。</div><div class="notion-text notion-block-a39a90f2e3b84a72a7ff0735b464bc43">前者实现了 AmsiUtils 类，后者调用 AmsiUtils 类的方法进行扫描。</div><div class="notion-text notion-block-5d15be4c279b4e6e8cf6a9350e1d93ca">在 <code class="notion-inline-code">CompiledScriptBlock.cs</code> 的 <code class="notion-inline-code">PerformSecurityChecks</code> 函数调用 <code class="notion-inline-code">ScanContent</code> 进行扫描。</div><div class="notion-text notion-block-20571dfd661e4d30a3c2cf3818a3dcec"><code class="notion-inline-code">ScanContent</code> 只是调用了<code class="notion-inline-code">WinScanContent</code> ，实际的扫描逻辑都是在<code class="notion-inline-code">WinScanContent</code> 里。</div><blockquote class="notion-quote notion-block-53215e32181d4de280960ff15c53ec2d"><div>不少文章 都是这么写的，但这只是开源的跨平台 powershell 7.x 才有的设计，在 windows 自带的 powershell 5.x 中，扫描逻辑位于 <code class="notion-inline-code">ScanContent</code> 。</div></blockquote><blockquote class="notion-quote notion-block-cb55020fba92464496fee6af37977c90"><div><code class="notion-inline-code">PSEtwLog.LogAmsiUtilStateEvent</code> 这个也是7.x新增的，windows自带的 powershell 没有，有了这个，安全产品检测 AMSI 绕过就容易多了（这个也能绕过）。</div></blockquote><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-1c253a61be854ce3a825a3f8337f475f" data-id="1c253a61be854ce3a825a3f8337f475f"><span><div id="1c253a61be854ce3a825a3f8337f475f" class="notion-header-anchor"></div><a class="notion-hash-link" href="#1c253a61be854ce3a825a3f8337f475f" title="2.2 汇编分析"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">2.2 汇编分析</span></span></h3><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-c451b2191cb04b01859bcbe6593b1494"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F9b088554-7e2b-4e15-a3ac-f935a8faacef%2F639ad2de-3000-4014-b7a9-069765815d38%2FUntitled.png?table=block&amp;id=c451b219-1cb0-4b01-859b-cbe6593b1494&amp;t=c451b219-1cb0-4b01-859b-cbe6593b1494&amp;width=707.96875&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-text notion-block-d49f8aa28bb14ac89559965a665c08b4">使用 API Monitor 看下api 调用。</div><div class="notion-text notion-block-6b84f625262e405c97004fb4501b675c"><code class="notion-inline-code">AmsiInitialize</code> 调用发生在powershell初始化时，执行语句时，先 <code class="notion-inline-code">AmsiOpenSession</code> 打开会话 ，然后用  <code class="notion-inline-code">AmsiScanBuffer</code> 扫描，再用<code class="notion-inline-code">AmsiCloseSession</code> 关闭会话。</div><div class="notion-text notion-block-d1f8b23532c14e08baad8a721248570f">这里只分析 <code class="notion-inline-code">AmsiOpenSession</code> 的调用，其他函数的调用与之类似     。</div><h4 class="notion-h notion-h3 notion-h-indent-2 notion-block-ed4493e97f714473b372d6610e7d4829" data-id="ed4493e97f714473b372d6610e7d4829"><span><div id="ed4493e97f714473b372d6610e7d4829" class="notion-header-anchor"></div><a class="notion-hash-link" href="#ed4493e97f714473b372d6610e7d4829" title="AmsiOpenSession"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">AmsiOpenSession</span></span></h4><div class="notion-text notion-block-695adb88c109443e9a30b69a0fa1e0b2">使用 windbg 设置断点。</div><div class="notion-text notion-block-659cacb75f274d2e9e576c99c0cd8afa"><code class="notion-inline-code">bp amsi!AmsiOpenSession</code></div><div class="notion-text notion-block-ff8937eb11e3410fb82d57b5b9283524">查看调用栈。</div><div class="notion-text notion-block-ba1c97cdca5b452888529561596832d7">最近的3处调用如下，内存的权限均为 <code class="notion-inline-code">PAGE_EXECUTE_READ</code> ，不修改内存权限的情况下只有 <code class="notion-inline-code">call    rax</code> 这个有可能用于绕过，别的  都是写死的。         </div><div class="notion-text notion-block-9e2cce60833d4097bf3e082e375fb4ee">  </div><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-6a2709ede5b84cd6b3924d5f091f9e8f" data-id="6a2709ede5b84cd6b3924d5f091f9e8f"><span><div id="6a2709ede5b84cd6b3924d5f091f9e8f" class="notion-header-anchor"></div><a class="notion-hash-link" href="#6a2709ede5b84cd6b3924d5f091f9e8f" title="0x03 分析  [System.Reflection.Assembly]::Load() AMSI 扫描的实现"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">0x03 分析 <b> [System.Reflection.Assembly]::Load() AMSI 扫描的实现</b></span></span></h2><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-8dcbd1049fd144c39fd19c4a2949570e"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F9b088554-7e2b-4e15-a3ac-f935a8faacef%2Faf91c379-884b-4d5f-829e-ac96d4096ccf%2FUntitled.png?table=block&amp;id=8dcbd104-9fd1-44c3-9fd1-9c4a2949570e&amp;t=8dcbd104-9fd1-44c3-9fd1-9c4a2949570e&amp;width=708&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-text notion-block-8f65fac6b2c54bacb26aa5bb3e096082"><code class="notion-inline-code">[System.Reflection.Assembly]::Load()</code> 可以加载C#程序集，在powershell中也可以调用，其也会调用 AMSI ，扫描不通过时会产生上述报错。</div><div class="notion-text notion-block-36aafce094144ba8b7ddbb42cbe4e7ac">使用  dnSpy 分析 <code class="notion-inline-code">Load</code>方法的实现。   </div><div class="notion-text notion-block-d998b6be17804f3791cae8e244527d94">跟进  <code class="notion-inline-code">nLoadImage</code> 。</div><div class="notion-text notion-block-0aab7608525249059bda2da6c762914e">标记为 <code class="notion-inline-code">[MethodImpl(MethodImplOptions.InternalCall)]</code>，这意味着它是通过内部调用实现的，而不是用托管代码（C#）实现。</div><div class="notion-text notion-block-91e35a350b1e46a48501a1cac437cfa6">使用 windbg 进行调试</div><div class="notion-text notion-block-9b1200ef180345fabd79b8a15b1adde7">反汇编结果如下</div><div class="notion-text notion-block-caf69197029448e1b9946b5135e29fd5">使用 mdToken 检索 nLoadImage 方法的 MethodDesc</div><div class="notion-text notion-block-8f9e429b34e043fcae49a249253a2f8d">列出了 MethodDesc 的信息。这将提供实现 <code class="notion-inline-code"><b>nLoadImage</b></code> 的对象的方法表的地址。</div><blockquote class="notion-quote notion-block-4ea28a7307f24520bc7130176784e50e"><div>方法表 (Method Table) 是一种数据结构，用于描述类型的所有方法，并提供访问这些方法的机制。</div></blockquote><div class="notion-text notion-block-53da8c7d70ef49ed85c75c9b8f797de5">列出方法表并找到  <code class="notion-inline-code"><b>nLoadImage</b></code> </div><div class="notion-text notion-block-99fabd86d1bc4eb8b621c65200ba5aea">因此，nLoadImage 的本机地址是 0x00007fffffc24c70</div><div class="notion-text notion-block-2fb007f3ae244c9c84fe367e115bc265">clr!AssemblyNative::LoadImage 调用  clr!AmsiScan 的调用栈为  </div><div class="notion-text notion-block-b315880dc6a6484891b3a6f74020ce0b">可以用 IDA 分析 clr.dll 研究 AmsiScan 具体实现。</div><div class="notion-text notion-block-81896a3ec61943e9a17fb67be26d83e6"><code class="notion-inline-code">CLRLoadLibraryEx </code>是对 <code class="notion-inline-code">LoadLibraryExW</code>  的封装，因为没有启动新进程，当前进程还是 powershell进程，<code class="notion-inline-code">LoadLibraryExW</code> 会返回已经加载的 <code class="notion-inline-code">amsi.dll</code> 模块的句柄，并增加其引用计数。这意味着在powershell 中对 <code class="notion-inline-code">amsi.dll</code> 进行的修改，在 <code class="notion-inline-code">[System.Reflection.Assembly]::Load()</code> 也会生效。</div><div class="notion-text notion-block-ba4fd5f7da7c402bbf8c0b491fda7b20">在 AmsiScan 中，调用 <code class="notion-inline-code">AmsiInitialize</code>  建立了新的 <code class="notion-inline-code">amsiContext</code>  ，着意味着对 powershell <code class="notion-inline-code">amsiContext</code> 的修改不会影响到<code class="notion-inline-code">Load()</code> 的 AMSI 检测。</div><div class="notion-text notion-block-86f645bde7f7416997601244fa5b4529">随后调用  <code class="notion-inline-code">AmsiScanBuffer</code> 进行扫描（这里并没有使用 <code class="notion-inline-code">AmsiOpenSession</code> 建立会话），根据扫描结果决定是否进行阻断。  </div><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-a187f2a80dc248b39537d145f7e89aea" data-id="a187f2a80dc248b39537d145f7e89aea"><span><div id="a187f2a80dc248b39537d145f7e89aea" class="notion-header-anchor"></div><a class="notion-hash-link" href="#a187f2a80dc248b39537d145f7e89aea" title="0x04 分析 fastprox.dll AMSI 扫描的实现"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">0x04 分析 fastprox.dll AMSI 扫描的实现</span></span></h2><div class="notion-text notion-block-aeed0931e8cb480bb11371ec14916c8e">逆向 <code class="notion-inline-code">fastprox.dll</code> ，对象初始化函数如下</div><div class="notion-text notion-block-b196027cf0b14c9bb3f0e7e7b3a0acf6">检查注册表，如果 <code class="notion-inline-code">AmsiEnable</code> 值被设置为0后续就不进行 AMSI 扫描，这块和 <code class="notion-inline-code">JScript.dll</code> 处理差不多，早期 win10 版本可以修改 HKCU 注册表绕过，现在的版本都是检查 <code class="notion-inline-code">HKLM</code> 了。</div><div class="notion-text notion-block-f19370699bdf4c19a7557371985899b3">在 <code class="notion-inline-code">JAmsiInitialize </code>函数中，加载 amsi 前进行了一些判断。<code class="notion-inline-code">g_Amsi</code> 是前文检查的注册表项，<code class="notion-inline-code">JAmsiIsCurrentProcessWmiprvse</code> 则是比对当前文件的路径是否为系统目录下的<code class="notion-inline-code">\wbem\wmiprvse.exe</code> ，如果是的话则不进行检测。</div><div class="notion-callout notion-gray_background_co notion-block-57120ae8038441d9a26c51eebe0d9dcb"><div class="notion-page-icon-inline notion-page-icon-span"><span class="notion-page-icon" role="img" aria-label="💡">💡</span></div><div class="notion-callout-text">经常干蓝队的肯定知道，wmi 操作时会先由 svchost.exe 调用 WmiPrvSE.exe 然后由 WmiPrvSE 调用指定的程序。他这不检测 WmiPrvSE.exe ，那这个基本对 wmi 远程攻击没啥检测能力了。
目前只有本机用 wmic、powershell 等程序操作 wmi 的时候才能触发检测，并且本地操作也不是全触发检测，还要判断hash，搞不懂微软这么设计图啥，搞得这块的检测非常容易绕过。</div></div><div class="notion-text notion-block-9ceb4dba118c4736bc64c2dee06cf5d9">在 <code class="notion-inline-code">JAmsi::JAmsiProcessor</code> 中进行扫描前，还进行了一个判断，判断需不需要进行扫描。</div><div class="notion-text notion-block-4159fcba06c74b2b9b74551f15b2aa27"><code class="notion-inline-code">JAmsiIsScannerNeeded</code> 会对对象及方法进行判断，比如执行</div><div class="notion-text notion-block-c6b69b108f6f44929d58006f6d6dff55"><code class="notion-inline-code">wmic Process Call Create &quot;cmd /c whoami&quot;</code> 时</div><div class="notion-text notion-block-b34b3bc9690d4762993809f53c59a848">会依次对以下对象及方法进行hash（hash算法为CRC32，此处不展开说明）。</div><table class="notion-simple-table notion-block-ffdabdf733ff429187c51813cd7462a0"><tbody><tr class="notion-simple-table-row notion-block-aac517293c4746c3a360be7b268210db"><td class="" style="width:587.9957275390625px"><div class="notion-simple-table-cell">对象</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">方法</div></td></tr><tr class="notion-simple-table-row notion-block-523739f47ef449a68ce649c909dfe7e0"><td class="" style="width:587.9957275390625px"><div class="notion-simple-table-cell"><code class="notion-inline-code">MSFT_CliAlias.FriendlyName=&#x27;Process&#x27;</code></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">GetObject</code></div></td></tr><tr class="notion-simple-table-row notion-block-4bad9231c6944b0c8dfa09c0ef865d2f"><td class="" style="width:587.9957275390625px"><div class="notion-simple-table-cell"><code class="notion-inline-code">MSFT_LocalizablePropertyValue.ObjectLocator=&quot;&quot;,PropertyName=&quot;Description&quot;,RelPath=&quot;MSFT_CliAlias.FriendlyName=\&quot;Process\&quot;&quot;</code></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">GetObject</code></div></td></tr><tr class="notion-simple-table-row notion-block-ae503c95e79642d3b2c15e891e209b2e"><td class="" style="width:587.9957275390625px"><div class="notion-simple-table-cell"><code class="notion-inline-code">MSFT_CliAlias.FriendlyName=&#x27;Process&#x27;</code></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">GetObject</code></div></td></tr><tr class="notion-simple-table-row notion-block-47ec9112057e4446acb7c7f900ee8f97"><td class="" style="width:587.9957275390625px"><div class="notion-simple-table-cell"><code class="notion-inline-code">Win32_Process</code></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">GetObject</code></div></td></tr><tr class="notion-simple-table-row notion-block-eb845b9660c2448a8856133ff5fd7c3b"><td class="" style="width:587.9957275390625px"><div class="notion-simple-table-cell"><code class="notion-inline-code">SetPropValue</code></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">CommandLine</code></div></td></tr></tbody></table><div class="notion-text notion-block-6ecdb126693047019a4b9c4254aa1ca2">当有 hash 等于以下的内置hash时，启动 AMSI 检测。</div><div class="notion-text notion-block-e5a79ef7b0244a4e81b41f97e0cf532b"><code class="notion-inline-code">SetPropValueCommandLine</code> hash得到的结果为 c0b29b3d，故进行AMSI检测。</div><blockquote class="notion-quote notion-block-12c8be7cf7f4421faff01502b8f96abf"><div>WMI 检测的 hash 没太大爆破的价值，jscript 和 vba 的检测 hash 如下文所示。
<a target="_blank" rel="noopener noreferrer" class="notion-link" href="https://github.com/synacktiv/AMSI-Bypass/tree/master">https://github.com/synacktiv/AMSI-Bypass/tree/master</a></div></blockquote><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-da695086cdec40c9a929990f80c9a715" data-id="da695086cdec40c9a929990f80c9a715"><span><div id="da695086cdec40c9a929990f80c9a715" class="notion-header-anchor"></div><a class="notion-hash-link" href="#da695086cdec40c9a929990f80c9a715" title="0x05 分析AMSI.dll 的实现"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">0x05 分析AMSI.dll 的实现</span></span></h2><div class="notion-text notion-block-3e8591dd4fb341c3982dbaf7d6c3a3c5"><code class="notion-inline-code">AMSI.dll</code> 不开源，只能通过逆向的方法分析，并且不同版本之间存在一定的差异，以下分析以windows 11 为准，与旧版本的差异会指出一部分，</div><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-97ff3f0baa0643a9ac808244977dc632" data-id="97ff3f0baa0643a9ac808244977dc632"><span><div id="97ff3f0baa0643a9ac808244977dc632" class="notion-header-anchor"></div><a class="notion-hash-link" href="#97ff3f0baa0643a9ac808244977dc632" title="5.1 AmsiInitialize"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">5.1 AmsiInitialize</span></span></h3><div class="notion-text notion-block-6982e2ca84214a97833233eb5e9d6afa">首先会创建 COM 对象，在早期版本调用 <code class="notion-inline-code">CoCreateInstance</code> 实现，其会通过注册表CLSID查找和定位COM服务器，由于其会先在注册表 HKCU 项查询，故普通用户也可以对其进行劫持。微软为了修复这个问题将代码改为直接调用更底层的 <code class="notion-inline-code">DllGetClassObject</code> 创建 COM 类工厂。</div><div class="notion-text notion-block-4bf551a4c2914f46a2ca7bcede410cdb">在 win11 上，此处被替换为调用 <code class="notion-inline-code">AtlComModuleGetClassObject</code> ，网上并未找到分析为什么替换的文章。               </div><div class="notion-text notion-block-70de6454feeb4f75b7b07b7e36489e44">调试 <code class="notion-inline-code">AtlComModuleGetClassObject</code> 查看参数。</div><div class="notion-text notion-block-e5155485243148ee9f2d7f0e13f64279">随后使用 类工厂对象创建 COM对象，<code class="notion-inline-code">ATL::CComClassFactory::CreateInstance</code> 是 ATL 类工厂的一部分，用于创建 COM 对象的实例。创建了 <code class="notion-inline-code">CAmsiAntimalware</code> 对象。
<code class="notion-inline-code">amsi!ATL::CComCreator&lt;ATL::CComObject&lt;CAmsiAntimalware&gt; &gt;::CreateInstance</code>函数负责实际的对象创建过程。<code class="notion-inline-code">CAmsiAntimalware</code> 是 AMSI 的一个具体实现类。</div><div class="notion-text notion-block-cdfbacd409974a3895093fffd5aa2602"><code class="notion-inline-code">AmsiComCreateProviders</code> 负责创建和初始化 <code class="notion-inline-code">IAntimalwareProvider</code> 接口的实际实例。</div><div class="notion-text notion-block-22b531328ad64b619b4d08730283834f"><code class="notion-inline-code">AmsiComCreateProviders</code> 调用栈如下。</div><div class="notion-text notion-block-a1dc3e61eadc4b1a91fdb7adae67d50f"><code class="notion-inline-code">AmsiComCreateProviders</code> 函数中调用 <code class="notion-inline-code">RegOpenKeyExW</code> 和 <code class="notion-inline-code">RegQueryInfoKeyW</code> 获取</div><div class="notion-text notion-block-cdaee5f13b2743018d76d342c258681c"><code class="notion-inline-code">&quot;Software\\Microsoft\\AMSI\\Providers&quot;</code> 的信息，并使用 <code class="notion-inline-code">RegEnumKeyExW</code> 枚举其子项，获取已注册的 AMSI 提供程序的类标识符。随后将提供程序的类标识符传递给 <code class="notion-inline-code">AmsiComSecureLoadInProcServer</code> ，用 <code class="notion-inline-code">RegGetValueW()</code> 查询与 AMSI 提供程序对应的 <code class="notion-inline-code">InProcServer32</code> 值。</div><div class="notion-text notion-block-20ae7258a4dc4356b015adcb21fb5cf7">然后，<code class="notion-inline-code">AmsiComSecureLoadInProcServer</code> 会调用 <code class="notion-inline-code">amsi!CheckTrustLevel()</code> 读取<code class="notion-inline-code">SOFTWARE\Microsoft\AMSI\FeatureBits</code> 的值，这个键包含一个 DWORD 值，可以是 1（默认值）或 2，用于禁用或启用对提供程序的 Authenticode 签名检查。</div><div class="notion-text notion-block-d0833cf2aa8a4540a5bf3568d66f35cb">随后会调用 <code class="notion-inline-code">LoadLibraryExW</code> 以加载 AMSI 提供程序的 DLL。通过以下方法调试可以看到加载了 <code class="notion-inline-code">MpOav.dll</code></div><div class="notion-text notion-block-f3e1bd1487d34b79ad509fb2f8e49117">加载 dll 成功后会调用 dll 的<code class="notion-inline-code">DllGetClassObject</code>函数创建一个类对象，并调用调用 <code class="notion-inline-code">IClassFactory::CreateInstance</code> 获取请求的接口指针。</div><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-a4062752edf142fc8c67179f9b3b89ff" data-id="a4062752edf142fc8c67179f9b3b89ff"><span><div id="a4062752edf142fc8c67179f9b3b89ff" class="notion-header-anchor"></div><a class="notion-hash-link" href="#a4062752edf142fc8c67179f9b3b89ff" title="5.2 AmsiOpenSession"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">5.2 AmsiOpenSession</span></span></h3><div class="notion-text notion-block-accc1cf5a07c4c2ba54ca23c45352c86">需要重点关注的内容如下</div><div class="notion-text notion-block-e6ed07cc911c41948eb414271694f1f0">检查输入参数是否有效。如果 <code class="notion-inline-code">amsiSession</code> 或 <code class="notion-inline-code">amsiContext</code> 为 <code class="notion-inline-code">NULL</code>，或者 <code class="notion-inline-code">amsiContext</code> 的第二和第三个 <code class="notion-inline-code">_QWORD</code> 为0，则返回错误代码 <code class="notion-inline-code">-2147024809</code>（通常表示无效参数）。</div><div class="notion-text notion-block-ce12a4e3e0f148779c80c7e87a9f5938">在 win10 上，这个判断逻辑为</div><div class="notion-text notion-block-ac33bab66cba41dc894462465270a7b1">在 win10 中还会额外判断  amsiContext 的第一个 DWORD 值是否为 1230196033 （对应16进制数据0x49534D41，对应字符串 ISMA ，因为小端序的原因，实际匹配的字符串是 AMSI），可能是因为有相当的多的文章修改这个字符串绕过 AMSI，微软在 win11 移除了这个判断逻辑。不过这样治标不治本，攻击者还可以修改另外几处判断。</div><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-b206d6b8271f49e6a2ec728fc9cf2786" data-id="b206d6b8271f49e6a2ec728fc9cf2786"><span><div id="b206d6b8271f49e6a2ec728fc9cf2786" class="notion-header-anchor"></div><a class="notion-hash-link" href="#b206d6b8271f49e6a2ec728fc9cf2786" title="5.3 AmsiScanBuffer"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">5.3 AmsiScanBuffer</span></span></h3><div class="notion-text notion-block-16208d5b91b4438fa4e42dba01ac5115">首先会检测各个参数。</div><div class="notion-text notion-block-ac1911eb5794444aaecdba3b2935f9d9">随后通过指针调用了一个函数，用 windbg 看下调用的函数是 <code class="notion-inline-code">amsi!CAmsiAntimalware::Scan</code> 。</div><div class="notion-text notion-block-823342ed61a74f5ab50914d70996cd32"><code class="notion-inline-code">CAmsiAntimalware::Scan</code> 会遍历每个已注册的 AMSI 提供程序，调用供应商实现的<code class="notion-inline-code">IAntimalwareProvider::Scan()</code> 函数，如果各个 AMSI 提供程序都没有发现恶意软件，则将结果设置为<code class="notion-inline-code">AMSI_RESULT_NOT_DETECTE</code> 。</div><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-bca2b55ee4e74d69a5c572e31c4ed46e" data-id="bca2b55ee4e74d69a5c572e31c4ed46e"><span><div id="bca2b55ee4e74d69a5c572e31c4ed46e" class="notion-header-anchor"></div><a class="notion-hash-link" href="#bca2b55ee4e74d69a5c572e31c4ed46e" title="参考文章"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">参考文章</span></span></h2><div class="notion-text notion-block-654c49ded51543debca0b819b4584ace"><a target="_blank" rel="noopener noreferrer" class="notion-link" href="https://redcanary.com/blog/threat-detection/better-know-a-data-source/amsi/">https://redcanary.com/blog/threat-detection/better-know-a-data-source/amsi/</a></div><div class="notion-text notion-block-a471d06c7a294329ae506cadb5116749"><a target="_blank" rel="noopener noreferrer" class="notion-link" href="https://gustavshen.medium.com/bypass-amsi-on-windows-11-75d231b2cac6">https://gustavshen.medium.com/bypass-amsi-on-windows-11-75d231b2cac6</a></div><div class="notion-text notion-block-43fb4edbd740448d97da720e84268dd3"><a target="_blank" rel="noopener noreferrer" class="notion-link" href="https://i.blackhat.com/Asia-22/Friday-Materials/AS-22-Korkos-AMSI-and-Bypass.pdf">https://i.blackhat.com/Asia-22/Friday-Materials/AS-22-Korkos-AMSI-and-Bypass.pdf</a></div><div class="notion-text notion-block-00a186fd2974468ab2f0ad5532091d1a"><a target="_blank" rel="noopener noreferrer" class="notion-link" href="https://posts.specterops.io/antimalware-scan-interface-detection-optics-analysis-methodology-858c37c38383">https://posts.specterops.io/antimalware-scan-interface-detection-optics-analysis-methodology-858c37c38383</a></div></main></div>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AMSI研究(3) - 绕过及检测  ]]></title>
            <link>https://blog.fatekey.icu/article/AMSI3</link>
            <guid>https://blog.fatekey.icu/article/AMSI3</guid>
            <pubDate>Wed, 26 Jun 2024 00:00:00 GMT</pubDate>
            <content:encoded><![CDATA[<div id="notion-article" class="mx-auto overflow-hidden "><main class="notion light-mode notion-page notion-block-8c0ec22206bf4d728a1461160f1fe2e4"><div class="notion-viewport"></div><div class="notion-collection-page-properties"></div><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-1d0f651bdc0a4074af4816e8364e5fa3" data-id="1d0f651bdc0a4074af4816e8364e5fa3"><span><div id="1d0f651bdc0a4074af4816e8364e5fa3" class="notion-header-anchor"></div><a class="notion-hash-link" href="#1d0f651bdc0a4074af4816e8364e5fa3" title="0x00 混淆代码"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">0x00 混淆代码</span></span></h2><div class="notion-text notion-block-d6a3251f2e474e429eacf5bcfb11e86b">对于 powershell 绕过 AMSI 来说，混淆代码是绕过 AMSI 最基础的步骤，因为大部分绕过方法还是要执行 AMSI 语句，这个用来绕过的语句本身也是要被 AMSI 检测的，所以要对这个绕过语句进行混淆处理。</div><blockquote class="notion-quote notion-block-7b715550d5d6429c9d433fe7cfb9cc17"><div>这块严格来说不是绕过 AMSI，而是绕过 AMSI 对接的安全产品的规则，自带的 windows defender 的规则非常容易绕过。</div></blockquote><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-23aa6be881b047b68ced36a4c6553f42" data-id="23aa6be881b047b68ced36a4c6553f42"><span><div id="23aa6be881b047b68ced36a4c6553f42" class="notion-header-anchor"></div><a class="notion-hash-link" href="#23aa6be881b047b68ced36a4c6553f42" title="攻击姿势"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">攻击姿势</span></span></h3><div class="notion-text notion-block-c7b58a34b5ce4155ad7473058896ddb3">经过简单的分割测试，可以确定有如下规则</div><ul class="notion-list notion-list-disc notion-block-920e6a0cc68642849f7368aebf2e6acd"><li>字符串 <code class="notion-inline-code">&#x27;AmsiUtils&#x27;</code></li></ul><ul class="notion-list notion-list-disc notion-block-c9651c5c2d4a47ce814444fb2a44b658"><li>字符串<code class="notion-inline-code">&#x27;amsiInitFailed&#x27;</code></li></ul><ul class="notion-list notion-list-disc notion-block-d1383721c7bd4ab6840ff7b6e61f3fc5"><li>同时出现 <code class="notion-inline-code">[Ref].Assembly.GetType</code> <code class="notion-inline-code">GetField</code> <code class="notion-inline-code">SetValue($null,$true)</code></li></ul><div class="notion-text notion-block-0a73202fbcf048e8a0b0f20aee7ef46b">powershell 语法极为灵活，下面简单列举几种绕过的方法。</div><div class="notion-text notion-block-af615b1d4ce542f78d6ca7be2f6d3cfc">使用 like 避免出现完整字符串 + 拆分成多条语句避免同时出现关键字</div><div class="notion-text notion-block-4aa119f36e0941c984b20c07c6f391d6">对方法名进行字符串拼接</div><div class="notion-text notion-block-1ef90487a98544f8831a01b4f3ec27ea">拆分成变量</div><div class="notion-text notion-block-e8638fd6143f4fe69782c86e00a493fd">除了手动混淆，也可以使用专门的混淆工具，如：https://github.com/danielbohannon/Invoke-Obfuscation</div><div class="notion-text notion-block-f3e0b4c6ffd443c89a62d08609abbbb2">不过要注意，一些混淆手法是对命令进行加密，再利用<code class="notion-inline-code">Invoke-Expression</code> 执行解密的命令，这样是无法绕过 AMSI 的，因为<code class="notion-inline-code">Invoke-Expression</code> 执行的命令将会被 AMSI 检测，效果如下： </div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-ca6fd927b5914453822ecaa0704ffb33"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:673.984375px;max-width:100%;flex-direction:column"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F9b088554-7e2b-4e15-a3ac-f935a8faacef%2Fdb5c7bf8-64e1-43dc-88ed-4a44d4450f44%2FUntitled.png?table=block&amp;id=ca6fd927-b591-4453-822e-caa0704ffb33&amp;t=ca6fd927-b591-4453-822e-caa0704ffb33&amp;width=673.984375&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-512a54a15d2142f491e69299f4f4341b" data-id="512a54a15d2142f491e69299f4f4341b"><span><div id="512a54a15d2142f491e69299f4f4341b" class="notion-header-anchor"></div><a class="notion-hash-link" href="#512a54a15d2142f491e69299f4f4341b" title="检测方法"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">检测方法</span></span></h3><div class="notion-text notion-block-25fd5359a17847a9b342ddf3fab5db5b">对于分割绕过，可以将同一 powershell 进程执行的多条命令合并后进行检测。</div><div class="notion-text notion-block-eb06c05723194a7a8f87b6846460c536">因为 AMSI 需要快速响应，所以很难使用高级检测方案，我的想法是阻断规则和告警规则可以分开，阻断规则就是高性能的正则表达式或者关键字，检测完成后直接返回给 AMSI，避免程序卡死，然后再进行相对耗时的高级检测，将检测结果发往服务端。</div><ul class="notion-list notion-list-disc notion-block-8d8d446ce8da48409513a65f1d17a205"><li>使用语法树判断 powershell 代码是否混淆，正常业务一般不会混淆 powershell 代码，所以检测到混淆行为就可以直接告警个低危。（也许需要对一些业务混淆加白）</li><ul class="notion-list notion-list-disc notion-block-8d8d446ce8da48409513a65f1d17a205"><blockquote class="notion-quote notion-block-cca0eed75cb6404fb674f015b57ce1b4"><div><a target="_blank" rel="noopener noreferrer" class="notion-link" href="https://github.com/danielbohannon/Revoke-Obfuscation">https://github.com/danielbohannon/Revoke-Obfuscation</a> </div></blockquote></ul></ul><ul class="notion-list notion-list-disc notion-block-f2663e58a1d842d9a24042422bf1430f"><li>静态反混淆</li><ul class="notion-list notion-list-disc notion-block-f2663e58a1d842d9a24042422bf1430f"><blockquote class="notion-quote notion-block-b172b16c30504c11954b52029c698e07"><div>https://github.com/pan-unit42/public_tools/tree/master/powershellprofiler</div></blockquote></ul></ul><ul class="notion-list notion-list-disc notion-block-8827ee5551bb4d7b8a251d25eb9cc05d"><li>动态反混淆 - powershell 沙箱</li><ul class="notion-list notion-list-disc notion-block-8827ee5551bb4d7b8a251d25eb9cc05d"><div class="notion-text notion-block-c549f1ee4e9649b8bca940efb96962ec">静态反混淆容易被一些动态特性击败，可以对 powershell 进行二开，做成 powershell 沙箱，真正的获取语句执行的操作。</div></ul></ul><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-eac3f66aa03845f29dea690e14fa4582" data-id="eac3f66aa03845f29dea690e14fa4582"><span><div id="eac3f66aa03845f29dea690e14fa4582" class="notion-header-anchor"></div><a class="notion-hash-link" href="#eac3f66aa03845f29dea690e14fa4582" title="0x01 降级攻击"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">0x01 降级攻击</span></span></h2><div class="notion-text notion-block-92d8abcbb05c4331bed2a01fd58e8636">降级PowerShell版本到 2.0 可以绕过 AMSI，因为这个版本的 powershell 还没有引入 AMSI 机制。</div><div class="notion-text notion-block-d4b79e40d3d34d19819deda7ef95da96">PowerShell 2.0 基于.NET CLR 2.0，对应的 .NET 版本是 2/3/3.5，这在现在的系统上预装的并不多，可以用以下命令查看安装的 .NET 版本。</div><blockquote class="notion-quote notion-block-86f60df557e44df09a469c8986a327a3"><div>早期的部分 win10 预装了 .NET 3.5</div></blockquote><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-1af8b043e4f149b5b31c0a6f45602857" data-id="1af8b043e4f149b5b31c0a6f45602857"><span><div id="1af8b043e4f149b5b31c0a6f45602857" class="notion-header-anchor"></div><a class="notion-hash-link" href="#1af8b043e4f149b5b31c0a6f45602857" title="攻击姿势"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">攻击姿势</span></span></h3><div class="notion-text notion-block-9ff914020ea3435dab34a2cb32d0ee6b">使用 <code class="notion-inline-code">powershell.exe -version 2</code> 改变版本。</div><div class="notion-text notion-block-e0c203627e0748f18faa2406bec4df60">在脚本开头加入 <code class="notion-inline-code">#requires -version 2</code> ，可以指定脚本使用 PowerShell 2.0 执行。</div><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-3f68400d70574e3eac0d8be3a82a5781" data-id="3f68400d70574e3eac0d8be3a82a5781"><span><div id="3f68400d70574e3eac0d8be3a82a5781" class="notion-header-anchor"></div><a class="notion-hash-link" href="#3f68400d70574e3eac0d8be3a82a5781" title="检测方法"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">检测方法</span></span></h3><div class="notion-text notion-block-ffe5927c9aa64cddafc606b21683db8c">检测进程启动事件是否有 <code class="notion-inline-code">-version 2</code> 参数。</div><div class="notion-text notion-block-bf38cc9617c246eb86d0aeeaceb990f7">检测 powershell 脚本中是否有 <code class="notion-inline-code">#requires -version 2</code>。</div><div class="notion-text notion-block-6e4ca700587544dca3f56160e1c8093e">感觉只要有这种行为，就可以给个中低危告警了，现在正常业务用 powershell 2 的情况太少了。</div><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-2b4e40c2c6854711874e1aab440e3871" data-id="2b4e40c2c6854711874e1aab440e3871"><span><div id="2b4e40c2c6854711874e1aab440e3871" class="notion-header-anchor"></div><a class="notion-hash-link" href="#2b4e40c2c6854711874e1aab440e3871" title="0x02  修改注册表"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">0x02  修改注册表</span></span></h2><div class="notion-text notion-block-c12e455d74104a3c8b02ad92bc7e635e">对于 powershell、.NET 之外的 AMSI 检测，不少可以被注册表配置影响，比如 Jscript 对应的 <code class="notion-inline-code">Software\\Microsoft\\Windows Script\\Settings\\AmsiEnable</code> ，wmi 对应的 <code class="notion-inline-code">Software\\Microsoft\\WBEM\\AmsiEnable</code> 。</div><blockquote class="notion-quote notion-block-fc9b178c19eb400cbb1245de3f00cb4a"><div>需要注意的是，这块微软做过多次修改，能不能生效要针对具体的windows版本来分析。</div></blockquote><div class="notion-text notion-block-e8f5224e33654c9ea6951402fd048aaa">需要注意的是，在早期 win10 中，读取的是 <code class="notion-inline-code">HKEY_CURRENT_USER</code> ，现在读取的是<code class="notion-inline-code">HKEY_LOCAL_MACHINE</code> ，修改相关的注册表需要管理员权限。</div><div class="notion-text notion-block-84e3c72864ed467a998ab8cc1afc2edc">此外，还可以直接删除注册表中注册的 <code class="notion-inline-code">Providers</code>来影响 AMSI 正常运作。</div><div class="notion-text notion-block-bc220d6e408246cb8f8f7272fa98ec5b"><code class="notion-inline-code">HKLM:\SOFTWARE\Microsoft\AMSI\Providers</code></div><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-3d12f99d1502475593f56e6aa39ddec8" data-id="3d12f99d1502475593f56e6aa39ddec8"><span><div id="3d12f99d1502475593f56e6aa39ddec8" class="notion-header-anchor"></div><a class="notion-hash-link" href="#3d12f99d1502475593f56e6aa39ddec8" title="检测方法"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">检测方法</span></span></h3><div class="notion-text notion-block-50f632f6e1a942e6a26814ad6c92c374">监控修改相关注册表的行为。</div><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-fd87ceb9e1a446dab771b925d83dabb6" data-id="fd87ceb9e1a446dab771b925d83dabb6"><span><div id="fd87ceb9e1a446dab771b925d83dabb6" class="notion-header-anchor"></div><a class="notion-hash-link" href="#fd87ceb9e1a446dab771b925d83dabb6" title="0x03 反射"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">0x03 反射</span></span></h2><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-0b0a665160424668b27a2bb43de7dfde" data-id="0b0a665160424668b27a2bb43de7dfde"><span><div id="0b0a665160424668b27a2bb43de7dfde" class="notion-header-anchor"></div><a class="notion-hash-link" href="#0b0a665160424668b27a2bb43de7dfde" title="攻击姿势"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">攻击姿势</span></span></h3><div class="notion-text notion-block-607a69794b9e42a1a2b19b528a5a3097">PowerShell 将有关 AMSI 的信息存储在 <code class="notion-inline-code">System.Management.Automation.AmsiUtils</code> 类内。通过反射与其进行交互。</div><div class="notion-text notion-block-af622010164e496d9dd65b757e51e497">前面几篇分析过，powershell 在进行 AMSI 扫描时会对 <code class="notion-inline-code">amsiInitFailed</code>  进行判断，如果为 <code class="notion-inline-code">true</code> 则直接跳过扫描。那么可以使用反射访问 <code class="notion-inline-code">AmsiUtils</code> 类中的<code class="notion-inline-code">amsiInitFailed</code> ，将其直接设置为 <code class="notion-inline-code">true</code>。</div><div class="notion-text notion-block-0eaa92aa2001471e8b834a6c99e6f727">混淆后</div><div class="notion-text notion-block-479e42d3173f40b69c3ab68b35952a4e">前文还提到 AmsiOpenSession 的参数检查，如果 <code class="notion-inline-code">amsiSession</code> 的指针或 <code class="notion-inline-code">amsiContext</code> 为 <code class="notion-inline-code">NULL</code>，或者 <code class="notion-inline-code">amsiContext</code> 的第二和第三个 <code class="notion-inline-code">_QWORD</code> 为0，则返回错误代码 <code class="notion-inline-code">-2147024809</code>。</div><div class="notion-text notion-block-68b5ad858d4a4935b64715677c7b000d">那么就可以通过反射获取<code class="notion-inline-code">amsiContext</code> 的地址进行修改，将第二<code class="notion-inline-code">_QWORD</code> 修改为0。</div><blockquote class="notion-quote notion-block-4912c566a5f340db809950dd32885d2a"><div>在 win10上，还有个判断验证的是 <code class="notion-inline-code">amsiContext</code> 的第一个 DWORD 值是否为 <code class="notion-inline-code">&#x27;AMSI&#x27;</code>，这个判断在 win11上被去除了。</div></blockquote><blockquote class="notion-quote notion-block-256cf45d35ec4188a70c521ac5f847ca"><div>在 win10 可以对<code class="notion-inline-code">amsiSession</code> 赋值为 <code class="notion-inline-code">NULL</code> 进行绕过， 在 win11 上并不可以，使用 dnspy 分析代码可以发现 win11 上每次的  <code class="notion-inline-code">amsiSession</code> 都是从新从 <code class="notion-inline-code">amsiContext</code> 中取出的。</div></blockquote><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-3c32c15666c847b2b1b8af42cc2ee4de" data-id="3c32c15666c847b2b1b8af42cc2ee4de"><span><div id="3c32c15666c847b2b1b8af42cc2ee4de" class="notion-header-anchor"></div><a class="notion-hash-link" href="#3c32c15666c847b2b1b8af42cc2ee4de" title="检测方法"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">检测方法</span></span></h3><ul class="notion-list notion-list-disc notion-block-432a1dc6390d4f6098f752afa654d9d7"><li>使用反混淆分析语句</li></ul><ul class="notion-list notion-list-disc notion-block-1d2466accd1e48bc88696cf79f8e960e"><li>hook <code class="notion-inline-code">SetValue</code>，检测设置 <code class="notion-inline-code">amsiInitFailed</code> 值的行为。</li></ul><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-0d9fc62b055f462fa76c442a5d2ac4ab" data-id="0d9fc62b055f462fa76c442a5d2ac4ab"><span><div id="0d9fc62b055f462fa76c442a5d2ac4ab" class="notion-header-anchor"></div><a class="notion-hash-link" href="#0d9fc62b055f462fa76c442a5d2ac4ab" title="0x04 修补"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">0x04 修补</span></span></h2><div class="notion-text notion-block-7997ffd1bf414d78a9e9092f2a80325b">从内存中修补 Amsi.dll 也是常用的绕过的手法。</div><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-ef1d2a2923be47bf8088d12e6d5733fc" data-id="ef1d2a2923be47bf8088d12e6d5733fc"><span><div id="ef1d2a2923be47bf8088d12e6d5733fc" class="notion-header-anchor"></div><a class="notion-hash-link" href="#ef1d2a2923be47bf8088d12e6d5733fc" title="AmsiInitialize"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">AmsiInitialize</span></span></h3><div class="notion-text notion-block-c68c871df59c421f958baedfc74b2638"><code class="notion-inline-code">AmsiInitialize</code> 在执行命令前就已经执行，但可以修补后执行 <code class="notion-inline-code">AmsiUninitialize</code> 重新触发 <code class="notion-inline-code">AmsiInitialize</code> 。</div><blockquote class="notion-quote notion-block-2778ac0c77b94c81aa4f199e378906de"><div><code class="notion-inline-code">AmsiInitialize</code> 较为复杂且版本差异大，攻击者一般不会考虑修补这个函数的逻辑来绕过，以下仅为研究使用。
（实战要修补的话应该也是修补为强制失败，见后文）</div></blockquote><div class="notion-text notion-block-0ed62d2de2c14b10b357711f1cc6f7fe"><code class="notion-inline-code">AmsiInitialize</code> 存在如下汇编，可以通过修补满足两个跳转条件，强制跳转返回 <code class="notion-inline-code">80070057h</code> 。</div><div class="notion-text notion-block-baff9da46a6c45ebb816e653c1e8c4b1">以下脚本内容为获取内存地址、修改内存权限、修补对应内存</div><div class="notion-text notion-block-09109054fed84e69a9cef8efdc34e1e5">触发重新初始化，完成绕过</div><div class="notion-text notion-block-fa5a3737663548c4abd183e1fb9e6dda">更通用的绕过脚本，强制返回错误代码</div><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-4137b43cd8bc44b2a70a7b6e55129c3a" data-id="4137b43cd8bc44b2a70a7b6e55129c3a"><span><div id="4137b43cd8bc44b2a70a7b6e55129c3a" class="notion-header-anchor"></div><a class="notion-hash-link" href="#4137b43cd8bc44b2a70a7b6e55129c3a" title="AmsiOpenSession"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">AmsiOpenSession</span></span></h3><div class="notion-text notion-block-7b46be9fd15646fdb7239f40ebb5a7c3">这是一个比较好的修补对象，在win10和win11上的变化很小，且逻辑较为简单，只要满足第一个跳转条件就可以直接返回报错。</div><div class="notion-text notion-block-9b52f256804147789dd2801d303b0779">将 <code class="notion-inline-code">test rdx,rdx</code> 修补为 <code class="notion-inline-code">xor rax,rax</code></div><div class="notion-text notion-block-c3d6e85962dc4ed1afa9919455a18f9c">脚本如下</div><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-7cfcbe7e3f0844c1bc21a11815bf349e" data-id="7cfcbe7e3f0844c1bc21a11815bf349e"><span><div id="7cfcbe7e3f0844c1bc21a11815bf349e" class="notion-header-anchor"></div><a class="notion-hash-link" href="#7cfcbe7e3f0844c1bc21a11815bf349e" title="AmsiScanBuffer"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title"><b>AmsiScanBuffer</b></span></span></h3><div class="notion-text notion-block-9c56585307624113921b048d01cd1c73">逻辑比较复杂，可以将函数开头修补为以下内容，以强制其返回错误代码，稍微混淆了下避免特征被匹配。</div><div class="notion-blank notion-block-6e6ba6516f7148fa803fa97e2b2c6b6d"> </div><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-fdf0f162a6934761947b619426991d63" data-id="fdf0f162a6934761947b619426991d63"><span><div id="fdf0f162a6934761947b619426991d63" class="notion-header-anchor"></div><a class="notion-hash-link" href="#fdf0f162a6934761947b619426991d63" title="检测方法"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">检测方法</span></span></h3><ul class="notion-list notion-list-disc notion-block-855ca2cafc004da9bec8a64c5eeec777"><li>去混淆后识别攻击代码特征</li></ul><ul class="notion-list notion-list-disc notion-block-a9a29714297c40cb9166d267e06a4c3d"><li>扫描 Amsi.dll 中特定地址</li><ul class="notion-list notion-list-disc notion-block-a9a29714297c40cb9166d267e06a4c3d"><div class="notion-text notion-block-b883d96f044e42f987ee2da9727a3054">性能比扫描整个 Amsi.dll 好点，不过攻击者能修改的位置是非常多的，比较容易被绕过。</div></ul></ul><ul class="notion-list notion-list-disc notion-block-bab36ba447324956bd6f47de6d21951d"><li>内存完整性检查</li><ul class="notion-list notion-list-disc notion-block-bab36ba447324956bd6f47de6d21951d"><li>对 Amsi.dll 的代码部分进行哈希处理，而不是对整个Amsi.dll模块进行哈希处理，与硬盘上 Amsi.dll 的代码部分进行比较。</li><li>考虑到性能问题，扫描频率不可能太高，攻击者有可能在完成攻击后将 amsi 修改回去（仅对短时间就能完成目的的攻击有效）。</li><li>瞬间修改 Amsi.dll 造成永久失效 （在win10上修改后再改回来可以永久失效，但 win11上不行，win11 每次执行时发现AMSI失败会重新初始化。</li><ul class="notion-list notion-list-disc notion-block-2df959770bad435690e4c10575735b14"><blockquote class="notion-quote notion-block-4f4c206d0ed046208cfecb6cf4b4f772"><div>经过研究，只要修补<code class="notion-inline-code">AmsiInitialize</code>保证初始化成功但没有执行加载杀毒软件的dll，还是可以在win11瞬间修改造成永久失效的，但这样修补不仅复杂且很容易受 amsi.dll 版本影响。</div></blockquote></ul></ul></ul><ul class="notion-list notion-list-disc notion-block-f0fb2c1a92374d52a1c942160c7db455"><li>api监控，检测修改 Amsi.dll 内存权限、内存内容的调用。</li></ul><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-53c78cbb33044d0489606547128c0d2b" data-id="53c78cbb33044d0489606547128c0d2b"><span><div id="53c78cbb33044d0489606547128c0d2b" class="notion-header-anchor"></div><a class="notion-hash-link" href="#53c78cbb33044d0489606547128c0d2b" title="0x05 ScriptBlock Shaulling"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">0x05 ScriptBlock Shaulling</span></span></h2><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-f7b9e620d22c4b0bb4b00de612e06884" data-id="f7b9e620d22c4b0bb4b00de612e06884"><span><div id="f7b9e620d22c4b0bb4b00de612e06884" class="notion-header-anchor"></div><a class="notion-hash-link" href="#f7b9e620d22c4b0bb4b00de612e06884" title="攻击姿势"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">攻击姿势</span></span></h3><div class="notion-text notion-block-f0e7f8e555b34dfd9c7bcfe3bc5c617b">详见 <a target="_blank" rel="noopener noreferrer" class="notion-link" href="https://bc-security.org/scriptblock-smuggling">https://bc-security.org/scriptblock-smuggling</a></div><div class="notion-text notion-block-1213e91ee6cc4cf9a2179bddb1d39e61">简单来说，就是 PowerShell 中的所有的安全功能都只传递 <code class="notion-inline-code">ScriptBlock</code> 的 <code class="notion-inline-code">Extent</code> ，但实际上还可以通过 <code class="notion-inline-code">BeginBlock</code> 和 <code class="notion-inline-code">EndBlock</code> 执行代码。</div><div class="notion-text notion-block-d14f7f40d2324a5ca2cca4c28ff4cb78">可以用以下方法来创建 <code class="notion-inline-code">BeginBlock</code> 或 <code class="notion-inline-code">EndBlock</code> 和 <code class="notion-inline-code">Extent</code> 不一致的代码块</div><div class="notion-text notion-block-fd6f44d1e5f74d389f8271de2ef1241f">利用方式</div><div class="notion-text notion-block-e16e30bd0da94e40b2ecf020126955ab">可以看到 AMSI 接收的结果和实际执行的命令并不一致</div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-f5a2bde602c54f16a92654d7847b9d02"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F9b088554-7e2b-4e15-a3ac-f935a8faacef%2Fe832c10a-98ab-41a0-ade0-7f956ddbeadc%2FUntitled.png?table=block&amp;id=f5a2bde6-02c5-4f16-a926-54d7847b9d02&amp;t=f5a2bde6-02c5-4f16-a926-54d7847b9d02&amp;width=707.9609375&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><blockquote class="notion-quote notion-block-283849a99cbe4b2089671e1ce8041d55"><div>虽然这样也需要传入恶意命令，但与混淆那里的绕过不同的是，这里传入的恶意命令是字符串，不需要基于 powershell 语法混淆，可以随意进行混淆，解密后的代码不是通过 <code class="notion-inline-code">Invoke-Expression</code> 执行的，也就不用担心</div></blockquote><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-5cf3b365c5644f0a85e09fe7fb0f95b8" data-id="5cf3b365c5644f0a85e09fe7fb0f95b8"><span><div id="5cf3b365c5644f0a85e09fe7fb0f95b8" class="notion-header-anchor"></div><a class="notion-hash-link" href="#5cf3b365c5644f0a85e09fe7fb0f95b8" title="检测方法"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">检测方法</span></span></h3><div class="notion-text notion-block-6793e03839cc41fcae5348b8e8b27a1e">检测操控 <code class="notion-inline-code">ScriptBlockAst</code> 的行为，正常业务程序几乎不可能用到这个特性。</div><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-36eb591a056f493ebe38609b2eb6650f" data-id="36eb591a056f493ebe38609b2eb6650f"><span><div id="36eb591a056f493ebe38609b2eb6650f" class="notion-header-anchor"></div><a class="notion-hash-link" href="#36eb591a056f493ebe38609b2eb6650f" title="0x06 硬件断点"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">0x06 硬件断点</span></span></h2><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-1add3301cf7a47d7b2e90d69f1f6166c" data-id="1add3301cf7a47d7b2e90d69f1f6166c"><span><div id="1add3301cf7a47d7b2e90d69f1f6166c" class="notion-header-anchor"></div><a class="notion-hash-link" href="#1add3301cf7a47d7b2e90d69f1f6166c" title="攻击姿势"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">攻击姿势</span></span></h3><div class="notion-text notion-block-295594febc9d44198a6311009076146f">参考文章：</div><div class="notion-text notion-block-dc5ab504faf64a70800f2e145ca3da2a"><a target="_blank" rel="noopener noreferrer" class="notion-link" href="https://cloud.tencent.com/developer/article/2225484">https://cloud.tencent.com/developer/article/2225484</a></div><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-9161b704ef934cbbb4d7e24cc12337b9" data-id="9161b704ef934cbbb4d7e24cc12337b9"><span><div id="9161b704ef934cbbb4d7e24cc12337b9" class="notion-header-anchor"></div><a class="notion-hash-link" href="#9161b704ef934cbbb4d7e24cc12337b9" title="检测方法（待验证）"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">检测方法（待验证）</span></span></h3><div class="notion-text notion-block-ddde315fef7640c1919ae884edfd8835">参考文章：</div><div class="notion-text notion-block-024831367fb6465cb89d5d653694aabd"><a target="_blank" rel="noopener noreferrer" class="notion-link" href="https://bbs.kanxue.com/thread-181720.htm">https://bbs.kanxue.com/thread-181720.htm</a></div><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-1c77fcfe800f410582973c5a8153c1f7" data-id="1c77fcfe800f410582973c5a8153c1f7"><span><div id="1c77fcfe800f410582973c5a8153c1f7" class="notion-header-anchor"></div><a class="notion-hash-link" href="#1c77fcfe800f410582973c5a8153c1f7" title="0x07 修补其他程序"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">0x07 修补其他程序</span></span></h2><div class="notion-text notion-block-65aea4139e3d4f14bc186e70ecabe8f7">因为对 amsi.dll 的修改检测比较严格，所以出现了这种绕过思路。</div><div class="notion-text notion-block-b629b53516154a00b7281c8c63ca30d4">修补杀毒软件的 amsi 提供程序对应的 dll。</div><div class="notion-text notion-block-35a1a99a9fdc4c1983f16920a127861e">修补调用 amsi.dll 的程序。</div><div class="notion-text notion-block-166a8162226d800c85eddf7bcd41c75f">比如修补powershell：</div><div class="notion-text notion-block-166a8162226d801eae3ceb76502592cc"><a target="_blank" rel="noopener noreferrer" class="notion-link" href="https://practicalsecurityanalytics.com/new-amsi-bypass-using-clr-hooking/">https://practicalsecurityanalytics.com/new-amsi-bypass-using-clr-hooking/</a></div><div class="notion-text notion-block-166a8162226d8023a74df9a8aac1ce65"><a target="_blank" rel="noopener noreferrer" class="notion-link" href="https://www.offsec.com/blog/amsi-write-raid-0day-vulnerability/">https://www.offsec.com/blog/amsi-write-raid-0day-vulnerability/</a></div><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-77fb2395ff5840f6a616c9bfd514d080" data-id="77fb2395ff5840f6a616c9bfd514d080"><span><div id="77fb2395ff5840f6a616c9bfd514d080" class="notion-header-anchor"></div><a class="notion-hash-link" href="#77fb2395ff5840f6a616c9bfd514d080" title="参考文章"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">参考文章</span></span></h2><div class="notion-text notion-block-9c058733580744f09c19f13b680f0551"><a target="_blank" rel="noopener noreferrer" class="notion-link" href="https://mp.weixin.qq.com/s/Sg0LK8emSWP1m-yds4VGrQ">https://mp.weixin.qq.com/s/Sg0LK8emSWP1m-yds4VGrQ</a></div><div class="notion-text notion-block-29021962a2ff4de691526bcd7dd2b017"><a target="_blank" rel="noopener noreferrer" class="notion-link" href="https://blog.f-secure.com/hunting-for-amsi-bypasses/">https://blog.f-secure.com/hunting-for-amsi-bypasses/</a></div><div class="notion-text notion-block-a46d59cdb1144d5bbe37b04e78254cbe"><a target="_blank" rel="noopener noreferrer" class="notion-link" href="https://ethicalchaos.dev/2022/04/17/in-process-patchless-amsi-bypass/">https://ethicalchaos.dev/2022/04/17/in-process-patchless-amsi-bypass/</a></div></main></div>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AMSI研究(2) - 实现检测]]></title>
            <link>https://blog.fatekey.icu/article/AMSI2</link>
            <guid>https://blog.fatekey.icu/article/AMSI2</guid>
            <pubDate>Wed, 19 Jun 2024 00:00:00 GMT</pubDate>
            <content:encoded><![CDATA[<div id="notion-article" class="mx-auto overflow-hidden "><main class="notion light-mode notion-page notion-block-06347787cfec40ea9fb24f9bd329b16a"><div class="notion-viewport"></div><div class="notion-collection-page-properties"></div><div class="notion-blank notion-block-ffec4452c47042e29ddee4eca2fe1a95"> </div><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-e75598d514624e0ebc9ba44fc6bb15ab" data-id="e75598d514624e0ebc9ba44fc6bb15ab"><span><div id="e75598d514624e0ebc9ba44fc6bb15ab" class="notion-header-anchor"></div><a class="notion-hash-link" href="#e75598d514624e0ebc9ba44fc6bb15ab" title="0x00 基础"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">0x00 基础</span></span></h2><div class="notion-text notion-block-5cdf9250ce124779a41079e235c06104">参考项目：<a target="_blank" rel="noopener noreferrer" class="notion-link" href="https://github.com/microsoft/Windows-classic-samples/tree/main/Samples/AmsiProvider">https://github.com/microsoft/Windows-classic-samples/tree/main/Samples/AmsiProvider</a></div><div class="notion-text notion-block-5851e2547a3d4f51a6cc2a52d1ec8843">分析源代码发现 <code class="notion-inline-code">SampleAmsiProvider</code> 类实现了 <code class="notion-inline-code">IAntimalwareProvider</code> 接口。</div><ul class="notion-list notion-list-disc notion-block-3c91d0a8b78248c99265554d89592071"><li><code class="notion-inline-code">Scan</code> 方法实现了扫描逻辑。</li></ul><ul class="notion-list notion-list-disc notion-block-02012b1a12c44ba89dac91f7dfa85c09"><li><code class="notion-inline-code">CloseSession</code> 方法用于关闭会话。</li></ul><ul class="notion-list notion-list-disc notion-block-c18ffd7109f246d8941304565434963b"><li><code class="notion-inline-code">DisplayName</code> 方法返回提供者的显示名称。</li></ul><div class="notion-text notion-block-5f16e2eb03ad4021bb96651bf79b9ea3"><code class="notion-inline-code">Scan</code> 接收<code class="notion-inline-code">IAmsiStream</code> 作为参数，其有两个方法：GetAttribute() 和 Read()。</div><div class="notion-text notion-block-adb8eb2aa4aa4b2ab5683a14f29080c2">GetAttribute() 方法获取有关待扫描内容的元数据。开发人员通过传递一个 AMSI_ATTRIBUTE 值来请求这些属性，该值指示他们希望检索的信息。</div><ul class="notion-list notion-list-disc notion-block-356e793e41944823bb89566196a60eef"><li>APP_NAME</li><ul class="notion-list notion-list-disc notion-block-356e793e41944823bb89566196a60eef"><li>提交要扫描的内容的应用程序的名称</li></ul></ul><ul class="notion-list notion-list-disc notion-block-39c6771749d3444ea4218f51cd3b95e8"><li>CONTENT_NAME</li><ul class="notion-list notion-list-disc notion-block-39c6771749d3444ea4218f51cd3b95e8"><li>如果内容源自磁盘上的文件，则该 <code class="notion-inline-code">contentname</code> 为文件的完整路径。如果内容源自内存，则此字段将为空。</li></ul></ul><ul class="notion-list notion-list-disc notion-block-2678a40180ae41e19f8ddd9065d78bb2"><li>AMSI_ATTRIBUTE_CONTENT_SIZE、AMSI_ATTRIBUTE_CONTENT_ADDRESS</li><ul class="notion-list notion-list-disc notion-block-2678a40180ae41e19f8ddd9065d78bb2"><li>待扫描内容的地址和大小，可以通过这两个值取出待扫描内容。</li><li>一般需要检测的只有 <code class="notion-inline-code">DotNet</code> 和 <code class="notion-inline-code">VSS</code> 事件是二进制数据。</li><ul class="notion-list notion-list-disc notion-block-e59ecd5421534b60b365ede5e3323d47"><li><code class="notion-inline-code">coreclr</code> 也是二进制数据，但我感觉 EDR 没有检测的必要。</li></ul></ul></ul><div class="notion-text notion-block-ed3aa7c547b44b7ab29bf1f67ab38e13">只有当内容已经完全加载到内存中时才会返回 AMSI_ATTRIBUTE_CONTENT_ADDRESS ，大多数情况下，数据是作为流提供的，在这种情况下，可以使用 <code class="notion-inline-code">Read()</code> 方法来逐块读取缓冲区中的数据。</div><div class="notion-text notion-block-1fc280e6810c4101b0916efe1119eca8">当 <code class="notion-inline-code">Scan()</code>方法返回时，它必须将 HRESULT 和 AMSI_RESULT 传递给调用方。</div><div class="notion-text notion-block-879267927e354af69007863cffc5de58">可以在 dll 中直接实现检测逻辑，不过我想实现更接近 EDR 的检测流程：dll 获取检测信息，传递给agent，agent 进行判断后再返回给 dll。</div><div class="notion-callout notion-gray_background_co notion-block-f19c5317d67e46458afb728cb0eab122"><div class="notion-page-icon-inline notion-page-icon-span"><span class="notion-page-icon" role="img" aria-label="💡">💡</span></div><div class="notion-callout-text">需要特别注意的是，执行操作时会等待 Scan() 方法给出扫描结果，并且没有超时机制，所以此处不能用太复杂的扫描逻辑，不然会严重影响相关程序的执行速度。个人感觉可以先文本正则+二进制yara，并且自己实现超时机制。
如果有复杂的检测逻辑，也许可以先用正则和二进制进行检测，返回结果后客户端再进行复杂的检测，如果检出就上报服务器。如果这时还想阻断，可以考虑不借助 AMSI ，直接杀进程。
此外，前文分析 AMSI 实现时发现，AMSI 得到一个恶意结果后，就会退出循环不再调用其余提供者的扫描函数，如果 EDR 要集成 AMSI 的话，是不是把自己的顺序提到 windows definder 前面会更好？</div></div><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-ee94d572d6ad4af9aaee8956bd2a8cfa" data-id="ee94d572d6ad4af9aaee8956bd2a8cfa"><span><div id="ee94d572d6ad4af9aaee8956bd2a8cfa" class="notion-header-anchor"></div><a class="notion-hash-link" href="#ee94d572d6ad4af9aaee8956bd2a8cfa" title="0x01 实现dll"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">0x01 实现dll</span></span></h2><div class="notion-text notion-block-61e08f3f9367428ea5e287a2ab9e14a5">采用JSON协议进行跨语言RPC，将数据传输给 agent 。</div><div class="notion-text notion-block-adc68d55efa84621b5c6fe7f4a2d5061">主要代码逻辑如下：    </div><div class="notion-text notion-block-723d96f5b7f14b418e4a6a2e083a1295">代码还有很多优化的空间，如</div><ul class="notion-list notion-list-disc notion-block-5a6bb2384e4d49f7887425a816970931"><li>引入错误处理及超时机制，以免在运行出错、超时的情况下影响 powershell 等程序的运行。</li></ul><ul class="notion-list notion-list-disc notion-block-d686f2b353844aec95d1f59cc6ab543a"><li>优化通信机制，使用更高效的传输方法。                                     </li></ul><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-ea3d9e6c0a53420983432748074fddb8" data-id="ea3d9e6c0a53420983432748074fddb8"><span><div id="ea3d9e6c0a53420983432748074fddb8" class="notion-header-anchor"></div><a class="notion-hash-link" href="#ea3d9e6c0a53420983432748074fddb8" title="0x02 实现 agent 接收数据   "><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">0x02 实现 agent 接收数据   </span></span></h2><div class="notion-text notion-block-ef081a4ac98545cc90e5de1f16c88d2d">agent 接收数据比较简单，因为前面的数据就是使用的  go 的 net/rpc/jsonrpc 包规定的格式。   </div><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-6a378f01d4784274919c5d6f8314c0d1" data-id="6a378f01d4784274919c5d6f8314c0d1"><span><div id="6a378f01d4784274919c5d6f8314c0d1" class="notion-header-anchor"></div><a class="notion-hash-link" href="#6a378f01d4784274919c5d6f8314c0d1" title="0x03 实现规则检测"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">0x03 实现规则检测</span></span></h2><div class="notion-text notion-block-e139d889b2dc41c6a9f9e43ee9a6e6ac">对于普通的文本数据，使用正则表达式规则来检测，对于二进制数据，使用 YARA 规则来进行检测。（具体代码不贴了，简单的调用库罢了。）</div><div class="notion-text notion-block-a50efc5cd5c6467599975c88fa2c599f">对不同应用的待检测数据进行分析。</div><div class="notion-blank notion-block-a56cb1cc017c422580db54a7ae5d555b"> </div><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-51e59c7adac547a498bc4ddd7476e7d1" data-id="51e59c7adac547a498bc4ddd7476e7d1"><span><div id="51e59c7adac547a498bc4ddd7476e7d1" class="notion-header-anchor"></div><a class="notion-hash-link" href="#51e59c7adac547a498bc4ddd7476e7d1" title="powershell"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">powershell</span></span></h3><div class="notion-text notion-block-aea4b915735e4db497b7990d3c29d373">单条命令执行时    </div><div class="notion-text notion-block-b7d9555c765841d6b3ba38d20fa9c7b6">执行脚本文件时</div><div class="notion-text notion-block-9e970c93e9ea4ce28403d25501444918">告警时，对于得到的脚本文件路径，应该去获取脚本文件的创建、 修改时间、所属用户等信息，对于已经检测过的脚本，可以不再重发触发扫描。</div><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-7c97413112ce4506b27e12f89905096f" data-id="7c97413112ce4506b27e12f89905096f"><span><div id="7c97413112ce4506b27e12f89905096f" class="notion-header-anchor"></div><a class="notion-hash-link" href="#7c97413112ce4506b27e12f89905096f" title="WMI"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">WMI</span></span></h3><div class="notion-text notion-block-65f4f6981a95467192154af1ad6c855f">执行命令产生的数据如下，可以用正则匹配，不过如果做成产品的话也许加入语法解析会更好。</div><div class="notion-text notion-block-387ca22c550d49c2a52ca4a6a65af08c">WMIC 执行 cmd 命令</div><div class="notion-text notion-block-66ccee21536543b89b88c6b019230789"><code class="notion-inline-code">WMIC  Process Call Create &quot;cmd /c whoami&quot;</code></div><div class="notion-text notion-block-763d0d25877f43ebb97bd3a47d6aa6f4">powershell 执行 cmd命令</div><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-a200600999474be88bec47ec27425842" data-id="a200600999474be88bec47ec27425842"><span><div id="a200600999474be88bec47ec27425842" class="notion-header-anchor"></div><a class="notion-hash-link" href="#a200600999474be88bec47ec27425842" title="VSS"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">VSS</span></span></h3><div class="notion-blank notion-block-e9145296dcd243efba9920b6bf0489e9"> </div><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-94cf75c127544a2ab47a6ca2105098a2" data-id="94cf75c127544a2ab47a6ca2105098a2"><span><div id="94cf75c127544a2ab47a6ca2105098a2" class="notion-header-anchor"></div><a class="notion-hash-link" href="#94cf75c127544a2ab47a6ca2105098a2" title="参考资料"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">参考资料</span></span></h2><div class="notion-text notion-block-f3d9bb6eb81142b189e79a76404507b0"><a target="_blank" rel="noopener noreferrer" class="notion-link" href="https://learn.microsoft.com/en-us/windows/win32/amsi/dev-audience">https://learn.microsoft.com/en-us/windows/win32/amsi/dev-audience</a></div><div class="notion-text notion-block-33aeae282d6543f0a2cd3ae9a0780f93"><a target="_blank" rel="noopener noreferrer" class="notion-link" href="https://github.com/cparmn/SoYouWannaBeAnAMSIProvider">https://github.com/cparmn/SoYouWannaBeAnAMSIProvider</a></div><div class="notion-blank notion-block-9fc7a6baaf294344832cc2d26ac597e3"> </div></main></div>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[wannamine 分析]]></title>
            <link>https://blog.fatekey.icu/article/wannamine</link>
            <guid>https://blog.fatekey.icu/article/wannamine</guid>
            <pubDate>Wed, 19 Jan 2022 00:00:00 GMT</pubDate>
            <description><![CDATA[ 逆向练习]]></description>
            <content:encoded><![CDATA[<div id="notion-article" class="mx-auto overflow-hidden "><main class="notion light-mode notion-page notion-block-21eb30a5e05f4cf981a1fb15f31901c6"><div class="notion-viewport"></div><div class="notion-collection-page-properties"></div><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-3561af901d5644909d6eae8c30309a7c" data-id="3561af901d5644909d6eae8c30309a7c"><span><div id="3561af901d5644909d6eae8c30309a7c" class="notion-header-anchor"></div><a class="notion-hash-link" href="#3561af901d5644909d6eae8c30309a7c" title="0x00 简单分析"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">0x00 简单分析</span></span></h2><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-fd341b308bff4f08a868d54ad6bcab2e"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:636px;max-width:100%;flex-direction:column"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F320e5297-5cf7-4ae5-b0a3-e8e8a330b314%2FUntitled.png?table=block&amp;id=fd341b30-8bff-4f08-a868-d54ad6bcab2e&amp;t=fd341b30-8bff-4f08-a868-d54ad6bcab2e&amp;width=636&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-text notion-block-1e9d020c12a24c39973517f05ba0c3eb">未加壳,c++开发</div><div class="notion-text notion-block-f8cb7722d4364035a4f99926d81162ae">微步沙箱分析</div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-3ae7ac174f504665b972420287454655"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F3f70c074-4545-4dd9-825e-0762e34478e3%2FUntitled.png?table=block&amp;id=3ae7ac17-4f50-4665-b972-420287454655&amp;t=3ae7ac17-4f50-4665-b972-420287454655&amp;width=554.9921875&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-text notion-block-7d828688f573494ba7ac32f963288e18">微步说可能被加壳?应该是微步误报了吧</div><div class="notion-text notion-block-6a977f430dc24d53812994b5b2c3a1b5">火绒剑分析行为</div><div class="notion-text notion-block-e5236cac0a2e4037b353bcfbdd2f2933">添加过滤</div><ul class="notion-list notion-list-disc notion-block-dc94065f881e48278edc35251c0bdaa4"><li>进程过滤-挖矿进程</li></ul><ul class="notion-list notion-list-disc notion-block-1a62a6017b13423eb16c1f34da1cb3f8"><li>动作过滤-创建文件\写入文件</li></ul><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-95ce35f16d234ddd86a1855017ba79a1"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F77cd4a30-cfbb-4182-aff3-eea89c4e82da%2FUntitled.png?table=block&amp;id=95ce35f1-6d23-4ddd-86a1-855017ba79a1&amp;t=95ce35f1-6d23-4ddd-86a1-855017ba79a1&amp;width=554.9609375&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><ul class="notion-list notion-list-disc notion-block-6146594c1676418e91300b6446d2678b"><li>进程过滤-挖矿进程</li></ul><ul class="notion-list notion-list-disc notion-block-326731b811e54751a8ea90261977a666"><li>动作过滤-设置\创建\删除注册表</li></ul><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-11f0d3c8cabf4b68a8b53263e25dd68c"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fcf524850-fbd8-405f-ac27-855dd7aec375%2FUntitled.png?table=block&amp;id=11f0d3c8-cabf-4b68-a8b5-3263e25dd68c&amp;t=11f0d3c8-cabf-4b68-a8b5-3263e25dd68c&amp;width=2408&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><ul class="notion-list notion-list-disc notion-block-1d454f9ec6cc46f9912e6e6b6c082d8a"><li>进程过滤-挖矿进程</li></ul><ul class="notion-list notion-list-disc notion-block-0bf277a5efe84be98c34b15347b6e475"><li>动作过滤-网络连接</li></ul><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-fc2e8fb58b9f40f8968c7826e93f2b49"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F8bb63f3c-0a36-4531-8866-c67f4d7c2e45%2FUntitled.png?table=block&amp;id=fc2e8fb5-8b9f-40f8-968c-7826e93f2b49&amp;t=fc2e8fb5-8b9f-40f8-968c-7826e93f2b49&amp;width=554.984375&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-text notion-block-bc0c82f0d2354ab985f3827e1498caee">ip 查询</div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-9bb193f018c64fa6bbcea983bb55f71e"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fda0a63be-1a94-4877-8211-2ec4d98eeab6%2FUntitled.png?table=block&amp;id=9bb193f0-18c6-4fa6-bbce-a983bb55f71e&amp;t=9bb193f0-18c6-4fa6-bbce-a983bb55f71e&amp;width=2088&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-text notion-block-1feb300af14b4620af59387ab76afff1">通过查看对挖矿进程创建 cmd 进程的参数分析执行的命令</div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-40cff10878c94472b926c2851786dc08"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F3105d8bf-679e-40e8-8bbf-0e9f3dc3dab4%2FUntitled.png?table=block&amp;id=40cff108-78c9-4472-b926-c2851786dc08&amp;t=40cff108-78c9-4472-b926-c2851786dc08&amp;width=554.9921875&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-text notion-block-01ccaa9bdbbd438d8b915b8741fb29e4">?删除自身可以理解,为什么要 ping 127.0.0.1 呢?</div><div class="notion-text notion-block-204db0e847bc4b72809cd0fcbbe40a08">创建服务.服务名应该是随机的,但是看着还挺像正常服务的,应该是有一个随机字典</div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-720158564e8042dab1df0947266b143f"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fd2e43aa8-0882-497c-8eec-aa9be08e6171%2FUntitled.png?table=block&amp;id=72015856-4e80-42da-b1df-0947266b143f&amp;t=72015856-4e80-42da-b1df-0947266b143f&amp;width=554.96875&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-b82fcee2c8514ef09bc25b1a9dea0a79" data-id="b82fcee2c8514ef09bc25b1a9dea0a79"><span><div id="b82fcee2c8514ef09bc25b1a9dea0a79" class="notion-header-anchor"></div><a class="notion-hash-link" href="#b82fcee2c8514ef09bc25b1a9dea0a79" title="0x01 IDA分析"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">0x01 IDA分析</span></span></h2><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-f14a56d491e943e78b6eca834c72f021"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F0ae12d6a-9482-42d8-8980-7b06bb21afab%2FUntitled.png?table=block&amp;id=f14a56d4-91e9-43e7-8b6e-ca834c72f021&amp;t=f14a56d4-91e9-43e7-8b6e-ca834c72f021&amp;width=554.984375&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-text notion-block-f52161e2e3054b759d0a19a9b5f933ae">跟进到 404FF0</div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-dbb27365bafe4139aa779584aa0291ab"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F866fb56b-df29-4d61-a57a-29ec3d41efd3%2FUntitled.png?table=block&amp;id=dbb27365-bafe-4139-aa77-9584aa0291ab&amp;t=dbb27365-bafe-4139-aa77-9584aa0291ab&amp;width=554.984375&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-text notion-block-2ffb3fcb02c349d7bb161d611d649f9f">跟进到 4050E0</div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-78119aba2ca045daac047e4553e6591c"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F492258f0-44d0-442d-93c4-b94032888716%2FUntitled.png?table=block&amp;id=78119aba-2ca0-45da-ac04-7e4553e6591c&amp;t=78119aba-2ca0-45da-ac04-7e4553e6591c&amp;width=554.9921875&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-1385ab5951ed496bb3e0b1e9f93b37d7"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F11635cad-c3c5-47ef-a9db-72c932bea61c%2FUntitled.png?table=block&amp;id=1385ab59-51ed-496b-b3e0-b1e9f93b37d7&amp;t=1385ab59-51ed-496b-b3e0-b1e9f93b37d7&amp;width=554.9921875&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-text notion-block-0241df98a2564916962380a2a616d20c">判断<code class="notion-inline-code">Software\\Microsoft\\Windows NT\\CurrentVersion\\NetworkPlatform\\Location Awareness</code> 是否存在.</div><div class="notion-text notion-block-c976a485bb414b00b353f27c73194387">返回 404FF0 ,以上注册表不存在则调用 404880.这里应该是为了判断病毒是否是第一次运行.</div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-3d96571ccb9644ca9943127d9d4903a7"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:562px;max-width:100%;flex-direction:column"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Ff4da4f32-06a4-4a86-80a4-75ce45171fe8%2FUntitled.png?table=block&amp;id=3d96571c-cb96-44ca-9943-127d9d4903a7&amp;t=3d96571c-cb96-44ca-9943-127d9d4903a7&amp;width=562&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-text notion-block-3f256f4f404c49ec92554b9a5bce512a"> 跟进 404880</div><div class="notion-text notion-block-d2a8ed4a9d4c4cdc99967da2acbf21fd">发现生成随机服务名,由 3 个部分拼接而成</div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-406c1bcdffdf4b87801010cc77a8c846"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:692px;max-width:100%;flex-direction:column"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F6fd90106-dddb-411e-9fff-88b9e6fa44c3%2FUntitled.png?table=block&amp;id=406c1bcd-ffdf-4b87-8010-10cc77a8c846&amp;t=406c1bcd-ffdf-4b87-8010-10cc77a8c846&amp;width=692&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-text notion-block-f11a054b7acb44ae905f6c60d62cdb5f">生成用到的字典,拼接起来真的有系统服务那味了</div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-cd1faca8e9ca4157b6dfe738951f5ed0"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F72e1a370-1ff5-4845-9416-7fa0cb723d65%2FUntitled.png?table=block&amp;id=cd1faca8-e9ca-4157-b6df-e738951f5ed0&amp;t=cd1faca8-e9ca-4157-b6df-e738951f5ed0&amp;width=554.9921875&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-46d0b82961964028bde8a3dcbc9ac823"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fa16f0024-8133-40f7-97cf-d6763142a41c%2FUntitled.png?table=block&amp;id=46d0b829-6196-4028-bde8-a3dcbc9ac823&amp;t=46d0b829-6196-4028-bde8-a3dcbc9ac823&amp;width=554.9921875&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-text notion-block-0ba4144ff4a74a3e851120a3346f15e6">生成随机服务名.dll</div><blockquote class="notion-quote notion-block-42d6aaad90144b6fa4fb2802f6913460"><div>具体生成流程
获取 system 文件夹路径
创建随机文件名文件
删除随机服务名.dll 估计是为了防止生成的 dll 和某些 dll 重名
创建写入随机服务名.dll</div></blockquote><div class="notion-text notion-block-3835212b78f244eabb71fc313cb28c0a">创建用于判断是否第一次运行的注册表,<span class="notion-red">通过判断这个注册表是否存在,也就能判断是否感染过这个挖矿病毒了</span></div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-1a7894a26be94540b0528b1687a909f2"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F66056f7b-9d72-449c-afb0-64a0f153f054%2FUntitled.png?table=block&amp;id=1a7894a2-6be9-4540-b052-8b1687a909f2&amp;t=1a7894a2-6be9-4540-b052-8b1687a909f2&amp;width=554.984375&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-text notion-block-085121119b8e44d186d6ab34f57fd904">404FF0 如果不是第一次运行则进入 4041E0,具体功能为查询服务状态</div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-01d69d40f4f44833a0c12cb1715e05dc"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:660px;max-width:100%;flex-direction:column"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fefeb3379-954a-4e4c-afed-06543555077a%2FUntitled.png?table=block&amp;id=01d69d40-f4f4-4833-a0c1-2cb1715e05dc&amp;t=01d69d40-f4f4-4833-a0c1-2cb1715e05dc&amp;width=660&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-text notion-block-8e4354a8d2a947ab96210d119edaa580">再回到 main 函数,进入405330</div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-1654b69e142549dc81a6f3e773bb6932"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fa947f414-e1cc-4d22-b5f0-9d94d17513ff%2FUntitled.png?table=block&amp;id=1654b69e-1425-49dc-81a6-f3e773bb6932&amp;t=1654b69e-1425-49dc-81a6-f3e773bb6932&amp;width=554.9765625&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-afe6683c4aef4e35a6510d6dde235d65"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fd1b4ea8f-3343-4d28-bd4c-8847a0e32f61%2FUntitled.png?table=block&amp;id=afe6683c-4aef-4e35-a651-0d6dde235d65&amp;t=afe6683c-4aef-4e35-a651-0d6dde235d65&amp;width=554.9921875&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-text notion-block-5788dd20c24b47a9a99e10f350b1a8ce">再回到 main 函数,进入405390</div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-b7be9a63d6c845e0a1a21ed209ef3611"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F350ba79d-c09a-4c43-beae-3d481cb67ff2%2FUntitled.png?table=block&amp;id=b7be9a63-d6c8-45e0-a1a2-1ed209ef3611&amp;t=b7be9a63-d6c8-45e0-a1a2-1ed209ef3611&amp;width=554.9921875&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-text notion-block-f724f7ac22c542b5a2ad0801fdc8d975">装载后返回了资源在内存中的开始指针</div><div class="notion-text notion-block-4bd5e5d98f1046d0bc8792407bf06ce2">进入 4052D0</div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-242afefda8dc4704ba09341e345cf552"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fcc275d74-e51e-4581-9d45-82b853e79c73%2FUntitled.png?table=block&amp;id=242afefd-a8dc-4704-ba09-341e345cf552&amp;t=242afefd-a8dc-4704-ba09-341e345cf552&amp;width=554.9921875&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-text notion-block-1305280311984315a8bcaaa8dde18fbb">根据之前知道的长度和内存指针,取出内容,创建并写入文件</div><div class="notion-text notion-block-5d036f54863b454d9334e2ac0a6fac92">返回 main 函数</div><div class="notion-text notion-block-5412e3d7f2094d7f9746bb93c31d2cc5">进入 4054F0</div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-399b686f8861498ebbc8f3e737f3afdb"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fcb72da93-7717-4540-95e4-32549f0a17b6%2FUntitled.png?table=block&amp;id=399b686f-8861-498e-bbc8-f3e737f3afdb&amp;t=399b686f-8861-498e-bbc8-f3e737f3afdb&amp;width=554.9921875&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-15dbeb2a70cc491fb30292202dbd8080"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fe84c0d0b-239f-4d53-b3e7-0001fa7299e7%2FUntitled.png?table=block&amp;id=15dbeb2a-70cc-491f-b302-92202dbd8080&amp;t=15dbeb2a-70cc-491f-b302-92202dbd8080&amp;width=554.9921875&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-text notion-block-4740e5c9b17543878b002789d50731e1">进入 403F80</div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-384daf170e6d4ecb8a6e3fda686f5029"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F2ee94f27-b833-48a4-9cc1-306a437e5b4f%2FUntitled.png?table=block&amp;id=384daf17-0e6d-4ecb-8a6e-3fda686f5029&amp;t=384daf17-0e6d-4ecb-8a6e-3fda686f5029&amp;width=554.984375&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-text notion-block-d7c73f72471b4bb286d90a4f361082d6">进入 403EA0</div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-16cb8a6c90c54848880ea2753d4fad96"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fdc90ae3f-b47e-4cae-83c9-cd351c366681%2FUntitled.png?table=block&amp;id=16cb8a6c-90c5-4848-880e-a2753d4fad96&amp;t=16cb8a6c-90c5-4848-880e-a2753d4fad96&amp;width=554.984375&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-text notion-block-cf003b261b3f46dfa88fa86c265b5398">打开并读取之前写入内容那个随机文件名文件</div><div class="notion-text notion-block-5a436ab846c84c1793c7312a610f3db7">返回 4054F0</div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-55fc44fa7ee84987b76ac3820b32353c"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fdfe9c996-d2ce-48b4-9a6e-b4f85f675288%2FUntitled.png?table=block&amp;id=55fc44fa-7ee8-4987-b76a-c3820b32353c&amp;t=55fc44fa-7ee8-4987-b76a-c3820b32353c&amp;width=555&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-text notion-block-c0a722e908ba46e0b9ece0e5ab071ba4">进入 4052D0</div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-e2335733b33d40939cc7759efd03e05f"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F8ea2e737-8e16-4bd4-8464-279d55dffe01%2FUntitled.png?table=block&amp;id=e2335733-b33d-4093-9cc7-759efd03e05f&amp;t=e2335733-b33d-4093-9cc7-759efd03e05f&amp;width=554.9921875&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-text notion-block-760258cb2b584953b3aa559b2845fffe">将读取出的内容写入服务名.dll</div><div class="notion-text notion-block-007283a403744ef4a8119a3c6a5b0fba">再再再返回 main 函数</div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-8d0ebba54bdc4739a581c2b950f60f7c"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:638px;max-width:100%;flex-direction:column"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fbe2b9c72-b391-4be6-a5b8-f66b567edd76%2FUntitled.png?table=block&amp;id=8d0ebba5-4bdc-4739-a581-c2b950f60f7c&amp;t=8d0ebba5-4bdc-4739-a581-c2b950f60f7c&amp;width=638&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-text notion-block-b77657b608ea4fdf8f59447bde2c2a23">跟进 4051A0</div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-b6c8e00f7e9a4391b82ad6d415eb8881"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fbcbec28d-7e1d-46d4-8b08-c9f1a766762e%2FUntitled.png?table=block&amp;id=b6c8e00f-7e9a-4391-b82a-d6d415eb8881&amp;t=b6c8e00f-7e9a-4391-b82a-d6d415eb8881&amp;width=554.9921875&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-text notion-block-95d374fd84df423fa41a4aeca58e6c40">读取\设置svchost.exe的创建、访问及上次修改时间</div><div class="notion-text notion-block-bcb69f0b693b460399e13b5dfc8ad2b2">返回主函数,进入 406110</div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-2371db30386341a08772de0c0f8e37d2"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:624px;max-width:100%;flex-direction:column"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fd9adc36d-45b7-4818-8729-1f91d7be66e3%2FUntitled.png?table=block&amp;id=2371db30-3863-41a0-8772-de0c0f8e37d2&amp;t=2371db30-3863-41a0-8772-de0c0f8e37d2&amp;width=624&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-01b8096c0ae64886bccc843f249adca0"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F7c15300e-f852-426a-ae36-0e03ed4b177c%2FUntitled.png?table=block&amp;id=01b8096c-0ae6-4886-bccc-843f249adca0&amp;t=01b8096c-0ae6-4886-bccc-843f249adca0&amp;width=554.9921875&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-text notion-block-d4c3f804e64145a3b150a435e72e12a8">进入 405F40</div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-87d7c158de7d40d8b1fb29ac32409d60"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fa2c21baa-0f72-4186-a355-b45ee65fa2e2%2FUntitled.png?table=block&amp;id=87d7c158-de7d-40d8-b1fb-29ac32409d60&amp;t=87d7c158-de7d-40d8-b1fb-29ac32409d60&amp;width=554.9765625&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-text notion-block-e5c2ee385dec4a58b8f2bdfc7a5c408d">打开注册表<code class="notion-inline-code">SOFTWARE\Microsoft\Windows NT\CurrentVersion\Svchost</code></div><div class="notion-text notion-block-0a131f1e683749deaac26ca4c2b781e7">查询<code class="notion-inline-code">netsvcs</code> 的值</div><div class="notion-callout notion-gray_background_co notion-block-dd1dc7e70cfe421e8d3dda5f086edce5"><div class="notion-page-icon-inline notion-page-icon-span"><span class="notion-page-icon" role="img" aria-label="⭐">⭐</span></div><div class="notion-callout-text">一般来说，<code class="notion-inline-code">Svchost.exe</code> 总是根据
<code class="notion-inline-code">HKEY_LOCAL_MACHINE\Software\Microsoft\WindowsNT\CurrentVersion\Svchost</code>
下面的键值分组管理DLL 申请的服务，这里的每一键值对应一个独立的<code class="notion-inline-code">Svchost.exe</code>进程，也就是说这里的键值就是在任务管理器中我们看到的<code class="notion-inline-code">Svchost.exe</code>进程。
当然，由于这里的键值并不是一次性全部加载，而是根据需要才加载，因此这里的键值数要多于在任务管理器中看到的<code class="notion-inline-code">Svchost.exe</code>进程数，而每个<code class="notion-inline-code">Svchost.exe</code>进程所包含的服务名、参数值和DLL则来自<code class="notion-inline-code">HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Service</code>
这个键值。</div></div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-0879e59a2dd84103b2a853992c870368"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F6a42f981-4366-4665-9ce5-003ab4297930%2FUntitled.png?table=block&amp;id=0879e59a-2dd8-4103-b2a8-53992c870368&amp;t=0879e59a-2dd8-4103-b2a8-53992c870368&amp;width=554.9921875&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-text notion-block-ef0e910b9fd148919dfe6d8b2cef7139">建立一个连接到服务控制管理器并打开它的数据库</div><div class="notion-text notion-block-f89e0cd7eca04ac4a4017af57f5e368a">创建一个服务对象，并将其添加到指定的服务控制管理器数据库</div><div class="notion-text notion-block-13d1cf64bba8462a93ff7908ec764bae">这一步创建了随机命名的恶意服务</div><div class="notion-text notion-block-10d8c83745e74ed3856ba55e8b8bde99">跟进 405CA0</div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-144a728ae2fb4c9a9180ca82c762fb81"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fd5c1c5db-6fae-462f-9a1f-1f51c76fda9a%2FUntitled.png?table=block&amp;id=144a728a-e2fb-4c9a-9180-ca82c762fb81&amp;t=144a728a-e2fb-4c9a-9180-ca82c762fb81&amp;width=554.9921875&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-text notion-block-97f33b6e4c624346b0355d56bbc7e2ab">设置注册表 <code class="notion-inline-code">SYSTEM\CurrentControlSet\Services\%s</code> 的<code class="notion-inline-code">Description</code> 值</div><div class="notion-text notion-block-1f44208816fe4982ad5d161be8766373">返回 405F40</div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-03a230221a3f4b238099ae8971651a68"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fab478b12-32b3-4d89-9687-d34f0d965f65%2FUntitled.png?table=block&amp;id=03a23022-1a3f-4b23-8099-ae8971651a68&amp;t=03a23022-1a3f-4b23-8099-ae8971651a68&amp;width=554.9765625&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-text notion-block-196857ab46a144a7a96de63d998a4340">再次调用 405CA0设置注册表 <code class="notion-inline-code">SYSTEM\CurrentControlSet\Services\%s\Parameters</code> 的 <code class="notion-inline-code">ServiceDll</code> 值为随机服务名.dll</div><div class="notion-text notion-block-c2a343dc2f3f4463a0232603649b59cf">返回 406110</div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-4ad4eafc85bb40d3b669a1cb9d881c3b"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F79cdaf80-8eab-4d63-9d0b-cbf85413a88c%2FUntitled.png?table=block&amp;id=4ad4eafc-85bb-40d3-b669-a1cb9d881c3b&amp;t=4ad4eafc-85bb-40d3-b669-a1cb9d881c3b&amp;width=554.9921875&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-text notion-block-093dac9fb8774ee8a6efb9fff892106e">建立一个连接到服务控制管理器并打开它的数据库</div><div class="notion-text notion-block-28bbfd5c319547feab3f6ca8d3fa43ec">开启恶意服务,运行恶意服务</div><div class="notion-text notion-block-55188bb2c09445a0a155374009e408d7">该服务释放了挖矿模块<code class="notion-inline-code">dllhostex.exe</code></div><div class="notion-text notion-block-3344257a0ffe42a7ba5006b29141948d">返回 main</div><div class="notion-text notion-block-fb4502263a4e44e9928507942a9b1cec">进入 4041E0</div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-adebc74fa3a14785814b544c057fbbfd"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:622px;max-width:100%;flex-direction:column"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fe807850b-7e60-472e-b8b2-a1ccd4bf7779%2FUntitled.png?table=block&amp;id=adebc74f-a3a1-4785-814b-544c057fbbfd&amp;t=adebc74f-a3a1-4785-814b-544c057fbbfd&amp;width=622&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-e23843f7c7954303a7730feb4383af32"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F18b60496-6f82-4deb-9065-8388aabeb0bb%2FUntitled.png?table=block&amp;id=e23843f7-c795-4303-a773-0feb4383af32&amp;t=e23843f7-c795-4303-a773-0feb4383af32&amp;width=554.9921875&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-b730922070d4431ebb7a9f3df57d9024"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fd17fb700-a4a0-48e8-b77c-dd1730a5dc64%2FUntitled.png?table=block&amp;id=b7309220-70d4-431e-bb7a-9f3df57d9024&amp;t=b7309220-70d4-431e-bb7a-9f3df57d9024&amp;width=554.984375&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-text notion-block-201c795d3a81474a9781f6f2d2e3c498">检测恶意服务状态</div><div class="notion-text notion-block-2951e84da601476b97ee50956745e1ec">返回 main,进入4058E0</div><div class="notion-text notion-block-fe3d99924ca84487813c2d68e16ffd3a">如果安装成功,传入的是<code class="notion-inline-code">Install_Done</code>,安装失败传入<code class="notion-inline-code">Error_%d</code></div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-194b1c2f748f4bd09a9933aaf5903101"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F59f1cdff-ff11-4c36-987f-8b19bb8558e8%2FUntitled.png?table=block&amp;id=194b1c2f-748f-4bd0-9a99-33aaf5903101&amp;t=194b1c2f-748f-4bd0-9a99-33aaf5903101&amp;width=554.984375&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-c5ddb09693b242ccb942eeb14807a477"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F4ccaf164-c5d3-4919-a711-344f108d0020%2FUntitled.png?table=block&amp;id=c5ddb096-93b2-42cc-b942-eeb14807a477&amp;t=c5ddb096-93b2-42cc-b942-eeb14807a477&amp;width=554.984375&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-text notion-block-4c7bc22f955843a281f65af6bc94ad93">得到主机名和系统版本</div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-808fa378dd0d4ef29a83e070c9aa6e0d"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F293e1e00-1b84-44a5-b69d-51b978183c63%2FUntitled.png?table=block&amp;id=808fa378-dd0d-4ef2-9a83-e070c9aa6e0d&amp;t=808fa378-dd0d-4ef2-9a83-e070c9aa6e0d&amp;width=554.9921875&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-text notion-block-2d5aa4c4f4cf48a5a3a081827ea5df54">拼接请求参数</div><div class="notion-text notion-block-9ba47965a06b431b93250c12936d9387">系统版本,主机名,还有上一步传入的安装结果</div><div class="notion-text notion-block-7d2ed26092974c80b9b28500668a2332">进入405670</div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-1bd3818bffe149a5a4454c4af263b325"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:702px;max-width:100%;flex-direction:column"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F5da5a073-74f3-482f-a50d-1b92f2c7889e%2FUntitled.png?table=block&amp;id=1bd3818b-ffe1-49a5-a445-4c4af263b325&amp;t=1bd3818b-ffe1-49a5-a445-4c4af263b325&amp;width=702&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-text notion-block-9447d1c52e2344e6804ff815cd0e5e4b">获得请求的目标 <code class="notion-inline-code">185.128.24.101:80</code> 与火绒剑记录的一致</div><div class="notion-text notion-block-9472e630f12748deb4973956f0e93fd4">返回 4058E0 进入 405720</div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-e85c5ca2c02e41988800a24634c8b803"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fdb7ebcd9-9281-4382-9b7a-f807f5b2ac07%2FUntitled.png?table=block&amp;id=e85c5ca2-c02e-4198-8800-a24634c8b803&amp;t=e85c5ca2-c02e-4198-8800-a24634c8b803&amp;width=554.9921875&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-text notion-block-6d8411a6425a4d33a8af686721150c8e">发起 http 请求,请求方式为 get, UA 为<code class="notion-inline-code">Mozilla/4.0 (compatible; MSIE 6.1; Windows NT)</code></div><div class="notion-text notion-block-6c633e913cc14e98b068076ed90aaadb">返回 main 函数,进入 405570</div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-9dd1f351220045128f302729e9082d32"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F0c352a8b-1799-4127-89e2-ff32e3129c27%2FUntitled.png?table=block&amp;id=9dd1f351-2200-4512-8f30-2729e9082d32&amp;t=9dd1f351-2200-4512-8f30-2729e9082d32&amp;width=554.9921875&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-fcf7da2770c74939b6a00daa1d1b646e"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fdb73389c-b4a2-42ac-b0c9-de5e747b4793%2FUntitled.png?table=block&amp;id=fcf7da27-70c7-4939-b6a0-0daa1d1b646e&amp;t=fcf7da27-70c7-4939-b6a0-0daa1d1b646e&amp;width=554.9921875&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-text notion-block-e8c14ef4d682441689a1ce78ecb7515f">获取病毒文件路径</div><div class="notion-text notion-block-b05867e8b9f74386babb9066230afef6">不开窗口执行命令 <code class="notion-inline-code">cmd.exe /c ping 127.0.0.1 -n 5 &amp; cmd.exe /c del /a</code></div><div class="notion-text notion-block-1fbc44acee04483c99ea60bc91163800">完成病毒自杀</div><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-8c6298f4910a47f1ae9b4a5aeb589419" data-id="8c6298f4910a47f1ae9b4a5aeb589419"><span><div id="8c6298f4910a47f1ae9b4a5aeb589419" class="notion-header-anchor"></div><a class="notion-hash-link" href="#8c6298f4910a47f1ae9b4a5aeb589419" title="0x02 dll 分析"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">0x02 dll 分析</span></span></h2><div class="notion-text notion-block-1b84a9c8465f415795d77f13cf44612c">做了一定的伪装</div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-0662f6ffaca24dd4865064e5d4f81994"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F47951df5-8904-49a2-af75-8f1458c8911f%2FUntitled.png?table=block&amp;id=0662f6ff-aca2-4dd4-8650-64e5d4f81994&amp;t=0662f6ff-aca2-4dd4-8650-64e5d4f81994&amp;width=554.9921875&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-text notion-block-fc711d55d6f0480a8c0b41bb19fc438f">主要进行了 2 个操作</div><div class="notion-text notion-block-ce8e280dee604fc09ee06a1ec32da479">创建注册表<code class="notion-inline-code">Software\Microsoft\Windows NT\CurrentVersion\NetworkPlatform\</code> </div><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-1f4244a04a284b6a96431e8f70936680" data-id="1f4244a04a284b6a96431e8f70936680"><span><div id="1f4244a04a284b6a96431e8f70936680" class="notion-header-anchor"></div><a class="notion-hash-link" href="#1f4244a04a284b6a96431e8f70936680" title="横向移动 - searchindexer.exe"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">横向移动 - <code class="notion-inline-code">searchindexer.exe</code></span></span></h3><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-ba33d272ae0f483db91adee5847a958a"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fc589db32-7b8e-44a3-ad24-4cccfce4359e%2FUntitled.png?table=block&amp;id=ba33d272-ae0f-483d-b91a-dee5847a958a&amp;t=ba33d272-ae0f-483d-b91a-dee5847a958a&amp;width=2420&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-text notion-block-f452129973034f19b317c6caa4f5823c">写入<code class="notion-inline-code">C:\Windows\NetworkDistribution\</code>  MS17-010永恒之蓝利用工具</div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-b687a9831cc447bdb448821b9a192b7c"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F7aae25de-86e7-433d-9c65-d1103e4e2fc0%2FUntitled.png?table=block&amp;id=b687a983-1cc4-47bd-b448-821b9a192b7c&amp;t=b687a983-1cc4-47bd-b448-821b9a192b7c&amp;width=2426&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-text notion-block-320d074e54da45af9a4161c62e6816e7">攻击</div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-a7fde2262b80434d9e4dc699320d000c"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F82cc2f85-e5a6-4da8-a472-b8018aa5fad2%2FUntitled.png?table=block&amp;id=a7fde226-2b80-434d-9e4d-c699320d000c&amp;t=a7fde226-2b80-434d-9e4d-c699320d000c&amp;width=2424&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-text notion-block-af263139f2f045cbb2aa3d0adc9e5398">是获取内网 ip 选择网段扫描,不是内置网段扫描</div><div class="notion-text notion-block-4d820e8926e34beb89737b59ff2f044a">会多次扫描</div><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-6f7234a666584a61b09b9406cc2813cf" data-id="6f7234a666584a61b09b9406cc2813cf"><span><div id="6f7234a666584a61b09b9406cc2813cf" class="notion-header-anchor"></div><a class="notion-hash-link" href="#6f7234a666584a61b09b9406cc2813cf" title="挖矿 - dllhostex.exe"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">挖矿 - <code class="notion-inline-code">dllhostex.exe</code></span></span></h3><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-e29862ead8f94473914e5f4c0b1e589a"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:552px;max-width:100%;flex-direction:column"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F581bbeb6-5f3c-47f2-8f3e-cb400404a843%2FUntitled.png?table=block&amp;id=e29862ea-d8f9-4473-914e-5f4c0b1e589a&amp;t=e29862ea-d8f9-4473-914e-5f4c0b1e589a&amp;width=552&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-3c05a76f25544f74b7203a216cf880dd"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:644px;max-width:100%;flex-direction:column"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F39534518-b16b-40eb-aab5-726558356885%2FUntitled.png?table=block&amp;id=3c05a76f-2554-4f74-b720-3a216cf880dd&amp;t=3c05a76f-2554-4f74-b720-3a216cf880dd&amp;width=644&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-text notion-block-48fea2fa245549578c384adff961845f">看了下,应该就是稍微修改的开源挖矿程序.</div><div class="notion-callout notion-gray_background_co notion-block-326f48e639614953a494fa28cc449127"><div class="notion-page-icon-inline notion-page-icon-span"><span class="notion-page-icon" role="img" aria-label="⭐">⭐</span></div><div class="notion-callout-text">骚操作:系统任务管理器启动时, 挖矿进程会自动退出.任务管理器关闭后, 挖矿进程又会重新启动.</div></div></main></div>]]></content:encoded>
        </item>
    </channel>
</rss>